var AdminJS=function(e,t,r,n,a,o,i,l,s,c,u,d,p,f){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var h=m(e),v=m(t),b=m(n),y=m(o),E=g(i),x=m(s),w=g(c),I=m(u),C=m(d),D=m(p),A=m(f),S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},R={exports:{}};!function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},a=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var a=t&&t.prototype instanceof d?t:d,o=Object.create(a.prototype),i=new I(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return D()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var l=E(i,r);if(l){if(l===u)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(e,r,i),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var u={};function d(){}function p(){}function f(){}var m={};m[a]=function(){return this};var g=Object.getPrototypeOf,h=g&&g(g(C([])));h&&h!==t&&r.call(h,a)&&(m=h);var v=f.prototype=d.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){var n;this._invoke=function(a,o){function i(){return new t((function(n,i){!function n(a,o,i,l){var s=c(e[a],e,o);if("throw"!==s.type){var u=s.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(d).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}(a,o,n,i)}))}return n=n?n.then(i,i):i()}}function E(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,u;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:D}}function D(){return{value:void 0,done:!0}}return p.prototype=v.constructor=f,f.constructor=p,p.displayName=l(f,i,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(y.prototype),y.prototype[o]=function(){return this},e.AsyncIterator=y,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new y(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(v),l(v,i,"Generator"),v[a]=function(){return this},v.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=C,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(l&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),w(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;w(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(R);var P=R.exports;let B={};try{B=window}catch(e){if("window is not defined"!==e.message)throw e}const N=new Date;class O{constructor({options:e}={}){let t=O.getPaths(e);t=t||{rootPath:"/admin"},this.options=t}static getPaths(e){var t;return e||(null===(t=B.REDUX_STATE)||void 0===t?void 0:t.paths)}urlBuilder(e=[],t=""){const r=new RegExp("/{1,}","g");let{rootPath:n}=this.options;n.startsWith("/")||(n="/"+n);return`${[n,...e].join("/").replace(r,"/")}${t}`}loginUrl(){return this.options.loginPath}logoutUrl(){return this.options.logoutPath}dashboardUrl(){return this.options.rootPath}pageUrl(e){return this.urlBuilder(["pages",e])}editUrl(e,t,r){return this.recordActionUrl({resourceId:e,recordId:t,actionName:"edit",search:r})}showUrl(e,t,r){return this.recordActionUrl({resourceId:e,recordId:t,actionName:"show",search:r})}deleteUrl(e,t,r){return this.recordActionUrl({resourceId:e,recordId:t,actionName:"delete",search:r})}newUrl(e,t){return this.resourceActionUrl({resourceId:e,actionName:"new",search:t})}listUrl(e,t){return this.resourceActionUrl({resourceId:e,actionName:"list",search:t})}bulkDeleteUrl(e,t,r){return this.bulkActionUrl({resourceId:e,recordIds:t,actionName:"bulkDelete",search:r})}resourceActionUrl({resourceId:e,actionName:t,search:r}){return this.urlBuilder(["resources",e,"actions",t],r)}resourceUrl({resourceId:e,search:t}){return this.urlBuilder(["resources",e],t)}recordActionUrl({resourceId:e,recordId:t,actionName:r,search:n}){return this.urlBuilder(["resources",e,"records",t,r],n)}bulkActionUrl({resourceId:e,recordIds:t,actionName:r,search:n}){const a=this.urlBuilder(["resources",e,"bulk",r]);if(t&&t.length){const e=new URLSearchParams(n);return e.set("recordIds",t.join(",")),`${a}?${e.toString()}`}return`${a}${n||""}`}assetPath(e){if(this.options.assetsCDN){return`${new URL(e,this.options.assetsCDN).href}?date=${N.getTime()}`}return this.urlBuilder(["frontend","assets",e])}}function L(){return T=L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},L.apply(this,arguments)}var T=L,_=T;function k(e,t){if("undefined"==typeof window)return e;return r=>{let n=window;n=window;let a=e;return n.AdminJS&&n.AdminJS.UserComponents&&n.AdminJS.UserComponents[t]?(a=n.AdminJS.UserComponents[t],h.default.createElement(a,_({},r,{OriginalComponent:e}))):h.default.createElement(a,r)}}const M=b.default(r.Link).withConfig({displayName:"sidebar-branding__StyledLogo",componentId:"sc-13gs4e8-0"})(["text-align:center;display:flex;align-content:center;justify-content:center;flex-shrink:0;padding:"," "," ",";text-decoration:none;& > h1{text-decoration:none;font-weight:",";font-size:",";color:",";font-size:",";line-height:",";}& > img{max-width:170px;}&:hover h1{color:",";}"],i.themeGet("space","lg"),i.themeGet("space","xxl"),i.themeGet("space","xxl"),i.themeGet("fontWeights","bolder"),i.themeGet("fontWeights","bolder"),i.themeGet("colors","grey80"),i.themeGet("fontSizes","xl"),i.themeGet("lineHeights","xl"),i.themeGet("colors","primary100")),G=new O;var U=k(e=>{const{branding:t}=e,{logo:r,companyName:n}=t;return h.default.createElement(M,{className:i.cssClass("Logo"),to:G.dashboardUrl()},r?h.default.createElement("img",{src:r,alt:n}):h.default.createElement("h1",null,n))},"SidebarBranding");var F=function(e,t,r,n){var a=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++a]);++a<o;)r=t(r,e[a],a,e);return r};var j=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","Ĳ":"IJ","ĳ":"ij","Œ":"Oe","œ":"oe","ŉ":"'n","ſ":"s"}),H="object"==typeof S&&S&&S.Object===Object&&S,W="object"==typeof self&&self&&self.Object===Object&&self,z=(H||W||Function("return this")()).Symbol;var V=function(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a},q=Array.isArray,$=z,Y=Object.prototype,J=Y.hasOwnProperty,Z=Y.toString,X=$?$.toStringTag:void 0;var K=function(e){var t=J.call(e,X),r=e[X];try{e[X]=void 0;var n=!0}catch(e){}var a=Z.call(e);return n&&(t?e[X]=r:delete e[X]),a},Q=Object.prototype.toString;var ee=K,te=function(e){return Q.call(e)},re=z?z.toStringTag:void 0;var ne=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":re&&re in Object(e)?ee(e):te(e)},ae=function(e){return null!=e&&"object"==typeof e};var oe=V,ie=q,le=function(e){return"symbol"==typeof e||ae(e)&&"[object Symbol]"==ne(e)},se=z?z.prototype:void 0,ce=se?se.toString:void 0;var ue=function e(t){if("string"==typeof t)return t;if(ie(t))return oe(t,e)+"";if(le(t))return ce?ce.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r};var de=function(e){return null==e?"":ue(e)},pe=j,fe=de,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ge=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var he=function(e){return(e=fe(e))&&e.replace(me,pe).replace(ge,"")},ve=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var be=function(e){return e.match(ve)||[]},ye=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Ee=function(e){return ye.test(e)},xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",we="["+xe+"]",Ie="\\d+",Ce="[\\u2700-\\u27bf]",De="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ae="[^\\ud800-\\udfff"+xe+Ie+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Se="(?:\\ud83c[\\udde6-\\uddff]){2}",Re="[\\ud800-\\udbff][\\udc00-\\udfff]",Pe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Be="(?:"+De+"|"+Ae+")",Ne="(?:"+Pe+"|"+Ae+")",Oe="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Le="[\\ufe0e\\ufe0f]?"+Oe+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",Se,Re].join("|")+")[\\ufe0e\\ufe0f]?"+Oe+")*"),Te="(?:"+[Ce,Se,Re].join("|")+")"+Le,_e=RegExp([Pe+"?"+De+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[we,Pe,"$"].join("|")+")",Ne+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[we,Pe+Be,"$"].join("|")+")",Pe+"?"+Be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Pe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ie,Te].join("|"),"g");var ke=be,Me=Ee,Ge=de,Ue=function(e){return e.match(_e)||[]};var Fe=F,je=he,He=function(e,t,r){return e=Ge(e),void 0===(t=r?void 0:t)?Me(e)?Ue(e):ke(e):e.match(t)||[]},We=RegExp("['’]","g");var ze=function(e){return function(t){return Fe(He(je(t).replace(We,"")),e,"")}};var Ve=function(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(a);++n<a;)o[n]=e[n+t];return o};var qe=function(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:Ve(e,t,r)},$e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Ye=function(e){return $e.test(e)};var Je=function(e){return e.split("")},Ze="[\\ud800-\\udfff]",Xe="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ke="\\ud83c[\\udffb-\\udfff]",Qe="[^\\ud800-\\udfff]",et="(?:\\ud83c[\\udde6-\\uddff]){2}",tt="[\\ud800-\\udbff][\\udc00-\\udfff]",rt="(?:"+Xe+"|"+Ke+")"+"?",nt="[\\ufe0e\\ufe0f]?"+rt+("(?:\\u200d(?:"+[Qe,et,tt].join("|")+")[\\ufe0e\\ufe0f]?"+rt+")*"),at="(?:"+[Qe+Xe+"?",Xe,et,tt,Ze].join("|")+")",ot=RegExp(Ke+"(?="+Ke+")|"+at+nt,"g");var it=Je,lt=Ye,st=function(e){return e.match(ot)||[]};var ct=qe,ut=Ye,dt=function(e){return lt(e)?st(e):it(e)},pt=de;var ft=function(e){return function(t){t=pt(t);var r=ut(t)?dt(t):void 0,n=r?r[0]:t.charAt(0),a=r?ct(r,1).join(""):t.slice(1);return n[e]()+a}}("toUpperCase"),mt=ze((function(e,t,r){return e+(r?" ":"")+ft(t)}));const gt=(e,t,r,n,a)=>{const o=("string"==typeof n?a:n)||{},i=(e=>e.split(".").join("&#46;"))(r);let l=[`${t}.${i}`];return n&&(l=[`resources.${n}.${t}.${i}`,...l]),e.exists(l)?e.t(l,o):o.defaultValue??mt(r)},ht=()=>{const{i18n:e,...t}=a.useTranslation();return{...t,i18n:e,...(e=>{const t=(t,r,n)=>gt(e,"actions",t,r,n),r=(t,r,n)=>gt(e,"buttons",t,r,n),n=(t,r,n)=>gt(e,"labels",t,r,n),a=(t,r,n)=>gt(e,"properties",t,r,n),o=(t,r,n)=>gt(e,"messages",t,r,n);return{translateAction:t,ta:t,translateButton:r,tb:r,translateLabel:n,tl:n,translateProperty:a,tp:a,translateMessage:o,tm:o,t:e.t,translate:e.t}})(e)}},vt=new O,bt=e=>{const{pages:t}=e,{translateLabel:r}=ht(),n=l.useLocation(),a=l.useHistory();if(!t||!t.length)return h.default.createElement(h.default.Fragment,null);const o=e=>!!n.pathname.match("/pages/"+e.name),s=t.map(e=>({id:e.name,label:e.name,isSelected:o(e),icon:e.icon,href:vt.pageUrl(e.name),onClick:(e,t)=>{e.preventDefault(),t.href&&a.push(t.href,{previousPage:window.location.href})}}));return h.default.createElement(i.Navigation,{label:r("pages"),elements:s})};var yt=k(()=>h.default.createElement(i.Box,{mt:"lg"},h.default.createElement(i.SoftwareBrothers,null)),"SidebarFooter");let Et={};try{Et=window}catch(e){if("window is not defined"!==e.message)throw e;Et={isOnServer:!0}}const xt=e=>{if(Et.isOnServer)return;const t=[Et.location.origin,Et.REDUX_STATE.paths.loginPath].join("");e.request.responseURL&&e.request.responseURL.match(t)&&(alert("Your session expired. You will be redirected to login screen"),Et.location.assign(t))};class wt{constructor(){this.baseURL=wt.getBaseUrl(),this.client=x.default.create({baseURL:this.baseURL})}static getBaseUrl(){var e;return Et.isOnServer?"":[Et.location.origin,null===(e=Et.REDUX_STATE)||void 0===e?void 0:e.paths.rootPath].join("")}async searchRecords({resourceId:e,query:t}){if(Et.isOnServer)return[];const r=await this.resourceAction({resourceId:e,actionName:"search",query:t});return xt(r),r.data.records}async resourceAction(e){const{resourceId:t,actionName:r,data:n,query:a,...o}=e;let i=`/api/resources/${t}/actions/${r}`;if(a){i=[i,encodeURIComponent(a)].join("/")}const l=await this.client.request({url:i,method:n?"POST":"GET",...o,data:n});return xt(l),l}async recordAction(e){const{resourceId:t,recordId:r,actionName:n,data:a,...o}=e,i=await this.client.request({url:`/api/resources/${t}/records/${r}/${n}`,method:a?"POST":"GET",...o,data:a});return xt(i),i}async bulkAction(e){const{resourceId:t,recordIds:r,actionName:n,data:a,...o}=e,i=new URLSearchParams;i.set("recordIds",(r||[]).join(","));const l=await this.client.request({url:`/api/resources/${t}/bulk/${n}`,method:a?"POST":"GET",...o,data:a,params:i});return xt(l),l}async getDashboard(e={}){const t=await this.client.get("/api/dashboard",e);return xt(t),t}async getPage(e){const{pageName:t,...r}=e,n=await this.client.request({url:"/api/pages/"+t,...r});return xt(n),n}}function It(e){const t=new FormData;return Object.entries(e).forEach(([e,r])=>null===r?t.set(e,"__FORM_VALUE_NULL__"):(e=>"object"==typeof e&&e.constructor!==File&&!(e instanceof Date))(r)?Array.isArray(r)?t.set(e,"__FORM_VALUE_EMPTY_ARRAY__"):t.set(e,"__FORM_VALUE_EMPTY_OBJECT__"):r instanceof Date?t.set(e,r.toISOString()):t.set(e,r)),t}const Ct=(e={message:""})=>({type:"ADD_NOTICE",data:{message:e.message,id:Math.random().toString(36).substr(2,9),type:e.type||"success",progress:0}}),Dt=()=>{const e=t.useDispatch();return t=>e(Ct(t))},At=(e,t)=>({...t.record||e,errors:t.record.errors,populated:{...e.populated,...t.record.populated},params:{...e.params,...t.record.params}}),St=(e,t)=>{const r=new RegExp("\\.","g"),n=null!=t&&t.includeAllSiblings?e.replace(r,"(\\.|\\.\\d+\\.)"):e.replace(r,"\\.");return new RegExp(`^${n}($|\\.)`,"")},Rt=(e,t,r)=>(Array.isArray(t)?t:[t]).filter(e=>!!e).reduce((t,n)=>{const a=St(n,r);return{...t,...Object.keys(e).filter(e=>e.match(a)).reduce((t,r)=>(t[r]=e[r],t),{})}},{}),Pt=(e,t)=>(Array.isArray(t)?t:[t]).filter(e=>!!e).reduce((t,r)=>{const n=St(r);return Object.keys(t).filter(e=>!e.match(n)).reduce((t,r)=>(t[r]=e[r],t),{})},e),Bt=(e,t={})=>{let r=e.split(".");return t.skipArrayIndexes&&(r=r.filter(e=>isNaN(+e))),r.reduce((e,t)=>e.length?[...e,[e[e.length-1],t].join(".")]:[t],[])},Nt=(e={},t,r)=>{const n=St(t),a=Object.keys(e).filter(e=>!e.match(n)).reduce((t,r)=>(t[r]=e[r],t),{});if(void 0!==r){if(!(e=>"undefined"==typeof File?"object"==typeof e&&null!==e:"object"==typeof e&&!(e instanceof File)&&null!==e)(r)||r instanceof Date)a[t]=r;else{const e=c.flatten(r);Object.keys(e).length?Object.keys(e).forEach(r=>{a[`${t}.${r}`]=e[r]}):Array.isArray(r)?a[t]=[]:a[t]={}}const e=Bt(t).slice(0,-1);if(e.length)return Object.keys(a).filter(t=>!e.includes(t)).reduce((e,t)=>(e[t]=a[t],e),{})}return a},Ot=(e={},t,r)=>{if(!t)return c.unflatten(e);if(Object.keys(e).find(e=>e===t))return e[t];const n=St(t,r),a=Rt(e,t,r),o=Object.keys(a).reduce((e,t,o)=>{let i=t.replace(n,"TEMP_HOLDING_KEY.");return null!=r&&r.includeAllSiblings&&(i=i.replace(new RegExp("TEMP_HOLDING_KEY\\.(\\d*)"),"TEMP_HOLDING_KEY."+o)),e[i]=a[t],e},{});return Object.keys(o).length?c.unflatten(o).TEMP_HOLDING_KEY:void 0},Lt={flatten:c.flatten,unflatten:c.unflatten,set:Nt,get:Ot,selectParams:Rt,filterOutParams:Pt,removePath:(e,t)=>{let r=Pt(e,t);const n=Bt(t).reverse();return n.find((t,a)=>{const o=Ot(e,t);if(Array.isArray(o)){const i=n[a-1].split("."),l=i[i.length-1];return o.splice(+l,1),r=Nt(e,t,o),!0}return!1}),r},DELIMITER:".",pathToParts:Bt,merge:(e={},...t)=>{const r=c.flatten(e);return t.reverse().reduce((e,t)=>Object.keys(t).reduce((e,r)=>Nt(e,r,t[r]),e),r)}},Tt=(e,t,r)=>n=>{let a=!1;const o={...n.populated},i=Lt.set(n.params,e,t);return e in o&&(delete o[e],a=!0),r&&(o[e]=r,a=!0),{...n,params:i,populated:a?o:n.populated}},_t=(e,t)=>!(void 0!==t||"string"==typeof e||!e.params),kt=function(e,t={}){return t.includeParams&&e?{...e,params:Lt.selectParams(e.params||{},t.includeParams)}:e},Mt=new wt,Gt=(t,r,n)=>{const[a,o]=e.useState(!1),[i,l]=e.useState(!0),[s,c]=e.useState(0),u=t?kt(t,n):null,[d,p]=e.useState({...u,params:(null==u?void 0:u.params)??{},errors:(null==t?void 0:t.errors)??{},populated:(null==t?void 0:t.populated)??{}}),f=e.useCallback(e=>{const t=e instanceof Function?e(d):e;p(kt(t,n))},[n,d]),m=Dt(),g=e.useCallback((e,t,r)=>{_t(e,t)?f(e):((e,t={})=>{const{includeParams:r}=t;if(r){return Lt.pathToParts(e,{skipArrayIndexes:!0}).some(e=>r.includes(e))}return!0})(e,n)&&p(Tt(e,t,r)),l(!1)},[p,n]),h=e.useCallback((e={},t)=>{o(!0);const n=It(Lt.merge(d.params,e)),a={resourceId:r,onUploadProgress:e=>c(Math.round(100*e.loaded/e.total)),data:n,headers:{"Content-Type":"multipart/form-data"}},i=d.id?Mt.recordAction({...a,actionName:"edit",recordId:d.id}):Mt.resourceAction({...a,actionName:"new"});return i.then(e=>{e.data.notice&&m(e.data.notice),!1!==(null==t?void 0:t.updateOnSave)&&f(t=>At(t,e.data)),c(0),o(!1),l(!0)}).catch(()=>{m({message:"There was an error updating record, Check out console to see more information.",type:"error"}),c(0),o(!1)}),i},[d,r,o,c,p]);return{record:d,handleChange:g,submit:h,loading:a,progress:s,setRecord:f,isSynced:i}},Ut=new O,Ft=(e,t)=>{const r=e.name;if(!e.component&&!e.hasHandler)return null;const n={record:()=>Ut.recordActionUrl({...t,actionName:r}),resource:()=>Ut.resourceActionUrl({resourceId:t.resourceId,actionName:r}),bulk:()=>Ut.bulkActionUrl({...t,actionName:r})};if(n[e.actionType])return n[e.actionType]();throw new Error('"actionType" should be either record, resource or bulk')},jt=new wt;const Ht=e=>{const{action:t,params:r,actionResponseHandler:n,search:a}=e;return()=>{const e=function(e,t,r){let n;const{recordId:a,recordIds:o,resourceId:i}=t;switch(e.actionType){case"record":if(!a)throw new Error('You have to specify "recordId" for record action');n=jt.recordAction({resourceId:i,actionName:e.name,recordId:a,search:r});break;case"resource":n=jt.resourceAction({resourceId:i,actionName:e.name});break;case"bulk":if(!o)throw new Error('You have to specify "recordIds" for bulk action');n=jt.bulkAction({resourceId:i,actionName:e.name,recordIds:o,search:r});break;default:throw new Error('"actionType" should be either record, resource or bulk')}return n}(t,r,a);return e.then(n).catch(e=>{throw e}),e}},Wt=e=>"action-"+e.name,zt=e=>{const{action:t,params:r,actionResponseHandler:n,push:a}=e;return e=>{e.preventDefault(),e.stopPropagation();const o=Ft(t,r),i=Ht({params:r,action:t,actionResponseHandler:n});t.guard&&!confirm(t.guard)||((e=>void 0!==e.component&&!1===e.component)(t)?i():o&&a(o,{previousPage:window.location.href}))}},Vt=(e,t)=>{const r=e.lastIndexOf("?"),n=-1!==r?e.substring(r+1):null,a=new URLSearchParams(t??n??window.location.search??""),o="true"===new URLSearchParams(n||"").get("ignore_params")?new URLSearchParams(""):new URLSearchParams(a.toString());o.set("refresh","true");return`${-1!==r?e.substring(0,r):e}?${o.toString()}`},qt=e=>{const t=new URLSearchParams(e);return t.get("refresh")&&t.delete("refresh"),t.toString()},$t=e=>{const t=l.useLocation(),r=l.useHistory(),n=Dt();return a=>{const{data:o}=a;if(o.notice&&n(o.notice),o.redirectUrl&&t.pathname!==o.redirectUrl){const e=Vt(o.redirectUrl);r.push(e,{previousPage:window.location.href})}e&&e(o)}};function Yt(e,t,r){const n=l.useHistory(),a=$t(r);return{href:Ft(e,t),callApi:Ht({action:e,params:t,actionResponseHandler:a}),handleClick:zt({action:e,params:t,actionResponseHandler:a,push:n.push})}}function Jt(t,r){const[n,a]=e.useState(()=>{try{const e=window.localStorage.getItem(t);return e?JSON.parse(e):r}catch(e){return console.log(e),r}});return[n,e=>{try{const r=e instanceof Function?e(n):e;a(r),window.localStorage.setItem(t,JSON.stringify(r))}catch(e){console.log(e)}}]}const Zt=(e,t)=>{const r=new RegExp(e+"($|/)");return!!t.pathname.match(r)};function Xt(t){const[r,n]=Jt("sidebarElements",{}),a=l.useHistory(),o=l.useLocation(),i=e.useMemo(()=>(e,t)=>({href:e.href||void 0,icon:t,isSelected:Zt(e.href,o),label:e.name,id:e.id,onClick:t=>{e.href&&(t.preventDefault(),a.push(e.href,{previousPage:window.location.href}))}}),[o,a]),s=t.filter(e=>{var t;return e.href&&!1!==(null===(t=e.navigation)||void 0===t?void 0:t.show)}).reduce((e,t)=>{var a,o;const l=(null===(a=t.navigation)||void 0===a?void 0:a.name)||["resource",t.name].join("-");var s;if(t.navigation&&null!==t.navigation.name)if(e[l]&&e[l].elements&&null!==(o=t.navigation)&&void 0!==o&&o.name)e[l].elements.push(i(t));else{var c,u;e[l]={elements:[i(t)],label:null===(c=t.navigation)||void 0===c?void 0:c.name,icon:null===(u=t.navigation)||void 0===u?void 0:u.icon,onClick:()=>n({...r,[l]:!r[l]}),isOpen:!!r[l]}}else e[l]=i(t,null===(s=t.navigation)||void 0===s?void 0:s.icon);return e},{});return Object.values(s)}const Kt=new wt;function Qt(t){const[r,n]=e.useState([]),[a,o]=e.useState(!1),[i,s]=e.useState(10),[c,u]=e.useState(1),[d,p]=e.useState(0),[f,m]=e.useState("asc"),[g,h]=e.useState(),v=l.useLocation(),b=l.useHistory(),y=Dt(),{translateMessage:E}=ht(),x=Dt(),w=()=>{o(!0);const e=new URLSearchParams(v.search),r=Kt.resourceAction({actionName:"list",resourceId:t,params:e});return r.then(e=>{const t=e.data;t.notice&&x(t.notice),t.redirectUrl?b.push(t.redirectUrl,{previousPage:window.location.href}):(n(t.records),u(t.meta.page),s(t.meta.perPage),p(t.meta.total),m(t.meta.direction),h(t.meta.sortBy),o(!1))}).catch(()=>{y({message:E("errorFetchingRecords",t),type:"error"})}),r};return e.useEffect(()=>{if(e=v.search,new URLSearchParams(e).get("refresh")){const e=v.state||{};e.previousPage||(e.previousPage=window.location.href),b.replace({pathname:v.pathname,state:e,search:qt(v.search).toString()})}else w();var e},[t,v.search,v.state]),{records:r,loading:a,page:c,total:d,direction:f,sortBy:g,perPage:i,fetchData:w}}function er(t){const[r,n]=e.useState([]);return{handleSelect:e=>{const t=r.findIndex(t=>t.id===e.id);if(t<0)n([...r,e]);else{const e=[...r];e.splice(t,1),n(e)}},handleSelectAll:()=>{const e=t.filter(e=>!r.find(t=>t.id===e.id)&&e.bulkActions.length);if(e.length)n([...r,...e]);else{const e=r.filter(e=>!t.find(t=>t.id===e.id));n(e)}},selectedRecords:r,setSelectedRecords:n}}const tr=e=>t.useSelector(e=>e.resources).find(t=>t.id===e);var rr=Object.freeze({__proto__:null,useRecord:Gt,isEntireRecordGiven:_t,FORM_VALUE_NULL:"__FORM_VALUE_NULL__",FORM_VALUE_EMPTY_OBJECT:"__FORM_VALUE_EMPTY_OBJECT__",FORM_VALUE_EMPTY_ARRAY:"__FORM_VALUE_EMPTY_ARRAY__",paramsToFormData:It,updateRecord:Tt,useAction:Yt,useActionResponseHandler:$t,useCurrentAdmin:function(){const e=t.useSelector(e=>e.session),r=t.useDispatch();return[e,e=>r(((e=null)=>({type:"SESSION_INITIALIZE",data:e}))(e))]},useLocalStorage:Jt,useNavigationResources:Xt,useNotice:Dt,useRecords:Qt,useSelectedRecords:er,useTranslation:ht,useResource:tr});const nr=k(({resources:e})=>{const t=Xt(e),{translateLabel:r}=ht();return h.default.createElement(i.Navigation,{label:r("navigation"),elements:t})},"SidebarResourceSection"),ar=b.default(i.Box).withConfig({displayName:"sidebar__StyledSidebar",componentId:"rspq5q-0"})(["transition:left 0.3s;top:0;bottom:0;flex-shrink:0;overflow-y:auto;&.hidden{left:-",";}&.visible{left:0;}"],i.themeGet("sizes","sidebarWidth"));ar.defaultProps={position:["absolute","absolute","absolute","absolute","inherit"],width:"sidebarWidth",borderRight:"default",display:"flex",flexDirection:"column",zIndex:50,bg:"white"};const or=k(e=>{const{isVisible:r}=e,[n,a,o]=t.useSelector(e=>[e.branding,e.resources,e.pages]);return h.default.createElement(ar,{className:r?"visible":"hidden"},h.default.createElement(U,{branding:n}),h.default.createElement(i.Box,{flexGrow:1,className:i.cssClass("Resources")},h.default.createElement(nr,{resources:a})),h.default.createElement(bt,{pages:o}),(null==n?void 0:n.softwareBrothers)&&h.default.createElement(yt,null))},"Sidebar"),ir=k(e=>{const{session:t,paths:r}=e,{translateButton:n}=ht(),a=[{label:n("logout"),onClick:e=>{e.preventDefault(),window.location.href=r.logoutPath},icon:"Logout"}];return h.default.createElement(i.Box,{flexShrink:0},h.default.createElement(i.CurrentUserNav,{name:t.email,title:t.title,avatarUrl:t.avatarUrl,dropActions:a}))},"LoggedIn"),lr=b.default(i.Text).withConfig({displayName:"version__VersionItem",componentId:"r49gcr-0"})(["padding:12px 24px 12px 0;"]);lr.defaultProps={display:["none","block"],color:"grey100"};const sr=e=>{const{versions:t}=e,{admin:r,app:n}=t,{translateLabel:a}=ht();return h.default.createElement(i.Box,{flex:!0,flexGrow:1,py:"default",px:"xxl",className:i.cssClass("Version")},r&&h.default.createElement(lr,null,a("adminVersion",{version:r})),n&&h.default.createElement(lr,null,a("appVersion",{version:n})))},cr=b.default(i.Box).withConfig({displayName:"top-bar__NavBar",componentId:"vpnnkx-0"})(["height:",";border-bottom:",";background:",";display:flex;flex-direction:row;flex-shrink:0;"],({theme:e})=>e.sizes.navbarHeight,i.themeGet("borders","default"),({theme:e})=>e.colors.white);cr.defaultProps={className:i.cssClass("NavBar")};const ur=e=>{const{toggleSidebar:r}=e,[n,a,o]=t.useSelector(e=>[e.session,e.paths,e.versions]);return h.default.createElement(cr,null,h.default.createElement(i.Box,{py:"lg",px:["default","lg"],onClick:r,display:["block","block","block","block","none"],style:{cursor:"pointer"}},h.default.createElement(i.Icon,{icon:"Menu",size:32,color:"grey100"})),h.default.createElement(sr,{versions:o}),n&&n.email?h.default.createElement(ir,{session:n,paths:a}):"")};class dr extends h.default.Component{constructor(e){super(e);const{notice:t}=e;this.timer=null,this.state={progress:t.progress||0}}componentDidMount(){const{drop:e,notice:t,notifyProgress:r}=this.props;this.timer=setInterval(()=>{this.setState(e=>{const n=e.progress+100/3;return r({noticeId:t.id,progress:n}),{progress:n}})},1e3),setTimeout(()=>{this.timer&&clearInterval(this.timer),e()},4e3)}componentWillUnmount(){this.timer&&clearInterval(this.timer)}render(){const{notice:e,drop:t}=this.props;return h.default.createElement(i.MessageBox,{style:{minWidth:"480px"},message:e.message,variant:"success"===e.type?"success":"danger",onCloseClick:t})}}const pr=t.connect(e=>({notices:e.notices}),e=>({drop:t=>e((e=>({type:"DROP_NOTICE",data:{noticeId:e}}))(t)),notifyProgress:({noticeId:t,progress:r})=>e({type:"SET_NOTICE_PROGRESS",data:{noticeId:t,progress:r}})}))(e=>{const{drop:t,notices:r,notifyProgress:n}=e,a=r.length?r[r.length-1]:null;return a?h.default.createElement("div",{"data-testid":"notice-wrapper"},h.default.createElement(dr,{key:a.id,notice:a,drop:()=>t(a.id),notifyProgress:n})):h.default.createElement("div",null)}),fr=()=>{const{translateMessage:e}=ht();return h.default.createElement(i.Box,{position:"relative",overflow:"hidden"},h.default.createElement(i.Box,{position:"absolute",top:50,left:-10,opacity:[.2,.4,1],animate:!0},h.default.createElement(i.Illustration,{variant:"Rocket"})),h.default.createElement(i.Box,{position:"absolute",top:-70,right:-15,opacity:[.2,.4,1],animate:!0},h.default.createElement(i.Illustration,{variant:"Moon"})),h.default.createElement(i.Box,{bg:"grey100",height:284,py:74,px:["default","lg",250]},h.default.createElement(i.Text,{textAlign:"center",color:"white"},h.default.createElement(i.H2,null,e("welcomeOnBoard_title")),h.default.createElement(i.Text,{opacity:.8},e("welcomeOnBoard_subtitle")))))},mr=b.default(i.Box).withConfig({displayName:"default-dashboard__Card",componentId:"sc-1be5kmo-0"})(["display:",";color:",";text-decoration:none;border:1px solid transparent;&:hover{border:1px solid ",";box-shadow:",";}"],({flex:e})=>e?"flex":"block",({theme:e})=>e.colors.grey100,({theme:e})=>e.colors.primary100,({theme:e})=>e.shadows.cardHover);mr.defaultProps={variant:"white",boxShadow:"card"};const gr=()=>{const{translateMessage:e,translateButton:t}=ht();return h.default.createElement(i.Box,null,h.default.createElement(fr,null),h.default.createElement(i.Box,{mt:["xl","xl","-100px"],mb:"xl",mx:[0,0,0,"auto"],px:["default","lg","xxl","0"],position:"relative",flex:!0,flexDirection:"row",flexWrap:"wrap",width:[1,1,1,1024]},(({translateMessage:e})=>[{variant:"Planet",title:e("addingResources_title"),subtitle:e("addingResources_subtitle"),href:"https://adminjs.co/tutorial-passing-resources.html"},{variant:"DocumentCheck",title:e("customizeResources_title"),subtitle:e("customizeResources_subtitle"),href:"https://adminjs.co/tutorial-customizing-resources.html"},{variant:"DocumentSearch",title:e("customizeActions_title"),subtitle:e("customizeActions_subtitle"),href:"https://adminjs.co/tutorial-actions.html"},{variant:"FlagInCog",title:e("writeOwnComponents_title"),subtitle:e("writeOwnComponents_subtitle"),href:"https://adminjs.co/tutorial-writing-react-components.html"},{variant:"Folders",title:e("customDashboard_title"),subtitle:e("customDashboard_subtitle"),href:"https://adminjs.co/tutorial-custom-dashboard.html"},{variant:"Astronaut",title:e("roleBasedAccess_title"),subtitle:e("roleBasedAccess_subtitle"),href:"https://adminjs.co/tutorial-rbac.html"}])({translateMessage:e}).map((e,t)=>h.default.createElement(i.Box,{key:t,width:[1,.5,.5,1/3],p:"lg"},h.default.createElement(mr,{as:"a",href:e.href},h.default.createElement(i.Text,{textAlign:"center"},h.default.createElement(i.Illustration,{variant:e.variant,width:100,height:70}),h.default.createElement(i.H5,{mt:"lg"},e.title),h.default.createElement(i.Text,null,e.subtitle))))),h.default.createElement(i.Box,{width:[1,1,.5],p:"lg"},h.default.createElement(mr,{as:"a",flex:!0,href:"https://join.slack.com/t/adminbro/shared_invite/zt-djsqxxpz-_YCS8UMtQ9Ade6DPuLR7Zw"},h.default.createElement(i.Box,{flexShrink:0},h.default.createElement(i.Illustration,{variant:"SlackLogo"})),h.default.createElement(i.Box,{ml:"xl"},h.default.createElement(i.H4,null,e("community_title")),h.default.createElement(i.Text,null,e("community_subtitle"))))),h.default.createElement(i.Box,{width:[1,1,.5],p:"lg"},h.default.createElement(mr,{as:"a",flex:!0,href:"https://github.com/SoftwareBrothers/adminjs/issues"},h.default.createElement(i.Box,{flexShrink:0},h.default.createElement(i.Illustration,{variant:"GithubLogo"})),h.default.createElement(i.Box,{ml:"xl"},h.default.createElement(i.H4,null,e("foundBug_title")),h.default.createElement(i.Text,null,e("foundBug_subtitle"))))),h.default.createElement(i.Box,{variant:"white",boxShadow:"card",width:1,m:"lg"},h.default.createElement(i.Text,{textAlign:"center"},h.default.createElement(i.Illustration,{variant:"SoftwareBrothersLogo"}),h.default.createElement(i.H4,null,e("needMoreSolutions_title")),h.default.createElement(i.Text,null,e("needMoreSolutions_subtitle")),h.default.createElement(i.Text,{mt:"xxl"},h.default.createElement(i.Button,{as:"a",variant:"primary",href:"https://softwarebrothers.co/services"},t("contactUs")))))))},hr=({error:e})=>{const{translateMessage:t}=ht();return h.default.createElement(i.MessageBox,{m:"xxl",variant:"danger",message:"Javascript Error"},h.default.createElement(i.Text,null,e.toString()),h.default.createElement(i.Text,{mt:"default"},t("seeConsoleForMore")))};class vr extends h.default.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;return null!==t?h.default.createElement(hr,{error:t}):e||null}}class br extends h.default.Component{constructor(e){super(e),this.state={isClient:!1}}componentDidMount(){this.setState({isClient:!0})}render(){const{dashboard:e}=this.props,{isClient:t}=this.state;let r;return r=e&&e.component&&t&&AdminJS.UserComponents[e.component]?AdminJS.UserComponents[e.component]:gr,h.default.createElement(vr,null,h.default.createElement(r,null))}}var yr=t.connect(e=>({dashboard:e.dashboard}))(br),Er={};var xr=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t},wr={};Object.defineProperty(wr,"__esModule",{value:!0});var Ir=h.default;function Cr(e,t){var r=Ir.useState((function(){return{inputs:t,result:e()}}))[0],n=Ir.useRef(!0),a=Ir.useRef(r),o=n.current||Boolean(t&&a.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(t,a.current.inputs))?a.current:{inputs:t,result:e()};return Ir.useEffect((function(){n.current=!1,a.current=o}),[o]),o.result}function Dr(e,t){return Cr((function(){return e}),t)}var Ar=Cr,Sr=Dr;wr.useCallback=Sr,wr.useCallbackOne=Dr,wr.useMemo=Ar,wr.useMemoOne=Cr;var Rr={},Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.default=function(e,t){if(!e)throw new Error("Invariant failed")},Object.defineProperty(Rr,"__esModule",{value:!0});var Br,Nr=(Br=Pr)&&"object"==typeof Br&&"default"in Br?Br.default:Br,Or=function(e){var t=e.top,r=e.right,n=e.bottom,a=e.left;return{top:t,right:r,bottom:n,left:a,width:r-a,height:n-t,x:a,y:t,center:{x:(r+a)/2,y:(n+t)/2}}},Lr=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},Tr=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},_r={top:0,right:0,bottom:0,left:0},kr=function(e){var t=e.borderBox,r=e.margin,n=void 0===r?_r:r,a=e.border,o=void 0===a?_r:a,i=e.padding,l=void 0===i?_r:i,s=Or(Lr(t,n)),c=Or(Tr(t,o)),u=Or(Tr(c,l));return{marginBox:s,borderBox:Or(t),paddingBox:c,contentBox:u,margin:n,border:o,padding:l}},Mr=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var r=Number(t);return isNaN(r)&&Nr(!1),r},Gr=function(e,t){var r,n,a=e.borderBox,o=e.border,i=e.margin,l=e.padding,s=(n=t,{top:(r=a).top+n.y,left:r.left+n.x,bottom:r.bottom+n.y,right:r.right+n.x});return kr({borderBox:s,border:o,margin:i,padding:l})},Ur=function(e,t){var r={top:Mr(t.marginTop),right:Mr(t.marginRight),bottom:Mr(t.marginBottom),left:Mr(t.marginLeft)},n={top:Mr(t.paddingTop),right:Mr(t.paddingRight),bottom:Mr(t.paddingBottom),left:Mr(t.paddingLeft)},a={top:Mr(t.borderTopWidth),right:Mr(t.borderRightWidth),bottom:Mr(t.borderBottomWidth),left:Mr(t.borderLeftWidth)};return kr({borderBox:e,margin:r,padding:n,border:a})};function Fr(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}Rr.calculateBox=Ur,Rr.createBox=kr,Rr.expand=Lr,Rr.getBox=function(e){var t=e.getBoundingClientRect(),r=window.getComputedStyle(e);return Ur(t,r)},Rr.getRect=Or,Rr.offset=Gr,Rr.shrink=Tr,Rr.withScroll=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),Gr(e,t)};var jr=function(e,t){var r;void 0===t&&(t=Fr);var n,a=[],o=!1;return function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];return o&&r===this&&t(i,a)||(n=e.apply(this,i),o=!0,r=this,a=i),n}},Hr=function(e){var t=[],r=null,n=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];t=a,r||(r=requestAnimationFrame((function(){r=null,e.apply(void 0,t)})))};return n.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},n};function Wr(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(Er,"__esModule",{value:!0});var zr=h.default,Vr=Wr(zr),qr=Wr(xr),$r=Wr(T),Yr=I.default,Jr=v.default,Zr=wr,Xr=Rr,Kr=Wr(jr),Qr=Wr(Hr),en=Wr(C.default);function tn(e,t){}function rn(){}function nn(e,t,r){var n=t.map((function(t){var n,a,o=(n=r,a=t.options,$r({},n,{},a));return e.addEventListener(t.eventName,t.fn,o),function(){e.removeEventListener(t.eventName,t.fn,o)}}));return function(){n.forEach((function(e){e()}))}}tn.bind(null,"warn"),tn.bind(null,"error");function an(e){this.message=e}function on(e,t){if(!e)throw new an("Invariant failed")}an.prototype.toString=function(){return this.message};var ln=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))||this).callbacks=null,t.unbind=rn,t.onWindowError=function(e){var r=t.getCallbacks();r.isDragging()&&r.tryAbort(),e.error instanceof an&&e.preventDefault()},t.getCallbacks=function(){if(!t.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}qr(t,e);var r=t.prototype;return r.componentDidMount=function(){this.unbind=nn(window,[{eventName:"error",fn:this.onWindowError}])},r.componentWillUnmount=function(){this.unbind()},r.componentDidCatch=function(e){if(!(e instanceof an))throw e;this.setState({})},r.render=function(){return this.props.children(this.setCallbacks)},t}(Vr.Component),sn=function(e){return e+1},cn=function(e,t){var r=e.droppableId===t.droppableId,n=sn(e.index),a=sn(t.index);return r?"\n      You have moved the item from position "+n+"\n      to position "+a+"\n    ":"\n    You have moved the item from position "+n+"\n    in list "+e.droppableId+"\n    to list "+t.droppableId+"\n    in position "+a+"\n  "},un=function(e,t,r){return t.droppableId===r.droppableId?"\n      The item "+e+"\n      has been combined with "+r.draggableId:"\n      The item "+e+"\n      in list "+t.droppableId+"\n      has been combined with "+r.draggableId+"\n      in list "+r.droppableId+"\n    "},dn=function(e){return"\n  The item has returned to its starting position\n  of "+sn(e.index)+"\n"},pn="\n  Press space bar to start a drag.\n  When dragging you can use the arrow keys to move the item around and escape to cancel.\n  Some screen readers may require you to be in focus mode or to use your pass through key\n",fn=function(e){return"\n  You have lifted an item in position "+sn(e.source.index)+"\n"},mn=function(e){var t=e.destination;if(t)return cn(e.source,t);var r=e.combine;return r?un(e.draggableId,e.source,r):"You are over an area that cannot be dropped on"},gn=function(e){if("CANCEL"===e.reason)return"\n      Movement cancelled.\n      "+dn(e.source)+"\n    ";var t=e.destination,r=e.combine;return t?"\n      You have dropped the item.\n      "+cn(e.source,t)+"\n    ":r?"\n      You have dropped the item.\n      "+un(e.draggableId,e.source,r)+"\n    ":"\n    The item has been dropped while not over a drop area.\n    "+dn(e.source)+"\n  "},hn={x:0,y:0},vn=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},bn=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},yn=function(e,t){return e.x===t.x&&e.y===t.y},En=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},xn=function(e,t,r){var n;return void 0===r&&(r=0),(n={})[e]=t,n["x"===e?"y":"x"]=r,n},wn=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},In=function(e,t){return Math.min.apply(Math,t.map((function(t){return wn(e,t)})))},Cn=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},Dn=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},An=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},Sn=function(e,t){return t&&t.shouldClipSubject?function(e,t){var r=Xr.getRect({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return r.width<=0||r.height<=0?null:r}(t.pageMarginBox,e):Xr.getRect(e)},Rn=function(e){var t=e.page,r=e.withPlaceholder,n=e.axis,a=e.frame,o=function(e,t,r){var n;return r&&r.increasedBy?$r({},e,((n={})[t.end]=e[t.end]+r.increasedBy[t.line],n)):e}(function(e,t){return t?Dn(e,t.scroll.diff.displacement):e}(t.marginBox,a),n,r);return{page:t,withPlaceholder:r,active:Sn(o,a)}},Pn=function(e,t){e.frame||on(!1);var r=e.frame,n=bn(t,r.scroll.initial),a=En(n),o=$r({},r,{scroll:{initial:r.scroll.initial,current:t,diff:{value:n,displacement:a},max:r.scroll.max}}),i=Rn({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return $r({},e,{frame:o,subject:i})};function Bn(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function Nn(e,t){if(e.findIndex)return e.findIndex(t);for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1}function On(e,t){if(e.find)return e.find(t);var r=Nn(e,t);return-1!==r?e[r]:void 0}function Ln(e){return Array.prototype.slice.call(e)}var Tn=Kr((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),_n=Kr((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),kn=Kr((function(e){return Bn(e)})),Mn=Kr((function(e){return Bn(e)})),Gn=Kr((function(e,t){return Mn(t).filter((function(t){return e===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}))}));function Un(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function Fn(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var jn=Kr((function(e,t){return t.filter((function(t){return t.descriptor.id!==e.descriptor.id}))})),Hn=function(e,t){return e.descriptor.droppableId===t.descriptor.id},Wn={point:hn,value:0},zn={invisible:{},visible:{},all:[]},Vn={displaced:zn,displacedBy:Wn,at:null},qn=function(e,t){return function(r){return e<=r&&r<=t}},$n=function(e){var t=qn(e.top,e.bottom),r=qn(e.left,e.right);return function(n){if(t(n.top)&&t(n.bottom)&&r(n.left)&&r(n.right))return!0;var a=t(n.top)||t(n.bottom),o=r(n.left)||r(n.right);if(a&&o)return!0;var i=n.top<e.top&&n.bottom>e.bottom,l=n.left<e.left&&n.right>e.right;return!(!i||!l)||(i&&o||l&&a)}},Yn=function(e){var t=qn(e.top,e.bottom),r=qn(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&r(e.left)&&r(e.right)}},Jn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Zn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Xn=function(e){var t=e.target,r=e.destination,n=e.viewport,a=e.withDroppableDisplacement,o=e.isVisibleThroughFrameFn,i=a?function(e,t){var r=t.frame?t.frame.scroll.diff.displacement:hn;return Dn(e,r)}(t,r):t;return function(e,t,r){return!!t.subject.active&&r(t.subject.active)(e)}(i,r,o)&&function(e,t,r){return r(t)(e)}(i,n,o)},Kn=function(e){return Xn($r({},e,{isVisibleThroughFrameFn:$n}))},Qn=function(e){return Xn($r({},e,{isVisibleThroughFrameFn:Yn}))};function ea(e){var t=e.afterDragging,r=e.destination,n=e.displacedBy,a=e.viewport,o=e.forceShouldAnimate,i=e.last;return t.reduce((function(e,t){var l=function(e,t){var r=e.page.marginBox,n={top:t.point.y,right:0,bottom:0,left:t.point.x};return Xr.getRect(Xr.expand(r,n))}(t,n),s=t.descriptor.id;if(e.all.push(s),!Kn({target:l,destination:r,viewport:a,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var c={draggableId:s,shouldAnimate:function(e,t,r){if("boolean"==typeof r)return r;if(!t)return!0;var n=t.invisible,a=t.visible;if(n[e])return!1;var o=a[e];return!o||o.shouldAnimate}(s,i,o)};return e.visible[s]=c,e}),{all:[],visible:{},invisible:{}})}function ta(e){var t=e.insideDestination,r=e.inHomeList,n=e.displacedBy,a=e.destination,o=function(e,t){if(!e.length)return 0;var r=e[e.length-1].descriptor.index;return t.inHomeList?r:r+1}(t,{inHomeList:r});return{displaced:zn,displacedBy:n,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:o}}}}function ra(e){var t=e.draggable,r=e.insideDestination,n=e.destination,a=e.viewport,o=e.displacedBy,i=e.last,l=e.index,s=e.forceShouldAnimate,c=Hn(t,n);if(null==l)return ta({insideDestination:r,inHomeList:c,displacedBy:o,destination:n});var u=On(r,(function(e){return e.descriptor.index===l}));if(!u)return ta({insideDestination:r,inHomeList:c,displacedBy:o,destination:n});var d=jn(t,r),p=r.indexOf(u);return{displaced:ea({afterDragging:d.slice(p),destination:n,displacedBy:o,last:i,viewport:a.frame,forceShouldAnimate:s}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:l}}}}function na(e,t){return Boolean(t.effected[e])}var aa=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.draggable,a=e.draggables,o=e.destination,i=e.insideDestination,l=e.previousImpact,s=e.viewport,c=e.afterCritical,u=l.at;if(u||on(!1),"REORDER"===u.type){var d=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.insideDestination,a=e.location;if(!n.length)return null;var o=a.index,i=t?o+1:o-1,l=n[0].descriptor.index,s=n[n.length-1].descriptor.index;return i<l||i>(r?s:s+1)?null:i}({isMovingForward:t,isInHomeList:r,location:u.destination,insideDestination:i});return null==d?null:ra({draggable:n,insideDestination:i,destination:o,viewport:s,last:l.displaced,displacedBy:l.displacedBy,index:d})}var p=function(e){var t=e.isMovingForward,r=e.destination,n=e.draggables,a=e.combine,o=e.afterCritical;if(!r.isCombineEnabled)return null;var i=a.draggableId,l=n[i].descriptor.index;return na(i,o)?t?l:l-1:t?l+1:l}({isMovingForward:t,destination:o,displaced:l.displaced,draggables:a,combine:u.combine,afterCritical:c});return null==p?null:ra({draggable:n,insideDestination:i,destination:o,viewport:s,last:l.displaced,displacedBy:l.displacedBy,index:p})},oa=function(e){var t=e.afterCritical,r=e.impact,n=e.draggables,a=Fn(r);a||on(!1);var o=a.draggableId,i=n[o].page.borderBox.center,l=function(e){var t=e.displaced,r=e.afterCritical,n=e.combineWith,a=e.displacedBy,o=Boolean(t.visible[n]||t.invisible[n]);return na(n,r)?o?hn:En(a.point):o?a.point:hn}({displaced:r.displaced,afterCritical:t,combineWith:o,displacedBy:r.displacedBy});return vn(i,l)},ia=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},la=function(e,t,r){return t[e.crossAxisStart]+r.margin[e.crossAxisStart]+r.borderBox[e.crossAxisSize]/2},sa=function(e){var t=e.axis,r=e.moveRelativeTo,n=e.isMoving;return xn(t.line,r.marginBox[t.end]+ia(t,n),la(t,r.marginBox,n))},ca=function(e){var t=e.axis,r=e.moveRelativeTo,n=e.isMoving;return xn(t.line,r.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,n),la(t,r.marginBox,n))},ua=function(e){var t=e.impact,r=e.draggable,n=e.draggables,a=e.droppable,o=e.afterCritical,i=Gn(a.descriptor.id,n),l=r.page,s=a.axis;if(!i.length)return function(e){var t=e.axis,r=e.moveInto,n=e.isMoving;return xn(t.line,r.contentBox[t.start]+ia(t,n),la(t,r.contentBox,n))}({axis:s,moveInto:a.page,isMoving:l});var c=t.displaced,u=t.displacedBy,d=c.all[0];if(d){var p=n[d];if(na(d,o))return ca({axis:s,moveRelativeTo:p.page,isMoving:l});var f=Xr.offset(p.page,u.point);return ca({axis:s,moveRelativeTo:f,isMoving:l})}var m=i[i.length-1];if(m.descriptor.id===r.descriptor.id)return l.borderBox.center;if(na(m.descriptor.id,o)){var g=Xr.offset(m.page,En(o.displacedBy.point));return sa({axis:s,moveRelativeTo:g,isMoving:l})}return sa({axis:s,moveRelativeTo:m.page,isMoving:l})},da=function(e,t){var r=e.frame;return r?vn(t,r.scroll.diff.displacement):t},pa=function(e){var t=function(e){var t=e.impact,r=e.draggable,n=e.droppable,a=e.draggables,o=e.afterCritical,i=r.page.borderBox.center,l=t.at;return n&&l?"REORDER"===l.type?ua({impact:t,draggable:r,draggables:a,droppable:n,afterCritical:o}):oa({impact:t,draggables:a,afterCritical:o}):i}(e),r=e.droppable;return r?da(r,t):t},fa=function(e,t){var r=bn(t,e.scroll.initial),n=En(r);return{frame:Xr.getRect({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:r,displacement:n}}}};function ma(e,t){return e.map((function(e){return t[e]}))}var ga=function(e){var t=e.pageBorderBoxCenter,r=e.draggable,n=function(e,t){return vn(e.scroll.diff.displacement,t)}(e.viewport,t),a=bn(n,r.page.borderBox.center);return vn(r.client.borderBox.center,a)},ha=function(e){var t=e.draggable,r=e.destination,n=e.newPageBorderBoxCenter,a=e.viewport,o=e.withDroppableDisplacement,i=e.onlyOnMainAxis,l=void 0!==i&&i,s=bn(n,t.page.borderBox.center),c={target:Dn(t.page.borderBox,s),destination:r,withDroppableDisplacement:o,viewport:a};return l?function(e){return Xn($r({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var r=qn(e.top,e.bottom),n=qn(e.left,e.right);return function(e){return t===Jn?r(e.top)&&r(e.bottom):n(e.left)&&n(e.right)}})}));var t}(c):Qn(c)},va=function(e){var t=e.isMovingForward,r=e.draggable,n=e.destination,a=e.draggables,o=e.previousImpact,i=e.viewport,l=e.previousPageBorderBoxCenter,s=e.previousClientSelection,c=e.afterCritical;if(!n.isEnabled)return null;var u=Gn(n.descriptor.id,a),d=Hn(r,n),p=function(e){var t=e.isMovingForward,r=e.draggable,n=e.destination,a=e.insideDestination,o=e.previousImpact;if(!n.isCombineEnabled)return null;if(!Un(o))return null;function i(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:n.descriptor.id}};return $r({},o,{at:t})}var l=o.displaced.all,s=l.length?l[0]:null;if(t)return s?i(s):null;var c=jn(r,a);if(!s)return c.length?i(c[c.length-1].descriptor.id):null;var u=Nn(c,(function(e){return e.descriptor.id===s}));-1===u&&on(!1);var d=u-1;return d<0?null:i(c[d].descriptor.id)}({isMovingForward:t,draggable:r,destination:n,insideDestination:u,previousImpact:o})||aa({isMovingForward:t,isInHomeList:d,draggable:r,draggables:a,destination:n,insideDestination:u,previousImpact:o,viewport:i,afterCritical:c});if(!p)return null;var f=pa({impact:p,draggable:r,droppable:n,draggables:a,afterCritical:c});if(ha({draggable:r,destination:n,newPageBorderBoxCenter:f,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:ga({pageBorderBoxCenter:f,draggable:r,viewport:i}),impact:p,scrollJumpRequest:null};var m=bn(f,l);return{clientSelection:s,impact:function(e){var t=e.impact,r=e.viewport,n=e.destination,a=e.draggables,o=e.maxScrollChange,i=fa(r,vn(r.scroll.current,o)),l=n.frame?Pn(n,vn(n.frame.scroll.current,o)):n,s=t.displaced,c=ea({afterDragging:ma(s.all,a),destination:n,displacedBy:t.displacedBy,viewport:i.frame,last:s,forceShouldAnimate:!1}),u=ea({afterDragging:ma(s.all,a),destination:l,displacedBy:t.displacedBy,viewport:r.frame,last:s,forceShouldAnimate:!1}),d={},p={},f=[s,c,u];return s.all.forEach((function(e){var t=function(e,t){for(var r=0;r<t.length;r++){var n=t[r].visible[e];if(n)return n}return null}(e,f);t?p[e]=t:d[e]=!0})),$r({},t,{displaced:{all:s.all,invisible:d,visible:p}})}({impact:p,viewport:i,destination:n,draggables:a,maxScrollChange:m}),scrollJumpRequest:m}},ba=function(e){var t=e.subject.active;return t||on(!1),t},ya=function(e,t){var r=e.page.borderBox.center;return na(e.descriptor.id,t)?bn(r,t.displacedBy.point):r},Ea=function(e,t){var r=e.page.borderBox;return na(e.descriptor.id,t)?Dn(r,En(t.displacedBy.point)):r},xa=Kr((function(e,t){var r=t[e.line];return{value:r,point:xn(e.line,r)}})),wa=function(e,t){return $r({},e,{scroll:$r({},e.scroll,{max:t})})},Ia=function(e,t,r){var n=e.frame;Hn(t,e)&&on(!1),e.subject.withPlaceholder&&on(!1);var a=xa(e.axis,t.displaceBy).point,o=function(e,t,r){var n=e.axis;if("virtual"===e.descriptor.mode)return xn(n.line,t[n.line]);var a=e.subject.page.contentBox[n.size],o=Gn(e.descriptor.id,r).reduce((function(e,t){return e+t.client.marginBox[n.size]}),0)+t[n.line]-a;return o<=0?null:xn(n.line,o)}(e,a,r),i={placeholderSize:a,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!n){var l=Rn({page:e.subject.page,withPlaceholder:i,axis:e.axis,frame:e.frame});return $r({},e,{subject:l})}var s=o?vn(n.scroll.max,o):n.scroll.max,c=wa(n,s),u=Rn({page:e.subject.page,withPlaceholder:i,axis:e.axis,frame:c});return $r({},e,{subject:u,frame:c})},Ca=function(e){var t=e.isMovingForward,r=e.previousPageBorderBoxCenter,n=e.draggable,a=e.isOver,o=e.draggables,i=e.droppables,l=e.viewport,s=e.afterCritical,c=function(e){var t=e.isMovingForward,r=e.pageBorderBoxCenter,n=e.source,a=e.droppables,o=e.viewport,i=n.subject.active;if(!i)return null;var l=n.axis,s=qn(i[l.start],i[l.end]),c=kn(a).filter((function(e){return e!==n})).filter((function(e){return e.isEnabled})).filter((function(e){return Boolean(e.subject.active)})).filter((function(e){return $n(o.frame)(ba(e))})).filter((function(e){var r=ba(e);return t?i[l.crossAxisEnd]<r[l.crossAxisEnd]:r[l.crossAxisStart]<i[l.crossAxisStart]})).filter((function(e){var t=ba(e),r=qn(t[l.start],t[l.end]);return s(t[l.start])||s(t[l.end])||r(i[l.start])||r(i[l.end])})).sort((function(e,r){var n=ba(e)[l.crossAxisStart],a=ba(r)[l.crossAxisStart];return t?n-a:a-n})).filter((function(e,t,r){return ba(e)[l.crossAxisStart]===ba(r[0])[l.crossAxisStart]}));if(!c.length)return null;if(1===c.length)return c[0];var u=c.filter((function(e){return qn(ba(e)[l.start],ba(e)[l.end])(r[l.line])}));return 1===u.length?u[0]:u.length>1?u.sort((function(e,t){return ba(e)[l.start]-ba(t)[l.start]}))[0]:c.sort((function(e,t){var n=In(r,An(ba(e))),a=In(r,An(ba(t)));return n!==a?n-a:ba(e)[l.start]-ba(t)[l.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:r,source:a,droppables:i,viewport:l});if(!c)return null;var u=Gn(c.descriptor.id,o),d=function(e){var t=e.previousPageBorderBoxCenter,r=e.moveRelativeTo,n=e.insideDestination,a=e.draggable,o=e.draggables,i=e.destination,l=e.viewport,s=e.afterCritical;if(!r){if(n.length)return null;var c={displaced:zn,displacedBy:Wn,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},u=pa({impact:c,draggable:a,droppable:i,draggables:o,afterCritical:s}),d=Hn(a,i)?i:Ia(i,a,o);return ha({draggable:a,destination:d,newPageBorderBoxCenter:u,viewport:l.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?c:null}var p,f=Boolean(t[i.axis.line]<=r.page.borderBox.center[i.axis.line]),m=(p=r.descriptor.index,r.descriptor.id===a.descriptor.id||f?p:p+1),g=xa(i.axis,a.displaceBy);return ra({draggable:a,insideDestination:n,destination:i,viewport:l,displacedBy:g,last:zn,index:m})}({previousPageBorderBoxCenter:r,destination:c,draggable:n,draggables:o,moveRelativeTo:function(e){var t=e.pageBorderBoxCenter,r=e.viewport,n=e.destination,a=e.insideDestination,o=e.afterCritical;return a.filter((function(e){return Qn({target:Ea(e,o),destination:n,viewport:r.frame,withDroppableDisplacement:!0})})).sort((function(e,r){var a=wn(t,da(n,ya(e,o))),i=wn(t,da(n,ya(r,o)));return a<i?-1:i<a?1:e.descriptor.index-r.descriptor.index}))[0]||null}({pageBorderBoxCenter:r,viewport:l,destination:c,insideDestination:u,afterCritical:s}),insideDestination:u,viewport:l,afterCritical:s});if(!d)return null;var p=pa({impact:d,draggable:n,droppable:c,draggables:o,afterCritical:s});return{clientSelection:ga({pageBorderBoxCenter:p,draggable:n,viewport:l}),impact:d,scrollJumpRequest:null}},Da=function(e){var t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},Aa=function(e){var t=e.state,r=e.type,n=function(e,t){var r=Da(e);return r?t[r]:null}(t.impact,t.dimensions.droppables),a=Boolean(n),o=t.dimensions.droppables[t.critical.droppable.id],i=n||o,l=i.axis.direction,s="vertical"===l&&("MOVE_UP"===r||"MOVE_DOWN"===r)||"horizontal"===l&&("MOVE_LEFT"===r||"MOVE_RIGHT"===r);if(s&&!a)return null;var c="MOVE_DOWN"===r||"MOVE_RIGHT"===r,u=t.dimensions.draggables[t.critical.draggable.id],d=t.current.page.borderBoxCenter,p=t.dimensions,f=p.draggables,m=p.droppables;return s?va({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,destination:i,draggables:f,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):Ca({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,isOver:i,draggables:f,droppables:m,viewport:t.viewport,afterCritical:t.afterCritical})};function Sa(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function Ra(e){var t=qn(e.top,e.bottom),r=qn(e.left,e.right);return function(e){return t(e.y)&&r(e.x)}}function Pa(e){var t=e.pageBorderBox,r=e.draggable,n=e.droppables,a=kn(n).filter((function(e){if(!e.isEnabled)return!1;var r,n,a=e.subject.active;if(!a)return!1;if(n=a,!((r=t).left<n.right&&r.right>n.left&&r.top<n.bottom&&r.bottom>n.top))return!1;if(Ra(a)(t.center))return!0;var o=e.axis,i=a.center[o.crossAxisLine],l=t[o.crossAxisStart],s=t[o.crossAxisEnd],c=qn(a[o.crossAxisStart],a[o.crossAxisEnd]),u=c(l),d=c(s);return!u&&!d||(u?l<i:s>i)}));return a.length?1===a.length?a[0].descriptor.id:function(e){var t=e.pageBorderBox,r=e.draggable,n=e.candidates,a=r.page.borderBox.center,o=n.map((function(e){var r=e.axis,n=xn(e.axis.line,t.center[r.line],e.page.borderBox.center[r.crossAxisLine]);return{id:e.descriptor.id,distance:wn(a,n)}})).sort((function(e,t){return t.distance-e.distance}));return o[0]?o[0].id:null}({pageBorderBox:t,draggable:r,candidates:a}):null}var Ba=function(e,t){return Xr.getRect(Dn(e,t))};function Na(e){var t=e.displaced,r=e.id;return Boolean(t.visible[r]||t.invisible[r])}var Oa=function(e){var t=e.pageOffset,r=e.draggable,n=e.draggables,a=e.droppables,o=e.previousImpact,i=e.viewport,l=e.afterCritical,s=Ba(r.page.borderBox,t),c=Pa({pageBorderBox:s,draggable:r,droppables:a});if(!c)return Vn;var u=a[c],d=Gn(u.descriptor.id,n),p=function(e,t){var r=e.frame;return r?Ba(t,r.scroll.diff.value):t}(u,s);return function(e){var t=e.draggable,r=e.pageBorderBoxWithDroppableScroll,n=e.previousImpact,a=e.destination,o=e.insideDestination,i=e.afterCritical;if(!a.isCombineEnabled)return null;var l=a.axis,s=xa(a.axis,t.displaceBy),c=s.value,u=r[l.start],d=r[l.end],p=On(jn(t,o),(function(e){var t=e.descriptor.id,r=e.page.borderBox,a=r[l.size]/4,o=na(t,i),s=Na({displaced:n.displaced,id:t});return o?s?d>r[l.start]+a&&d<r[l.end]-a:u>r[l.start]-c+a&&u<r[l.end]-c-a:s?d>r[l.start]+c+a&&d<r[l.end]+c-a:u>r[l.start]+a&&u<r[l.end]-a}));return p?{displacedBy:s,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:p.descriptor.id,droppableId:a.descriptor.id}}}:null}({pageBorderBoxWithDroppableScroll:p,draggable:r,previousImpact:o,destination:u,insideDestination:d,afterCritical:l})||function(e){var t=e.pageBorderBoxWithDroppableScroll,r=e.draggable,n=e.destination,a=e.insideDestination,o=e.last,i=e.viewport,l=e.afterCritical,s=n.axis,c=xa(n.axis,r.displaceBy),u=c.value,d=t[s.start],p=t[s.end],f=function(e){var t=e.draggable,r=e.closest,n=e.inHomeList;return r?n&&r.descriptor.index>t.descriptor.index?r.descriptor.index-1:r.descriptor.index:null}({draggable:r,closest:On(jn(r,a),(function(e){var t=e.descriptor.id,r=e.page.borderBox.center[s.line],n=na(t,l),a=Na({displaced:o,id:t});return n?a?p<=r:d<r-u:a?p<=r+u:d<r})),inHomeList:Hn(r,n)});return ra({draggable:r,insideDestination:a,destination:n,viewport:i,last:o,displacedBy:c,index:f})}({pageBorderBoxWithDroppableScroll:p,draggable:r,destination:u,insideDestination:d,last:o.displaced,viewport:i,afterCritical:l})},La=function(e,t){var r;return $r({},e,((r={})[t.descriptor.id]=t,r))},Ta=function(e){var t=e.previousImpact,r=e.impact,n=e.droppables,a=Da(t),o=Da(r);if(!a)return n;if(a===o)return n;var i=n[a];if(!i.subject.withPlaceholder)return n;var l=function(e){var t=e.subject.withPlaceholder;t||on(!1);var r=e.frame;if(!r){var n=Rn({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return $r({},e,{subject:n})}var a=t.oldFrameMaxScroll;a||on(!1);var o=wa(r,a),i=Rn({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return $r({},e,{subject:i,frame:o})}(i);return La(n,l)},_a=function(e){var t=e.state,r=e.clientSelection,n=e.dimensions,a=e.viewport,o=e.impact,i=e.scrollJumpRequest,l=a||t.viewport,s=n||t.dimensions,c=r||t.current.client.selection,u=bn(c,t.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:vn(t.initial.client.borderBoxCenter,u)},p={selection:vn(d.selection,l.scroll.current),borderBoxCenter:vn(d.borderBoxCenter,l.scroll.current),offset:vn(d.offset,l.scroll.diff.value)},f={client:d,page:p};if("COLLECTING"===t.phase)return $r({phase:"COLLECTING"},t,{dimensions:s,viewport:l,current:f});var m=s.draggables[t.critical.draggable.id],g=o||Oa({pageOffset:p.offset,draggable:m,draggables:s.draggables,droppables:s.droppables,previousImpact:t.impact,viewport:l,afterCritical:t.afterCritical}),h=function(e){var t=e.draggable,r=e.draggables,n=e.droppables,a=e.previousImpact,o=e.impact,i=Ta({previousImpact:a,impact:o,droppables:n}),l=Da(o);if(!l)return i;var s=n[l];if(Hn(t,s))return i;if(s.subject.withPlaceholder)return i;var c=Ia(s,t,r);return La(i,c)}({draggable:m,impact:g,previousImpact:t.impact,draggables:s.draggables,droppables:s.droppables});return $r({},t,{current:f,dimensions:{draggables:s.draggables,droppables:h},impact:g,viewport:l,scrollJumpRequest:i||null,forceShouldAnimate:!i&&null})};var ka=function(e){var t=e.impact,r=e.viewport,n=e.draggables,a=e.destination,o=e.forceShouldAnimate,i=t.displaced,l=ea({afterDragging:function(e,t){return e.map((function(e){return t[e]}))}(i.all,n),destination:a,displacedBy:t.displacedBy,viewport:r.frame,forceShouldAnimate:o,last:i});return $r({},t,{displaced:l})},Ma=function(e){var t=e.impact,r=e.draggable,n=e.droppable,a=e.draggables,o=e.viewport,i=e.afterCritical,l=pa({impact:t,draggable:r,draggables:a,droppable:n,afterCritical:i});return ga({pageBorderBoxCenter:l,draggable:r,viewport:o})},Ga=function(e){var t=e.state,r=e.dimensions,n=e.viewport;"SNAP"!==t.movementMode&&on(!1);var a=t.impact,o=n||t.viewport,i=r||t.dimensions,l=i.draggables,s=i.droppables,c=l[t.critical.draggable.id],u=Da(a);u||on(!1);var d=s[u],p=ka({impact:a,viewport:o,destination:d,draggables:l}),f=Ma({impact:p,draggable:c,droppable:d,draggables:l,viewport:o,afterCritical:t.afterCritical});return _a({impact:p,clientSelection:f,state:t,dimensions:i,viewport:o})},Ua=function(e){var t=e.draggable,r=e.home,n=e.draggables,a=e.viewport,o=xa(r.axis,t.displaceBy),i=Gn(r.descriptor.id,n),l=i.indexOf(t);-1===l&&on(!1);var s,c=i.slice(l+1),u=c.reduce((function(e,t){return e[t.descriptor.id]=!0,e}),{}),d={inVirtualList:"virtual"===r.descriptor.mode,displacedBy:o,effected:u};return{impact:{displaced:ea({afterDragging:c,destination:r,displacedBy:o,last:null,viewport:a.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(s=t.descriptor,{index:s.index,droppableId:s.droppableId})}},afterCritical:d}},Fa=function(e){var t=e.additions,r=e.updatedDroppables,n=e.viewport,a=n.scroll.diff.value;return t.map((function(e){var t=e.descriptor.droppableId,o=function(e){var t=e.frame;return t||on(!1),t}(r[t]).scroll.diff.value;return function(e){var t=e.draggable,r=e.offset,n=e.initialWindowScroll,a=Xr.offset(t.client,r),o=Xr.withScroll(a,n);return $r({},t,{placeholder:$r({},t.placeholder,{client:a}),client:a,page:o})}({draggable:e,offset:vn(a,o),initialWindowScroll:n.scroll.initial})}))},ja=function(e){return"SNAP"===e.movementMode},Ha=function(e,t,r){var n=function(e,t){return{draggables:e.draggables,droppables:La(e.droppables,t)}}(e.dimensions,t);return!ja(e)||r?_a({state:e,dimensions:n}):Ga({state:e,dimensions:n})};function Wa(e){return e.isDragging&&"SNAP"===e.movementMode?$r({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var za={phase:"IDLE",completed:null,shouldFlush:!1},Va=function(e,t){if(void 0===e&&(e=za),"FLUSH"===t.type)return $r({},za,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&on(!1);var r=t.payload,n=r.critical,a=r.clientSelection,o=r.viewport,i=r.dimensions,l=r.movementMode,s=i.draggables[n.draggable.id],c=i.droppables[n.droppable.id],u={selection:a,borderBoxCenter:s.client.borderBox.center,offset:hn},d={client:u,page:{selection:vn(u.selection,o.scroll.initial),borderBoxCenter:vn(u.selection,o.scroll.initial),offset:vn(u.selection,o.scroll.diff.value)}},p=kn(i.droppables).every((function(e){return!e.isFixedOnPage})),f=Ua({draggable:s,home:c,draggables:i.draggables,viewport:o}),m=f.impact;return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:l,dimensions:i,initial:d,current:d,isWindowScrollAllowed:p,impact:m,afterCritical:f.afterCritical,onLiftImpact:m,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&on(!1),$r({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&on(!1),function(e){var t=e.state,r=e.published,n=r.modified.map((function(e){var r=t.dimensions.droppables[e.droppableId];return Pn(r,e.scroll)})),a=$r({},t.dimensions.droppables,{},Tn(n)),o=_n(Fa({additions:r.additions,updatedDroppables:a,viewport:t.viewport})),i=$r({},t.dimensions.draggables,{},o);r.removals.forEach((function(e){delete i[e]}));var l={droppables:a,draggables:i},s=Da(t.impact),c=s?l.droppables[s]:null,u=l.draggables[t.critical.draggable.id],d=l.droppables[t.critical.droppable.id],p=Ua({draggable:u,home:d,draggables:i,viewport:t.viewport}),f=p.impact,m=p.afterCritical,g=c&&c.isCombineEnabled?t.impact:f,h=Oa({pageOffset:t.current.page.offset,draggable:l.draggables[t.critical.draggable.id],draggables:l.draggables,droppables:l.droppables,previousImpact:g,viewport:t.viewport,afterCritical:m}),v=$r({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:h,onLiftImpact:f,dimensions:l,afterCritical:m,forceShouldAnimate:!1});return"COLLECTING"===t.phase?v:$r({phase:"DROP_PENDING"},v,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})}({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;Sa(e)||on(!1);var g=t.payload.client;return yn(g,e.current.client.selection)?e:_a({state:e,clientSelection:g,impact:ja(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return Wa(e);if("COLLECTING"===e.phase)return Wa(e);Sa(e)||on(!1);var h=t.payload,v=h.id,b=h.newScroll,y=e.dimensions.droppables[v];if(!y)return e;var E=Pn(y,b);return Ha(e,E,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Sa(e)||on(!1);var x=t.payload,w=x.id,I=x.isEnabled,C=e.dimensions.droppables[w];C||on(!1),C.isEnabled===I&&on(!1);var D=$r({},C,{isEnabled:I});return Ha(e,D,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Sa(e)||on(!1);var A=t.payload,S=A.id,R=A.isCombineEnabled,P=e.dimensions.droppables[S];P||on(!1),P.isCombineEnabled===R&&on(!1);var B=$r({},P,{isCombineEnabled:R});return Ha(e,B,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;Sa(e)||on(!1),e.isWindowScrollAllowed||on(!1);var N=t.payload.newScroll;if(yn(e.viewport.scroll.current,N))return Wa(e);var O=fa(e.viewport,N);return ja(e)?Ga({state:e,viewport:O}):_a({state:e,viewport:O})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!Sa(e))return e;var L=t.payload.maxScroll;if(yn(L,e.viewport.scroll.max))return e;var T=$r({},e.viewport,{scroll:$r({},e.viewport.scroll,{max:L})});return $r({phase:"DRAGGING"},e,{viewport:T})}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&on(!1);var _=Aa({state:e,type:t.type});return _?_a({state:e,impact:_.impact,clientSelection:_.clientSelection,scrollJumpRequest:_.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var k=t.payload.reason;return"COLLECTING"!==e.phase&&on(!1),$r({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:k})}if("DROP_ANIMATE"===t.type){var M=t.payload,G=M.completed,U=M.dropDuration,F=M.newHomeClientOffset;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&on(!1),{phase:"DROP_ANIMATING",completed:G,dropDuration:U,newHomeClientOffset:F,dimensions:e.dimensions}}return"DROP_COMPLETE"===t.type?{phase:"IDLE",completed:t.payload.completed,shouldFlush:!1}:e},qa=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},$a=function(){return{type:"COLLECTION_STARTING",payload:null}},Ya=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},Ja=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},Za=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},Xa=function(e){return{type:"MOVE",payload:e}},Ka=function(){return{type:"MOVE_UP",payload:null}},Qa=function(){return{type:"MOVE_DOWN",payload:null}},eo=function(){return{type:"MOVE_RIGHT",payload:null}},to=function(){return{type:"MOVE_LEFT",payload:null}},ro=function(e){return{type:"DROP_COMPLETE",payload:e}},no=function(e){return{type:"DROP",payload:e}},ao=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}},oo="cubic-bezier(.2,1,.1,1)",io={drop:0,combining:.7},lo={drop:.75},so=.2+"s "+"cubic-bezier(0.2, 0, 0, 1)",co={fluid:"opacity "+so,snap:"transform "+so+", opacity "+so,drop:function(e){var t=e+"s "+oo;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+so,placeholder:"height "+so+", width "+so+", margin "+so},uo=function(e){return yn(e,hn)?null:"translate("+e.x+"px, "+e.y+"px)"},po=uo,fo=function(e,t){var r=uo(e);return r?t?r+" scale("+lo.drop+")":r:null},mo=.33,go=.55,ho=go-mo,vo=function(e){var t=e.getState,r=e.dispatch;return function(e){return function(n){if("DROP"===n.type){var a=t(),o=n.payload.reason;if("COLLECTING"!==a.phase){if("IDLE"!==a.phase){"DROP_PENDING"===a.phase&&a.isWaiting&&on(!1),"DRAGGING"!==a.phase&&"DROP_PENDING"!==a.phase&&on(!1);var i=a.critical,l=a.dimensions,s=l.draggables[a.critical.draggable.id],c=function(e){var t=e.draggables,r=e.reason,n=e.lastImpact,a=e.home,o=e.viewport,i=e.onLiftImpact;return n.at&&"DROP"===r?"REORDER"===n.at.type?{impact:n,didDropInsideDroppable:!0}:{impact:$r({},n,{displaced:zn}),didDropInsideDroppable:!0}:{impact:ka({draggables:t,impact:i,destination:a,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}}({reason:o,lastImpact:a.impact,afterCritical:a.afterCritical,onLiftImpact:a.onLiftImpact,home:a.dimensions.droppables[a.critical.droppable.id],viewport:a.viewport,draggables:a.dimensions.draggables}),u=c.impact,d=c.didDropInsideDroppable,p=d?Un(u):null,f=d?Fn(u):null,m={index:i.draggable.index,droppableId:i.droppable.id},g={draggableId:s.descriptor.id,type:s.descriptor.type,source:m,reason:o,mode:a.movementMode,destination:p,combine:f},h=function(e){var t=e.impact,r=e.draggable,n=e.dimensions,a=e.viewport,o=e.afterCritical,i=n.draggables,l=n.droppables,s=Da(t),c=s?l[s]:null,u=l[r.descriptor.droppableId],d=Ma({impact:t,draggable:r,draggables:i,afterCritical:o,droppable:c||u,viewport:a});return bn(d,r.client.borderBox.center)}({impact:u,draggable:s,dimensions:l,viewport:a.viewport,afterCritical:a.afterCritical}),v={critical:a.critical,afterCritical:a.afterCritical,result:g,impact:u};if(!yn(a.current.client.offset,h)||Boolean(g.combine)){var b=function(e){var t=e.current,r=e.destination,n=e.reason,a=wn(t,r);if(a<=0)return mo;if(a>=1500)return go;var o=mo+ho*(a/1500);return Number(("CANCEL"===n?.6*o:o).toFixed(2))}({current:a.current.client.offset,destination:h,reason:o});r(function(e){return{type:"DROP_ANIMATE",payload:e}}({newHomeClientOffset:h,dropDuration:b,completed:v}))}else r(ro({completed:v}))}}else r(function(e){return{type:"DROP_PENDING",payload:e}}({reason:o}))}else e(n)}}},bo=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function yo(e){var t=e.onWindowScroll;var r=Qr((function(){t(bo())})),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(t){t.target!==window&&t.target!==window.document||e()}}}(r),a=rn;function o(){return a!==rn}return{start:function(){o()&&on(!1),a=nn(window,[n])},stop:function(){o()||on(!1),r.cancel(),a(),a=rn},isActive:o}}var Eo=function(e){var t=yo({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return function(e){return function(r){t.isActive()||"INITIAL_PUBLISH"!==r.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(r)&&t.stop(),e(r)}}},xo=function(){var e=[];return{add:function(t){var r=setTimeout((function(){return function(t){var r=Nn(e,(function(e){return e.timerId===t}));-1===r&&on(!1),e.splice(r,1)[0].callback()}(r)})),n={timerId:r,callback:t};e.push(n)},flush:function(){if(e.length){var t=[].concat(e);e.length=0,t.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}},wo=function(e,t){t()},Io=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},Co=function(e,t,r,n){if(e){var a=function(e){var t=!1,r=!1,n=setTimeout((function(){r=!0})),a=function(a){t||r||(t=!0,e(a),clearTimeout(n))};return a.wasCalled=function(){return t},a}(r);e(t,{announce:a}),a.wasCalled()||r(n(t))}else r(n(t))},Do=function(e,t){var r=function(e,t){var r=xo(),n=null,a=function(r){n||on(!1),n=null,wo(0,(function(){return Co(e().onDragEnd,r,t,gn)}))};return{beforeCapture:function(t,r){n&&on(!1),wo(0,(function(){var n=e().onBeforeCapture;n&&n({draggableId:t,mode:r})}))},beforeStart:function(t,r){n&&on(!1),wo(0,(function(){var n=e().onBeforeDragStart;n&&n(Io(t,r))}))},start:function(a,o){n&&on(!1);var i=Io(a,o);n={mode:o,lastCritical:a,lastLocation:i.source,lastCombine:null},r.add((function(){wo(0,(function(){return Co(e().onDragStart,i,t,fn)}))}))},update:function(a,o){var i=Un(o),l=Fn(o);n||on(!1);var s=!function(e,t){if(e===t)return!0;var r=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,n=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return r&&n}(a,n.lastCritical);s&&(n.lastCritical=a);var c,u,d=(c=n.lastLocation,u=i,!(null==c&&null==u||null!=c&&null!=u&&c.droppableId===u.droppableId&&c.index===u.index));d&&(n.lastLocation=i);var p=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&(e.draggableId===t.draggableId&&e.droppableId===t.droppableId)}(n.lastCombine,l);if(p&&(n.lastCombine=l),s||d||p){var f=$r({},Io(a,n.mode),{combine:l,destination:i});r.add((function(){wo(0,(function(){return Co(e().onDragUpdate,f,t,mn)}))}))}},flush:function(){n||on(!1),r.flush()},drop:a,abort:function(){if(n){var e=$r({},Io(n.lastCritical,n.mode),{combine:null,destination:null,reason:"CANCEL"});a(e)}}}}(e,t);return function(e){return function(t){return function(n){if("BEFORE_INITIAL_CAPTURE"!==n.type){if("INITIAL_PUBLISH"===n.type){var a=n.payload.critical;return r.beforeStart(a,n.payload.movementMode),t(n),void r.start(a,n.payload.movementMode)}if("DROP_COMPLETE"===n.type){var o=n.payload.completed.result;return r.flush(),t(n),void r.drop(o)}if(t(n),"FLUSH"!==n.type){var i=e.getState();"DRAGGING"===i.phase&&r.update(i.critical,i.impact)}else r.abort()}else r.beforeCapture(n.payload.draggableId,n.payload.movementMode)}}}},Ao=function(e){return function(t){return function(r){if("DROP_ANIMATION_FINISHED"===r.type){var n=e.getState();"DROP_ANIMATING"!==n.phase&&on(!1),e.dispatch(ro({completed:n.completed}))}else t(r)}}},So=function(e){var t=null,r=null;return function(n){return function(a){if("FLUSH"!==a.type&&"DROP_COMPLETE"!==a.type&&"DROP_ANIMATION_FINISHED"!==a.type||(r&&(cancelAnimationFrame(r),r=null),t&&(t(),t=null)),n(a),"DROP_ANIMATE"===a.type){var o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};r=requestAnimationFrame((function(){r=null,t=nn(window,[o])}))}}}},Ro=function(e){return function(t){return function(r){if(t(r),"PUBLISH_WHILE_DRAGGING"===r.type){var n=e.getState();"DROP_PENDING"===n.phase&&(n.isWaiting||e.dispatch(no({reason:n.reason})))}}}},Po=Yr.compose,Bo=function(e){var t,r=e.dimensionMarshal,n=e.focusMarshal,a=e.styleMarshal,o=e.getResponders,i=e.announce,l=e.autoScroller;return Yr.createStore(Va,Po(Yr.applyMiddleware((t=a,function(){return function(e){return function(r){"INITIAL_PUBLISH"===r.type&&t.dragging(),"DROP_ANIMATE"===r.type&&t.dropping(r.payload.completed.result.reason),"FLUSH"!==r.type&&"DROP_COMPLETE"!==r.type||t.resting(),e(r)}}}),function(e){return function(){return function(t){return function(r){"DROP_COMPLETE"!==r.type&&"FLUSH"!==r.type&&"DROP_ANIMATE"!==r.type||e.stopPublishing(),t(r)}}}}(r),function(e){return function(t){var r=t.getState,n=t.dispatch;return function(t){return function(a){if("LIFT"===a.type){var o=a.payload,i=o.id,l=o.clientSelection,s=o.movementMode,c=r();"DROP_ANIMATING"===c.phase&&n(ro({completed:c.completed})),"IDLE"!==r().phase&&on(!1),n({type:"FLUSH",payload:null}),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:s}});var u={draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},d=e.startPublishing(u),p=d.critical,f=d.dimensions,m=d.viewport;n(function(e){return{type:"INITIAL_PUBLISH",payload:e}}({critical:p,dimensions:f,clientSelection:l,movementMode:s,viewport:m}))}else t(a)}}}}(r),vo,Ao,So,Ro,function(e){return function(t){return function(r){return function(n){if(function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n))return e.stop(),void r(n);if("INITIAL_PUBLISH"===n.type){r(n);var a=t.getState();return"DRAGGING"!==a.phase&&on(!1),void e.start(a)}r(n),e.scroll(t.getState())}}}}(l),Eo,function(e){var t=!1;return function(){return function(r){return function(n){if("INITIAL_PUBLISH"===n.type)return t=!0,e.tryRecordFocus(n.payload.critical.draggable.id),r(n),void e.tryRestoreFocusRecorded();if(r(n),t){if("FLUSH"===n.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===n.type){t=!1;var a=n.payload.completed.result;a.combine&&e.tryShiftRecord(a.draggableId,a.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}(n),Do(o,i))))};var No=function(e){var t=e.scrollHeight,r=e.scrollWidth,n=e.height,a=e.width,o=bn({x:r,y:t},{x:a,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},Oo=function(){var e=document.documentElement;return e||on(!1),e},Lo=function(){var e=Oo();return No({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},To=function(e){var t=e.critical,r=e.scrollOptions,n=e.registry,a=function(){var e=bo(),t=Lo(),r=e.y,n=e.x,a=Oo(),o=n+a.clientWidth,i=r+a.clientHeight;return{frame:Xr.getRect({top:r,left:n,right:o,bottom:i}),scroll:{initial:e,current:e,max:t,diff:{value:hn,displacement:hn}}}}(),o=a.scroll.current,i=t.droppable,l=n.droppable.getAllByType(i.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(o,r)})),s=n.draggable.getAllByType(t.draggable.type).map((function(e){return e.getDimension(o)}));return{dimensions:{draggables:_n(s),droppables:Tn(l)},critical:t,viewport:a}};function _o(e,t,r){return r.descriptor.id!==t.id&&(r.descriptor.type===t.type&&"virtual"===e.droppable.getById(r.descriptor.droppableId).descriptor.mode)}var ko,Mo,Go=function(e,t){var r=null,n=function(e){var t=e.registry,r=e.callbacks,n={additions:{},removals:{},modified:{}},a=null,o=function(){a||(r.collectionStarting(),a=requestAnimationFrame((function(){a=null;var e=n,o=e.additions,i=e.removals,l=e.modified,s=Object.keys(o).map((function(e){return t.draggable.getById(e).getDimension(hn)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(l).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),u={additions:s,removals:Object.keys(i),modified:c};n={additions:{},removals:{},modified:{}},r.publish(u)})))};return{add:function(e){var t=e.descriptor.id;n.additions[t]=e,n.modified[e.descriptor.droppableId]=!0,n.removals[t]&&delete n.removals[t],o()},remove:function(e){var t=e.descriptor;n.removals[t.id]=!0,n.modified[t.droppableId]=!0,n.additions[t.id]&&delete n.additions[t.id],o()},stop:function(){a&&(cancelAnimationFrame(a),a=null,n={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),a=function(t){r||on(!1);var a=r.critical.draggable;"ADDITION"===t.type&&_o(e,a,t.value)&&n.add(t.value),"REMOVAL"===t.type&&_o(e,a,t.value)&&n.remove(t.value)};return{updateDroppableIsEnabled:function(n,a){e.droppable.exists(n)||on(!1),r&&t.updateDroppableIsEnabled({id:n,isEnabled:a})},updateDroppableIsCombineEnabled:function(n,a){r&&(e.droppable.exists(n)||on(!1),t.updateDroppableIsCombineEnabled({id:n,isCombineEnabled:a}))},scrollDroppable:function(t,n){r&&e.droppable.getById(t).callbacks.scroll(n)},updateDroppableScroll:function(n,a){r&&(e.droppable.exists(n)||on(!1),t.updateDroppableScroll({id:n,newScroll:a}))},startPublishing:function(t){r&&on(!1);var n=e.draggable.getById(t.draggableId),o=e.droppable.getById(n.descriptor.droppableId),i={draggable:n.descriptor,droppable:o.descriptor},l=e.subscribe(a);return r={critical:i,unsubscribe:l},To({critical:i,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(r){n.stop();var t=r.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),r.unsubscribe(),r=null}}}},Uo=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&(e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason)},Fo=function(e){window.scrollBy(e.x,e.y)},jo=Kr((function(e){return kn(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),Ho=function(e){var t=e.center,r=e.destination,n=e.droppables;if(r){var a=n[r];return a.frame?a:null}return function(e,t){return On(jo(t),(function(t){return t.frame||on(!1),Ra(t.frame.pageMarginBox)(e)}))}(t,n)},Wo=.25,zo=.05,Vo=28,qo=function(e){return Math.pow(e,2)},$o={stopDampeningAt:1200,accelerateAt:360},Yo=function(e){var t=e.startOfRange,r=e.endOfRange,n=e.current,a=r-t;return 0===a?0:(n-t)/a},Jo=$o.accelerateAt,Zo=$o.stopDampeningAt,Xo=function(e){var t=e.distanceToEdge,r=e.thresholds,n=e.dragStartTime,a=e.shouldUseTimeDampening,o=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return Vo;if(e===t.startScrollingFrom)return 1;var r=Yo({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),n=Vo*qo(1-r);return Math.ceil(n)}(t,r);return 0===o?0:a?Math.max(function(e,t){var r=t,n=Zo,a=Date.now()-r;if(a>=Zo)return e;if(a<Jo)return 1;var o=Yo({startOfRange:Jo,endOfRange:n,current:a}),i=e*qo(o);return Math.ceil(i)}(o,n),1):o},Ko=function(e){var t=e.container,r=e.distanceToEdges,n=e.dragStartTime,a=e.axis,o=e.shouldUseTimeDampening,i=function(e,t){return{startScrollingFrom:e[t.size]*Wo,maxScrollValueAt:e[t.size]*zo}}(t,a);return r[a.end]<r[a.start]?Xo({distanceToEdge:r[a.end],thresholds:i,dragStartTime:n,shouldUseTimeDampening:o}):-1*Xo({distanceToEdge:r[a.start],thresholds:i,dragStartTime:n,shouldUseTimeDampening:o})},Qo=Cn((function(e){return 0===e?0:e})),ei=function(e){var t=e.dragStartTime,r=e.container,n=e.subject,a=e.center,o=e.shouldUseTimeDampening,i={top:a.y-r.top,right:r.right-a.x,bottom:r.bottom-a.y,left:a.x-r.left},l=Ko({container:r,distanceToEdges:i,dragStartTime:t,axis:Jn,shouldUseTimeDampening:o}),s=Ko({container:r,distanceToEdges:i,dragStartTime:t,axis:Zn,shouldUseTimeDampening:o}),c=Qo({x:s,y:l});if(yn(c,hn))return null;var u=function(e){var t=e.container,r=e.subject,n=e.proposedScroll,a=r.height>t.height,o=r.width>t.width;return o||a?o&&a?null:{x:o?0:n.x,y:a?0:n.y}:n}({container:r,subject:n,proposedScroll:c});return u?yn(u,hn)?null:u:null},ti=Cn((function(e){return 0===e?0:e>0?1:-1})),ri=(ko=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,r=e.max,n=e.change,a=vn(t,n),o={x:ko(a.x,r.x),y:ko(a.y,r.y)};return yn(o,hn)?null:o}),ni=function(e){var t=e.max,r=e.current,n=e.change,a={x:Math.max(r.x,t.x),y:Math.max(r.y,t.y)},o=ti(n),i=ri({max:a,current:r,change:o});return!i||(0!==o.x&&0===i.x||0!==o.y&&0===i.y)},ai=function(e,t){return ni({current:e.scroll.current,max:e.scroll.max,change:t})},oi=function(e,t){var r=e.frame;return!!r&&ni({current:r.scroll.current,max:r.scroll.max,change:t})},ii=function(e){var t=e.state,r=e.dragStartTime,n=e.shouldUseTimeDampening,a=e.scrollWindow,o=e.scrollDroppable,i=t.current.page.borderBoxCenter,l=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var s=function(e){var t=e.viewport,r=e.subject,n=e.center,a=e.dragStartTime,o=e.shouldUseTimeDampening,i=ei({dragStartTime:a,container:t.frame,subject:r,center:n,shouldUseTimeDampening:o});return i&&ai(t,i)?i:null}({dragStartTime:r,viewport:t.viewport,subject:l,center:i,shouldUseTimeDampening:n});if(s)return void a(s)}var c=Ho({center:i,destination:Da(t.impact),droppables:t.dimensions.droppables});if(c){var u=function(e){var t=e.droppable,r=e.subject,n=e.center,a=e.dragStartTime,o=e.shouldUseTimeDampening,i=t.frame;if(!i)return null;var l=ei({dragStartTime:a,container:i.pageMarginBox,subject:r,center:n,shouldUseTimeDampening:o});return l&&oi(t,l)?l:null}({dragStartTime:r,droppable:c,subject:l,center:i,shouldUseTimeDampening:n});u&&o(c.descriptor.id,u)}},li=function(e){var t=e.move,r=e.scrollDroppable,n=e.scrollWindow,a=function(e,t){if(!oi(e,t))return t;var n=function(e,t){var r=e.frame;return r&&oi(e,t)?ri({current:r.scroll.current,max:r.scroll.max,change:t}):null}(e,t);if(!n)return r(e.descriptor.id,t),null;var a=bn(t,n);return r(e.descriptor.id,a),bn(t,a)},o=function(e,t,r){if(!e)return r;if(!ai(t,r))return r;var a=function(e,t){if(!ai(e,t))return null;var r=e.scroll.max,n=e.scroll.current;return ri({current:n,max:r,change:t})}(t,r);if(!a)return n(r),null;var o=bn(r,a);return n(o),bn(r,o)};return function(e){var r=e.scrollJumpRequest;if(r){var n=Da(e.impact);n||on(!1);var i=a(e.dimensions.droppables[n],r);if(i){var l=e.viewport,s=o(e.isWindowScrollAllowed,l,i);s&&function(e,r){var n=vn(e.current.client.selection,r);t({client:n})}(e,s)}}}},si=function(e){var t=e.scrollDroppable,r=e.scrollWindow,n=e.move,a=function(e){var t=e.scrollWindow,r=e.scrollDroppable,n=Qr(t),a=Qr(r),o=null,i=function(e){o||on(!1);var t=o,r=t.shouldUseTimeDampening,i=t.dragStartTime;ii({state:e,scrollWindow:n,scrollDroppable:a,dragStartTime:i,shouldUseTimeDampening:r})};return{start:function(e){o&&on(!1);var t=Date.now(),r=!1,n=function(){r=!0};ii({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:n,scrollDroppable:n}),o={dragStartTime:t,shouldUseTimeDampening:r},r&&i(e)},stop:function(){o&&(n.cancel(),a.cancel(),o=null)},scroll:i}}({scrollWindow:r,scrollDroppable:t}),o=li({move:n,scrollWindow:r,scrollDroppable:t});return{scroll:function(e){"DRAGGING"===e.phase&&("FLUID"!==e.movementMode?e.scrollJumpRequest&&o(e):a.scroll(e))},start:a.start,stop:a.stop}},ci={base:Mo="data-rbd-drag-handle",draggableId:Mo+"-draggable-id",contextId:Mo+"-context-id"},ui=function(){var e="data-rbd-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),di=function(){var e="data-rbd-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),pi={contextId:"data-rbd-scroll-container-context-id"},fi=function(e,t){return e.map((function(e){var r=e.styles[t];return r?e.selector+" { "+r+" }":""})).join(" ")},mi="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?zr.useLayoutEffect:zr.useEffect,gi=function(){var e=document.querySelector("head");return e||on(!1),e},hi=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function vi(e,t){var r=Zr.useMemo((function(){return function(e){var t,r,n,a=(t=e,function(e){return"["+e+'="'+t+'"]'}),o=(r="\n      cursor: -webkit-grab;\n      cursor: grab;\n    ",{selector:a(ci.contextId),styles:{always:"\n          -webkit-touch-callout: none;\n          -webkit-tap-highlight-color: rgba(0,0,0,0);\n          touch-action: manipulation;\n        ",resting:r,dragging:"pointer-events: none;",dropAnimating:r}}),i=[(n="\n      transition: "+co.outOfTheWay+";\n    ",{selector:a(ui.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),o,{selector:a(di.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n        cursor: grabbing;\n        cursor: -webkit-grabbing;\n        user-select: none;\n        -webkit-user-select: none;\n        -moz-user-select: none;\n        -ms-user-select: none;\n        overflow-anchor: none;\n      "}}];return{always:fi(i,"always"),resting:fi(i,"resting"),dragging:fi(i,"dragging"),dropAnimating:fi(i,"dropAnimating"),userCancel:fi(i,"userCancel")}}(e)}),[e]),n=zr.useRef(null),a=zr.useRef(null),o=Zr.useCallback(Kr((function(e){var t=a.current;t||on(!1),t.textContent=e})),[]),i=Zr.useCallback((function(e){var t=n.current;t||on(!1),t.textContent=e}),[]);mi((function(){(n.current||a.current)&&on(!1);var l=hi(t),s=hi(t);return n.current=l,a.current=s,l.setAttribute("data-rbd-always",e),s.setAttribute("data-rbd-dynamic",e),gi().appendChild(l),gi().appendChild(s),i(r.always),o(r.resting),function(){var e=function(e){var t=e.current;t||on(!1),gi().removeChild(t),e.current=null};e(n),e(a)}}),[t,i,o,r.always,r.resting,e]);var l=Zr.useCallback((function(){return o(r.dragging)}),[o,r.dragging]),s=Zr.useCallback((function(e){o("DROP"!==e?r.userCancel:r.dropAnimating)}),[o,r.dropAnimating,r.userCancel]),c=Zr.useCallback((function(){a.current&&o(r.resting)}),[o,r.resting]);return Zr.useMemo((function(){return{dragging:l,dropping:s,resting:c}}),[l,s,c])}var bi=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function yi(e){return e instanceof bi(e).HTMLElement}function Ei(e){var t=zr.useRef({}),r=zr.useRef(null),n=zr.useRef(null),a=zr.useRef(!1),o=Zr.useCallback((function(e,r){var n={id:e,focus:r};return t.current[e]=n,function(){var r=t.current;r[e]!==n&&delete r[e]}}),[]),i=Zr.useCallback((function(t){var r=function(e,t){var r="["+ci.contextId+'="'+e+'"]',n=Ln(document.querySelectorAll(r));if(!n.length)return null;var a=On(n,(function(e){return e.getAttribute(ci.draggableId)===t}));return a&&yi(a)?a:null}(e,t);r&&r!==document.activeElement&&r.focus()}),[e]),l=Zr.useCallback((function(e,t){r.current===e&&(r.current=t)}),[]),s=Zr.useCallback((function(){n.current||a.current&&(n.current=requestAnimationFrame((function(){n.current=null;var e=r.current;e&&i(e)})))}),[i]),c=Zr.useCallback((function(e){r.current=null;var t=document.activeElement;t&&t.getAttribute(ci.draggableId)===e&&(r.current=e)}),[]);return mi((function(){return a.current=!0,function(){a.current=!1;var e=n.current;e&&cancelAnimationFrame(e)}}),[]),Zr.useMemo((function(){return{register:o,tryRecordFocus:c,tryRestoreFocusRecorded:s,tryShiftRecord:l}}),[o,c,s,l])}function xi(){var e={draggables:{},droppables:{}},t=[];function r(e){t.length&&t.forEach((function(t){return t(e)}))}function n(t){return e.draggables[t]||null}function a(t){return e.droppables[t]||null}return{draggable:{register:function(t){e.draggables[t.descriptor.id]=t,r({type:"ADDITION",value:t})},update:function(t,r){var n=e.draggables[r.descriptor.id];n&&n.uniqueId===t.uniqueId&&(delete e.draggables[r.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var a=t.descriptor.id,o=n(a);o&&t.uniqueId===o.uniqueId&&(delete e.draggables[a],r({type:"REMOVAL",value:t}))},getById:function(e){var t=n(e);return t||on(!1),t},findById:n,exists:function(e){return Boolean(n(e))},getAllByType:function(t){return Bn(e.draggables).filter((function(e){return e.descriptor.type===t}))}},droppable:{register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var r=a(t.descriptor.id);r&&t.uniqueId===r.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=a(e);return t||on(!1),t},findById:a,exists:function(e){return Boolean(a(e))},getAllByType:function(t){return Bn(e.droppables).filter((function(e){return e.descriptor.type===t}))}},subscribe:function(e){return t.push(e),function(){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var wi=Vr.createContext(null),Ii=function(){var e=document.body;return e||on(!1),e},Ci={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};var Di=0,Ai={separator:"::"};function Si(e,t){return void 0===t&&(t=Ai),Zr.useMemo((function(){return""+e+t.separator+Di++}),[t.separator,e])}var Ri=Vr.createContext(null);function Pi(e){var t=zr.useRef(e);return zr.useEffect((function(){t.current=e})),t}var Bi,Ni=((Bi={})[13]=!0,Bi[9]=!0,Bi),Oi=function(e){Ni[e.keyCode]&&e.preventDefault()},Li=function(){var e="visibilitychange";return"undefined"==typeof document?e:On([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}();var Ti,_i={type:"IDLE"};function ki(e){var t=e.cancel,r=e.completed,n=e.getPhase,a=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,r=e.clientX,o=e.clientY;if(0===t){var i={x:r,y:o},l=n();if("DRAGGING"===l.type)return e.preventDefault(),void l.actions.move(i);"PENDING"!==l.type&&on(!1);var s=l.point;if(c=s,u=i,Math.abs(u.x-c.x)>=5||Math.abs(u.y-c.y)>=5){var c,u;e.preventDefault();var d=l.actions.fluidLift(i);a({type:"DRAGGING",actions:d})}}}},{eventName:"mouseup",fn:function(e){var a=n();"DRAGGING"===a.type?(e.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),r()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===n().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==n().type)return 27===e.keyCode?(e.preventDefault(),void t()):void Oi(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===n().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var r=n();"IDLE"===r.type&&on(!1),r.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:Li,fn:t}]}function Mi(){}var Gi=((Ti={})[34]=!0,Ti[33]=!0,Ti[36]=!0,Ti[35]=!0,Ti);function Ui(e,t){function r(){t(),e.cancel()}return[{eventName:"keydown",fn:function(n){return 27===n.keyCode?(n.preventDefault(),void r()):32===n.keyCode?(n.preventDefault(),t(),void e.drop()):40===n.keyCode?(n.preventDefault(),void e.moveDown()):38===n.keyCode?(n.preventDefault(),void e.moveUp()):39===n.keyCode?(n.preventDefault(),void e.moveRight()):37===n.keyCode?(n.preventDefault(),void e.moveLeft()):void(Gi[n.keyCode]?n.preventDefault():Oi(n))}},{eventName:"mousedown",fn:r},{eventName:"mouseup",fn:r},{eventName:"click",fn:r},{eventName:"touchstart",fn:r},{eventName:"resize",fn:r},{eventName:"wheel",fn:r,options:{passive:!0}},{eventName:Li,fn:r}]}var Fi={type:"IDLE"};var ji={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Hi(e,t){var r=t.target;return!!yi(r)&&function e(t,r){if(null==r)return!1;if(Boolean(ji[r.tagName.toLowerCase()]))return!0;var n=r.getAttribute("contenteditable");return"true"===n||""===n||r!==t&&e(t,r.parentElement)}(e,r)}var Wi=function(e){return Xr.getRect(e.getBoundingClientRect()).center};var zi="undefined"==typeof document?"matches":On(["matches","msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}))||"matches";function Vi(e,t){return e.closest?e.closest(t):function e(t,r){return null==t?null:t[zi](r)?t:e(t.parentElement,r)}(e,t)}function qi(e,t){var r,n=t.target;if(!((r=n)instanceof bi(r).Element))return null;var a=Vi(n,function(e){return"["+ci.contextId+'="'+e+'"]'}(e));return a&&yi(a)?a:null}function $i(e){e.preventDefault()}function Yi(e){var t=e.expected,r=e.phase,n=e.isLockActive;return e.shouldWarn,!!n()&&t===r}function Ji(e){var t=e.lockAPI,r=e.store,n=e.registry,a=e.draggableId;if(t.isClaimed())return!1;var o=n.draggable.findById(a);return!!o&&(!!o.options.isEnabled&&!!Uo(r.getState(),a))}function Zi(e){var t=e.lockAPI,r=e.contextId,n=e.store,a=e.registry,o=e.draggableId,i=e.forceSensorStop,l=e.sourceEvent;if(!Ji({lockAPI:t,store:n,registry:a,draggableId:o}))return null;var s=a.draggable.getById(o),c=function(e,t){var r="["+ui.contextId+'="'+e+'"]',n=On(Ln(document.querySelectorAll(r)),(function(e){return e.getAttribute(ui.id)===t}));return n&&yi(n)?n:null}(r,s.descriptor.id);if(!c)return null;if(l&&!s.options.canDragInteractiveElements&&Hi(c,l))return null;var u=t.claim(i||rn),d="PRE_DRAG";function p(){return s.options.shouldRespectForcePress}function f(){return t.isActive(u)}var m=function(e,t){Yi({expected:e,phase:d,isLockActive:f,shouldWarn:!0})&&n.dispatch(t())}.bind(null,"DRAGGING");function g(e){function r(){t.release(),d="COMPLETED"}function a(t,a){if(void 0===a&&(a={shouldBlockNextClick:!1}),e.cleanup(),a.shouldBlockNextClick){var o=nn(window,[{eventName:"click",fn:$i,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(o)}r(),n.dispatch(no({reason:t}))}return"PRE_DRAG"!==d&&(r(),"PRE_DRAG"!==d&&on(!1)),n.dispatch(function(e){return{type:"LIFT",payload:e}}(e.liftActionArgs)),d="DRAGGING",$r({isActive:function(){return Yi({expected:"DRAGGING",phase:d,isLockActive:f,shouldWarn:!1})},shouldRespectForcePress:p,drop:function(e){return a("DROP",e)},cancel:function(e){return a("CANCEL",e)}},e.actions)}return{isActive:function(){return Yi({expected:"PRE_DRAG",phase:d,isLockActive:f,shouldWarn:!1})},shouldRespectForcePress:p,fluidLift:function(e){var t=Qr((function(e){m((function(){return Xa({client:e})}))})),r=g({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return $r({},r,{move:t})},snapLift:function(){var e={moveUp:function(){return m(Ka)},moveRight:function(){return m(eo)},moveDown:function(){return m(Qa)},moveLeft:function(){return m(to)}};return g({liftActionArgs:{id:o,clientSelection:Wi(c),movementMode:"SNAP"},cleanup:rn,actions:e})},abort:function(){Yi({expected:"PRE_DRAG",phase:d,isLockActive:f,shouldWarn:!0})&&t.release()}}}var Xi=[function(e){var t=zr.useRef(_i),r=zr.useRef(rn),n=Zr.useMemo((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var n=e.findClosestDraggableId(t);if(n){var a=e.tryGetLock(n,i,{sourceEvent:t});if(a){t.preventDefault();var o={x:t.clientX,y:t.clientY};r.current(),c(a,o)}}}}}}),[e]),a=Zr.useMemo((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var n=e.findOptionsForDraggable(r);n&&(n.shouldRespectForcePress||e.canGetLock(r)&&t.preventDefault())}}}}}),[e]),o=Zr.useCallback((function(){r.current=nn(window,[a,n],{passive:!1,capture:!0})}),[a,n]),i=Zr.useCallback((function(){"IDLE"!==t.current.type&&(t.current=_i,r.current(),o())}),[o]),l=Zr.useCallback((function(){var e=t.current;i(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[i]),s=Zr.useCallback((function(){var e=ki({cancel:l,completed:i,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});r.current=nn(window,e,{capture:!0,passive:!1})}),[l,i]),c=Zr.useCallback((function(e,r){"IDLE"!==t.current.type&&on(!1),t.current={type:"PENDING",point:r,actions:e},s()}),[s]);mi((function(){return o(),function(){r.current()}}),[o])},function(e){var t=zr.useRef(Mi),r=Zr.useMemo((function(){return{eventName:"keydown",fn:function(r){if(!r.defaultPrevented&&32===r.keyCode){var a=e.findClosestDraggableId(r);if(a){var o=e.tryGetLock(a,s,{sourceEvent:r});if(o){r.preventDefault();var i=!0,l=o.snapLift();t.current(),t.current=nn(window,Ui(l,s),{capture:!0,passive:!1})}}}function s(){i||on(!1),i=!1,t.current(),n()}}}}),[e]),n=Zr.useCallback((function(){t.current=nn(window,[r],{passive:!1,capture:!0})}),[r]);mi((function(){return n(),function(){t.current()}}),[n])},function(e){var t=zr.useRef(Fi),r=zr.useRef(rn),n=Zr.useCallback((function(){return t.current}),[]),a=Zr.useCallback((function(e){t.current=e}),[]),o=Zr.useMemo((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var a=e.tryGetLock(n,l,{sourceEvent:t});if(a){var o=t.touches[0],i={x:o.clientX,y:o.clientY};r.current(),d(a,i)}}}}}}),[e]),i=Zr.useCallback((function(){r.current=nn(window,[o],{capture:!0,passive:!1})}),[o]),l=Zr.useCallback((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),a(Fi),r.current(),i())}),[i,a]),s=Zr.useCallback((function(){var e=t.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[l]),c=Zr.useCallback((function(){var e={capture:!0,passive:!1},t={cancel:s,completed:l,getPhase:n},a=nn(window,function(e){var t=e.cancel,r=e.completed,n=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var r=n();if("DRAGGING"===r.type){r.hasMoved=!0;var a=e.touches[0],o={x:a.clientX,y:a.clientY};e.preventDefault(),r.actions.move(o)}else t()}},{eventName:"touchend",fn:function(e){var a=n();"DRAGGING"===a.type?(e.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),r()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===n().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var r=n();"IDLE"===r.type&&on(!1);var a=e.touches[0];if(a&&a.force>=.15){var o=r.actions.shouldRespectForcePress();if("PENDING"!==r.type)return o?r.hasMoved?void e.preventDefault():void t():void e.preventDefault();o&&t()}}},{eventName:Li,fn:t}]}(t),e),o=nn(window,function(e){var t=e.cancel,r=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===r().type?(27===e.keyCode&&e.preventDefault(),t()):t()}},{eventName:Li,fn:t}]}(t),e);r.current=function(){a(),o()}}),[s,n,l]),u=Zr.useCallback((function(){var e=n();"PENDING"!==e.type&&on(!1);var t=e.actions.fluidLift(e.point);a({type:"DRAGGING",actions:t,hasMoved:!1})}),[n,a]),d=Zr.useCallback((function(e,t){"IDLE"!==n().type&&on(!1);var r=setTimeout(u,120);a({type:"PENDING",point:t,actions:e,longPressTimerId:r}),c()}),[c,n,a,u]);mi((function(){return i(),function(){r.current();var e=n();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),a(Fi))}}),[n,i,a]),mi((function(){return nn(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function Ki(e){var t=e.contextId,r=e.store,n=e.registry,a=e.customSensors,o=e.enableDefaultSensors,i=[].concat(o?Xi:[],a||[]),l=zr.useState((function(){return function(){var e=null;function t(){e||on(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&on(!1);var r={abandon:t};return e=r,r},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],s=Zr.useCallback((function(e,t){e.isDragging&&!t.isDragging&&l.tryAbandon()}),[l]);mi((function(){var e=r.getState();return r.subscribe((function(){var t=r.getState();s(e,t),e=t}))}),[l,r,s]),mi((function(){return l.tryAbandon}),[l.tryAbandon]);for(var c=Zr.useCallback((function(e){return Ji({lockAPI:l,registry:n,store:r,draggableId:e})}),[l,n,r]),u=Zr.useCallback((function(e,a,o){return Zi({lockAPI:l,registry:n,contextId:t,store:r,draggableId:e,forceSensorStop:a,sourceEvent:o&&o.sourceEvent?o.sourceEvent:null})}),[t,l,n,r]),d=Zr.useCallback((function(e){return function(e,t){var r=qi(e,t);return r?r.getAttribute(ci.draggableId):null}(t,e)}),[t]),p=Zr.useCallback((function(e){var t=n.draggable.findById(e);return t?t.options:null}),[n.draggable]),f=Zr.useCallback((function(){l.isClaimed()&&(l.tryAbandon(),"IDLE"!==r.getState().phase&&r.dispatch({type:"FLUSH",payload:null}))}),[l,r]),m=Zr.useCallback(l.isClaimed,[l]),g=Zr.useMemo((function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:f,isLockClaimed:m}}),[c,u,d,p,f,m]),h=0;h<i.length;h++)i[h](g)}function Qi(e){return e.current||on(!1),e.current}function el(e){var t=e.contextId,r=e.setCallbacks,n=e.sensors,a=e.nonce,o=e.dragHandleUsageInstructions,i=zr.useRef(null),l=Pi(e),s=Zr.useCallback((function(){return function(e){return{onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}}(l.current)}),[l]),c=function(e){var t=Zr.useMemo((function(){return function(e){return"rbd-announcement-"+e}(e)}),[e]),r=zr.useRef(null);return zr.useEffect((function(){var e=document.createElement("div");return r.current=e,e.id=t,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),$r(e.style,Ci),Ii().appendChild(e),function(){setTimeout((function(){var t=Ii();t.contains(e)&&t.removeChild(e),e===r.current&&(r.current=null)}))}}),[t]),Zr.useCallback((function(e){var t=r.current;t&&(t.textContent=e)}),[])}(t),u=function(e){var t=e.contextId,r=e.text,n=Si("hidden-text",{separator:"-"}),a=Zr.useMemo((function(){return"rbd-hidden-text-"+(e={contextId:t,uniqueId:n}).contextId+"-"+e.uniqueId;var e}),[n,t]);return zr.useEffect((function(){var e=document.createElement("div");return e.id=a,e.textContent=r,e.style.display="none",Ii().appendChild(e),function(){var t=Ii();t.contains(e)&&t.removeChild(e)}}),[a,r]),a}({contextId:t,text:o}),d=vi(t,a),p=Zr.useCallback((function(e){Qi(i).dispatch(e)}),[]),f=Zr.useMemo((function(){return Yr.bindActionCreators({publishWhileDragging:qa,updateDroppableScroll:Ya,updateDroppableIsEnabled:Ja,updateDroppableIsCombineEnabled:Za,collectionStarting:$a},p)}),[p]),m=function(){var e=Zr.useMemo(xi,[]);return zr.useEffect((function(){return function(){requestAnimationFrame(e.clean)}}),[e]),e}(),g=Zr.useMemo((function(){return Go(m,f)}),[m,f]),h=Zr.useMemo((function(){return si($r({scrollWindow:Fo,scrollDroppable:g.scrollDroppable},Yr.bindActionCreators({move:Xa},p)))}),[g.scrollDroppable,p]),v=Ei(t),b=Zr.useMemo((function(){return Bo({announce:c,autoScroller:h,dimensionMarshal:g,focusMarshal:v,getResponders:s,styleMarshal:d})}),[c,h,g,v,s,d]);i.current=b;var y=Zr.useCallback((function(){var e=Qi(i);"IDLE"!==e.getState().phase&&e.dispatch({type:"FLUSH",payload:null})}),[]),E=Zr.useCallback((function(){var e=Qi(i).getState();return e.isDragging||"DROP_ANIMATING"===e.phase}),[]);r(Zr.useMemo((function(){return{isDragging:E,tryAbort:y}}),[E,y]));var x=Zr.useCallback((function(e){return Uo(Qi(i).getState(),e)}),[]),w=Zr.useCallback((function(){return Sa(Qi(i).getState())}),[]),I=Zr.useMemo((function(){return{marshal:g,focus:v,contextId:t,canLift:x,isMovementAllowed:w,dragHandleUsageInstructionsId:u,registry:m}}),[t,g,u,v,x,w,m]);return Ki({contextId:t,store:b,registry:m,customSensors:n,enableDefaultSensors:!1!==e.enableDefaultSensors}),zr.useEffect((function(){return y}),[y]),Vr.createElement(Ri.Provider,{value:I},Vr.createElement(Jr.Provider,{context:wi,store:b},e.children))}var tl=0;var rl=function(e){return function(t){return e===t}},nl=rl("scroll"),al=rl("auto"),ol=function(e,t){return t(e.overflowX)||t(e.overflowY)},il=function e(t){return null==t||t===document.body||t===document.documentElement?null:function(e){var t=window.getComputedStyle(e),r={overflowX:t.overflowX,overflowY:t.overflowY};return ol(r,nl)||ol(r,al)}(t)?t:e(t.parentElement)},ll=function(e){return{x:e.scrollLeft,y:e.scrollTop}},sl=function(e){return{closestScrollable:il(e),isFixedOnPage:function e(t){return!!t&&("fixed"===window.getComputedStyle(t).position||e(t.parentElement))}(e)}},cl=function(e){var t=e.ref,r=e.descriptor,n=e.env,a=e.windowScroll,o=e.direction,i=e.isDropDisabled,l=e.isCombineEnabled,s=e.shouldClipSubject,c=n.closestScrollable,u=function(e,t){var r=Xr.getBox(e);if(!t)return r;if(e!==t)return r;var n=r.paddingBox.top-t.scrollTop,a=r.paddingBox.left-t.scrollLeft,o=n+t.scrollHeight,i={top:n,right:a+t.scrollWidth,bottom:o,left:a},l=Xr.expand(i,r.border);return Xr.createBox({borderBox:l,margin:r.margin,border:r.border,padding:r.padding})}(t,c),d=Xr.withScroll(u,a),p=function(){if(!c)return null;var e=Xr.getBox(c),t={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:e,page:Xr.withScroll(e,a),scroll:ll(c),scrollSize:t,shouldClipSubject:s}}();return function(e){var t=e.descriptor,r=e.isEnabled,n=e.isCombineEnabled,a=e.isFixedOnPage,o=e.direction,i=e.client,l=e.page,s=e.closest,c=function(){if(!s)return null;var e=s.scrollSize,t=s.client,r=No({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:r,diff:{value:hn,displacement:hn}}}}(),u="vertical"===o?Jn:Zn;return{descriptor:t,isCombineEnabled:n,isFixedOnPage:a,axis:u,isEnabled:r,client:i,page:l,frame:c,subject:Rn({page:l,withPlaceholder:null,axis:u,frame:c})}}({descriptor:r,isEnabled:!i,isCombineEnabled:l,isFixedOnPage:n.isFixedOnPage,direction:o,client:u,page:d,closest:p})},ul={passive:!1},dl={passive:!0},pl=function(e){return e.shouldPublishImmediately?ul:dl};function fl(e){var t=zr.useContext(e);return t||on(!1),t}var ml=function(e){return e&&e.env.closestScrollable||null};function gl(){}var hl={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}},vl=function(e){var t=e.isAnimatingOpenOnMount,r=e.placeholder,n=e.animate,a=function(e){var t=e.isAnimatingOpenOnMount,r=e.placeholder,n=e.animate;return t||"close"===n?hl:{height:r.client.borderBox.height,width:r.client.borderBox.width,margin:r.client.margin}}({isAnimatingOpenOnMount:t,placeholder:r,animate:n});return{display:r.display,boxSizing:"border-box",width:a.width,height:a.height,marginTop:a.margin.top,marginRight:a.margin.right,marginBottom:a.margin.bottom,marginLeft:a.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==n?co.placeholder:null}};var bl=Vr.memo((function(e){var t=zr.useRef(null),r=Zr.useCallback((function(){t.current&&(clearTimeout(t.current),t.current=null)}),[]),n=e.animate,a=e.onTransitionEnd,o=e.onClose,i=e.contextId,l=zr.useState("open"===e.animate),s=l[0],c=l[1];zr.useEffect((function(){return s?"open"!==n?(r(),c(!1),gl):t.current?gl:(t.current=setTimeout((function(){t.current=null,c(!1)})),r):gl}),[n,s,r]);var u=Zr.useCallback((function(e){"height"===e.propertyName&&(a(),"close"===n&&o())}),[n,o,a]),d=vl({isAnimatingOpenOnMount:s,animate:e.animate,placeholder:e.placeholder});return Vr.createElement(e.placeholder.tagName,{style:d,"data-rbd-placeholder-context-id":i,onTransitionEnd:u,ref:e.innerRef})})),yl=Vr.createContext(null),El=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return(t=e.call.apply(e,[this].concat(n))||this).state={isVisible:Boolean(t.props.on),data:t.props.on,animate:t.props.shouldAnimate&&t.props.on?"open":"none"},t.onClose=function(){"close"===t.state.animate&&t.setState({isVisible:!1})},t}return qr(t,e),t.getDerivedStateFromProps=function(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}},t.prototype.render=function(){if(!this.state.isVisible)return null;var e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)},t}(Vr.PureComponent),xl=5e3,wl=4500,Il=function(e,t){return t?co.drop(t.duration):e?co.snap:co.fluid},Cl=function(e,t){return e?t?io.drop:io.combining:null};function Dl(e){return"DRAGGING"===e.type?function(e){var t=e.dimension.client,r=e.offset,n=e.combineWith,a=e.dropping,o=Boolean(n),i=function(e){return null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode}(e),l=Boolean(a),s=l?fo(r,o):po(r);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:Il(i,a),transform:s,opacity:Cl(o,l),zIndex:l?wl:xl,pointerEvents:"none"}}(e):{transform:po((t=e).offset),transition:t.shouldAnimateDisplacement?null:"none"};var t}function Al(e){var t=Si("draggable"),r=e.descriptor,n=e.registry,a=e.getDraggableRef,o=e.canDragInteractiveElements,i=e.shouldRespectForcePress,l=e.isEnabled,s=Zr.useMemo((function(){return{canDragInteractiveElements:o,shouldRespectForcePress:i,isEnabled:l}}),[o,l,i]),c=Zr.useCallback((function(e){var t=a();return t||on(!1),function(e,t,r){void 0===r&&(r=hn);var n=window.getComputedStyle(t),a=t.getBoundingClientRect(),o=Xr.calculateBox(a,n),i=Xr.withScroll(o,r);return{descriptor:e,placeholder:{client:o,tagName:t.tagName.toLowerCase(),display:n.display},displaceBy:{x:o.marginBox.width,y:o.marginBox.height},client:o,page:i}}(r,t,e)}),[r,a]),u=Zr.useMemo((function(){return{uniqueId:t,descriptor:r,options:s,getDimension:c}}),[r,c,s,t]),d=zr.useRef(u),p=zr.useRef(!0);mi((function(){return n.draggable.register(d.current),function(){return n.draggable.unregister(d.current)}}),[n.draggable]),mi((function(){if(p.current)p.current=!1;else{var e=d.current;d.current=u,n.draggable.update(u,e)}}),[u,n.draggable])}function Sl(e){e.preventDefault()}var Rl=function(e,t){return e===t},Pl=function(e){var t=e.combine,r=e.destination;return r?r.droppableId:t?t.droppableId:null};function Bl(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var Nl={mapped:{type:"SECONDARY",offset:hn,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Bl(null)}};var Ol={dropAnimationFinished:ao},Ll=Jr.connect((function(){var e,t,r,n=(e=Kr((function(e,t){return{x:e,y:t}})),t=Kr((function(e,t,r,n,a){return{isDragging:!0,isClone:t,isDropAnimating:Boolean(a),dropAnimation:a,mode:e,draggingOver:r,combineWith:n,combineTargetFor:null}})),r=Kr((function(e,r,n,a,o,i,l){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:o,combineWith:i,mode:r,offset:e,dimension:n,forceShouldAnimate:l,snapshot:t(r,a,o,i,null)}}})),function(n,a){if(n.isDragging){if(n.critical.draggable.id!==a.draggableId)return null;var o=n.current.client.offset,i=n.dimensions.draggables[a.draggableId],l=Da(n.impact),s=(u=n.impact).at&&"COMBINE"===u.at.type?u.at.combine.draggableId:null,c=n.forceShouldAnimate;return r(e(o.x,o.y),n.movementMode,i,a.isClone,l,s,c)}var u;if("DROP_ANIMATING"===n.phase){var d=n.completed;if(d.result.draggableId!==a.draggableId)return null;var p=a.isClone,f=n.dimensions.draggables[a.draggableId],m=d.result,g=m.mode,h=Pl(m),v=function(e){return e.combine?e.combine.draggableId:null}(m),b={duration:n.dropDuration,curve:oo,moveTo:n.newHomeClientOffset,opacity:v?io.drop:null,scale:v?lo.drop:null};return{mapped:{type:"DRAGGING",offset:n.newHomeClientOffset,dimension:f,dropping:b,draggingOver:h,combineWith:v,mode:g,forceShouldAnimate:null,snapshot:t(g,p,h,v,b)}}}return null}),a=function(){var e=Kr((function(e,t){return{x:e,y:t}})),t=Kr(Bl),r=Kr((function(e,r,n){return void 0===r&&(r=null),{mapped:{type:"SECONDARY",offset:e,combineTargetFor:r,shouldAnimateDisplacement:n,snapshot:t(r)}}})),n=function(e){return e?r(hn,e,!0):null},a=function(t,a,o,i){var l=o.displaced.visible[t],s=Boolean(i.inVirtualList&&i.effected[t]),c=Fn(o),u=c&&c.draggableId===t?a:null;if(!l){if(!s)return n(u);if(o.displaced.invisible[t])return null;var d=En(i.displacedBy.point),p=e(d.x,d.y);return r(p,u,!0)}if(s)return n(u);var f=o.displacedBy.point,m=e(f.x,f.y);return r(m,u,l.shouldAnimate)};return function(e,t){if(e.isDragging)return e.critical.draggable.id===t.draggableId?null:a(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){var r=e.completed;return r.result.draggableId===t.draggableId?null:a(t.draggableId,r.result.draggableId,r.impact,r.afterCritical)}return null}}();return function(e,t){return n(e,t)||a(e,t)||Nl}}),Ol,null,{context:wi,pure:!0,areStatePropsEqual:Rl})((function(e){var t=zr.useRef(null),r=Zr.useCallback((function(e){t.current=e}),[]),n=Zr.useCallback((function(){return t.current}),[]),a=fl(Ri),o=a.contextId,i=a.dragHandleUsageInstructionsId,l=a.registry,s=fl(yl),c=s.type,u=s.droppableId,d=Zr.useMemo((function(){return{id:e.draggableId,index:e.index,type:c,droppableId:u}}),[e.draggableId,e.index,c,u]),p=e.children,f=e.draggableId,m=e.isEnabled,g=e.shouldRespectForcePress,h=e.canDragInteractiveElements,v=e.isClone,b=e.mapped,y=e.dropAnimationFinished;v||Al(Zr.useMemo((function(){return{descriptor:d,registry:l,getDraggableRef:n,canDragInteractiveElements:h,shouldRespectForcePress:g,isEnabled:m}}),[d,l,n,h,g,m]));var E=Zr.useMemo((function(){return m?{tabIndex:0,role:"button","aria-describedby":i,"data-rbd-drag-handle-draggable-id":f,"data-rbd-drag-handle-context-id":o,draggable:!1,onDragStart:Sl}:null}),[o,i,f,m]),x=Zr.useCallback((function(e){"DRAGGING"===b.type&&b.dropping&&"transform"===e.propertyName&&y()}),[y,b]),w=Zr.useMemo((function(){var e=Dl(b),t="DRAGGING"===b.type&&b.dropping?x:null;return{innerRef:r,draggableProps:{"data-rbd-draggable-context-id":o,"data-rbd-draggable-id":f,style:e,onTransitionEnd:t},dragHandleProps:E}}),[o,E,f,b,x,r]),I=Zr.useMemo((function(){return{draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}}),[d.droppableId,d.id,d.index,d.type]);return p(w,b.snapshot,I)}));function Tl(e){return fl(yl).isUsingCloneFor!==e.draggableId||e.isClone?Vr.createElement(Ll,e):null}var _l=function(e,t){return e===t.droppable.type},kl=function(e,t){return t.draggables[e.draggable.id]},Ml={updateViewportMaxScroll:function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}}};var Gl={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||on(!1),document.body}},Ul=Jr.connect((function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=$r({},e,{shouldAnimatePlaceholder:!1}),r=Kr((function(e){return{draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}})),n=Kr((function(n,a,o,i,l,s){var c=l.descriptor.id;if(l.descriptor.droppableId===n){var u=s?{render:s,dragging:r(l.descriptor)}:null,d={isDraggingOver:o,draggingOverWith:o?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:l.placeholder,shouldAnimatePlaceholder:!1,snapshot:d,useClone:u}}if(!a)return t;if(!i)return e;var p={isDraggingOver:o,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:l.placeholder,shouldAnimatePlaceholder:!0,snapshot:p,useClone:null}}));return function(r,a){var o=a.droppableId,i=a.type,l=!a.isDropDisabled,s=a.renderClone;if(r.isDragging){var c=r.critical;if(!_l(i,c))return t;var u=kl(c,r.dimensions),d=Da(r.impact)===o;return n(o,l,d,d,u,s)}if("DROP_ANIMATING"===r.phase){var p=r.completed;if(!_l(i,p.critical))return t;var f=kl(p.critical,r.dimensions);return n(o,l,Pl(p.result)===o,Da(p.impact)===o,f,s)}if("IDLE"===r.phase&&r.completed&&!r.shouldFlush){var m=r.completed;if(!_l(i,m.critical))return t;var g=Da(m.impact)===o,h=Boolean(m.impact.at&&"COMBINE"===m.impact.at.type),v=m.critical.droppable.id===o;return g?h?e:t:v?e:t}return t}}),Ml,null,{context:wi,pure:!0,areStatePropsEqual:Rl})((function(e){var t=zr.useContext(Ri);t||on(!1);var r=t.contextId,n=t.isMovementAllowed,a=zr.useRef(null),o=zr.useRef(null),i=e.children,l=e.droppableId,s=e.type,c=e.mode,u=e.direction,d=e.ignoreContainerClipping,p=e.isDropDisabled,f=e.isCombineEnabled,m=e.snapshot,g=e.useClone,h=e.updateViewportMaxScroll,v=e.getContainerForClone,b=Zr.useCallback((function(){return a.current}),[]),y=Zr.useCallback((function(e){a.current=e}),[]);Zr.useCallback((function(){return o.current}),[]);var E=Zr.useCallback((function(e){o.current=e}),[]),x=Zr.useCallback((function(){n()&&h({maxScroll:Lo()})}),[n,h]);!function(e){var t=zr.useRef(null),r=fl(Ri),n=Si("droppable"),a=r.registry,o=r.marshal,i=Pi(e),l=Zr.useMemo((function(){return{id:e.droppableId,type:e.type,mode:e.mode}}),[e.droppableId,e.mode,e.type]),s=zr.useRef(l),c=Zr.useMemo((function(){return Kr((function(e,r){t.current||on(!1);var n={x:e,y:r};o.updateDroppableScroll(l.id,n)}))}),[l.id,o]),u=Zr.useCallback((function(){var e=t.current;return e&&e.env.closestScrollable?ll(e.env.closestScrollable):hn}),[]),d=Zr.useCallback((function(){var e=u();c(e.x,e.y)}),[u,c]),p=Zr.useMemo((function(){return Qr(d)}),[d]),f=Zr.useCallback((function(){var e=t.current,r=ml(e);e&&r||on(!1),e.scrollOptions.shouldPublishImmediately?d():p()}),[p,d]),m=Zr.useCallback((function(e,n){t.current&&on(!1);var a=i.current,o=a.getDroppableRef();o||on(!1);var s=sl(o),c={ref:o,descriptor:l,env:s,scrollOptions:n};t.current=c;var u=cl({ref:o,descriptor:l,env:s,windowScroll:e,direction:a.direction,isDropDisabled:a.isDropDisabled,isCombineEnabled:a.isCombineEnabled,shouldClipSubject:!a.ignoreContainerClipping}),d=s.closestScrollable;return d&&(d.setAttribute(pi.contextId,r.contextId),d.addEventListener("scroll",f,pl(c.scrollOptions))),u}),[r.contextId,l,f,i]),g=Zr.useCallback((function(){var e=t.current,r=ml(e);return e&&r||on(!1),ll(r)}),[]),h=Zr.useCallback((function(){var e=t.current;e||on(!1);var r=ml(e);t.current=null,r&&(p.cancel(),r.removeAttribute(pi.contextId),r.removeEventListener("scroll",f,pl(e.scrollOptions)))}),[f,p]),v=Zr.useCallback((function(e){var r=t.current;r||on(!1);var n=ml(r);n||on(!1),n.scrollTop+=e.y,n.scrollLeft+=e.x}),[]),b=Zr.useMemo((function(){return{getDimensionAndWatchScroll:m,getScrollWhileDragging:g,dragStopped:h,scroll:v}}),[h,m,g,v]),y=Zr.useMemo((function(){return{uniqueId:n,descriptor:l,callbacks:b}}),[b,l,n]);mi((function(){return s.current=y.descriptor,a.droppable.register(y),function(){t.current&&h(),a.droppable.unregister(y)}}),[b,l,h,y,o,a.droppable]),mi((function(){t.current&&o.updateDroppableIsEnabled(s.current.id,!e.isDropDisabled)}),[e.isDropDisabled,o]),mi((function(){t.current&&o.updateDroppableIsCombineEnabled(s.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,o])}({droppableId:l,type:s,mode:c,direction:u,isDropDisabled:p,isCombineEnabled:f,ignoreContainerClipping:d,getDroppableRef:b});var w=Vr.createElement(El,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(function(e){var t=e.onClose,n=e.data,a=e.animate;return Vr.createElement(bl,{placeholder:n,onClose:t,innerRef:E,animate:a,contextId:r,onTransitionEnd:x})})),I=Zr.useMemo((function(){return{innerRef:y,placeholder:w,droppableProps:{"data-rbd-droppable-id":l,"data-rbd-droppable-context-id":r}}}),[r,l,w,y]),C=g?g.dragging.draggableId:null,D=Zr.useMemo((function(){return{droppableId:l,type:s,isUsingCloneFor:C}}),[l,C,s]);return Vr.createElement(yl.Provider,{value:D},i(I,m),function(){if(!g)return null;var e=g.dragging,t=g.render,r=Vr.createElement(Tl,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(function(r,n){return t(r,n,e)}));return en.createPortal(r,v())}())}));Ul.defaultProps=Gl;var Fl=Er.DragDropContext=function(e){var t=Zr.useMemo((function(){return""+tl++}),[]),r=e.dragHandleUsageInstructions||pn;return Vr.createElement(ln,null,(function(n){return Vr.createElement(el,{nonce:e.nonce,contextId:t,setCallbacks:n,dragHandleUsageInstructions:r,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)}))},jl=Er.Draggable=function(e){var t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,r=Boolean(e.disableInteractiveElementBlocking),n=Boolean(e.shouldRespectForcePress);return Vr.createElement(Tl,$r({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:r,shouldRespectForcePress:n}))},Hl=Er.Droppable=Ul;Er.resetServerContext=function(){tl=0,Di=0};const Wl=e=>{const{resource:t,property:r}=e,{translateProperty:n,translateButton:a}=ht(),o=n(r.path+".addNewItem",t.id,{defaultValue:a("addNewItem",t.id)});return h.default.createElement(h.default.Fragment,null,h.default.createElement(i.Icon,{icon:"Add"}),o)},zl=e=>{const{property:t}=e;return t.description?h.default.createElement(i.Box,{mx:"sm",display:"inline-flex"},h.default.createElement(i.Tooltip,{direction:"top",title:t.description,size:"lg"},h.default.createElement(i.Box,null,h.default.createElement(i.Icon,{icon:"Help",color:"info"})))):null},Vl=e=>{const{property:t,props:r}=e;return t.hideLabel?null:h.default.createElement(i.Label,_({htmlFor:t.path,required:t.isRequired},r),t.label,t.description&&h.default.createElement(zl,{property:t}))},ql=(e,t)=>({...e,path:[e.path,t].join("."),label:`[${t+1}]`,isArray:!1,isDraggable:!1}),$l=e=>{const{ItemComponent:t,property:r,onDelete:n,index:a,record:o,isDraggable:l}=e,s=window.btoa(unescape(encodeURIComponent(`${JSON.stringify(Lt.get(o.params,r.path))}-${r.path}`)));return h.default.createElement(jl,{draggableId:s,index:a,key:s,isDragDisabled:!l},a=>h.default.createElement(i.Box,_({ref:a.innerRef},a.draggableProps,a.dragHandleProps,{backgroundColor:"white",flex:!0,flexDirection:"row",alignItems:"center","data-testid":r.path}),h.default.createElement(i.Box,{flexGrow:1},h.default.createElement(t,e)),h.default.createElement(i.Box,{flexShrink:0,ml:"lg"},h.default.createElement(i.Button,{rounded:!0,ml:"default","data-testid":"delete-item",type:"button",size:"icon",onClick:e=>n(e,r),variant:"danger"},h.default.createElement(i.Icon,{icon:"TrashCan"})))))},Yl=t=>{const{property:r,record:n,resource:a,onChange:o}=t,l=Lt.get(n.params,r.path)||[],s=e.useCallback(e=>{const t=[...l,r.subProperties.length?{}:""];return o(r.path,t),e.preventDefault(),!1},[n,o,r]),c=e.useCallback((e,t)=>{const r=((e,t)=>{const r=Object.keys(e.populated).reduce((e,t)=>({...e,[t]:t}),{}),n=Lt.removePath(r,t),a=Object.entries(n).reduce((t,[r,n])=>({...t,[r]:n&&e.populated[null==n?void 0:n.toString()]}),{});return{...e,params:Lt.removePath(e.params,t),populated:a}})(n,t.path);return o(r),e.preventDefault(),!1},[n,o,r]),u=e.useCallback(e=>{const{source:t,destination:n}=e;if(!t||!n||n.index===t.index)return;const a=Array.from(l),[i]=a.splice(t.index,1);a.splice(n.index,0,i),o(r.path,a)},[n,o,r]);return h.default.createElement(Fl,{onDragEnd:u},h.default.createElement(Hl,{droppableId:r.path},e=>h.default.createElement(i.Section,_({ref:e.innerRef},e.droppableProps,{mt:"xl",className:r.path}),l.map((e,n)=>{const a=ql(t.property,n);return h.default.createElement($l,_({},t,{property:a,isDraggable:r.isDraggable,key:a.path,onDelete:c,index:n}))}),e.placeholder,h.default.createElement(i.Button,{onClick:s,type:"button",rounded:!0},h.default.createElement(Wl,{resource:a,property:r})))))};class Jl extends h.default.PureComponent{render(){const{property:e,record:t,ItemComponent:r}=this.props,n=Lt.get(t.params,e.path)||[];return h.default.createElement(i.ValueGroup,{label:e.label},h.default.createElement(i.Section,null,(n||[]).map((t,n)=>{const a=ql(e,n);return h.default.createElement(r,_({},this.props,{key:a.path,property:a}))})))}}var Zl=Object.freeze({__proto__:null,show:Jl,edit:e=>{const{property:t,record:r,testId:n}=e,a=r.errors&&r.errors[t.propertyPath];return h.default.createElement(i.FormGroup,{error:!!a,"data-testid":n},h.default.createElement(Vl,{property:t}),h.default.createElement(Yl,e),h.default.createElement(i.FormMessage,null,a&&a.message))},list:e=>{const{property:t,record:r}=e,n=Lt.get(r.params,t.path)||[],{translateProperty:a}=ht();return h.default.createElement("span",null,`${a("length")}: ${n.length}`)}});function Xl(e,t){const[r]=t.name.split(".").slice(-1);return{...t,path:[e.path,r].join(".")}}class Kl extends h.default.PureComponent{renderItems(){const{property:e,ItemComponent:t}=this.props;return h.default.createElement(h.default.Fragment,null,e.subProperties.filter(e=>!e.isId).map(r=>{const n=Xl(e,r);return h.default.createElement("div",{key:n.path},h.default.createElement(i.Label,{inline:!0},r.label+": "),h.default.createElement(t,_({},this.props,{property:n})))}))}render(){const{property:e,record:t,resource:n}=this.props,a=t.recordActions.find(e=>"show"===e.name);if(n.titleProperty.propertyPath===e.propertyPath&&a){const e=(new O).recordActionUrl({resourceId:n.id,recordId:t.id,actionName:"show"});return h.default.createElement(r.Link,{to:e},this.renderItems())}return this.renderItems()}}var Ql=Object.freeze({__proto__:null,show:e=>{const{property:t,ItemComponent:r}=e;return h.default.createElement(i.ValueGroup,{label:t.label},h.default.createElement(i.Section,null,t.subProperties.filter(e=>!e.isId).map(n=>{const a=Xl(t,n);return h.default.createElement(r,_({},e,{key:a.path,property:a}))})))},edit:e=>{const{property:t,record:r,ItemComponent:n}=e,a=r.errors&&r.errors[t.path];return h.default.createElement(i.FormGroup,{error:!!a},h.default.createElement(Vl,{property:t}),h.default.createElement(i.Section,t.props,t.subProperties.filter(e=>!e.isId).map(r=>{const a=Xl(t,r);return h.default.createElement(n,_({},e,{key:a.path,property:a}))})),h.default.createElement(i.FormMessage,null,a&&a.message))},list:Kl});const es=e=>{const{property:t,record:r}=e,n=null==r?void 0:r.params[t.path];if(void 0===n)return null;if(t.availableValues){const e=t.availableValues.find(e=>e.value===n);return e?h.default.createElement(i.Badge,null,(null==e?void 0:e.label)||n):n}return n};class ts extends h.default.PureComponent{render(){const{property:e}=this.props;return h.default.createElement(i.ValueGroup,{label:e.label},h.default.createElement(es,this.props))}}const rs=(e,t)=>{const r=e.record.params[e.property.path],n=t.record.params[t.property.path],a=e.record.errors[e.property.path],o=t.record.errors[t.property.path];return r===n&&a===o},ns=e=>{var t;const{property:r,record:n}=e,a=null===(t=n.errors)||void 0===t?void 0:t[r.path];return h.default.createElement(i.FormGroup,{error:Boolean(a)},h.default.createElement(Vl,{property:r}),r.availableValues?h.default.createElement(as,e):h.default.createElement(os,e),h.default.createElement(i.FormMessage,null,a&&a.message))},as=e=>{var t;const{theme:r,record:n,property:a,onChange:o}=e;if(!a.availableValues)return null;const l=(null===(t=n.params)||void 0===t?void 0:t[a.path])??"",s=i.selectStyles(r),c=a.availableValues.find(e=>e.value===l);return h.default.createElement(D.default,_({isClearable:!0,styles:s,value:c,required:a.isRequired,options:a.availableValues,onChange:e=>o(a.path,(null==e?void 0:e.value)??""),isDisabled:a.isDisabled},a.props))},os=t=>{var r;const{property:n,record:a,onChange:o}=t,l=(null===(r=a.params)||void 0===r?void 0:r[n.path])??"",[s,c]=e.useState(l);return e.useEffect(()=>{s!==l&&c(l)},[l]),h.default.createElement(i.Input,_({id:n.path,name:n.path,required:n.isRequired,onChange:e=>c(e.target.value),onBlur:()=>o(n.path,s),onKeyDown:e=>13===e.keyCode&&o(n.path,s),value:s,disabled:n.isDisabled},n.props))};var is=n.withTheme(e.memo(ns,rs));class ls extends h.default.PureComponent{constructor(e){super(e),this.handleInputChange=this.handleInputChange.bind(this),this.handleSelectChange=this.handleSelectChange.bind(this)}handleInputChange(e){const{onChange:t,property:r}=this.props;t(r.path,e.target.value)}handleSelectChange(e){const{onChange:t,property:r}=this.props,n=e?e.value:"";t(r.path,n)}renderInput(){const{property:e,filter:t,theme:r}=this.props,n="filter-"+e.path,a=t[e.path]||"";if(e.availableValues){const t=e.availableValues.find(e=>e.value===a);return h.default.createElement(D.default,{value:void 0===t?"":t,isClearable:!0,options:e.availableValues,styles:i.filterStyles(r),onChange:this.handleSelectChange})}return h.default.createElement(i.Input,{name:n,onChange:this.handleInputChange,value:a})}render(){const{property:e}=this.props;return h.default.createElement(i.FormGroup,{variant:"filter"},h.default.createElement(i.Label,null,e.label),this.renderInput())}}var ss=n.withTheme(ls);class cs extends h.default.PureComponent{render(){return h.default.createElement(es,this.props)}}var us=Object.freeze({__proto__:null,show:ts,edit:is,filter:ss,list:cs});const ds=e=>{const{property:t,onChange:r,record:n}=e,a=(e=>!(!e||"false"===e))(n.params&&n.params[t.path]),o=n.errors&&n.errors[t.path];return h.default.createElement(i.FormGroup,{error:!!o},h.default.createElement(i.CheckBox,_({id:t.path,name:t.path,onChange:()=>{t.isDisabled||r(t.path,!a)},checked:a,disabled:t.isDisabled},t.props)),h.default.createElement(Vl,{property:t,props:{inline:!0}}),h.default.createElement(i.FormMessage,null,o&&o.message))};var ps=e.memo(ds,rs),fs=e=>void 0===e?"":e?"Yes":"No";const ms=e=>{const{record:t,property:r,resource:n}=e,{translateProperty:a}=ht(),o=null==t?void 0:t.params[r.path];if(void 0===o||""===o)return null;const l=fs(o),s=a(`${r.path}.${o}`,n.id,{defaultValue:l});return h.default.createElement(i.Badge,{outline:!0,size:"sm"},s)};class gs extends h.default.PureComponent{render(){const{property:e}=this.props;return h.default.createElement(i.ValueGroup,{label:e.label},h.default.createElement(ms,this.props))}}class hs extends h.default.PureComponent{render(){return h.default.createElement(ms,this.props)}}class vs extends h.default.PureComponent{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){const{onChange:t,property:r}=this.props,n=e?e.value:"";t(r.path,n)}render(){const{property:e,filter:t={},theme:r}=this.props,n=void 0===t[e.path]?"":t[e.path],a=[{value:!0,label:fs(!0)},{value:!1,label:fs(!1)}],o=a.find(e=>e.value===n);return h.default.createElement(i.FormGroup,null,h.default.createElement(i.Label,null,e.label),h.default.createElement(D.default,{value:void 0===o?"":o,isClearable:!0,options:a,styles:i.filterStyles(r),onChange:this.handleChange}))}}var bs=n.withTheme(vs),ys=Object.freeze({__proto__:null,edit:ps,show:gs,list:hs,filter:bs});const Es=e=>{const{property:t,onChange:r,record:n}=e,a=n.params&&n.params[t.path]||"",o=n.errors&&n.errors[t.path];return h.default.createElement(i.FormGroup,{error:!!o},h.default.createElement(Vl,{property:t}),h.default.createElement(i.DatePicker,_({value:a,disabled:t.isDisabled,onChange:e=>r(t.path,e),propertyType:t.type},t.props)),h.default.createElement(i.FormMessage,null,o&&o.message))};var xs=e.memo(Es,rs),ws=(e,t)=>{if(!e)return"";const r=new Date(e);return r?i.formatDateProperty(r,t):""};class Is extends h.default.PureComponent{render(){const{property:e,record:t}=this.props,r=ws(t.params[e.path],e.type);return h.default.createElement(i.ValueGroup,{label:e.label},r)}}class Cs extends h.default.PureComponent{render(){const{property:e,record:t}=this.props,r=ws(t.params[e.path],e.type);return h.default.createElement("span",null,r)}}class Ds{static normalizeKeys(e){return w.unflatten(w.flatten(e),{delimiter:"~~"})}constructor(e={},t){this.resource=t;const r=Ds.normalizeKeys(e);this.filters=Object.keys(r).reduce((e,t)=>(e[t]={path:t,property:this.resource.property(t),value:r[t]},e),{})}get(e){return this.filters[e]}async populate(){const e=Object.keys(this.filters);for(let r=0;r<e.length;r+=1){var t;const n=e[r],a=null===(t=this.resource.decorate().getPropertyByKey(n))||void 0===t?void 0:t.reference();a&&(this.filters[n].populated=await a.findOne(this.filters[n].value))}return this}reduce(e,t){return Object.values(this.filters).reduce(e,t||{})}isVisible(){return!!Object.keys(this.filters).length}}var As=Object.freeze({__proto__:null,PARAM_SEPARATOR:"~~",Filter:Ds,default:Ds});const{PARAM_SEPARATOR:Ss}=As;var Rs=Object.freeze({__proto__:null,edit:xs,show:Is,list:Cs,filter:e=>{const{property:t,filter:r,onChange:n}=e,{translateProperty:a}=ht(),o=`${t.path}${Ss}from`,l=`${t.path}${Ss}to`,s=r[o],c=r[l];return h.default.createElement(h.default.Fragment,null,h.default.createElement(i.FormGroup,{variant:"filter"},h.default.createElement(i.Label,null,t.label),h.default.createElement(i.Label,null,`- ${a("from")}: `),h.default.createElement(i.DatePicker,{value:s,onChange:e=>n(o,e),propertyType:t.type}),h.default.createElement(i.Label,{mt:"default"},`- ${a("to")}: `),h.default.createElement(i.DatePicker,{value:c,onChange:e=>n(l,e),propertyType:t.type})))}});const Ps=e=>{var t;const{property:r,record:n,onChange:a}=e,o=(null===(t=n.params)||void 0===t?void 0:t[r.path])??"",l=n.errors&&n.errors[r.path],{props:s}=r,{quill:c={},...u}=s||{};return c.theme=c.theme||"snow",c.modules={toolbar:i.DefaultQuillToolbarOptions,...c.modules||{}},h.default.createElement(i.FormGroup,{error:Boolean(l)},h.default.createElement(Vl,{property:r}),h.default.createElement(i.RichText,_({},u,{value:o,onChange:e=>a(r.path,e),quill:c})),h.default.createElement(i.FormMessage,null,null==l?void 0:l.message))};var Bs=e.memo(Ps,rs);class Ns extends h.default.PureComponent{constructor(e){super(e),this.contentRef=h.default.createRef()}componentDidMount(){const{property:e,record:t}=this.props,r=t.params[e.path];this.contentRef.current.innerHTML=r}render(){const{property:e}=this.props;return h.default.createElement(i.ValueGroup,{label:e.label},h.default.createElement(i.Box,{variant:"grey",border:"default"},h.default.createElement(i.Text,{ref:this.contentRef})))}}var Os=Object.freeze({__proto__:null,edit:Bs,show:Ns,list:e=>{const{property:t,record:r}=e,n=r.params[t.path]||"",a=n.substring(0,15)+(n.length>15?"...":"");return h.default.createElement("span",null,a)}});var Ls=n.withTheme(t=>{const{onChange:r,property:n,record:a,theme:o}=t,{reference:l}=n;if(!l)throw new Error(`Cannot reference resource in property '${n.path}'`);const s=null==a?void 0:a.errors[n.path],c=null==a?void 0:a.params[n.path],[u,d]=e.useState(),[p,f]=e.useState(0),m=(null==a?void 0:a.populated[n.path])??u,g=c&&m?{value:m.id,label:m.title}:{value:"",label:""},v=i.selectStyles(o);return e.useEffect(()=>{if(!m&&c){f(e=>e+1);(new wt).recordAction({actionName:"show",resourceId:l,recordId:c}).then(({data:e})=>{d(e.record)}).finally(()=>{f(e=>e-1)})}},[m,c,l]),h.default.createElement(i.FormGroup,{error:Boolean(s)},h.default.createElement(Vl,{property:n}),h.default.createElement(A.default,_({cacheOptions:!0,value:g,styles:v,defaultOptions:!0,loadOptions:async e=>{const t=new wt;return(await t.searchRecords({resourceId:l,query:e})).map(e=>({value:e.id,label:e.title,record:e}))},onChange:e=>{e?r(n.path,e.value,e.record):r(n.path,null)},isClearable:!0,isDisabled:n.isDisabled,isLoading:p},n.props)),h.default.createElement(i.FormMessage,null,null==s?void 0:s.message))});const Ts=b.default(r.Link).withConfig({displayName:"reference-value__StyledLink",componentId:"sc-1ujousf-0"})(["",";padding-left:",";padding-right:",";"],i.ButtonCSS,({theme:e})=>e.space.xs,({theme:e})=>e.space.xs),_s=e=>{const{property:t,record:r}=e,n=new O,a=r.params[t.path],o=r.populated[t.path],i=o&&o.title||a;if(!t.reference)throw new Error(`property: "${t.path}" does not have a reference`);if(o&&o.recordActions.find(e=>"show"===e.name)){const e=n.recordActionUrl({resourceId:t.reference,recordId:a,actionName:"show"});return h.default.createElement(Ts,{variant:"text",to:e},i)}return h.default.createElement("span",null,i)};class ks extends h.default.PureComponent{render(){const{property:e,record:t}=this.props;return h.default.createElement(i.ValueGroup,{label:e.label},h.default.createElement(_s,{property:e,record:t}))}}class Ms extends h.default.PureComponent{render(){const{property:e,record:t}=this.props;return h.default.createElement(_s,{property:e,record:t})}}class Gs extends h.default.PureComponent{constructor(e){super(e),this.api=new wt,this.options=[],this.loadOptions=this.loadOptions.bind(this),this.handleChange=this.handleChange.bind(this)}handleChange(e){const{onChange:t,property:r}=this.props;t(r.path,e?e.value:"")}async loadOptions(e){const{property:t}=this.props,r=await this.api.searchRecords({resourceId:t.reference,query:e});return this.options=r.map(e=>({value:e.id,label:e.title})),this.options}render(){const{property:e,filter:t,theme:r}=this.props,n=void 0===t[e.path]?"":t[e.path],a=(this.options||[]).find(e=>e.value===n);return h.default.createElement(i.FormGroup,null,h.default.createElement(i.Label,null,e.label),h.default.createElement(A.default,{value:void 0===a?"":a,isClearable:!0,cacheOptions:!0,styles:i.filterStyles(r),loadOptions:this.loadOptions,onChange:this.handleChange,defaultOptions:!0}))}}var Us=n.withTheme(Gs),Fs=Object.freeze({__proto__:null,edit:Ls,show:ks,list:Ms,filter:Us});class js extends h.default.PureComponent{render(){const{property:e,record:t}=this.props,r=t.params[e.path]||"";return h.default.createElement(i.ValueGroup,{label:e.label},r.split(/(?:\r\n|\r|\n)/g).map((e,t)=>h.default.createElement(h.default.Fragment,{key:t},e,h.default.createElement("br",null))))}}const Hs=t=>{var r,n;const{onChange:a,property:o,record:l}=t,s=(null===(r=l.params)||void 0===r?void 0:r[o.path])??"",[c,u]=e.useState(s),d=null===(n=l.errors)||void 0===n?void 0:n[o.path];return e.useEffect(()=>{c!==s&&u(s)},[s]),h.default.createElement(i.FormGroup,{error:Boolean(d)},h.default.createElement(Vl,{property:o}),h.default.createElement(i.Input,_({as:"textarea",rows:(c.match(/\n/g)||[]).length+1,id:o.path,name:o.path,onChange:e=>u(e.target.value),onBlur:()=>a(o.path,c),value:c,disabled:o.isDisabled},o.props)),h.default.createElement(i.FormMessage,null,d&&d.message))};var Ws=e.memo(Hs,rs),zs=Object.freeze({__proto__:null,show:js,edit:Ws});const Vs=t=>{const{property:r,record:n,onChange:a}=t,o=n.params[r.path],[l,s]=e.useState(o),c=n.errors&&n.errors[r.path],[u,d]=e.useState(!1);return e.useEffect(()=>{l!==o&&s(o)},[o]),h.default.createElement(i.FormGroup,{error:!!c},h.default.createElement(Vl,{property:r}),h.default.createElement(i.InputGroup,null,h.default.createElement(i.Input,_({type:u?"input":"password",className:"input",id:r.path,name:r.path,onChange:e=>s(e.target.value),onBlur:()=>a(r.path,l),onKeyDown:e=>13===e.keyCode&&a(r.path,l),value:l??"",disabled:r.isDisabled},r.props)),h.default.createElement(i.Button,{variant:u?"primary":"text",type:"button",size:"icon",onClick:()=>d(!u)},h.default.createElement(i.Icon,{icon:"View"}))),h.default.createElement(i.FormMessage,null,c&&c.message))};var qs=e.memo(Vs,rs),$s=Object.freeze({__proto__:null,edit:qs});let Ys={};try{Ys=window}catch(e){if("window is not defined"!==e.message)throw e}const Js={textarea:zs,boolean:ys,datetime:Rs,reference:Fs,password:$s,date:Rs,richtext:Os,string:us,number:us,float:us,mixed:null},Zs=t=>{const{property:r,resource:n,record:a,filter:o,where:l,onChange:s}=t,c=e.useMemo(()=>({...r,path:r.path||r.propertyPath}),[r]),u=`property-${l}-${c.path}`;let d=Js[c.type]&&Js[c.type][l]||us[l];if(c.components&&c.components[l]){const e=c.components[l];if(!e)throw new Error(`there is no "${c.path}.components.${l}"`);return d=Ys.AdminJS.UserComponents[e],h.default.createElement(vr,null,h.default.createElement(i.Box,{"data-testid":u},h.default.createElement(d,{property:c,resource:n,record:a,filter:o,onChange:s,where:l})))}const p=Zl[l],f=Ql[l];return r.isArray?p?h.default.createElement(p,_({},t,{property:c,ItemComponent:Zs,testId:u})):h.default.createElement("div",null):"mixed"===r.type?f?h.default.createElement(f,_({},t,{property:c,ItemComponent:Zs,testId:u})):h.default.createElement("div",null):h.default.createElement(vr,null,h.default.createElement(i.Box,{"data-testid":u},h.default.createElement(d,{property:c,resource:n,record:a,filter:o,onChange:s,where:l})))};function Xs(e){return{Edit:e.edit,Show:e.show,List:e.list,Filter:e.filter}}const Ks=Object.assign(Zs,{DefaultType:Xs(us),Boolean:Xs(ys),DateTime:Xs(Rs),RichText:Xs(Os),Reference:Xs(Fs),TextArea:Xs(zs),Password:Xs($s)}),Qs=b.default(r.Link).withConfig({displayName:"breadcrumbs__BreadcrumbLink",componentId:"tbb6y0-0"})(["color:",";font-family:",";line-height:",";font-size:",";text-decoration:none;&:hover{color:",";}&:after{content:'/';padding:0 ",";}&:last-child{&:after{content:'';}}"],({theme:e})=>e.colors.grey40,({theme:e})=>e.font,({theme:e})=>e.lineHeights.default,({theme:e})=>e.fontSizes.default,({theme:e})=>e.colors.primary100,({theme:e})=>e.space.default),ec=e=>{const{resource:t,record:r,actionName:n}=e,a=t.actions.find(e=>e.name===n),o=new O;return h.default.createElement(i.Box,{flexGrow:1,className:i.cssClass("Breadcrumbs")},h.default.createElement(Qs,{to:o.dashboardUrl()},"Dashboard"),h.default.createElement(Qs,{to:t.href?t.href:"/",className:r?"is-active":""},t.name),a&&"list"!==a.name&&h.default.createElement(Qs,{to:"#"},a.label))},tc=e=>{const{actions:t,params:r,handleClick:n}=e,a=t.map(e=>{const t=Ft(e,r);return{icon:e.icon,label:e.label,variant:e.variant,source:e,href:t||void 0,onClick:t?n:void 0,"data-testid":Wt(e),buttons:[]}}),o=a.reduce((e,t)=>{const r=t.source;if(r.parent){const n=e[r.parent]||a.find(e=>e.source.name===r.parent)||{label:r.parent};return n.buttons=n.buttons||[],n.buttons.push(t),{...e,[r.parent]:n}}return{...e,[t.source.name]:t}},{});return Object.values(o)},rc=b.default(({rounded:e,...t})=>h.default.createElement(r.Link,t)).withConfig({displayName:"styled-back-button__StyledLink",componentId:"pn0p1u-0"})(["",""],i.ButtonCSS),nc=new O,ac=e=>{const{resourceId:t,showInDrawer:n}=e,a=r.useLocation(),o=n?"ChevronRight":"ChevronLeft",{previousPage:l}=a.state||{},s=l?new URL(l):null,c=s?s.pathname+s.search:nc.resourceUrl({resourceId:t,search:window.location.search});return h.default.createElement(rc,{size:"icon",to:c,rounded:!0,mr:"lg",type:"button"},h.default.createElement(i.Icon,{icon:o}))},oc=e=>{const{resource:t,toggleFilter:r,actionPerformed:n,record:a,action:o,tag:s,omitActions:c}=e,{translateButton:u}=ht(),d=l.useHistory(),p=$t(n);if(o.hideActionHeader)return null;const f=t.id,m={resourceId:f,recordId:null==a?void 0:a.id},g=(e,t)=>zt({action:t,params:m,actionResponseHandler:p,push:d.push})(e),v=tc({actions:a?a.recordActions.filter(e=>!o||o.name!==e.name):t.resourceActions.filter(e=>"new"===e.name&&(!o||o.name!==e.name)),params:m,handleClick:g});r&&v.push({label:u("filter",t.id),onClick:r,icon:"SettingsAdjust"});const b=tc({actions:t.resourceActions.filter(e=>!["list","new"].includes(e.name)),params:{resourceId:f},handleClick:g}),y=o?o.label:t.name,E=o&&"list"===o.name,x=t.resourceActions.find(e=>"list"===e.name),w=!o.showInDrawer,I=o.showInDrawer?"":"lg",C=o.showInDrawer?"xl":"default",D=o.showInDrawer?i.H3:i.H2;return h.default.createElement(i.Box,{className:i.cssClass("ActionHeader")},o.showInDrawer?"":h.default.createElement(i.Box,{flex:!0,flexDirection:"row",px:["default",0]},h.default.createElement(ec,{resource:t,actionName:o.name,record:a}),h.default.createElement(i.Box,{flexShrink:0},h.default.createElement(i.ButtonGroup,{size:"sm",rounded:!0,buttons:b}))),h.default.createElement(i.Box,{display:["block",w?"flex":"block"]},h.default.createElement(i.Box,{mt:I,flexGrow:1,px:["default",0]},h.default.createElement(D,{mb:"lg"},!E&&x?h.default.createElement(ac,{resourceId:f,showInDrawer:o.showInDrawer}):"",y,s?h.default.createElement(i.Badge,{variant:"primary",ml:"default"},s):"")),c?"":h.default.createElement(i.Box,{mt:"xl",mb:C,flexShrink:0},h.default.createElement(i.ButtonGroup,{buttons:v}))))},ic=e=>{const{layoutElement:t,resource:r,where:n,record:a,onChange:o}=e,{props:i,properties:l,layoutElements:s,component:c}=t,{children:u,...d}=i,p=l.map(e=>r.properties[e]),f=E[c];return f?h.default.createElement(f,d,p.map(e=>h.default.createElement(E.Box,{flexGrow:1,key:e.propertyPath},h.default.createElement(Ks,{key:e.propertyPath,where:n,property:e,resource:r,record:a,onChange:o}))),s.map((t,r)=>h.default.createElement(ic,_({},e,{key:r,layoutElement:t}))),u):h.default.createElement(E.MessageBox,{size:"sm",message:"Javascript Error",variant:"danger",py:"xl"},"There is no component by the name of",h.default.createElement(E.Badge,{size:"sm",variant:"danger",mx:"default"},c),"in @adminjs/design-system. Change",h.default.createElement(E.Badge,{size:"sm",variant:"danger",mx:"default"},"@"+c),"to available component like @Header")},lc=e=>[e?"table-cell":"none",e?"table-cell":"none","table-cell","table-cell"],sc=t=>{const{resource:n,record:a,actionPerformed:o,isLoading:l,onSelect:s,isSelected:c}=t,[u,d]=e.useState(a),p=r.useHistory(),f=e.useCallback(e=>{e.record&&!e.redirectUrl?d(At(u,e)):o&&o(e)},[o,u]),m=$t(f);e.useEffect(()=>{d(a)},[a]);const{recordActions:g}=u,v=u.recordActions.find(({name:e})=>"show"===e),b=u.recordActions.find(({name:e})=>"edit"===e),y=v||b,E={resourceId:n.id,recordId:u.id},x=[{icon:"OverflowMenuHorizontal",variant:"light",label:void 0,"data-testid":"actions-dropdown",buttons:tc({actions:g,params:E,handleClick:(e,t)=>zt({action:t,params:E,actionResponseHandler:m,push:p.push})(e)})}];return h.default.createElement(i.TableRow,{onClick:e=>{const t=e.target.tagName.toLowerCase();y&&"a"!==t&&"button"!==t&&"svg"!==t&&zt({action:y,params:{resourceId:n.id,recordId:u.id},actionResponseHandler:m,push:p.push})(e)},"data-id":u.id},h.default.createElement(i.TableCell,{className:c?"selected":"not-selected"},s&&u.bulkActions.length?h.default.createElement(i.CheckBox,{onChange:()=>s(u),checked:c}):null),n.listProperties.map(e=>h.default.createElement(i.TableCell,{style:{cursor:"pointer"},key:e.propertyPath,"data-property-name":e.propertyPath,display:lc(e.isTitle)},l?h.default.createElement(i.Placeholder,{style:{height:14}}):h.default.createElement(Ks,{key:e.propertyPath,where:"list",property:e,resource:n,record:u}))),h.default.createElement(i.TableCell,{key:"options"},g.length?h.default.createElement(i.ButtonGroup,{buttons:x}):""))};class cc extends h.default.PureComponent{constructor(e){super(e),this.isActive=this.isActive.bind(this)}isActive(){const{sortBy:e,property:t}=this.props;return e===t.propertyPath}render(){const{property:e,location:t,direction:n}=this.props,a=new URLSearchParams(t.search),o=this.isActive()&&"asc"===n?"desc":"asc",l="Caret"+("asc"===n?"Up":"Down");return a.set("direction",o),a.set("sortBy",e.propertyPath),h.default.createElement(r.NavLink,{to:{search:a.toString()},className:i.cssClass("SortLink")},e.label,this.isActive()?h.default.createElement(i.Icon,{icon:l,color:"primary100",ml:"default"}):"")}}var uc=r.withRouter(cc);const dc=e=>{const{property:t,titleProperty:r,display:n}=e,a=t.propertyPath===r.propertyPath;return h.default.createElement(i.TableCell,{className:a?"main":void 0,display:n},t.isSortable?h.default.createElement(uc,e):t.label)},pc=e=>{const{titleProperty:t,properties:r,sortBy:n,direction:a,onSelectAll:o,selectedAll:l}=e;return h.default.createElement(i.TableHead,null,h.default.createElement(i.TableRow,null,h.default.createElement(i.TableCell,null,o?h.default.createElement(i.CheckBox,{style:{marginLeft:5},onChange:()=>o(),checked:l}):null),r.map(e=>h.default.createElement(dc,{display:lc(e.isTitle),key:e.propertyPath,titleProperty:t,property:e,sortBy:n,direction:a})),h.default.createElement(i.TableCell,{key:"actions",style:{width:80}})))},fc=e=>{const{children:t,action:r,actionPerformed:n,resourceId:a,recordId:o,recordIds:i}=e,{href:l,handleClick:s}=Yt(r,{resourceId:a,recordId:o,recordIds:i},n);if(!r)return null;const c=h.default.Children.toArray(t)[0];if(!c||"string"==typeof c||"number"==typeof c||"boolean"==typeof c)throw new Error("ActionButton has to have one child");return h.default.cloneElement(c,{onClick:s,"data-testid":Wt(r),href:l})},mc=k(e=>{const{resource:t}=e,{translateButton:r,translateMessage:n}=ht(),a=t.resourceActions.find(e=>"new"===e.name);return h.default.createElement(i.InfoBox,{title:n("noRecords",t.id)},h.default.createElement(i.Text,{mb:"xxl"},n("noRecordsInResource",t.id)),a?h.default.createElement(fc,{action:a,resourceId:t.id},h.default.createElement(i.Button,{variant:"primary"},h.default.createElement(i.Icon,{icon:"Add"}),r("createFirstRecord",t.id))):"")},"NoRecords"),gc=e=>Object.values(e.reduce((e,t)=>({...e,...t.bulkActions.reduce((e,t)=>({...e,[t.name]:t}),{})}),{})),hc=e=>{const{resource:t,selectedRecords:r}=e,{translateLabel:n}=ht(),a=l.useHistory(),o=$t();if(!r||!r.length)return null;const s={resourceId:t.id,recordIds:r.map(e=>e.id)},c=tc({actions:gc(r),params:s,handleClick:(e,t)=>zt({action:t,params:s,actionResponseHandler:o,push:a.push})(e)});return h.default.createElement(i.TableCaption,null,h.default.createElement(i.Box,{flex:!0,py:"sm",alignItems:"center"},h.default.createElement(i.Title,{mr:"lg"},n("selectedRecords",t.id,{selected:r.length})),h.default.createElement(i.ButtonGroup,{size:"sm",rounded:!0,buttons:c})))},vc=e=>{const{resource:t,records:r,actionPerformed:n,sortBy:a,direction:o,isLoading:l,onSelect:s,selectedRecords:c,onSelectAll:u}=e;if(!r.length)return l?h.default.createElement(i.Loader,null):h.default.createElement(mc,{resource:t});const d=c&&!!r.find(e=>c.find(t=>t.id===e.id)),p=!!r.find(e=>e.bulkActions.length);return h.default.createElement(i.Table,null,h.default.createElement(hc,{resource:t,selectedRecords:c}),h.default.createElement(pc,{properties:t.listProperties,titleProperty:t.titleProperty,direction:o,sortBy:a,onSelectAll:p?u:void 0,selectedAll:d}),h.default.createElement(i.TableBody,null,r.map(e=>h.default.createElement(sc,{record:e,resource:t,key:e.id,actionPerformed:n,isLoading:l,onSelect:s,isSelected:c&&!!c.find(t=>t.id===e.id)}))))},bc=e=>({addNotice:t=>e(Ct(t))}),yc=e=>t.connect(null,bc)(e),Ec={new:t=>{const{record:r,resource:n,action:a}=t,{record:o,handleChange:s,submit:c,loading:u,setRecord:d}=Gt(r,n.id),{translateButton:p}=ht(),f=l.useHistory();e.useEffect(()=>{r&&d(r)},[r]);return h.default.createElement(i.Box,{as:"form",onSubmit:e=>(e.preventDefault(),c().then(e=>{e.data.redirectUrl&&f.push(Vt(e.data.redirectUrl),{previousPage:window.location.href}),e.data.record.id&&!Object.keys(e.data.record.errors).length&&s({params:{},populated:{},errors:{}})}),!1),flex:!0,flexGrow:1,flexDirection:"column"},h.default.createElement(i.DrawerContent,null,null!=a&&a.showInDrawer?h.default.createElement(oc,t):null,a.layout?a.layout.map((e,r)=>h.default.createElement(ic,_({key:r,layoutElement:e},t,{where:"edit",onChange:s,record:o}))):n.editProperties.map(e=>h.default.createElement(Ks,{key:e.propertyPath,where:"edit",onChange:s,property:e,resource:n,record:o}))),h.default.createElement(i.DrawerFooter,null,h.default.createElement(i.Button,{variant:"primary",size:"lg",type:"submit","data-testid":"button-save",disabled:u},u?h.default.createElement(i.Icon,{icon:"Fade",spin:!0}):null,p("save",n.id))))},edit:t=>{const{record:r,resource:n,action:a}=t,{record:o,handleChange:s,submit:c,loading:u,setRecord:d}=Gt(r,n.id),{translateButton:p}=ht(),f=l.useHistory();e.useEffect(()=>{r&&d(r)},[r]);return h.default.createElement(i.Box,{as:"form",onSubmit:e=>(e.preventDefault(),c().then(e=>{e.data.redirectUrl&&f.push(Vt(e.data.redirectUrl),{previousPage:window.location.href})}),!1),flex:!0,flexGrow:1,flexDirection:"column"},h.default.createElement(i.DrawerContent,null,null!=a&&a.showInDrawer?h.default.createElement(oc,t):null,a.layout?a.layout.map((e,r)=>h.default.createElement(ic,_({key:r,layoutElement:e},t,{where:"edit",onChange:s,record:o}))):n.editProperties.map(e=>h.default.createElement(Ks,{key:e.propertyPath,where:"edit",onChange:s,property:e,resource:n,record:o}))),h.default.createElement(i.DrawerFooter,null,h.default.createElement(i.Button,{variant:"primary",size:"lg",type:"submit","data-testid":"button-save",disabled:u},u?h.default.createElement(i.Icon,{icon:"Fade",spin:!0}):null,p("save",n.id))))},show:e=>{const{resource:t,record:r,action:n}=e,a=t.showProperties;return h.default.createElement(i.DrawerContent,null,null!=n&&n.showInDrawer?h.default.createElement(oc,e):null,n.layout?n.layout.map((t,r)=>h.default.createElement(ic,_({key:r,layoutElement:t},e,{where:"show"}))):a.map(e=>h.default.createElement(Ks,{key:e.propertyPath,where:"show",property:e,resource:t,record:r})))},list:({resource:t,setTag:r})=>{const{records:n,loading:a,direction:o,sortBy:s,page:c,total:u,fetchData:d,perPage:p}=Qt(t.id),{selectedRecords:f,handleSelect:m,handleSelectAll:g,setSelectedRecords:v}=er(n),b=l.useLocation(),y=l.useHistory();e.useEffect(()=>{r&&r(u.toString())},[u]),e.useEffect(()=>{v([])},[t.id]),e.useEffect(()=>{new URLSearchParams(b.search).get("refresh")&&v([])},[b.search]);return h.default.createElement(i.Box,{variant:"white"},h.default.createElement(vc,{resource:t,records:n,actionPerformed:()=>d(),onSelect:m,onSelectAll:g,selectedRecords:f,direction:o,sortBy:s,isLoading:a}),h.default.createElement(i.Text,{mt:"xl",textAlign:"center"},h.default.createElement(i.Pagination,{page:c,perPage:p,total:u,onChange:e=>{const t=new URLSearchParams(b.search);t.set("page",e.toString()),y.push({search:t.toString(),state:{previousPage:window.location.href}})}})))},bulkDelete:yc(l.withRouter(t=>{const{resource:r,records:n,action:a,addNotice:o,history:l}=t,[s,c]=e.useState(!1),{translateMessage:u,translateButton:d}=ht();if(!n)return h.default.createElement(i.Text,null,u("pickSomeFirstToRemove",r.id));return h.default.createElement(h.default.Fragment,null,h.default.createElement(i.DrawerContent,null,null!=a&&a.showInDrawer?h.default.createElement(oc,_({omitActions:!0},t)):null,h.default.createElement(i.MessageBox,{mb:"xxl",variant:"danger",message:u("theseRecordsWillBeRemoved",r.id,{count:n.length})}),h.default.createElement(i.Table,null,h.default.createElement(i.TableBody,null,n.map(e=>h.default.createElement(i.TableRow,{key:e.id},h.default.createElement(i.TableCell,null,h.default.createElement(Ks,{where:"list",property:r.titleProperty,resource:r,record:e}))))))),h.default.createElement(i.DrawerFooter,null,h.default.createElement(i.Button,{variant:"primary",size:"lg",onClick:()=>{const e=new wt;c(!0);const t=n.map(e=>e.id);e.bulkAction({resourceId:r.id,actionName:a.name,recordIds:t,method:"post"}).then(e=>{if(c(!1),e.data.notice&&o(e.data.notice),e.data.redirectUrl){const t=new URLSearchParams(window.location.search);t.delete("recordIds"),l.push(Vt(e.data.redirectUrl,t.toString()),{previousPage:window.location.href})}}).catch(e=>{throw c(!1),o({message:u("bulkDeleteError",r.id),type:"error"}),e})},disabled:s},s?h.default.createElement(i.Icon,{icon:"Fade",spin:!0}):null,d("confirmRemovalMany",r.id,{count:n.length}))))}))},xc="https://adminjs.co",wc={rootPath:"/admin",logoutPath:"/admin/logout",loginPath:"/admin/login"},Ic=e=>{const{resource:t,action:r,record:n,records:o,setTag:l}=e,s=[xc,"BaseAction.html"].join("/"),{translateMessage:c}=ht();let u=Ec[r.name];return r.component&&(u=AdminJS.UserComponents[r.component]),u?h.default.createElement(vr,null,h.default.createElement(u,{action:r,resource:t,record:n,records:o,setTag:l})):u||h.default.createElement(i.MessageBox,{variant:"danger"},c("noActionComponent"),h.default.createElement(a.Trans,{key:"messages.buttons.seeTheDocumentation"},"See:",h.default.createElement(i.Link,{ml:"default",href:s},"the documentation")))},Cc=e=>{const{children:t,title:r,testId:n}=e;return h.default.createElement(i.MessageBox,{"data-testid":n,message:r},h.default.createElement(i.Text,null,t))},Dc=e=>{const{resourceId:t}=e,{translateMessage:r}=ht();return h.default.createElement(i.MessageBox,{message:"404 - PAGE NOT FOUND","data-testid":"NoResourceError",variant:"info",m:"xxl"},h.default.createElement(i.Text,null,r("error404Resource",t,{resourceId:t})))},Ac=e=>{const{resourceId:t,actionName:r}=e,{translateMessage:n}=ht();return h.default.createElement(i.MessageBox,{message:"404 - PAGE NOT FOUND","data-testid":"NoActionError",variant:"info",m:"xxl"},h.default.createElement(i.Text,null,n("error404Action",t,{resourceId:t,actionName:r})))},Sc=e=>{const{resourceId:t,recordId:r}=e,{translateMessage:n}=ht();return h.default.createElement(i.MessageBox,{message:"404 - PAGE NOT FOUND","data-testid":"NoRecordError",variant:"info",m:"xxl"},h.default.createElement(i.Text,null,n("error404Record",t,{resourceId:t,recordId:r})))},Rc=b.default(i.Box).withConfig({displayName:"wrapper__StyledWrapper",componentId:"sc-1jcopgf-0"})(["& ","{background:",";padding:",";overflow:visible;}& ","{background:",";padding:0 "," ",";}"],i.DrawerContent,({theme:e})=>e.colors.white,({theme:e})=>e.space.xxl,i.DrawerFooter,({theme:e})=>e.colors.white,({theme:e})=>e.space.xxl,({theme:e})=>e.space.xxl),Pc=e=>{const{children:t,variant:r,color:n,...a}=e;return h.default.createElement(Rc,_({},a,{variant:"grey",mx:"auto"}),t)},Bc=({children:t,width:r})=>{const[a,o]=e.useState(window.document.getElementById("drawerPortal"));if(!a&&window){const e=window.document.createElement("div"),t=h.default.createElement(n.ThemeProvider,{theme:window.THEME},h.default.createElement(i.Drawer,{id:"drawerPortal",className:"hidden"}));window.document.body.appendChild(e),d.render(t,e,()=>{o(window.document.getElementById("drawerPortal"))})}return e.useEffect(()=>a?(a.classList.remove("hidden"),r&&(a.style.width=Array.isArray(r)?r[0].toString():r.toString()),()=>{a.style.width=i.DEFAULT_DRAWER_WIDTH,a.classList.add("hidden")}):()=>{},[a]),a?d.createPortal(t,a):null},Nc=t=>{const{resource:n,isVisible:a,toggleFilter:o}=t,l=n.filterProperties,s=r.useLocation(),[c,u]=e.useState((e=>{const t={},r=new URLSearchParams(e.search);for(const e of r.entries()){const[r,n]=e;r.match("filters.")&&(t[r.replace("filters.","")]=n)}return t})(s)),d=r.useRouteMatch(),p=r.useHistory(),{translateLabel:f,translateButton:m}=ht(),g=e.useRef(!0);e.useEffect(()=>{g.current?g.current=!1:u({})},[d.params.resourceId]);const v=(e,t)=>{if(e.params)throw new Error("you can not pass RecordJSON to filters");u({...c,[e]:t})};return h.default.createElement(i.Drawer,{variant:"filter",isHidden:!a,as:"form",onSubmit:e=>{e.preventDefault();const t=new URLSearchParams(window.location.search);return Object.keys(c).forEach(e=>{""!==c[e]?t.set("filters."+e,c[e]):t.delete("filters."+e)}),t.set("page","1"),p.push(`${p.location.pathname}?${t.toString()}`,{previousPage:window.location.href}),!1}},h.default.createElement(i.DrawerContent,null,h.default.createElement(i.H3,null,h.default.createElement(i.Button,{type:"button",size:"icon",rounded:!0,mr:"lg",onClick:()=>o()},h.default.createElement(i.Icon,{icon:"ChevronRight",color:"white"})),f("filters",n.id)),h.default.createElement(i.Box,{my:"x3"},l.map(e=>h.default.createElement(Ks,{key:e.propertyPath,where:"filter",onChange:v,property:e,filter:c,resource:n})))),h.default.createElement(i.DrawerFooter,null,h.default.createElement(i.Button,{variant:"primary",size:"lg"},m("applyChanges",n.id)),h.default.createElement(i.Button,{variant:"text",size:"lg",onClick:e=>{e.preventDefault();const t=new URLSearchParams,r=new URLSearchParams(window.location.search);for(const e of r.keys())e.match("filters.")||t.set(e,r.get(e));const n=""===t.toString()?"?"+t.toString():"";p.push(p.location.pathname+n,{previousPage:window.location.href}),u({})},type:"button",color:"white"},m("resetFilter",n.id))))};var Oc=Object.freeze({__proto__:null,SortLink:uc,NoRecords:mc,PropertyHeader:dc,RecordInList:sc,RecordsTableHeader:pc,RecordsTable:vc,SelectedRecords:hc,SidebarResourceSection:nr,Sidebar:or,ActionButton:fc,ActionHeader:oc,BaseActionComponent:Ic,BreadcrumbLink:Qs,Breadcrumbs:ec,DashboardHeader:fr,Dashboard:gr,ErrorBoundary:vr,DrawerPortal:Bc,NoResourceError:Dc,NoActionError:Ac,NoRecordError:Sc,ErrorMessageBox:Cc,FilterDrawer:Nc,LoggedIn:ir,NoticeElement:dr,NoticeBox:pr,TopBar:ur,Version:sr});const Lc=new wt,Tc=()=>{const[t,r]=e.useState(),[n,a]=e.useState(!0),o=l.useRouteMatch(),s=Dt(),{translateMessage:c}=ht(),{actionName:u,recordId:d,resourceId:p}=o.params,f=tr(p),m=t&&t.recordActions.find(e=>e.name===u),g=()=>{a(!0),Lc.recordAction(o.params).then(e=>{a(!1),e.data.notice&&"error"===e.data.notice.type&&s(e.data.notice),r(e.data.record)}).catch(e=>{throw s({message:c("errorFetchingRecord",p),type:"error"}),e})};e.useEffect(()=>{g()},[u,d,p]);const v=e.useCallback((e,t)=>{t.record?r(At(e,t)):g()},[g]);if(!f)return h.default.createElement(Dc,{resourceId:p});const b=t&&t.id&&t.id.toString()!==d;if(n||b){const e=f.actions.find(e=>e.name===u);return null!=e&&e.showInDrawer?h.default.createElement(Bc,null,h.default.createElement(i.Loader,null)):h.default.createElement(i.Loader,null)}return m?t?m.showInDrawer?h.default.createElement(Bc,{width:m.containerWidth},h.default.createElement(Ic,{action:m,resource:f,record:t})):h.default.createElement(Pc,{width:m.containerWidth},h.default.createElement(oc,{resource:f,action:m,record:t,actionPerformed:e=>v(t,e)}),h.default.createElement(Ic,{action:m,resource:f,record:t})):h.default.createElement(Sc,{resourceId:p,recordId:d}):h.default.createElement(Ac,{resourceId:p,actionName:u})};var _c=t.connect(e=>({resources:e.resources}))(e=>{const{resources:t,match:r}=e,{resourceId:n,actionName:a}=r.params,o=t.find(e=>e.id===n);if(!o)return h.default.createElement(Dc,{resourceId:n});const i=o.resourceActions.find(e=>e.name===a);return i?i.showInDrawer?h.default.createElement(Bc,{width:i.containerWidth},h.default.createElement(Ic,{action:i,resource:o})):h.default.createElement(Pc,{width:i.containerWidth},h.default.createElement(oc,{resource:o,action:i}),h.default.createElement(Ic,{action:i,resource:o})):h.default.createElement(Ac,{resourceId:n,actionName:a})});const kc=new wt,Mc=()=>{const t=l.useRouteMatch(),[r,n]=e.useState([]),[a,o]=e.useState(!1),{translateMessage:s}=ht(),c=Dt(),u=l.useLocation(),{resourceId:d,actionName:p}=t.params,f=tr(d);if(e.useEffect(()=>{(()=>{const e=new URLSearchParams(u.search).get("recordIds"),t=e?e.split(","):[];o(!0),kc.bulkAction({resourceId:d,recordIds:t,actionName:p}).then(e=>{o(!1),n(e.data.records)}).catch(e=>{throw o(!1),c({message:s("errorFetchingRecords",d),type:"error"}),e})})()},[t.params.resourceId,t.params.actionName]),!f)return h.default.createElement(Dc,{resourceId:d});if(!r&&!a)return h.default.createElement(Cc,{title:"No records"},h.default.createElement("p",null,s("noRecordsSelected",d)));const m=gc(r||[]).find(e=>e.name===p);if(a){const e=f.actions.find(e=>e.name===p);return null!=e&&e.showInDrawer?h.default.createElement(Bc,null,h.default.createElement(i.Loader,null)):h.default.createElement(i.Loader,null)}return m?m.showInDrawer?h.default.createElement(Bc,{width:m.containerWidth},h.default.createElement(Ic,{action:m,resource:f,records:r})):h.default.createElement(Pc,{width:m.containerWidth},null!=m&&m.showInDrawer?"":h.default.createElement(oc,{resource:f,action:m}),h.default.createElement(Ic,{action:m,resource:f,records:r})):h.default.createElement(Ac,{resourceId:d,actionName:p})};class Gc extends h.default.Component{constructor(e){super(e),this.state={isClient:!1}}componentDidMount(){this.setState({isClient:!0})}render(){const{pages:e,match:t}=this.props,{params:r}=t,{pageName:n}=r,{isClient:a}=this.state,o=e.find(e=>e.name===n);if(!o)return h.default.createElement(Cc,{title:"There is no page of given name"},h.default.createElement("p",null,"Page:",h.default.createElement("b",null,` "${n}" `),"does not exist."));const i=AdminJS.UserComponents[o.component];return i&&a?h.default.createElement(vr,null,h.default.createElement(i,null)):h.default.createElement(Cc,{title:"No component specified"},h.default.createElement("p",null,"You have to specify component which will render this Page"))}}var Uc=t.connect(e=>({pages:e.pages}))(Gc);var Fc=t.connect(e=>({resources:e.resources}))(t=>{const{resources:n,match:a,location:o}=t,{resourceId:l}=a.params,[s,c]=e.useState((e=>{const t=new URLSearchParams(e);for(const e of t.keys())if(e.match("filters."))return!0;return!1})(o.search)),[u,d]=e.useState(""),p=n.find(e=>e.id===l);if(!p)return h.default.createElement(Dc,{resourceId:l});const f=(e=>{const t=new O,n=t.recordActionUrl({resourceId:":resourceId",recordId:":recordId",actionName:":actionName"}),a=t.resourceActionUrl({resourceId:":resourceId",actionName:":actionName"}),o=t.bulkActionUrl({resourceId:":resourceId",actionName:":actionName"}),i=r.useRouteMatch(a),l=r.useRouteMatch(n),s=r.useRouteMatch(o),c=(null==i?void 0:i.params.actionName)||(null==l?void 0:l.params.actionName)||(null==s?void 0:s.params.actionName);return c?e.actions.find(e=>e.name===c):void 0})(p);if(f&&!f.showInDrawer)return null;const m=p.resourceActions.find(e=>"list"===e.name);if(!m)return h.default.createElement(Ac,{resourceId:l,actionName:"list"});const g=m.showFilter?()=>c(!s):void 0;return h.default.createElement(i.Box,{variant:"grey",width:m.containerWidth,mx:"auto"},h.default.createElement(oc,{resource:p,action:m,tag:u,toggleFilter:g}),h.default.createElement(Ic,{action:m,resource:p,setTag:d}),m.showFilter?h.default.createElement(Nc,{resource:p,isVisible:s,toggleFilter:()=>{c(!s)}}):"")});const jc=n.createGlobalStyle`
  html, body, #app {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    color: ${({theme:e})=>e.colors.grey100}
  }
`,Hc=new O,Wc=()=>{const[t,n]=e.useState(!1),a=l.useLocation();e.useEffect(()=>{t&&n(!1)},[a]);const o=Hc.recordActionUrl({resourceId:":resourceId",recordId:":recordId",actionName:":actionName"}),s=Hc.resourceActionUrl({resourceId:":resourceId",actionName:":actionName"}),c=Hc.bulkActionUrl({resourceId:":resourceId",actionName:":actionName"}),u=Hc.resourceUrl({resourceId:":resourceId"}),d=Hc.pageUrl(":pageName");return h.default.createElement(h.default.Fragment,null,h.default.createElement(i.Reset,null),h.default.createElement(jc,null),h.default.createElement(i.Box,{height:"100%",flex:!0},t?h.default.createElement(i.Overlay,{onClick:()=>n(!t)}):null,h.default.createElement(or,{isVisible:t}),h.default.createElement(i.Box,{flex:!0,flexGrow:1,flexDirection:"column",overflowY:"auto",bg:"bg"},h.default.createElement(ur,{toggleSidebar:()=>n(!t)}),h.default.createElement(i.Box,{position:"absolute",top:0,zIndex:2e3},h.default.createElement(pr,null)),h.default.createElement(r.Switch,null,h.default.createElement(r.Route,{path:Hc.dashboardUrl(),exact:!0,component:yr}),h.default.createElement(r.Route,{path:u,component:Fc}),h.default.createElement(r.Route,{path:d,exact:!0,component:Uc})),h.default.createElement(r.Switch,null,h.default.createElement(r.Route,{path:o,component:Tc}),h.default.createElement(r.Route,{path:s,component:_c}),h.default.createElement(r.Route,{path:c,component:Mc})))))},zc=u.combineReducers({resources:(e=[],t)=>{switch(t.type){case"RESOURCES_INITIALIZE":return t.data;default:return e}},branding:(e={},t)=>{switch(t.type){case"BRANDING_INITIALIZE":return t.data;default:return e}},assets:(e={},t)=>{switch(t.type){case"ASSETS_INITIALIZE":return t.data;default:return e}},paths:(e=wc,t)=>{switch(t.type){case"PATHS_INITIALIZE":return t.data;default:return e}},session:(e=null,t)=>{switch(t.type){case"SESSION_INITIALIZE":return t.data;default:return e}},dashboard:(e={},t)=>{switch(t.type){case"DASHBOARD_INITIALIZE":return t.data;default:return e}},notices:(e=[],t)=>{switch(t.type){case"ADD_NOTICE":return[t.data];case"DROP_NOTICE":return e.filter(e=>e.id!==t.data.noticeId);case"SET_NOTICE_PROGRESS":return e.map(e=>({...e,progress:e.id===t.data.noticeId?t.data.progress:e.progress}));default:return e}},versions:(e={},t)=>{switch(t.type){case"VERSIONS_INITIALIZE":return{admin:t.data.admin,app:t.data.app};default:return e}},pages:(e=[],t)=>{switch(t.type){case"PAGES_INITIALIZE":return t.data;default:return e}},locale:(e={language:"en",translations:{}},t)=>{switch(t.type){case"LOCALE_INITIALIZE":return t.data;default:return e}}});const Vc=((e={})=>u.createStore(zc,e))(window.REDUX_STATE),qc=window.THEME,{locale:$c}=window.REDUX_STATE;y.default.use(a.initReactI18next).init({resources:{[$c.language]:{translation:$c.translations}},lng:$c.language,interpolation:{escapeValue:!1}});const Yc=h.default.createElement(t.Provider,{store:Vc},h.default.createElement(n.ThemeProvider,{theme:qc},h.default.createElement(r.BrowserRouter,null,h.default.createElement(Wc,null))));return window.regeneratorRuntime=P,{withNotice:yc,Application:Yc,ViewHelpers:O,UserComponents:{},ApiClient:wt,BasePropertyComponent:Ks,env:{NODE_ENV:"production"},...Oc,...rr,flat:Lt,flatten:Lt.flatten,unflatten:Lt.unflatten}}(React,ReactRedux,ReactRouterDOM,styled,ReactI18Next,i18n,AdminJSDesignSystem,ReactRouter,axios,flat,Redux,ReactDOM,ReactSelect,ReactSelectAsync);
