UNPKG

admin-bro

Version:
1 lines 176 kB
var AdminBro=function(e,t,r,n,a,o,i,l,c,s,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(c),I=m(u),w=m(d),C=m(p),D=m(f),A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var R=S((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 c(e,t,r,n){var a=t&&t.prototype instanceof d?t:d,o=Object.create(a.prototype),i=new w(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 c=s(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,i),o}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;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 c=s(e[a],e,o);if("throw"!==c.type){var u=c.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(c.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=s(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(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(c(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,w.prototype={constructor:w,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(I),!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"),c=r.call(o,"finallyLoc");if(l&&c){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(!c)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),I(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;I(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)}}));let B={};try{B=window}catch(e){if("window is not defined"!==e.message)throw e}const P=new Date;class N{constructor({options:e}={}){let t=N.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=${P.getTime()}`}return this.urlBuilder(["frontend","assets",e])}}var O=S((function(e){function t(){return e.exports=t=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},t.apply(this,arguments)}e.exports=t}));function L(e,t){if("undefined"==typeof window)return e;return r=>{let n=window;n=window;let a=e;return n.AdminBro&&n.AdminBro.UserComponents&&n.AdminBro.UserComponents[t]?(a=n.AdminBro.UserComponents[t],h.default.createElement(a,O({},r,{OriginalComponent:e}))):h.default.createElement(a,r)}}const T=b.default(r.Link).withConfig({displayName:"sidebar-branding__StyledLogo",componentId:"sc-1ozeetj-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")),_=new N;var k=L(e=>{const{branding:t}=e,{logo:r,companyName:n}=t;return h.default.createElement(T,{className:i.cssClass("Logo"),to:_.dashboardUrl()},r?h.default.createElement("img",{src:r,alt:n}):h.default.createElement("h1",null,n))},"SidebarBranding");var M=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 G=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","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),U="object"==typeof A&&A&&A.Object===Object&&A,F="object"==typeof self&&self&&self.Object===Object&&self,j=(U||F||Function("return this")()).Symbol;var H=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},W=Array.isArray,z=Object.prototype,V=z.hasOwnProperty,q=z.toString,$=j?j.toStringTag:void 0;var Y=function(e){var t=V.call(e,$),r=e[$];try{e[$]=void 0;var n=!0}catch(e){}var a=q.call(e);return n&&(t?e[$]=r:delete e[$]),a},J=Object.prototype.toString;var Z=function(e){return J.call(e)},X=j?j.toStringTag:void 0;var K=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":X&&X in Object(e)?Y(e):Z(e)};var Q=function(e){return null!=e&&"object"==typeof e};var ee=function(e){return"symbol"==typeof e||Q(e)&&"[object Symbol]"==K(e)},te=j?j.prototype:void 0,re=te?te.toString:void 0;var ne=function e(t){if("string"==typeof t)return t;if(W(t))return H(t,e)+"";if(ee(t))return re?re.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r};var ae=function(e){return null==e?"":ne(e)},oe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ie=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var le=function(e){return(e=ae(e))&&e.replace(oe,G).replace(ie,"")},ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var se=function(e){return e.match(ce)||[]},ue=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var de=function(e){return ue.test(e)},pe="\\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",fe="["+pe+"]",me="\\d+",ge="[\\u2700-\\u27bf]",he="[a-z\\xdf-\\xf6\\xf8-\\xff]",ve="[^\\ud800-\\udfff"+pe+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee="[A-Z\\xc0-\\xd6\\xd8-\\xde]",xe="(?:"+he+"|"+ve+")",Ie="(?:"+Ee+"|"+ve+")",we="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ce="[\\ufe0e\\ufe0f]?"+we+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",be,ye].join("|")+")[\\ufe0e\\ufe0f]?"+we+")*"),De="(?:"+[ge,be,ye].join("|")+")"+Ce,Ae=RegExp([Ee+"?"+he+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[fe,Ee,"$"].join("|")+")",Ie+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[fe,Ee+xe,"$"].join("|")+")",Ee+"?"+xe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ee+"+(?:['’](?: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_])",me,De].join("|"),"g");var Se=function(e){return e.match(Ae)||[]};var Re=function(e,t,r){return e=ae(e),void 0===(t=r?void 0:t)?de(e)?Se(e):se(e):e.match(t)||[]},Be=RegExp("['’]","g");var Pe=function(e){return function(t){return M(Re(le(t).replace(Be,"")),e,"")}};var Ne=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 Oe=function(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:Ne(e,t,r)},Le=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Te=function(e){return Le.test(e)};var _e=function(e){return e.split("")},ke="[\\ud800-\\udfff]",Me="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ge="\\ud83c[\\udffb-\\udfff]",Ue="[^\\ud800-\\udfff]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",He="(?:"+Me+"|"+Ge+")"+"?",We="[\\ufe0e\\ufe0f]?"+He+("(?:\\u200d(?:"+[Ue,Fe,je].join("|")+")[\\ufe0e\\ufe0f]?"+He+")*"),ze="(?:"+[Ue+Me+"?",Me,Fe,je,ke].join("|")+")",Ve=RegExp(Ge+"(?="+Ge+")|"+ze+We,"g");var qe=function(e){return e.match(Ve)||[]};var $e=function(e){return Te(e)?qe(e):_e(e)};var Ye=function(e){return function(t){t=ae(t);var r=Te(t)?$e(t):void 0,n=r?r[0]:t.charAt(0),a=r?Oe(r,1).join(""):t.slice(1);return n[e]()+a}}("toUpperCase"),Je=Pe((function(e,t,r){return e+(r?" ":"")+Ye(t)}));const Ze=(e,t,r,n,a)=>{var o;const i=("string"==typeof n?a:n)||{},l=(e=>e.split(".").join("&#46;"))(r);let c=[`${t}.${l}`];return n&&(c=[`resources.${n}.${t}.${l}`,...c]),e.exists(c)?e.t(c,i):null!==(o=i.defaultValue)&&void 0!==o?o:Je(r)},Xe=()=>{const{i18n:e,...t}=a.useTranslation();return{...t,i18n:e,...(e=>{const t=(t,r,n)=>Ze(e,"actions",t,r,n),r=(t,r,n)=>Ze(e,"buttons",t,r,n),n=(t,r,n)=>Ze(e,"labels",t,r,n),a=(t,r,n)=>Ze(e,"properties",t,r,n),o=(t,r,n)=>Ze(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)}},Ke=new N,Qe=e=>{const{pages:t}=e,{translateLabel:r}=Xe(),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),c=t.map(e=>({id:e.name,label:e.name,isSelected:o(e),icon:e.icon,href:Ke.pageUrl(e.name),onClick:(e,t)=>{e.preventDefault(),t.href&&a.push(t.href)}}));return h.default.createElement(i.Navigation,{label:r("pages"),elements:c})};var et=L(()=>h.default.createElement(i.Box,{mt:"lg"},h.default.createElement(i.SoftwareBrothers,null)),"SidebarFooter");let tt={};try{tt=window}catch(e){if("window is not defined"!==e.message)throw e;tt={isOnServer:!0}}const rt=e=>{if(tt.isOnServer)return;const t=[tt.location.origin,tt.REDUX_STATE.paths.loginPath].join("");e.request.responseURL&&e.request.responseURL.match(t)&&(alert("Your session expired. You will be redirected to login screen"),tt.location.assign(t))};class nt{constructor(){this.baseURL=nt.getBaseUrl(),this.client=x.default.create({baseURL:this.baseURL})}static getBaseUrl(){var e;return tt.isOnServer?"":[tt.location.origin,null===(e=tt.REDUX_STATE)||void 0===e?void 0:e.paths.rootPath].join("")}async searchRecords({resourceId:e,query:t}){if(tt.isOnServer)return[];const r=await this.resourceAction({resourceId:e,actionName:"search",query:t});return rt(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 rt(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 rt(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 rt(l),l}async getDashboard(e={}){const t=await this.client.get("/api/dashboard",e);return rt(t),t}async getPage(e){const{pageName:t,...r}=e,n=await this.client.request({url:"/api/pages/"+t,...r});return rt(n),n}}function at(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__"):t.set(e,r)),t}const ot=(e={message:""})=>({type:"ADD_NOTICE",data:{message:e.message,id:Math.random().toString(36).substr(2,9),type:e.type||"success",progress:0}}),it=()=>{const e=t.useDispatch();return t=>e(ot(t))},lt=(e,t)=>({...t.record||e,errors:t.record.errors,populated:{...e.populated,...t.record.populated},params:{...e.params,...t.record.params}}),ct=(e,t)=>{const r=new RegExp("\\.","g"),n=(null==t?void 0:t.includeAllSiblings)?e.replace(r,"(\\.|\\.\\d+\\.)"):e.replace(r,"\\.");return new RegExp(`^${n}($|\\.)`,"")},st=(e,t,r)=>(Array.isArray(t)?t:[t]).filter(e=>!!e).reduce((t,n)=>{const a=ct(n,r);return{...t,...Object.keys(e).filter(e=>e.match(a)).reduce((t,r)=>(t[r]=e[r],t),{})}},{}),ut=(e,t)=>(Array.isArray(t)?t:[t]).filter(e=>!!e).reduce((t,r)=>{const n=ct(r);return Object.keys(t).filter(e=>!e.match(n)).reduce((t,r)=>(t[r]=e[r],t),{})},e),dt=(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],[])},pt=(e={},t,r)=>{const n=ct(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=s.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=dt(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},ft=(e={},t,r)=>{if(!t)return s.unflatten(e);if(Object.keys(e).find(e=>e===t))return e[t];const n=ct(t,r),a=st(e,t,r),o=Object.keys(a).reduce((e,t,o)=>{let i=t.replace(n,"TEMP_HOLDING_KEY.");return(null==r?void 0: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?s.unflatten(o).TEMP_HOLDING_KEY:void 0},mt={flatten:s.flatten,unflatten:s.unflatten,set:pt,get:ft,selectParams:st,filterOutParams:ut,removePath:(e,t)=>{let r=ut(e,t);const n=dt(t).reverse();return n.find((t,a)=>{const o=ft(e,t);if(Array.isArray(o)){const i=n[a-1].split("."),l=i[i.length-1];return o.splice(+l,1),r=pt(e,t,o),!0}return!1}),r},DELIMITER:".",pathToParts:dt,merge:(e={},...t)=>{const r=s.flatten(e);return t.reverse().reduce((e,t)=>Object.keys(t).reduce((e,r)=>pt(e,r,t[r]),e),r)}},gt=(e,t,r)=>n=>{let a=!1;const o={...n.populated},i=mt.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}},ht=(e,t)=>!(void 0!==t||"string"==typeof e||!e.params),vt=function(e,t={}){return t.includeParams&&e?{...e,params:mt.selectParams(e.params||{},t.includeParams)}:e},bt=new nt,yt=(t,r,n)=>{var a,o,i;const[l,c]=e.useState(!1),[s,u]=e.useState(!0),[d,p]=e.useState(0),f=t?vt(t,n):null,[m,g]=e.useState({...f,params:null!==(a=null==f?void 0:f.params)&&void 0!==a?a:{},errors:null!==(o=null==t?void 0:t.errors)&&void 0!==o?o:{},populated:null!==(i=null==t?void 0:t.populated)&&void 0!==i?i:{}}),h=e.useCallback(e=>{const t=e instanceof Function?e(m):e;g(vt(t,n))},[n,m]),v=it(),b=e.useCallback((e,t,r)=>{ht(e,t)?h(e):((e,t={})=>{const{includeParams:r}=t;if(r){return mt.pathToParts(e,{skipArrayIndexes:!0}).some(e=>r.includes(e))}return!0})(e,n)&&g(gt(e,t,r)),u(!1)},[g,n]),y=e.useCallback((e={},t)=>{c(!0);const n=at(mt.merge(m.params,e)),a={resourceId:r,onUploadProgress:e=>p(Math.round(100*e.loaded/e.total)),data:n,headers:{"Content-Type":"multipart/form-data"}},o=m.id?bt.recordAction({...a,actionName:"edit",recordId:m.id}):bt.resourceAction({...a,actionName:"new"});return o.then(e=>{e.data.notice&&v(e.data.notice),!1!==(null==t?void 0:t.updateOnSave)&&h(t=>lt(t,e.data)),p(0),c(!1),u(!0)}).catch(()=>{v({message:"There was an error updating record, Check out console to see more information.",type:"error"}),p(0),c(!1)}),o},[m,r,c,p,g]);return{record:m,handleChange:b,submit:y,loading:l,progress:d,setRecord:h,isSynced:s}},Et=new N,xt=(e,t)=>{const r=e.name;if(!e.component&&!e.hasHandler)return null;const n={record:()=>Et.recordActionUrl({...t,actionName:r}),resource:()=>Et.resourceActionUrl({resourceId:t.resourceId,actionName:r}),bulk:()=>Et.bulkActionUrl({...t,actionName:r})};if(n[e.actionType])return n[e.actionType]();throw new Error('"actionType" should be either record, resource or bulk')},It=new nt;const wt=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=It.recordAction({resourceId:i,actionName:e.name,recordId:a,search:r});break;case"resource":n=It.resourceAction({resourceId:i,actionName:e.name});break;case"bulk":if(!o)throw new Error('You have to specify "recordIds" for bulk action');n=It.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}},Ct=e=>"action-"+e.name,Dt=e=>{const{action:t,params:r,actionResponseHandler:n,push:a}=e;return e=>{e.preventDefault(),e.stopPropagation();const o=xt(t,r),i=wt({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}))}},At=(e,t)=>{var r,n;const a=e.lastIndexOf("?"),o=-1!==a?e.substring(a+1):null,i=new URLSearchParams(null!==(r=null!==(n=null!=t?t:o)&&void 0!==n?n:window.location.search)&&void 0!==r?r:""),l="true"===new URLSearchParams(o||"").get("ignore_params")?new URLSearchParams(""):new URLSearchParams(i.toString());l.set("refresh","true");return`${-1!==a?e.substring(0,a):e}?${l.toString()}`},St=e=>{const t=new URLSearchParams(e);return t.get("refresh")&&t.delete("refresh"),t.toString()},Rt=e=>{const t=l.useLocation(),r=l.useHistory(),n=it();return a=>{const{data:o}=a;if(o.notice&&n(o.notice),o.redirectUrl&&t.pathname!==o.redirectUrl){const e=At(o.redirectUrl);r.push(e)}e&&e(o)}};function Bt(e,t,r){const n=l.useHistory(),a=Rt(r);return{href:xt(e,t),callApi:wt({action:e,params:t,actionResponseHandler:a}),handleClick:Dt({action:e,params:t,actionResponseHandler:a,push:n.push})}}function Pt(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 Nt=(e,t)=>{const r=new RegExp(e+"($|/)");return!!t.pathname.match(r)};function Ot(t){const[r,n]=Pt("sidebarElements",{}),a=l.useHistory(),o=l.useLocation(),i=e.useMemo(()=>(e,t)=>({href:e.href||void 0,icon:t,isSelected:Nt(e.href,o),label:e.name,id:e.id,onClick:t=>{e.href&&(t.preventDefault(),a.push(e.href))}}),[o,a]),c=t.filter(e=>e.href).reduce((e,t)=>{var a,o;const l=(null===(a=t.navigation)||void 0===a?void 0:a.name)||["resource",t.name].join("-");var c;if(t.navigation&&null!==t.navigation.name)if(e[l]&&e[l].elements&&(null===(o=t.navigation)||void 0===o?void 0:o.name))e[l].elements.push(i(t));else{var s,u;e[l]={elements:[i(t)],label:null===(s=t.navigation)||void 0===s?void 0:s.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===(c=t.navigation)||void 0===c?void 0:c.icon);return e},{});return Object.values(c)}const Lt=new nt;function Tt(t){const[r,n]=e.useState([]),[a,o]=e.useState(!1),[i,c]=e.useState(10),[s,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=it(),{translateMessage:E}=Xe(),x=it(),I=()=>{o(!0);const e=new URLSearchParams(v.search),r=Lt.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):(n(t.records),u(t.meta.page),c(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(()=>{var e;e=v.search,new URLSearchParams(e).get("refresh")?b.replace([v.pathname,St(v.search).toString()].join("?")):I()},[t,v.search]),{records:r,loading:a,page:s,total:d,direction:f,sortBy:g,perPage:i,fetchData:I}}function _t(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 kt=e=>t.useSelector(e=>e.resources).find(t=>t.id===e);var Mt=Object.freeze({__proto__:null,useRecord:yt,isEntireRecordGiven:ht,FORM_VALUE_NULL:"__FORM_VALUE_NULL__",FORM_VALUE_EMPTY_OBJECT:"__FORM_VALUE_EMPTY_OBJECT__",FORM_VALUE_EMPTY_ARRAY:"__FORM_VALUE_EMPTY_ARRAY__",paramsToFormData:at,updateRecord:gt,useAction:Bt,useActionResponseHandler:Rt,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:Pt,useNavigationResources:Ot,useNotice:it,useRecords:Tt,useSelectedRecords:_t,useTranslation:Xe,useResource:kt});const Gt=L(({resources:e})=>{const t=Ot(e),{translateLabel:r}=Xe();return h.default.createElement(i.Navigation,{label:r("navigation"),elements:t})},"SidebarResourceSection"),Ut=b.default(i.Box).withConfig({displayName:"sidebar__StyledSidebar",componentId:"z5zut0-0"})(["transition:left 0.3s;top:0;bottom:0;flex-shrink:0;overflow-y:auto;&.hidden{left:-",";}&.visible{left:0;}"],i.themeGet("sizes","sidebarWidth"));Ut.defaultProps={position:["absolute","absolute","absolute","absolute","inherit"],width:"sidebarWidth",borderRight:"default",display:"flex",flexDirection:"column",zIndex:50,bg:"white"};const Ft=L(e=>{const{isVisible:r}=e,[n,a,o]=t.useSelector(e=>[e.branding,e.resources,e.pages]);return h.default.createElement(Ut,{className:r?"visible":"hidden"},h.default.createElement(k,{branding:n}),h.default.createElement(i.Box,{flexGrow:1,className:i.cssClass("Resources")},h.default.createElement(Gt,{resources:a})),h.default.createElement(Qe,{pages:o}),(null==n?void 0:n.softwareBrothers)&&h.default.createElement(et,null))},"Sidebar"),jt=L(e=>{const{session:t,paths:r}=e,{translateButton:n}=Xe(),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"),Ht=b.default(i.Text).withConfig({displayName:"version__VersionItem",componentId:"rgspw3-0"})(["padding:12px 24px 12px 0;"]);Ht.defaultProps={display:["none","block"],color:"grey100"};const Wt=e=>{const{versions:t}=e,{admin:r,app:n}=t,{translateLabel:a}=Xe();return h.default.createElement(i.Box,{flex:!0,flexGrow:1,py:"default",px:"xxl",className:i.cssClass("Version")},r&&h.default.createElement(Ht,null,a("adminVersion",{version:r})),n&&h.default.createElement(Ht,null,a("appVersion",{version:n})))},zt=b.default(i.Box).withConfig({displayName:"top-bar__NavBar",componentId:"sc-1qk1nql-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);zt.defaultProps={className:i.cssClass("NavBar")};const Vt=e=>{const{toggleSidebar:r}=e,[n,a,o]=t.useSelector(e=>[e.session,e.paths,e.versions]);return h.default.createElement(zt,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(Wt,{versions:o}),n&&n.email?h.default.createElement(jt,{session:n,paths:a}):"")};class qt 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 $t=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(qt,{key:a.id,notice:a,drop:()=>t(a.id),notifyProgress:n})):h.default.createElement("div",null)}),Yt=()=>{const{translateMessage:e}=Xe();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")))))},Jt=b.default(i.Box).withConfig({displayName:"default-dashboard__Card",componentId:"y6jxa9-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);Jt.defaultProps={variant:"white",boxShadow:"card"};const Zt=()=>{const{translateMessage:e,translateButton:t}=Xe();return h.default.createElement(i.Box,null,h.default.createElement(Yt,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://adminbro.com/tutorial-passing-resources.html"},{variant:"DocumentCheck",title:e("customizeResources_title"),subtitle:e("customizeResources_subtitle"),href:"https://adminbro.com/tutorial-customizing-resources.html"},{variant:"DocumentSearch",title:e("customizeActions_title"),subtitle:e("customizeActions_subtitle"),href:"https://adminbro.com/tutorial-actions.html"},{variant:"FlagInCog",title:e("writeOwnComponents_title"),subtitle:e("writeOwnComponents_subtitle"),href:"https://adminbro.com/tutorial-writing-react-components.html"},{variant:"Folders",title:e("customDashboard_title"),subtitle:e("customDashboard_subtitle"),href:"https://adminbro.com/tutorial-custom-dashboard.html"},{variant:"Astronaut",title:e("roleBasedAccess_title"),subtitle:e("roleBasedAccess_subtitle"),href:"https://adminbro.com/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(Jt,{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(Jt,{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(Jt,{as:"a",flex:!0,href:"https://github.com/SoftwareBrothers/admin-bro/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")))))))},Xt=({error:e})=>{const{translateMessage:t}=Xe();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 Kt 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(Xt,{error:t}):e||null}}class Qt 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&&AdminBro.UserComponents[e.component]?AdminBro.UserComponents[e.component]:Zt,h.default.createElement(Kt,null,h.default.createElement(r,null))}}var er=t.connect(e=>({dashboard:e.dashboard}))(Qt);var tr=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t},rr=S((function(e,t){function r(e,t){var r=h.default.useState((function(){return{inputs:t,result:e()}}))[0],n=h.default.useRef(!0),a=h.default.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 h.default.useEffect((function(){n.current=!1,a.current=o}),[o]),o.result}function n(e,t){return r((function(){return e}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=r,o=n;t.useCallback=o,t.useCallbackOne=n,t.useMemo=a,t.useMemoOne=r})),nr=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t){if(!e)throw new Error("Invariant failed")}})),ar=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r,n=(r=nr)&&"object"==typeof r&&"default"in r?r.default:r,a=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}}},o=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},i=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},l={top:0,right:0,bottom:0,left:0},c=function(e){var t=e.borderBox,r=e.margin,n=void 0===r?l:r,c=e.border,s=void 0===c?l:c,u=e.padding,d=void 0===u?l:u,p=a(o(t,n)),f=a(i(t,s)),m=a(i(f,d));return{marginBox:p,borderBox:a(t),paddingBox:f,contentBox:m,margin:n,border:s,padding:d}},s=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var r=Number(t);return isNaN(r)&&n(!1),r},u=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 c({borderBox:s,border:o,margin:i,padding:l})},d=function(e,t){var r={top:s(t.marginTop),right:s(t.marginRight),bottom:s(t.marginBottom),left:s(t.marginLeft)},n={top:s(t.paddingTop),right:s(t.paddingRight),bottom:s(t.paddingBottom),left:s(t.paddingLeft)},a={top:s(t.borderTopWidth),right:s(t.borderRightWidth),bottom:s(t.borderBottomWidth),left:s(t.borderLeftWidth)};return c({borderBox:e,margin:r,padding:n,border:a})};t.calculateBox=d,t.createBox=c,t.expand=o,t.getBox=function(e){var t=e.getBoundingClientRect(),r=window.getComputedStyle(e);return d(t,r)},t.getRect=a,t.offset=u,t.shrink=i,t.withScroll=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),u(e,t)}}));function or(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}var ir=function(e,t){var r;void 0===t&&(t=or);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}},lr=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},cr=S((function(e,t){function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var n=r(h.default),a=r(tr),o=r(O),i=r(ir),l=r(lr),c=r(w.default);function s(e,t){}s.bind(null,"warn"),s.bind(null,"error");function u(){}function d(e,t,r){var n=t.map((function(t){var n,a,i=(n=r,a=t.options,o({},n,{},a));return e.addEventListener(t.eventName,t.fn,i),function(){e.removeEventListener(t.eventName,t.fn,i)}}));return function(){n.forEach((function(e){e()}))}}function p(e){this.message=e}function f(e,t){if(!e)throw new p("Invariant failed")}p.prototype.toString=function(){return this.message};var m=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=u,t.onWindowError=function(e){var r=t.getCallbacks();r.isDragging()&&r.tryAbort(),e.error instanceof p&&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}a(t,e);var r=t.prototype;return r.componentDidMount=function(){this.unbind=d(window,[{eventName:"error",fn:this.onWindowError}])},r.componentWillUnmount=function(){this.unbind()},r.componentDidCatch=function(e){if(!(e instanceof p))throw e;this.setState({})},r.render=function(){return this.props.children(this.setCallbacks)},t}(n.Component),g=function(e){return e+1},b=function(e,t){var r=e.droppableId===t.droppableId,n=g(e.index),a=g(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 "},y=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 "},E=function(e){return"\n The item has returned to its starting position\n of "+g(e.index)+"\n"},x="\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",C=function(e){return"\n You have lifted an item in position "+g(e.source.index)+"\n"},D=function(e){var t=e.destination;if(t)return b(e.source,t);var r=e.combine;return r?y(e.draggableId,e.source,r):"You are over an area that cannot be dropped on"},A=function(e){if("CANCEL"===e.reason)return"\n Movement cancelled.\n "+E(e.source)+"\n ";var t=e.destination,r=e.combine;return t?"\n You have dropped the item.\n "+b(e.source,t)+"\n ":r?"\n You have dropped the item.\n "+y(e.draggableId,e.source,r)+"\n ":"\n The item has been dropped while not over a drop area.\n "+E(e.source)+"\n "},S={x:0,y:0},R=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},B=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},P=function(e,t){return e.x===t.x&&e.y===t.y},N=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},L=function(e,t,r){var n;return void 0===r&&(r=0),(n={})[e]=t,n["x"===e?"y":"x"]=r,n},T=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},_=function(e,t){return Math.min.apply(Math,t.map((function(t){return T(e,t)})))},k=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},M=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},G=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}]},U=function(e,t){return t&&t.shouldClipSubject?function(e,t){var r=ar.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):ar.getRect(e)},F=function(e){var t=e.page,r=e.withPlaceholder,n=e.axis,a=e.frame,i=function(e,t,r){var n;return r&&r.increasedBy?o({},e,((n={})[t.end]=e[t.end]+r.increasedBy[t.line],n)):e}(function(e,t){return t?M(e,t.scroll.diff.displacement):e}(t.marginBox,a),n,r);return{page:t,withPlaceholder:r,active:U(i,a)}},j=function(e,t){e.frame||f(!1);var r=e.frame,n=B(t,r.scroll.initial),a=N(n),i=o({},r,{scroll:{initial:r.scroll.initial,current:t,diff:{value:n,displacement:a},max:r.scroll.max}}),l=F({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return o({},e,{frame:i,subject:l})};function H(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function W(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 z(e,t){if(e.find)return e.find(t);var r=W(e,t);return-1!==r?e[r]:void 0}function V(e){return Array.prototype.slice.call(e)}var q=i((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),$=i((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),Y=i((function(e){return H(e)})),J=i((function(e){return H(e)})),Z=i((function(e,t){return J(t).filter((function(t){return e===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}))}));function X(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function K(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var Q=i((function(e,t){return t.filter((function(t){return t.descriptor.id!==e.descriptor.id}))})),ee=function(e,t){return e.descriptor.droppableId===t.descriptor.id},te={point:S,value:0},re={invisible:{},visible:{},all:[]},ne={displaced:re,displacedBy:te,at:null},ae=function(e,t){return function(r){return e<=r&&r<=t}},oe=function(e){var t=ae(e.top,e.bottom),r=ae(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)}},ie=function(e){var t=ae(e.top,e.bottom),r=ae(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&r(e.left)&&r(e.right)}},le={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},ce={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},se=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:S;return M(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)},ue=function(e){return se(o({},e,{isVisibleThroughFrameFn:oe}))},de=function(e){return se(o({},e,{isVisibleThroughFrameFn:ie}))};function pe(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 ar.getRect(ar.expand(r,n))}(t,n),c=t.descriptor.id;if(e.all.push(c),!ue({target:l,destination:r,viewport:a,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var s={draggableId:c,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}(c,i,o)};return e.visible[c]=s,e}),{all:[],visible:{},invisible:{}})}function fe(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:re,displacedBy:n,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:o}}}}function me(e){var t=e.draggable,r=e.insideDestination,n=e.destination,a=e.viewport,o=e.displacedBy,i=e.last,l=e.index,c=e.forceShouldAnimate,s=ee(t,n);if(null==l)return fe({insideDestination:r,inHomeList:s,displacedBy:o,destination:n});var u=z(r,(function(e){return e.descriptor.index===l}));if(!u)return fe({insideDestination:r,inHomeList:s,displacedBy:o,destination:n});var d=Q(t,r),p=r.indexOf(u);return{displaced:pe({afterDragging:d.slice(p),destination:n,displacedBy:o,last:i,viewport:a.frame,forceShouldAnimate:c}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:l}}}}function ge(e,t){return Boolean(t.effected[e])}var he=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.draggable,a=e.draggables,o=e.destination,i=e.insideDestination,l=e.previousImpact,c=e.viewport,s=e.afterCritical,u=l.at;if(u||f(!1),"REORDER"===u.type){var d=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.insideDestination,a=e.loca