@galadrim/galadmin 0.0.76 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/front/build/asset-manifest.json +3 -3
- package/src/front/build/index.html +1 -1
- package/src/front/build/static/js/{main.98d011ac.chunk.js → main.50297a9d.chunk.js} +2 -2
- package/src/front/build/static/js/main.50297a9d.chunk.js.map +1 -0
- package/src/front/node_modules/.cache/.eslintcache +1 -1
- package/src/front/node_modules/.cache/babel-loader/ea2c2ebc721648c438b40fb68ef65f04.json +1 -0
- package/src/front/node_modules/.cache/babel-loader/f4cb80e4316f8959fd9c2d589b91d8e5.json +1 -0
- package/src/front/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/92/b6/85f6e7e3f125c67e6eff4667e857a81df445a7ebf54527fec246baf4092670bdb7ea810171dbfa17282a87212fb3704da6ff58fdeee914fe55a6486b2dea +1 -0
- package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/18/2d/de44b1e416c1ae256e0aad3b64e58b8d60d3f1f576ae4d6048d3339bd9e5 +2 -0
- package/src/front/src/components/panels/GalleryPanel.js +1 -1
- package/src/front/src/components/panels/TablePanel.js +1 -1
- package/src/front/build/static/js/main.98d011ac.chunk.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"main.css": "/_HOMEPAGE_/static/css/main.6cc4d508.chunk.css",
|
|
4
|
-
"main.js": "/_HOMEPAGE_/static/js/main.
|
|
5
|
-
"main.js.map": "/_HOMEPAGE_/static/js/main.
|
|
4
|
+
"main.js": "/_HOMEPAGE_/static/js/main.50297a9d.chunk.js",
|
|
5
|
+
"main.js.map": "/_HOMEPAGE_/static/js/main.50297a9d.chunk.js.map",
|
|
6
6
|
"runtime-main.js": "/_HOMEPAGE_/static/js/runtime-main.2084140f.js",
|
|
7
7
|
"runtime-main.js.map": "/_HOMEPAGE_/static/js/runtime-main.2084140f.js.map",
|
|
8
8
|
"static/js/2.f2c3716e.chunk.js": "/_HOMEPAGE_/static/js/2.f2c3716e.chunk.js",
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"static/js/runtime-main.2084140f.js",
|
|
18
18
|
"static/js/2.f2c3716e.chunk.js",
|
|
19
19
|
"static/css/main.6cc4d508.chunk.css",
|
|
20
|
-
"static/js/main.
|
|
20
|
+
"static/js/main.50297a9d.chunk.js"
|
|
21
21
|
]
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="fr"><head><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script><script src="https://momentjs.com/downloads/moment-timezone-with-data-10-year-range.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/locale/fr.js"></script><script async="async" defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/js/datepicker.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/js/i18n/datepicker.fr.min.js"></script><script async="async" defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/downloadjs/1.4.8/download.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script><script async="async" defer="defer" src="https://cdn.jsdelivr.net/npm/sweetalert"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/quill/1.3.6/quill.min.js"></script><script src="https://sdk.amazonaws.com/js/aws-sdk-2.606.0.min.js"></script><script src="https://kit.fontawesome.com/75b28933ed.js" crossorigin="anonymous" async="async" defer="defer"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/css/datepicker.min.css"/><link rel="stylesheet" href="/_HOMEPAGE_/spectrum.css"/><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/quill/1.3.6/quill.snow.min.css"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta charset="utf-8"/><link rel="icon" href="/_HOMEPAGE_/favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/_HOMEPAGE_/manifest.json"/><title>Back-office</title><link href="/_HOMEPAGE_/static/css/main.6cc4d508.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],f=r[1],i=r[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var f=t[a];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/_HOMEPAGE_/";var a=this["webpackJsonpgaladmin-front"]=this["webpackJsonpgaladmin-front"]||[],f=a.push.bind(a);a.push=r,a=a.slice();for(var i=0;i<a.length;i++)r(a[i]);var p=f;t()}([])</script><script src="/_HOMEPAGE_/static/js/2.f2c3716e.chunk.js"></script><script src="/_HOMEPAGE_/static/js/main.
|
|
1
|
+
<!doctype html><html lang="fr"><head><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script><script src="https://momentjs.com/downloads/moment-timezone-with-data-10-year-range.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/locale/fr.js"></script><script async="async" defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/js/datepicker.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/js/i18n/datepicker.fr.min.js"></script><script async="async" defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/downloadjs/1.4.8/download.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script><script async="async" defer="defer" src="https://cdn.jsdelivr.net/npm/sweetalert"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/quill/1.3.6/quill.min.js"></script><script src="https://sdk.amazonaws.com/js/aws-sdk-2.606.0.min.js"></script><script src="https://kit.fontawesome.com/75b28933ed.js" crossorigin="anonymous" async="async" defer="defer"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/css/datepicker.min.css"/><link rel="stylesheet" href="/_HOMEPAGE_/spectrum.css"/><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/quill/1.3.6/quill.snow.min.css"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta charset="utf-8"/><link rel="icon" href="/_HOMEPAGE_/favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/_HOMEPAGE_/manifest.json"/><title>Back-office</title><link href="/_HOMEPAGE_/static/css/main.6cc4d508.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],f=r[1],i=r[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var f=t[a];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/_HOMEPAGE_/";var a=this["webpackJsonpgaladmin-front"]=this["webpackJsonpgaladmin-front"]||[],f=a.push.bind(a);a.push=r,a=a.slice();for(var i=0;i<a.length;i++)r(a[i]);var p=f;t()}([])</script><script src="/_HOMEPAGE_/static/js/2.f2c3716e.chunk.js"></script><script src="/_HOMEPAGE_/static/js/main.50297a9d.chunk.js"></script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(this["webpackJsonpgaladmin-front"]=this["webpackJsonpgaladmin-front"]||[]).push([[0],{15:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a=function(expression,data){try{var varString="";for(var key in data)varString+="var "+key+" = "+("string"===typeof data[key]?"'"+data[key].replace(/'/g,"\\'").replace(/\n/g,"<br>").replace(/\r/g,"")+"'":"object"===typeof data[key]?JSON.stringify(data[key]):data[key])+";";return eval(varString+expression)}catch(e){return console.log(varString+expression),console.error(e),"Error"}}},49:function(e,t,n){},50:function(e,t,n){},6:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return ConfigContext})),__webpack_require__.d(__webpack_exports__,"b",(function(){return ConfigProvider}));var _home_runner_work_galadmin_galadmin_src_front_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),react__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__),axios__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3),axios__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(0),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__),ConfigContext=Object(react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null),ConfigProvider=function ConfigProvider(props){var _useState=Object(react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),_useState2=Object(_home_runner_work_galadmin_galadmin_src_front_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__.a)(_useState,2),config=_useState2[0],setConfig=_useState2[1];return Object(react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((function(){axios__WEBPACK_IMPORTED_MODULE_2___default.a.get("/config").then((function(response){var _config=eval("("+response.data.config+")");if(setConfig(_config),_config.googleMapsKey){var script=document.createElement("script");return script.src="https://maps.googleapis.com/maps/api/js?key="+_config.googleMapsKey+"&libraries=places,autocomplete",document.body.appendChild(script),function(){document.body.removeChild(script)}}}))}),[]),config?Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ConfigContext.Provider,{value:config,children:props.children}):null}},75:function(e,t,n){"use strict";n.r(t);var c=n(1),r=n.n(c),a=n(39),i=n.n(a),l=(n(49),n(2)),s=n(8),o=n(7),u=(n(50),n(6)),d=n(0),j=function(e){var t=e.view;return Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)("div",{class:"sidebarIcon",children:Object(d.jsx)("i",{class:"fas fa-".concat(t.icon||"square")})}),Object(d.jsx)("div",{class:"sidebarLabel",children:t.label})]})},b=function(){var e=Object(o.h)(),t=Object(c.useContext)(u.a),n=Object(o.g)();return Object(d.jsxs)("div",{class:"sidebar",children:[t.logo?Object(d.jsx)("img",{src:t.logo,class:"logo"}):null,Object(d.jsx)("div",{class:"sidebarTitle",children:t.name}),Object(d.jsx)("div",{class:"sidebarSubtitle",children:"Back-office"}),t.views.filter((function(e){return!e.hidden})).map((function(t,c){if("link"===t.type)return Object(d.jsx)("a",{href:t.src,children:Object(d.jsx)("div",{class:"sidebarItem",children:Object(d.jsx)("div",{children:Object(d.jsx)(j,{view:t})})})},c);if("iframe"===t.type){var r=e.pathname==="/iframe/".concat(c);return Object(d.jsx)(s.b,{to:"/iframe/".concat(c),children:Object(d.jsx)("div",{class:"sidebarItem ".concat(r?"active":""),children:Object(d.jsx)("div",{children:Object(d.jsx)(j,{view:t})})})},c)}if("custom"===t.type){var a=e.pathname==="/customView/".concat(c);return Object(d.jsx)(s.b,{to:"/customView/".concat(c),children:Object(d.jsx)("div",{class:"sidebarItem ".concat(a?"active":""),children:Object(d.jsx)("div",{children:Object(d.jsx)(j,{view:t})})})},c)}if("table"===t.type){var i=e.pathname.startsWith("/records/".concat(c))||e.pathname==="/createRecord/".concat(c)||e.pathname.startsWith("/record/".concat(c))||e.pathname.startsWith("/editRecord/".concat(c));return Object(d.jsx)("div",{onClick:function(){return n.push("/records/".concat(c))},children:Object(d.jsxs)("div",{class:"sidebarItem ".concat(i?"active":""),children:[Object(d.jsxs)("div",{children:[Object(d.jsx)("div",{class:"notificationWrapper"}),Object(d.jsx)(j,{view:t})]}),t.subviews?Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)("div",{class:"subviewsSeparator"}),t.subviews.map((function(t,r){var a=e.pathname=="/records/".concat(c,"/").concat(r);return Object(d.jsx)("div",{onClick:function(e){n.push("/records/".concat(c,"/").concat(r)),e.stopPropagation()},children:Object(d.jsxs)("div",{"data-subview-index":r,class:a?"active":"",children:[Object(d.jsx)("div",{class:"notificationWrapperForSubview"}),t.label]})})}))]}):null]},c)})}})),t.hideBranding?null:Object(d.jsxs)("div",{class:"sidebarBranding",children:["Made with ",Object(d.jsx)("i",{class:"fas fa-heart"})," by Galadrim"]})]})},f=function(){var e=Object(c.useContext)(u.a).views[0];return e?"table"===e.type?Object(d.jsx)(o.a,{to:"/records/0"}):"iframe"===e.type?Object(d.jsx)(o.a,{to:"/iframe/0"}):"custom"===e.type?Object(d.jsx)(o.a,{to:"/customView/0"}):null:null},v=n(16),O=n(4),p=n.n(O),h=n(10),x=n(23),m=n(3),_=n.n(m),g=n(5),w=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useRef)(null);return Object(c.useEffect)((function(){return a.current&&(window.$(a.current).spectrum({preferredFormat:"hex",showInput:!0,chooseText:"OK",cancelText:"Annuler",color:null===r||void 0===r?void 0:r[t.name]}),window.$(a.current).on("change.spectrum",(function(e,c){n(Object(g.a)({},t.name,c.toHexString()))}))),function(){return window.$(a.current).off()}}),[a.current]),Object(d.jsx)("input",{ref:a,type:"text",onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))}})};window.Quill.prototype.getHTML=function(){return this.container.querySelector(".ql-editor").innerHTML};var y=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useRef)(null);return Object(c.useEffect)((function(){if(a.current&&!a.current.editor){var e=new window.Quill(a.current,{theme:"snow",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","link"],["image"],[{align:[]}],[{list:"ordered"},{list:"bullet"}],["clean"]]}});if(null===r||void 0===r?void 0:r[t.contentField])try{e.setContents(JSON.parse(null===r||void 0===r?void 0:r[t.contentField]))}catch(c){}return e.on("text-change",(function(){var c;n((c={},Object(g.a)(c,t.htmlField,e.getHTML()),Object(g.a)(c,t.contentField,JSON.stringify(e.getContents())),c))})),a.current.editor=e,e.off()}}),[a.current]),Object(d.jsx)("div",{class:"quillContainer",children:Object(d.jsx)("div",{class:"quill",ref:a,style:t.height?{height:t.height}:null})})},C=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=e.withTime,i=Object(c.useRef)(null);return Object(c.useEffect)((function(){if(i.current){var e=window.$(i.current).datepicker({language:"fr",autoClose:!0,onSelect:function(e,c){n(Object(g.a)({},t.name,window.moment(c).format(a?null:"YYYY-MM-DD")))}});(null===r||void 0===r?void 0:r[t.name])&&e.data("datepicker").selectDate(new Date(null===r||void 0===r?void 0:r[t.name]))}}),[i.current]),Object(d.jsx)("div",{children:Object(d.jsx)("input",{type:"text",ref:i,"data-timepicker":a?"true":"false"})})},I=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useRef)(null);return Object(c.useEffect)((function(){if(a.current&&window.google){var e=new window.google.maps.places.Autocomplete(a.current,t.componentRestrictions?{componentRestrictions:t.componentRestrictions}:{});e.addListener("place_changed",(function(){var c=e.getPlace();if(0!==c.length&&c.geometry){var r={latitudeField:function(e){return e.geometry.location.lat()},longitudeField:function(e){return e.geometry.location.lng()},addressField:function(e){return e.formatted_address},streetNumberField:function(e){var t;return null===(t=e.address_components.find((function(e){return"street_number"===e.type})))||void 0===t?void 0:t.long_name},routeField:function(e){var t;return null===(t=e.address_components.find((function(e){return"route"===e.type})))||void 0===t?void 0:t.long_name},localityField:function(e){var t;return null===(t=e.address_components.find((function(e){return"locality"===e.type})))||void 0===t?void 0:t.long_name},administrativeAreaLevel2Field:function(e){var t;return null===(t=e.address_components.find((function(e){return"administrative_area_level_2"===e.type})))||void 0===t?void 0:t.long_name},administrativeAreaLevel1Field:function(e){var t;return null===(t=e.address_components.find((function(e){return"administrative_area_level_1"===e.type})))||void 0===t?void 0:t.long_name},countryField:function(e){var t;return null===(t=e.address_components.find((function(e){return"country"===e.type})))||void 0===t?void 0:t.long_name},postalCodeField:function(e){var t;return null===(t=e.address_components.find((function(e){return"postal_code"===e.type})))||void 0===t?void 0:t.long_name}},i={};for(var l in r)t[l]&&(i[t[l]]=r[l](c));a.current.value=c.formatted_address,n(i)}}))}}),[a.current]),Object(c.useEffect)((function(){var e,t=function(){a.current&&(a.current.value="")};return null===a||void 0===a||null===(e=a.current)||void 0===e||e.addEventListener("focusout",t),function(){var e;return null===a||void 0===a||null===(e=a.current)||void 0===e?void 0:e.removeEventListener("focusout",t)}}),[a.current]),Object(d.jsx)("div",{children:Object(d.jsx)("input",{type:"text",placeholder:"",ref:a,defaultValue:null===r||void 0===r?void 0:r[t.name]})})},k=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useRef)(null),i=Object(c.useState)(!1),s=Object(l.a)(i,2),o=s[0],u=s[1],j=Object(c.useState)(null===r||void 0===r?void 0:r[t.name]),b=Object(l.a)(j,2),f=b[0],v=b[1],O=function(){var e=Object(h.a)(p.a.mark((function e(){var c,r,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=new FormData(a.current),u(!0),e.next=4,_()({method:"post",url:"/uploadFile?subdirectory=".concat(t.subdirectory,"&publicPath=").concat(t.publicPath,"&s3Config=").concat(encodeURI(JSON.stringify(t.s3Config))),data:c,headers:{"Content-Type":"multipart/form-data"}});case 4:r=e.sent,i=Object(g.a)({},t.name,r.data.path),t.aspectRatioField&&(i[t.aspectRatioField]=r.data.aspectRatio),t.originalNameField&&(i[t.originalNameField]=r.data.originalFilename),n(i),u(!1),v(r.data.path);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=Math.random().toString();return Object(d.jsx)("div",{class:"fileInputContainer",children:Object(d.jsxs)("label",{htmlFor:x,children:[Object(d.jsx)("form",{ref:a,children:Object(d.jsx)("input",{type:"file",id:x,style:{display:"none"},name:"file",onChange:O})}),Object(d.jsxs)("div",{class:"fileInputContent ".concat(f?"":"clickToSelectFile"),children:[o?Object(d.jsx)("i",{class:"fa fa-circle-notch fa-spin"}):null,o||f?null:Object(d.jsx)("div",{children:"Cliquez pour s\xe9lectionner un fichier"}),!o&&f?Object(d.jsxs)("div",{class:"nonImageFileOutput",children:[Object(d.jsx)("span",{children:"Fichier t\xe9l\xe9charg\xe9"}),Object(d.jsx)("div",{class:"deleteFile",onClick:function(e){v(null);var c=Object(g.a)({},t.name,null);t.aspectRatioField&&(c[t.aspectRatioField]=null),t.originalNameField&&(c[t.originalNameField]=null),n(c),e.preventDefault()},children:Object(d.jsx)("i",{class:"fal fa-trash-alt"})})]}):null]})]})})},E=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useState)(null),i=Object(l.a)(a,2),s=i[0],u=i[1],j=Object(o.i)().viewIndex;return Object(c.useEffect)((function(){_.a.post("/foreignSelectRecords",{viewIndex:j,columnId:t.__id__}).then((function(e){var c;u(e.data),n(Object(g.a)({},t.name,(null===r||void 0===r?void 0:r[t.name])||(t.optional?"NULL":null===(c=e.data[0])||void 0===c?void 0:c.value)))}))}),[]),null===s?Object(d.jsx)("i",{class:"fa fa-circle-notch fa-spin",style:{color:"#536579"}}):Object(d.jsxs)("select",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===r||void 0===r?void 0:r[t.name],children:[t.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,s.map((function(e){return Object(d.jsx)("option",{value:e.value,children:e.label},e.value)}))]})},D=function(e){var t,n=e.column,r=e.onChange,a=e.initialData,i=Object(c.useState)([]),s=Object(l.a)(i,2),u=s[0],j=s[1],b=Object(o.i)().viewIndex,f=Object(c.useState)(""),v=Object(l.a)(f,2),O=v[0],p=v[1],h=Object(c.useRef)(null),x=Object(c.useRef)(!1);Object(c.useEffect)((function(){_.a.post("/foreignSelectRecords",{viewIndex:b,columnId:n.__id__,query:O}).then((function(e){j(e.data)}))}),[O]),Object(c.useEffect)((function(){var e,t=function(){h.current&&!x.current&&(h.current.value="")};return null===h||void 0===h||null===(e=h.current)||void 0===e||e.addEventListener("focusout",t),function(){var e;return null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.removeEventListener("focusout",t)}}),[h.current]);var m=Math.random();return null===u?Object(d.jsx)("i",{class:"fa fa-circle-notch fa-spin",style:{color:"#536579"}}):Object(d.jsxs)("div",{children:[Object(d.jsx)("input",{type:"text",list:m,ref:h,onChange:function(e){var t,c,a=null!==(t=null===(c=u.find((function(t){return t.label===e.target.value})))||void 0===c?void 0:c.value)&&void 0!==t?t:null;x.current=!!a,p(e.target.value),r(Object(g.a)({},n.name,a))},defaultValue:null===(t=u.find((function(e){return e.value===(null===a||void 0===a?void 0:a[n.name])})))||void 0===t?void 0:t.label}),Object(d.jsxs)("datalist",{id:m,children:[n.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,u.map((function(e){return Object(d.jsx)("option",{value:e.label,children:e.label},e.value)}))]})]})},M=function(e){var t=e.column,n=e.onChange,c=e.initialData,r=t.dataType;return["int","double","float","decimal"].includes(r)?Object(d.jsx)("input",{type:"number",onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name]}):"tinyint"===r?Object(d.jsxs)("select",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name],children:[t.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,Object(d.jsx)("option",{value:"0",children:"Non"}),Object(d.jsx)("option",{value:"1",children:"Oui"})]}):"select"===r&&Array.isArray(t.options)?Object(d.jsxs)("select",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name],children:[t.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,t.options.map((function(e){return Object(d.jsx)("option",{value:e,children:e},e)}))]}):"select"===r?Object(d.jsxs)("select",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name],children:[t.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,Object.keys(t.options).map((function(e){return Object(d.jsx)("option",{value:e,children:t.options[e]},e)}))]}):"datalist"===r?Object(d.jsx)(D,{column:t,onChange:n,initialData:c}):"foreign"===r?Object(d.jsx)(E,{column:t,onChange:n,initialData:c}):"address"===r?Object(d.jsx)(I,{column:t,onChange:n,initialData:c}):"color"===r?Object(d.jsx)(w,{column:t,onChange:n,initialData:c}):"file"===r?Object(d.jsx)(k,{column:t,onChange:n,initialData:c}):"datetime"===r?Object(d.jsx)(C,{column:t,onChange:n,initialData:c,withTime:!0}):"date"===r?Object(d.jsx)(C,{column:t,onChange:n,initialData:c,withTime:!1}):"textarea"===r?Object(d.jsx)("textarea",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name]}):"richText"===r?Object(d.jsx)(y,{column:t,onChange:n,initialData:c}):Object(d.jsx)("input",{type:"text",onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name]})},S=function(e){var t=e.text,n=Object(c.useState)(!1),r=Object(l.a)(n,2),a=r[0],i=r[1];return Object(d.jsxs)("div",{class:"labelTooltipContainer",onMouseLeave:function(){return i(!1)},children:[Object(d.jsx)("div",{class:"labelTooltipIcon",onMouseEnter:function(){return i(!0)},children:Object(d.jsx)("i",{class:"fa fa-question-circle"})}),a?Object(d.jsx)("div",{class:"tooltip",children:t}):null]})},T=function(){var e,t=Object(c.useContext)(u.a),n=Object(o.i)(),r=n.viewIndex,a=n.panelIndex,i=n.recordId,s=Object(o.g)(),j=t.views[r],b=a?j.recordViewPanels[a]:null,f=b?b.createConfig.columns:j.columns.filter((function(e){return e.dataType&&(!0===e.canEditOnCreation||!1!==e.canEdit)&&!e.hidden})),O={},m=Object(x.a)(f);try{for(m.s();!(e=m.n()).done;){var g=e.value;"tinyint"===g.dataType?O[g.name]=g.optional?"NULL":"0":"select"===g.dataType&&Array.isArray(g.options)?O[g.name]=g.options[0]:"select"===g.dataType&&(O[g.name]=Object.keys(g.options)[0]),g.defaultValue&&(O[g.name]=g.defaultValue)}}catch(D){m.e(D)}finally{m.f()}var w=Object(c.useRef)(O),y=Object(c.useState)(!1),C=Object(l.a)(y,2),I=C[0],k=C[1],E=function(){var e=Object(h.a)(p.a.mark((function e(){var t,n,c;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t in j.createFilters)w.current[t]=j.createFilters[t];return k(!0),e.prev=2,e.next=5,_.a.post("/createRecord",{viewIndex:r,panelIndex:a,recordId:i,data:w.current});case 5:c=e.sent,k(!1),i?s.push("/record/".concat(r,"/").concat(i)):(null===j||void 0===j||null===(n=j.createConfig)||void 0===n?void 0:n.redirectToCreatedItems)?s.push("/record/".concat(r,"/").concat(c.data.id)):s.push("/records/".concat(r)),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(2),e.t0.response.responseText&&window.swal({title:"Erreur",text:e.t0.response.responseText,dangerMode:!0}),k(!1);case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{class:"view",children:[Object(d.jsx)("div",{class:"viewHeader",children:Object(d.jsx)("div",{class:"viewTitle",children:b?b.createConfig.label:"Cr\xe9er ".concat(j.aNewSingular)})}),Object(d.jsxs)("div",{class:"paddedView",children:[Object(d.jsx)("div",{class:"form",children:f.map((function(e,t){return Object(d.jsxs)("div",{class:"formElement",children:[Object(d.jsxs)("div",{class:"formLabel",children:[e.label,e.labelTooltip?Object(d.jsx)(S,{text:e.labelTooltip}):null]}),Object(d.jsx)("div",{class:"formInput",children:Object(d.jsx)(M,{column:e,onChange:function(e){w.current=Object(v.a)(Object(v.a)({},w.current),e)}})})]},t)}))}),Object(d.jsx)("div",{class:"button greenButton ".concat(I?"loading":""),onClick:E,children:I?"Sauvegarde en cours...":"Cr\xe9er"}),Object(d.jsx)("div",{class:"button",onClick:function(){return s.goBack()},children:"Annuler"})]})]})},A=function(){var e=Object(c.useContext)(u.a),t=Object(o.i)(),n=t.viewIndex,r=t.recordId,a=Object(o.g)(),i=e.views[n],s=Object(c.useState)(null),j=Object(l.a)(s,2),b=j[0],f=j[1],O=i.columns.filter((function(e){return e.dataType&&!1!==e.canEdit&&!e.hidden})),x=Object(c.useRef)({}),m=Object(c.useState)(!1),g=Object(l.a)(m,2),w=g[0],y=g[1];Object(c.useEffect)((function(){_.a.get("/record",{params:{viewIndex:n,recordId:r}}).then((function(e){x.current={},f(e.data)}))}),[n,r]);var C=function(){var e=Object(h.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.prev=1,e.next=4,_.a.post("/updateRecord",{viewIndex:n,primaryValue:r,data:x.current});case 4:y(!1),a.push("/record/".concat(n,"/").concat(r)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),e.t0.response.responseText&&window.swal({title:"Erreur",text:e.t0.response.responseText,dangerMode:!0}),y(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{class:"view",children:[Object(d.jsx)("div",{class:"viewHeader",children:Object(d.jsx)("div",{class:"viewTitle",children:i.label})}),Object(d.jsx)("div",{class:"paddedView",children:b?Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)("div",{class:"form",children:O.map((function(e,t){return Object(d.jsxs)("div",{class:"formElement",children:[Object(d.jsxs)("div",{class:"formLabel",children:[e.label,e.labelTooltip?Object(d.jsx)(S,{text:e.labelTooltip}):null]}),Object(d.jsx)("div",{class:"formInput",children:Object(d.jsx)(M,{column:e,initialData:b,onChange:function(e){x.current=Object(v.a)(Object(v.a)({},x.current),e)}})})]},t)}))}),Object(d.jsx)("div",{class:"button greenButton ".concat(w?"loading":""),onClick:C,children:w?"Sauvegarde en cours...":"Sauvegarder"}),Object(d.jsx)("div",{class:"button",onClick:function(){return a.goBack()},children:"Annuler"})]}):null})]})},P=n(28),L=function(e){var t=e.view,n=e.viewIndex,r=e.subviewIndex,a=e.currentFilters,i=e.orderBy,s=e.isDesc,o=e.query,u=Object(c.useState)(!1),j=Object(l.a)(u,2),b=j[0],f=j[1];return Object(d.jsx)("div",{class:"downloadButton",onClick:function(){f(!0),_.a.post("/recordsExport",{viewIndex:n,subviewIndex:r,filters:a.map((function(e){return e.query})),orderBy:i,isDesc:s,query:o}).then((function(e){f(!1),window.download(e.data.content,t.label+".csv")}))},children:Object(d.jsx)("i",{class:"fa ".concat(b?"fa-spin fa-circle-notch":"fa-cloud-download")})})};function R(e){var t,n,r=Object(c.useRef)(null);return t=r,n=e.onOutsideClick,Object(c.useEffect)((function(){function e(e){t.current&&!t.current.contains(e.target)&&n()}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[t]),Object(d.jsx)("div",{ref:r,children:e.children})}var F=function(e){var t=e.view,n=e.refreshData,r=e.onAddFilter,a=Object(c.useState)(!1),i=Object(l.a)(a,2),s=i[0],o=i[1],u=Object(c.useState)(null),j=Object(l.a)(u,2),b=j[0],f=j[1],v=Object(c.useState)("contains"),O=Object(l.a)(v,2),p=O[0],h=O[1],x=Object(c.useState)(null),m=Object(l.a)(x,2),_=m[0],g=m[1];return Object(d.jsx)(R,{onOutsideClick:function(){return o(!1)},children:Object(d.jsxs)("div",{class:"button openFilterPopup",onClick:function(){return o(!s)},children:[Object(d.jsx)("i",{class:"fas fa-filter"})," Ajouter un filtre",s?Object(d.jsxs)("div",{class:"addFilterPopup",onClick:function(e){return e.stopPropagation()},children:[Object(d.jsx)("div",{class:"filterLabel",children:"Champ"}),Object(d.jsxs)("select",{onChange:function(e){return f(e.target.value)},children:[Object(d.jsx)("option",{value:"",children:"S\xe9lectionnez un champ"}),t.columns.filter((function(e){return(e.searchableName||e.name)&&"foreign"!==e.dataType&&"datalist"!==e.dataType})).map((function(e){var t=e.searchableName||e.name;return Object(d.jsx)("option",{value:t,children:e.label},t)}))]}),Object(d.jsx)("div",{class:"filterLabel",children:"Op\xe9rateur"}),Object(d.jsxs)("select",{onChange:function(e){return h(e.target.value)},children:[Object(d.jsx)("option",{value:"contains",children:"contient"}),Object(d.jsx)("option",{value:"notContains",children:"ne contient pas"}),Object(d.jsx)("option",{value:"startsWith",children:"commence par"}),Object(d.jsx)("option",{value:"endsWith",children:"finit par"}),Object(d.jsx)("option",{value:"is",children:"est"}),Object(d.jsx)("option",{value:"isNot",children:"n'est pas"}),Object(d.jsx)("option",{value:"largerThan",children:"est sup\xe9rieur \xe0"}),Object(d.jsx)("option",{value:"smallerThan",children:"est inf\xe9rieur \xe0"})]}),Object(d.jsx)("div",{class:"filterLabel",children:"Valeur"}),Object(d.jsx)("input",{onChange:function(e){return g(e.target.value)}}),Object(d.jsx)("div",{class:"button greenButton",onClick:function(){if(b&&_){var e,c=null===(e=t.columns.find((function(e){return(e.searchableName||e.name)===b})))||void 0===e?void 0:e.label;"contains"===p?r({label:c+" contient "+_,query:b+" LIKE '%"+_+"%'"}):"notContains"===p?r({label:c+" ne contient pas "+_,query:b+" NOT LIKE '%"+_+"%'"}):"is"===p?r({label:c+" est "+_,query:b+" = '"+_+"'"}):"isNot"===p?r({label:c+" n'est pas "+_,query:b+" != '"+_+"'"}):"startsWith"===p?r({label:c+" commence par "+_,query:b+" LIKE '"+_+"%'"}):"endsWith"===p?r({label:c+" finit par "+_,query:b+" LIKE '%"+_+"'"}):"largerThan"===p?r({label:c+" sup\xe9rieur \xe0 "+_,query:b+" >= "+_}):"smallerThan"===p&&r({label:c+" inf\xe9rieur \xe0 "+_,query:b+" <= "+_}),f(null),g(null),o(!1),n()}},children:"Ajouter"})]}):null]})})},B=function(e){var t,n,r=e.viewIndex,a=e.selectedRecordIds,i=e.refreshData,s=Object(c.useContext)(u.a),o=s.views[r],j=Object(c.useState)(!1),b=Object(l.a)(j,2),f=b[0],v=b[1];return!s.hideMultiselect&&(!1!==o.canDelete||(null===(t=o.customActions)||void 0===t?void 0:t.length)>0)?Object(d.jsx)(R,{onOutsideClick:function(){return v(!1)},children:Object(d.jsxs)("div",{class:"actionButtonsContainer",children:[Object(d.jsx)("div",{class:"button openBulkActionsButton",onClick:function(){return v(!f)},children:"Actions"}),f?Object(d.jsxs)("div",{class:"bulkActions",children:[null===(n=o.customActions)||void 0===n?void 0:n.map((function(e,t){return Object(d.jsx)("div",{class:"action recordAction",onClick:(n=t,function(){v(!1),_.a.post("customAction",{viewIndex:r,actionIndex:n,selectedRecordIds:a}).then((function(e){e.data.message&&alert(e.data.message),i()})).catch((function(){window.swal({title:"Erreur",text:"L'action a \xe9chou\xe9",dangerMode:!0})}))}),children:e.label});var n})),!1!==o.canDelete?Object(d.jsx)("div",{class:"action recordAction red",onClick:function(){window.swal({title:"\xcates-vous s\xfbr ?",text:"Une fois la suppression confirm\xe9e, il ne sera pas possible de revenir en arri\xe8re.",buttons:["Annuler","Oui"],dangerMode:!0}).then((function(e){e&&_.a.post("deleteRecords",{viewIndex:r,primaryValues:a}).then((function(){i()})).catch((function(){window.swal({title:"Erreur",text:"Suppression impossible",dangerMode:!0})}))}))},children:"Supprimer"}):null]}):null]})}):null},q=n(15),V=function(e,t,n){if(e.showAsPicture){var c=e.baseUrl+t[e.pathField];return t[e.pathField]?Object(d.jsx)("a",{href:c,target:"_blank",children:Object(d.jsx)("img",{src:c,style:{width:n?60:300,height:n?30:150,objectFit:"contain"}})}):null}if(e.formatValue)return Object(d.jsx)("div",{dangerouslySetInnerHTML:{__html:t["__formatValue-".concat(e.__id__,"__")]}});if(e.formattedValue)return Object(d.jsx)("div",{children:Object(q.a)(e.formattedValue,t)});if(e.action){if(e.actionDisplayCondition)if(!Object(q.a)(e.actionDisplayCondition,t))return"";var r=JSON.parse(JSON.stringify(e.data));for(var a in r)r[a]=Object(q.a)(r[a],t);return Object(d.jsx)("div",{class:"actionButton","data-route":'" + column.route + "',"data-data":'" + JSON.stringify(data) + "',children:e.action})}return"tinyint"===e.dataType?Object(d.jsx)("div",{children:1===t[e.name]?"Oui":"Non"}):"color"===e.dataType?Object(d.jsx)("div",{class:"colorPreview",style:{backgroundColor:t[e.name]}}):"richText"===e.dataType?Object(d.jsx)("div",{dangerouslySetInnerHTML:{__html:t[e.htmlField]}}):"select"===e.dataType&&e.options&&e.options.constructor==Object?Object(d.jsx)("div",{children:e.options[t[e.name]]}):Object(d.jsx)("div",{children:t[e.name]})},N=function(){var e,t,n=Object(o.i)(),r=n.viewIndex,a=n.subviewIndex,i=Object(o.g)(),j=Object(c.useState)(1),b=Object(l.a)(j,2),f=b[0],v=b[1],O=Object(c.useState)([]),p=Object(l.a)(O,2),h=p[0],x=p[1],m=Object(c.useState)(null),g=Object(l.a)(m,2),w=g[0],y=g[1],C=Object(c.useState)(null),I=Object(l.a)(C,2),k=I[0],E=I[1],D=Object(c.useState)(null),M=Object(l.a)(D,2),S=M[0],T=M[1],A=Object(c.useState)([]),R=Object(l.a)(A,2),q=R[0],N=R[1],U=Object(c.useState)(null),W=Object(l.a)(U,2),K=W[0],H=W[1],J=Object(c.useContext)(u.a),Q=J.views[r],z=null===(e=Q.columns)||void 0===e?void 0:e.filter((function(e){return!e.hideInTable&&!e.hidden}));function Y(){H(null),_.a.post("/records",{viewIndex:r,subviewIndex:a,page:f,filters:h.map((function(e){return e.query})),orderBy:w,isDesc:k,query:S}).then((function(e){H(e.data)}))}return Object(c.useEffect)((function(){v(1),T(null),y(null),E(null),q.length>0&&N([]),h.length>0&&x([])}),[r]),Object(c.useEffect)((function(){Y()}),[r,a,f,S,h,w,k]),Object(d.jsxs)("div",{class:"view",children:[Object(d.jsxs)("div",{class:"scrollable",children:[Object(d.jsxs)("div",{class:"viewHeader",children:[Object(d.jsx)("div",{class:"viewTitle",children:Q.label}),Object(d.jsxs)("div",{class:"viewHeaderActions",children:[Object(d.jsxs)("div",{class:"searchBarContainer",children:[Object(d.jsx)("input",{type:"text",placeholder:"Rechercher",class:"searchBar",onChange:function(e){return T(e.target.value)}}),Object(d.jsx)("div",{class:"searchBarIcon",children:Object(d.jsx)("i",{class:"fa fa-search"})})]}),Object(d.jsx)(B,{viewIndex:r,selectedRecordIds:q,refreshData:Y}),Object(d.jsx)(F,{view:Q,refreshData:Y,onAddFilter:function(e){return x([].concat(Object(P.a)(h),[e]))}}),Object(d.jsx)(L,{view:Q,viewIndex:r,subviewIndex:a,currentFilters:h,orderBy:w,isDesc:k,query:S}),Q.canCreate?Object(d.jsx)(s.b,{to:"/createRecord/".concat(r),children:Object(d.jsx)("div",{class:"plusButton",children:Object(d.jsx)("i",{class:"fa fa-plus"})})}):null]})]}),h.length>0?Object(d.jsx)("div",{class:"filtersContainer",children:h.map((function(e,t){return Object(d.jsxs)("div",{class:"filterItem",children:[Object(d.jsx)("div",{class:"filterItemLabel",children:e.label}),Object(d.jsx)("div",{class:"filterRemove",onClick:function(){x(h.filter((function(t){return t.query!==e.query})))},children:Object(d.jsx)("i",{class:"fa fa-times"})})]},t)}))}):null,Object(d.jsxs)("table",{class:"table",children:[Object(d.jsx)("thead",{children:Object(d.jsxs)("tr",{children:[J.hideMultiselect?null:Object(d.jsx)("th",{}),z.map((function(e,t){var n="foreign"===e.dataType||"datalist"===e.dataType?e.formattedValue:e.sortName||e.name;return Object(d.jsxs)("th",{class:n?"sortable":"",onClick:function(){n&&(y(n),E(w===n&&!k))},children:[e.label,n?Object(d.jsx)("div",{class:"columnSortIcon",children:Object(d.jsx)("i",{class:"fas fa-sort".concat(!0===k&&n===w?"-down":!1===k&&n===w?"-up":"")})}):null]},t)}))]})}),Object(d.jsxs)("tbody",{children:[K?null:Array.from({length:10}).map((function(e,t){return Object(d.jsx)("tr",{class:"record",children:Array.from({length:z.length+(J.hideMultiselect?0:1)}).map((function(e,t){return Object(d.jsx)("td",{children:" "},t)}))},t)})),null===K||void 0===K||null===(t=K.records)||void 0===t?void 0:t.map((function(e){var t=e[Q.primaryId];return Object(d.jsxs)("tr",{class:"record ".concat(Q.notClickable?"nonClickableRow":""),onClick:function(e){"A"!=e.target.tagName?Q.notClickable||i.push("/record/".concat(r,"/").concat(t)):e.stopPropagation()},children:[J.hideMultiselect?null:Object(d.jsx)("td",{class:"checkboxParent",onClick:function(e){N(q.includes(t)?q.filter((function(e){return e!==t})):[].concat(Object(P.a)(q),[t])),e.stopPropagation()},children:Object(d.jsx)("div",{class:"checkbox ".concat(q.includes(t)?"checked":"")})}),z.map((function(t,n){return Object(d.jsx)("td",{children:V(t,e,!0)},n)}))]},t)}))]})]})]}),Object(d.jsxs)("div",{class:"tableFooter",children:[Object(d.jsxs)("div",{class:"tableCounter",children:[(null===K||void 0===K?void 0:K.count)||"-"," ",Q.label]}),Object(d.jsxs)("div",{class:"paginator",children:[Object(d.jsx)("div",{class:"paginatorLeft",onClick:function(){return v(Math.max(1,f-1))},children:Object(d.jsx)("i",{class:"fas fa-caret-left"})}),Object(d.jsxs)("div",{class:"paginatorNumber",children:[f," / ",K?Math.ceil(K.count/(Q.limit||10)):"-"]}),Object(d.jsx)("div",{class:"paginatorRight",onClick:function(){return v(Math.min(f+1,Math.ceil(K.count/(Q.limit||10))))},children:Object(d.jsx)("i",{class:"fas fa-caret-right"})})]})]})]})},U=function(e){var t,n,r=e.viewIndex,a=e.record,i=e.refreshData,s=Object(c.useContext)(u.a).views[r],j=Object(c.useState)(!1),b=Object(l.a)(j,2),f=b[0],v=b[1],O=Object(o.g)(),x=function(){var e=Object(h.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.swal({title:"\xcates-vous s\xfbr ?",text:"Une fois la suppression confirm\xe9e, il ne sera pas possible de revenir en arri\xe8re.",buttons:["Annuler","Oui"],dangerMode:!0});case 2:if(!e.sent){e.next=14;break}return s.deleteCallback&&_.a.post(s.deleteCallback,{id:a[s.primaryId],data:a}),e.prev=5,e.next=8,_.a.post("/deleteRecord",{viewIndex:r,primaryValue:a[s.primaryId]});case 8:O.push("/records/".concat(r)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),window.swal({title:"Erreur",text:"Suppression impossible",dangerMode:!0});case 14:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(){return e.apply(this,arguments)}}();return!0===s.canDuplicate||!1!==s.canDelete||(null===(t=s.customActions)||void 0===t?void 0:t.length)>0?Object(d.jsx)(R,{onOutsideClick:function(){return v(!1)},children:Object(d.jsxs)("div",{class:"actionButtonsContainer",children:[Object(d.jsx)("div",{class:"button openActionsButton",onClick:function(){return v(!f)},children:"Actions"}),f?Object(d.jsxs)("div",{class:"actions",children:[null===(n=s.customActions)||void 0===n?void 0:n.map((function(e,t){return Object(d.jsx)("div",{class:"action recordAction",onClick:(n=t,function(){v(!1),_.a.post("customAction",{viewIndex:r,actionIndex:n,selectedRecordIds:[a[s.primaryId]]}).then((function(e){e.data.message&&alert(e.data.message),i()})).catch((function(){window.swal({title:"Erreur",text:"L'action a \xe9chou\xe9",dangerMode:!0})}))}),children:e.label});var n})),!0===s.canDuplicate?Object(d.jsx)("div",{class:"action recordAction duplicateRecord",children:"Dupliquer"}):null,!1!==s.canDelete?Object(d.jsx)("div",{class:"action recordAction red",onClick:x,children:"Supprimer"}):null]}):null]})}):null},W=function(){var e=Object(o.g)();return Object(d.jsx)("div",{class:"button backButton",onClick:function(){return e.goBack()},children:"Retour"})},K=function(e){var t=e.record,n=e.panel;return Object(d.jsx)("div",{class:"downloadPanelButton",onClick:function(){_.a.get("/customQuery",{params:{query:n.query||Object(q.a)(n.formattedQuery,t),primaryValue:2630}}).then((function(e){var t=e.data,c=[];c.push(Object.keys(t[0]).filter((function(e){return e!==n.primaryId})).join(","));var r,a=Object(x.a)(t);try{var i=function(){var e=r.value;c.push(Object.keys(e).filter((function(e){return e!==n.primaryId})).map((function(t){return n.formattedValues&&t in n.formattedValues?Object(q.a)(n.formattedValues[t],e):e[t]})).join(","))};for(a.s();!(r=a.n()).done;)i()}catch(l){a.e(l)}finally{a.f()}window.download(c.join("\r\n"),n.label+".csv")}))},children:Object(d.jsx)("i",{class:"fa fa-cloud-download"})})},H=function(e){var t=e.panel,n=e.record,r=e.view,a=Object(c.useState)(null),i=Object(l.a)(a,2),s=i[0],j=i[1],b=Object(o.g)(),f=Object(o.i)().viewIndex,v=Object(c.useContext)(u.a);Object(c.useEffect)((function(){O()}),[]);var O=function(){_.a.get("/customQuery",{params:{query:t.query||Object(q.a)(t.formattedQuery,n),primaryValue:n[r.primaryId]}}).then((function(e){j(e.data)}))},x=function(){var e=Object(h.a)(p.a.mark((function e(n){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.swal({title:"\xcates-vous s\xfbr ?",text:"Une fois la suppression confirm\xe9e, il ne sera pas possible de revenir en arri\xe8re.",buttons:["Annuler","Oui"],dangerMode:!0});case 2:if(!e.sent){e.next=13;break}return e.prev=4,e.next=7,_.a.post("/deleteRecordFromPanel",{viewIndex:f,panelId:t.__id__,primaryValue:n[t.primaryId]});case 7:O(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),window.swal({title:"Erreur",text:"Suppression impossible",dangerMode:!0});case 13:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t){return e.apply(this,arguments)}}();return Object(d.jsx)("div",{children:(null===s||void 0===s?void 0:s.length)>0?Object(d.jsxs)("table",{class:"table panelTable ".concat(t.folded?"folded":""),children:[Object(d.jsx)("thead",{children:Object(d.jsxs)("tr",{children:[Object.keys(s[0]).filter((function(e){return e!==t.primaryId})).map((function(e){return Object(d.jsx)("th",{children:e},e)})),t.canDelete?Object(d.jsx)("th",{}):null]})}),Object(d.jsx)("tbody",{children:s.map((function(e){return Object(d.jsxs)("tr",{class:"record ".concat(t.canShow?"":"nonClickableRow"),onClick:function(){var n=v.views.findIndex((function(e){return"table"===e.type&&e.tableName===t.tableName}));t.canShow&&b.push("/record/".concat(n,"/").concat(e[t.primaryId]))},children:[Object.keys(e).filter((function(e){return e!==t.primaryId})).map((function(n){return Object(d.jsx)("td",{children:Object(d.jsx)("div",{dangerouslySetInnerHTML:{__html:t.formattedValues&&n in t.formattedValues?Object(q.a)(t.formattedValues[n],e):e[n]}})},n)})),t.canDelete?Object(d.jsx)("td",{class:"deleteIconCell",children:Object(d.jsx)("div",{class:"deleteIcon",onClick:function(){return x(e)},children:Object(d.jsx)("i",{class:"fa fa-minus"})})}):null]})}))})]}):0===(null===s||void 0===s?void 0:s.length)?Object(d.jsx)("div",{class:"noData panelTable ".concat(t.folded?"folded":""),children:"Aucune donn\xe9e"}):null})},J=function(e){var t=e.panel,n=e.record,r=e.view,a=Object(c.useState)(null),i=Object(l.a)(a,2),s=i[0],u=i[1],j=(Object(o.g)(),Object(o.i)().viewIndex);Object(c.useEffect)((function(){b()}),[t.query]);var b=function(){_.a.get("/customQuery",{params:{query:t.query,primaryValue:n[r.primaryId]}}).then((function(e){u(e.data)}))},f=function(){var e=Object(h.a)(p.a.mark((function e(n){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.swal({title:"\xcates-vous s\xfbr ?",text:"Une fois la suppression confirm\xe9e, il ne sera pas possible de revenir en arri\xe8re.",buttons:["Annuler","Oui"],dangerMode:!0});case 2:if(!e.sent){e.next=13;break}return e.prev=4,e.next=7,_.a.post("/deleteRecordFromPanel",{viewIndex:j,panelId:t.__id__,primaryValue:n[t.primaryId]});case 7:b(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),window.swal({title:"Erreur",text:"Suppression impossible",dangerMode:!0});case 13:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t){return e.apply(this,arguments)}}(),v=t.pathField||"Path";return Object(d.jsx)("div",{children:(null===s||void 0===s?void 0:s.length)>0?Object(d.jsx)("div",{class:"gallery",children:s.map((function(e){return Object(d.jsxs)("div",{class:"galleryPicture",children:[t.canDelete?Object(d.jsx)("div",{class:"deleteIcon",onClick:function(){return f(e)},children:Object(d.jsx)("i",{class:"fa fa-minus"})}):null,Object(d.jsx)("a",{href:t.baseUrl+e[v],target:"_blank",children:Object(d.jsx)("img",{src:t.baseUrl+e[v],style:{width:"100%",height:150,objectFit:t.objectFit||"cover"},onerror:"this.style.height = 0"})})]},e[v])}))}):0===(null===s||void 0===s?void 0:s.length)?Object(d.jsx)("div",{class:"noData panelTable ".concat(t.folded?"folded":""),children:"Aucune donn\xe9e"}):null})},Q=function(e){var t=e.panel,n=e.record,r=e.view,a=Object(c.useRef)();Object(c.useEffect)((function(){window.google&&n&&(t.query?_.a.get("/customQuery",{query:t.query,primaryValue:n[r.primaryId]}).then((function(e){var n,c=null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n[0];c&&i(c.Lat,c.Lng,t.zoom||12)})):i(n[t.latitudeField],n[t.longitudeField],t.zoom||12))}),[n,window.google]);var i=function(e,t,n){var c=new window.google.maps.Map(a.current,{zoom:n,center:{lat:e,lng:t}});new window.google.maps.Marker({position:{lat:e,lng:t},map:c})};return Object(d.jsx)("div",{class:"map",ref:a})},z=function(){var e,t=Object(c.useContext)(u.a),n=Object(o.i)(),r=n.viewIndex,a=n.recordId,i=Object(c.useState)(null),j=Object(l.a)(i,2),b=j[0],f=j[1],v=t.views[r],O=null===(e=v.columns)||void 0===e?void 0:e.filter((function(e){return!e.hidden}));Object(c.useEffect)((function(){p()}),[r,a]);var p=function(){_.a.get("/record",{params:{viewIndex:r,recordId:a}}).then((function(e){f(e.data)}))};return Object(d.jsxs)("div",{class:"view backgroundBlue",children:[Object(d.jsxs)("div",{class:"viewHeader",children:[Object(d.jsx)("div",{class:"viewTitle",children:v.label}),Object(d.jsxs)("div",{class:"viewHeaderActions",children:[Object(d.jsx)("div",{class:"button adjacentButton prevButton",children:"\u25c4"}),Object(d.jsx)("div",{class:"button adjacentButton nextButton",children:"\u25ba"}),Object(d.jsx)(W,{}),Object(d.jsx)(U,{viewIndex:r,record:b,refreshData:p}),!1!==v.canEdit?Object(d.jsx)(s.b,{to:"/editRecord/".concat(r,"/").concat(a),children:Object(d.jsx)("div",{class:"button greenButton recordAction",children:"Modifier"})}):null]})]}),Object(d.jsx)("div",{class:"paddedView",children:Object(d.jsxs)("div",{class:"showContainer",children:[Object(d.jsxs)("div",{class:"panel detailsPanel",children:[Object(d.jsx)("div",{class:"panelTitle",children:"D\xe9tails"}),b?O.map((function(e,t){return Object(d.jsxs)("div",{class:"showRecordField",children:[Object(d.jsx)("div",{class:"formLabel",children:e.label}),Object(d.jsx)("div",{class:"formValue",children:V(e,b,!1)||"-"})]},t)})):null]}),v.recordViewPanels&&b?Object(d.jsx)("div",{class:"recordViewPanels",children:v.recordViewPanels.map((function(e,t){return Object(d.jsxs)("div",{class:"panel",children:[Object(d.jsxs)("div",{class:"panelHeader",children:[Object(d.jsx)("div",{class:"viewTitle",children:e.label}),Object(d.jsxs)("div",{class:"viewHeaderActions",children:[e.folded?Object(d.jsx)("div",{class:"button smallButton unfoldPanel",children:"Afficher"}):null,e.canCreate?Object(d.jsx)(s.b,{to:"/createRecord/".concat(r,"/").concat(t,"/").concat(a),children:Object(d.jsx)("div",{class:"plusButton",children:Object(d.jsx)("i",{class:"fa fa-plus"})})}):null,e.canDownload&&"table"===e.type?Object(d.jsx)(K,{record:b,panel:e}):null]})]}),"table"===e.type?Object(d.jsx)(H,{record:b,panel:e,view:v}):null,"gallery"===e.type?Object(d.jsx)(J,{record:b,panel:e,view:v}):null,"map"===e.type?Object(d.jsx)(Q,{record:b,panel:e,view:v}):null]},t)}))}):null]})})]})},Y=n.p+"static/media/logo.e407b9ca.png",$=function(e){var t=e.setIsAuthenticated,n=Object(c.useState)(""),r=Object(l.a)(n,2),a=r[0],i=r[1],s=Object(c.useState)(""),o=Object(l.a)(s,2),u=o[0],j=o[1],b=function(){var e=Object(h.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_.a.post("/login",{username:a,password:u});case 2:e.sent.data.success&&t(!0);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(d.jsx)("div",{class:"loginPanelBackground",children:Object(d.jsxs)("div",{class:"loginPanel",children:[Object(d.jsx)("div",{class:"loginLogoContainer",children:Object(d.jsx)("img",{class:"loginLogo",src:Y})}),Object(d.jsx)("label",{children:"Nom d'utilisateur"}),Object(d.jsx)("input",{type:"text",name:"username",onChange:function(e){return i(e.target.value)}}),Object(d.jsx)("label",{children:"Mot de passe"}),Object(d.jsx)("input",{type:"password",name:"password",onChange:function(e){return j(e.target.value)}}),Object(d.jsx)("button",{class:"button greenButton fullWidth",onClick:b,children:"Se connecter"})]})})},G=function(){var e=Object(c.useContext)(u.a),t=Object(o.i)().viewIndex,n=e.views[t];return Object(d.jsx)("div",{class:"view",children:Object(d.jsx)("iframe",{src:n.src})})},X=n(44),Z=n(40),ee=["componentPath","children"],te={react:function(){return{exports:r.a}},axios:function(){return{exports:_.a}},"styled-components":function(){return{exports:Z.a}}};function ne(e,t,n){var c=Object.create(n);return function n(r){if(r in c||t!==r){if(!(r in c))throw"Module '".concat(r,"' not found")}else{var a={exports:{}};c[r]=function(){return a},Function("require, exports, module",e)(n,a.exports,a)}return c[r]().exports}(t)}function ce(e){return re.apply(this,arguments)}function re(){return(re=Object(h.a)(p.a.mark((function e(t){var n,c;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_.a.get("/customComponent",{params:{componentPath:t}});case 3:return n=e.sent,c=n.data,e.abrupt("return",{default:ne(c,"__moduleName__",te)});case 8:return e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",{default:function(){return Object(d.jsx)("div",{children:"Erreur de rendu"})}});case 12:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}var ae=function(e){var t=e.componentPath,n=e.children,a=Object(X.a)(e,ee),i=Object(c.useMemo)((function(){return r.a.lazy(Object(h.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ce(t));case 1:case"end":return e.stop()}}),e)}))))}),[t]);return Object(d.jsx)(c.Suspense,{fallback:null,children:Object(d.jsx)(i,Object(v.a)(Object(v.a)({},a),{},{children:n}))})},ie=r.a.memo(ae),le=function(){var e=Object(c.useContext)(u.a),t=Object(o.i)().viewIndex,n=e.views[t].componentPath;return Object(d.jsx)(ie,{componentPath:n})};_.a.defaults.withCredentials=!0,_.a.defaults.baseURL="/_HOMEPAGE_/api";var se=function(){var e=Object(c.useState)(null),t=Object(l.a)(e,2),n=t[0],r=t[1];return Object(c.useEffect)((function(){_.a.get("/isAuthenticated").then((function(e){r(e.data.isAuthenticated)}))}),[]),Object(d.jsx)("div",{id:"body",children:!0===n?Object(d.jsx)(u.b,{children:Object(d.jsxs)(s.a,{basename:"/_HOMEPAGE_",children:[Object(d.jsx)(b,{}),Object(d.jsxs)(o.d,{children:[Object(d.jsx)(o.b,{path:"/records/:viewIndex/:subviewIndex?",children:Object(d.jsx)(N,{})}),Object(d.jsx)(o.b,{path:"/record/:viewIndex/:recordId",children:Object(d.jsx)(z,{})}),Object(d.jsx)(o.b,{path:"/editRecord/:viewIndex/:recordId",children:Object(d.jsx)(A,{})}),Object(d.jsx)(o.b,{path:"/createRecord/:viewIndex/:panelIndex?/:recordId?",children:Object(d.jsx)(T,{})}),Object(d.jsx)(o.b,{path:"/iframe/:viewIndex",children:Object(d.jsx)(G,{})}),Object(d.jsx)(o.b,{path:"/customView/:viewIndex",children:Object(d.jsx)(le,{})}),Object(d.jsx)(o.b,{path:"/",children:Object(d.jsx)(f,{})})]})]})}):!1===n?Object(d.jsx)($,{setIsAuthenticated:r}):Object(d.jsx)("div",{class:"appLoading",children:Object(d.jsx)("i",{class:"fa fa-circle-notch fa-spin"})})})};i.a.render(Object(d.jsx)(r.a.StrictMode,{children:Object(d.jsx)(se,{})}),document.getElementById("root"))}},[[75,1,2]]]);
|
|
2
|
-
//# sourceMappingURL=main.
|
|
1
|
+
(this["webpackJsonpgaladmin-front"]=this["webpackJsonpgaladmin-front"]||[]).push([[0],{15:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a=function(expression,data){try{var varString="";for(var key in data)varString+="var "+key+" = "+("string"===typeof data[key]?"'"+data[key].replace(/'/g,"\\'").replace(/\n/g,"<br>").replace(/\r/g,"")+"'":"object"===typeof data[key]?JSON.stringify(data[key]):data[key])+";";return eval(varString+expression)}catch(e){return console.log(varString+expression),console.error(e),"Error"}}},49:function(e,t,n){},50:function(e,t,n){},6:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return ConfigContext})),__webpack_require__.d(__webpack_exports__,"b",(function(){return ConfigProvider}));var _home_runner_work_galadmin_galadmin_src_front_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),react__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__),axios__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3),axios__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(0),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__),ConfigContext=Object(react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null),ConfigProvider=function ConfigProvider(props){var _useState=Object(react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),_useState2=Object(_home_runner_work_galadmin_galadmin_src_front_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__.a)(_useState,2),config=_useState2[0],setConfig=_useState2[1];return Object(react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((function(){axios__WEBPACK_IMPORTED_MODULE_2___default.a.get("/config").then((function(response){var _config=eval("("+response.data.config+")");if(setConfig(_config),_config.googleMapsKey){var script=document.createElement("script");return script.src="https://maps.googleapis.com/maps/api/js?key="+_config.googleMapsKey+"&libraries=places,autocomplete",document.body.appendChild(script),function(){document.body.removeChild(script)}}}))}),[]),config?Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ConfigContext.Provider,{value:config,children:props.children}):null}},75:function(e,t,n){"use strict";n.r(t);var c=n(1),r=n.n(c),a=n(39),i=n.n(a),l=(n(49),n(2)),s=n(8),o=n(7),u=(n(50),n(6)),d=n(0),j=function(e){var t=e.view;return Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)("div",{class:"sidebarIcon",children:Object(d.jsx)("i",{class:"fas fa-".concat(t.icon||"square")})}),Object(d.jsx)("div",{class:"sidebarLabel",children:t.label})]})},b=function(){var e=Object(o.h)(),t=Object(c.useContext)(u.a),n=Object(o.g)();return Object(d.jsxs)("div",{class:"sidebar",children:[t.logo?Object(d.jsx)("img",{src:t.logo,class:"logo"}):null,Object(d.jsx)("div",{class:"sidebarTitle",children:t.name}),Object(d.jsx)("div",{class:"sidebarSubtitle",children:"Back-office"}),t.views.filter((function(e){return!e.hidden})).map((function(t,c){if("link"===t.type)return Object(d.jsx)("a",{href:t.src,children:Object(d.jsx)("div",{class:"sidebarItem",children:Object(d.jsx)("div",{children:Object(d.jsx)(j,{view:t})})})},c);if("iframe"===t.type){var r=e.pathname==="/iframe/".concat(c);return Object(d.jsx)(s.b,{to:"/iframe/".concat(c),children:Object(d.jsx)("div",{class:"sidebarItem ".concat(r?"active":""),children:Object(d.jsx)("div",{children:Object(d.jsx)(j,{view:t})})})},c)}if("custom"===t.type){var a=e.pathname==="/customView/".concat(c);return Object(d.jsx)(s.b,{to:"/customView/".concat(c),children:Object(d.jsx)("div",{class:"sidebarItem ".concat(a?"active":""),children:Object(d.jsx)("div",{children:Object(d.jsx)(j,{view:t})})})},c)}if("table"===t.type){var i=e.pathname.startsWith("/records/".concat(c))||e.pathname==="/createRecord/".concat(c)||e.pathname.startsWith("/record/".concat(c))||e.pathname.startsWith("/editRecord/".concat(c));return Object(d.jsx)("div",{onClick:function(){return n.push("/records/".concat(c))},children:Object(d.jsxs)("div",{class:"sidebarItem ".concat(i?"active":""),children:[Object(d.jsxs)("div",{children:[Object(d.jsx)("div",{class:"notificationWrapper"}),Object(d.jsx)(j,{view:t})]}),t.subviews?Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)("div",{class:"subviewsSeparator"}),t.subviews.map((function(t,r){var a=e.pathname=="/records/".concat(c,"/").concat(r);return Object(d.jsx)("div",{onClick:function(e){n.push("/records/".concat(c,"/").concat(r)),e.stopPropagation()},children:Object(d.jsxs)("div",{"data-subview-index":r,class:a?"active":"",children:[Object(d.jsx)("div",{class:"notificationWrapperForSubview"}),t.label]})})}))]}):null]},c)})}})),t.hideBranding?null:Object(d.jsxs)("div",{class:"sidebarBranding",children:["Made with ",Object(d.jsx)("i",{class:"fas fa-heart"})," by Galadrim"]})]})},f=function(){var e=Object(c.useContext)(u.a).views[0];return e?"table"===e.type?Object(d.jsx)(o.a,{to:"/records/0"}):"iframe"===e.type?Object(d.jsx)(o.a,{to:"/iframe/0"}):"custom"===e.type?Object(d.jsx)(o.a,{to:"/customView/0"}):null:null},v=n(16),p=n(4),O=n.n(p),h=n(10),x=n(23),m=n(3),_=n.n(m),g=n(5),w=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useRef)(null);return Object(c.useEffect)((function(){return a.current&&(window.$(a.current).spectrum({preferredFormat:"hex",showInput:!0,chooseText:"OK",cancelText:"Annuler",color:null===r||void 0===r?void 0:r[t.name]}),window.$(a.current).on("change.spectrum",(function(e,c){n(Object(g.a)({},t.name,c.toHexString()))}))),function(){return window.$(a.current).off()}}),[a.current]),Object(d.jsx)("input",{ref:a,type:"text",onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))}})};window.Quill.prototype.getHTML=function(){return this.container.querySelector(".ql-editor").innerHTML};var y=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useRef)(null);return Object(c.useEffect)((function(){if(a.current&&!a.current.editor){var e=new window.Quill(a.current,{theme:"snow",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","link"],["image"],[{align:[]}],[{list:"ordered"},{list:"bullet"}],["clean"]]}});if(null===r||void 0===r?void 0:r[t.contentField])try{e.setContents(JSON.parse(null===r||void 0===r?void 0:r[t.contentField]))}catch(c){}return e.on("text-change",(function(){var c;n((c={},Object(g.a)(c,t.htmlField,e.getHTML()),Object(g.a)(c,t.contentField,JSON.stringify(e.getContents())),c))})),a.current.editor=e,e.off()}}),[a.current]),Object(d.jsx)("div",{class:"quillContainer",children:Object(d.jsx)("div",{class:"quill",ref:a,style:t.height?{height:t.height}:null})})},C=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=e.withTime,i=Object(c.useRef)(null);return Object(c.useEffect)((function(){if(i.current){var e=window.$(i.current).datepicker({language:"fr",autoClose:!0,onSelect:function(e,c){n(Object(g.a)({},t.name,window.moment(c).format(a?null:"YYYY-MM-DD")))}});(null===r||void 0===r?void 0:r[t.name])&&e.data("datepicker").selectDate(new Date(null===r||void 0===r?void 0:r[t.name]))}}),[i.current]),Object(d.jsx)("div",{children:Object(d.jsx)("input",{type:"text",ref:i,"data-timepicker":a?"true":"false"})})},I=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useRef)(null);return Object(c.useEffect)((function(){if(a.current&&window.google){var e=new window.google.maps.places.Autocomplete(a.current,t.componentRestrictions?{componentRestrictions:t.componentRestrictions}:{});e.addListener("place_changed",(function(){var c=e.getPlace();if(0!==c.length&&c.geometry){var r={latitudeField:function(e){return e.geometry.location.lat()},longitudeField:function(e){return e.geometry.location.lng()},addressField:function(e){return e.formatted_address},streetNumberField:function(e){var t;return null===(t=e.address_components.find((function(e){return"street_number"===e.type})))||void 0===t?void 0:t.long_name},routeField:function(e){var t;return null===(t=e.address_components.find((function(e){return"route"===e.type})))||void 0===t?void 0:t.long_name},localityField:function(e){var t;return null===(t=e.address_components.find((function(e){return"locality"===e.type})))||void 0===t?void 0:t.long_name},administrativeAreaLevel2Field:function(e){var t;return null===(t=e.address_components.find((function(e){return"administrative_area_level_2"===e.type})))||void 0===t?void 0:t.long_name},administrativeAreaLevel1Field:function(e){var t;return null===(t=e.address_components.find((function(e){return"administrative_area_level_1"===e.type})))||void 0===t?void 0:t.long_name},countryField:function(e){var t;return null===(t=e.address_components.find((function(e){return"country"===e.type})))||void 0===t?void 0:t.long_name},postalCodeField:function(e){var t;return null===(t=e.address_components.find((function(e){return"postal_code"===e.type})))||void 0===t?void 0:t.long_name}},i={};for(var l in r)t[l]&&(i[t[l]]=r[l](c));a.current.value=c.formatted_address,n(i)}}))}}),[a.current]),Object(c.useEffect)((function(){var e,t=function(){a.current&&(a.current.value="")};return null===a||void 0===a||null===(e=a.current)||void 0===e||e.addEventListener("focusout",t),function(){var e;return null===a||void 0===a||null===(e=a.current)||void 0===e?void 0:e.removeEventListener("focusout",t)}}),[a.current]),Object(d.jsx)("div",{children:Object(d.jsx)("input",{type:"text",placeholder:"",ref:a,defaultValue:null===r||void 0===r?void 0:r[t.name]})})},k=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useRef)(null),i=Object(c.useState)(!1),s=Object(l.a)(i,2),o=s[0],u=s[1],j=Object(c.useState)(null===r||void 0===r?void 0:r[t.name]),b=Object(l.a)(j,2),f=b[0],v=b[1],p=function(){var e=Object(h.a)(O.a.mark((function e(){var c,r,i;return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=new FormData(a.current),u(!0),e.next=4,_()({method:"post",url:"/uploadFile?subdirectory=".concat(t.subdirectory,"&publicPath=").concat(t.publicPath,"&s3Config=").concat(encodeURI(JSON.stringify(t.s3Config))),data:c,headers:{"Content-Type":"multipart/form-data"}});case 4:r=e.sent,i=Object(g.a)({},t.name,r.data.path),t.aspectRatioField&&(i[t.aspectRatioField]=r.data.aspectRatio),t.originalNameField&&(i[t.originalNameField]=r.data.originalFilename),n(i),u(!1),v(r.data.path);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=Math.random().toString();return Object(d.jsx)("div",{class:"fileInputContainer",children:Object(d.jsxs)("label",{htmlFor:x,children:[Object(d.jsx)("form",{ref:a,children:Object(d.jsx)("input",{type:"file",id:x,style:{display:"none"},name:"file",onChange:p})}),Object(d.jsxs)("div",{class:"fileInputContent ".concat(f?"":"clickToSelectFile"),children:[o?Object(d.jsx)("i",{class:"fa fa-circle-notch fa-spin"}):null,o||f?null:Object(d.jsx)("div",{children:"Cliquez pour s\xe9lectionner un fichier"}),!o&&f?Object(d.jsxs)("div",{class:"nonImageFileOutput",children:[Object(d.jsx)("span",{children:"Fichier t\xe9l\xe9charg\xe9"}),Object(d.jsx)("div",{class:"deleteFile",onClick:function(e){v(null);var c=Object(g.a)({},t.name,null);t.aspectRatioField&&(c[t.aspectRatioField]=null),t.originalNameField&&(c[t.originalNameField]=null),n(c),e.preventDefault()},children:Object(d.jsx)("i",{class:"fal fa-trash-alt"})})]}):null]})]})})},E=function(e){var t=e.column,n=e.onChange,r=e.initialData,a=Object(c.useState)(null),i=Object(l.a)(a,2),s=i[0],u=i[1],j=Object(o.i)().viewIndex;return Object(c.useEffect)((function(){_.a.post("/foreignSelectRecords",{viewIndex:j,columnId:t.__id__}).then((function(e){var c;u(e.data),n(Object(g.a)({},t.name,(null===r||void 0===r?void 0:r[t.name])||(t.optional?"NULL":null===(c=e.data[0])||void 0===c?void 0:c.value)))}))}),[]),null===s?Object(d.jsx)("i",{class:"fa fa-circle-notch fa-spin",style:{color:"#536579"}}):Object(d.jsxs)("select",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===r||void 0===r?void 0:r[t.name],children:[t.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,s.map((function(e){return Object(d.jsx)("option",{value:e.value,children:e.label},e.value)}))]})},D=function(e){var t,n=e.column,r=e.onChange,a=e.initialData,i=Object(c.useState)([]),s=Object(l.a)(i,2),u=s[0],j=s[1],b=Object(o.i)().viewIndex,f=Object(c.useState)(""),v=Object(l.a)(f,2),p=v[0],O=v[1],h=Object(c.useRef)(null),x=Object(c.useRef)(!1);Object(c.useEffect)((function(){_.a.post("/foreignSelectRecords",{viewIndex:b,columnId:n.__id__,query:p}).then((function(e){j(e.data)}))}),[p]),Object(c.useEffect)((function(){var e,t=function(){h.current&&!x.current&&(h.current.value="")};return null===h||void 0===h||null===(e=h.current)||void 0===e||e.addEventListener("focusout",t),function(){var e;return null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.removeEventListener("focusout",t)}}),[h.current]);var m=Math.random();return null===u?Object(d.jsx)("i",{class:"fa fa-circle-notch fa-spin",style:{color:"#536579"}}):Object(d.jsxs)("div",{children:[Object(d.jsx)("input",{type:"text",list:m,ref:h,onChange:function(e){var t,c,a=null!==(t=null===(c=u.find((function(t){return t.label===e.target.value})))||void 0===c?void 0:c.value)&&void 0!==t?t:null;x.current=!!a,O(e.target.value),r(Object(g.a)({},n.name,a))},defaultValue:null===(t=u.find((function(e){return e.value===(null===a||void 0===a?void 0:a[n.name])})))||void 0===t?void 0:t.label}),Object(d.jsxs)("datalist",{id:m,children:[n.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,u.map((function(e){return Object(d.jsx)("option",{value:e.label,children:e.label},e.value)}))]})]})},M=function(e){var t=e.column,n=e.onChange,c=e.initialData,r=t.dataType;return["int","double","float","decimal"].includes(r)?Object(d.jsx)("input",{type:"number",onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name]}):"tinyint"===r?Object(d.jsxs)("select",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name],children:[t.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,Object(d.jsx)("option",{value:"0",children:"Non"}),Object(d.jsx)("option",{value:"1",children:"Oui"})]}):"select"===r&&Array.isArray(t.options)?Object(d.jsxs)("select",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name],children:[t.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,t.options.map((function(e){return Object(d.jsx)("option",{value:e,children:e},e)}))]}):"select"===r?Object(d.jsxs)("select",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name],children:[t.optional?Object(d.jsx)("option",{value:"NULL",children:"-"}):null,Object.keys(t.options).map((function(e){return Object(d.jsx)("option",{value:e,children:t.options[e]},e)}))]}):"datalist"===r?Object(d.jsx)(D,{column:t,onChange:n,initialData:c}):"foreign"===r?Object(d.jsx)(E,{column:t,onChange:n,initialData:c}):"address"===r?Object(d.jsx)(I,{column:t,onChange:n,initialData:c}):"color"===r?Object(d.jsx)(w,{column:t,onChange:n,initialData:c}):"file"===r?Object(d.jsx)(k,{column:t,onChange:n,initialData:c}):"datetime"===r?Object(d.jsx)(C,{column:t,onChange:n,initialData:c,withTime:!0}):"date"===r?Object(d.jsx)(C,{column:t,onChange:n,initialData:c,withTime:!1}):"textarea"===r?Object(d.jsx)("textarea",{onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name]}):"richText"===r?Object(d.jsx)(y,{column:t,onChange:n,initialData:c}):Object(d.jsx)("input",{type:"text",onChange:function(e){return n(Object(g.a)({},t.name,e.target.value))},defaultValue:null===c||void 0===c?void 0:c[t.name]})},S=function(e){var t=e.text,n=Object(c.useState)(!1),r=Object(l.a)(n,2),a=r[0],i=r[1];return Object(d.jsxs)("div",{class:"labelTooltipContainer",onMouseLeave:function(){return i(!1)},children:[Object(d.jsx)("div",{class:"labelTooltipIcon",onMouseEnter:function(){return i(!0)},children:Object(d.jsx)("i",{class:"fa fa-question-circle"})}),a?Object(d.jsx)("div",{class:"tooltip",children:t}):null]})},T=function(){var e,t=Object(c.useContext)(u.a),n=Object(o.i)(),r=n.viewIndex,a=n.panelIndex,i=n.recordId,s=Object(o.g)(),j=t.views[r],b=a?j.recordViewPanels[a]:null,f=b?b.createConfig.columns:j.columns.filter((function(e){return e.dataType&&(!0===e.canEditOnCreation||!1!==e.canEdit)&&!e.hidden})),p={},m=Object(x.a)(f);try{for(m.s();!(e=m.n()).done;){var g=e.value;"tinyint"===g.dataType?p[g.name]=g.optional?"NULL":"0":"select"===g.dataType&&Array.isArray(g.options)?p[g.name]=g.options[0]:"select"===g.dataType&&(p[g.name]=Object.keys(g.options)[0]),g.defaultValue&&(p[g.name]=g.defaultValue)}}catch(D){m.e(D)}finally{m.f()}var w=Object(c.useRef)(p),y=Object(c.useState)(!1),C=Object(l.a)(y,2),I=C[0],k=C[1],E=function(){var e=Object(h.a)(O.a.mark((function e(){var t,n,c;return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t in j.createFilters)w.current[t]=j.createFilters[t];return k(!0),e.prev=2,e.next=5,_.a.post("/createRecord",{viewIndex:r,panelIndex:a,recordId:i,data:w.current});case 5:c=e.sent,k(!1),i?s.push("/record/".concat(r,"/").concat(i)):(null===j||void 0===j||null===(n=j.createConfig)||void 0===n?void 0:n.redirectToCreatedItems)?s.push("/record/".concat(r,"/").concat(c.data.id)):s.push("/records/".concat(r)),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(2),e.t0.response.responseText&&window.swal({title:"Erreur",text:e.t0.response.responseText,dangerMode:!0}),k(!1);case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{class:"view",children:[Object(d.jsx)("div",{class:"viewHeader",children:Object(d.jsx)("div",{class:"viewTitle",children:b?b.createConfig.label:"Cr\xe9er ".concat(j.aNewSingular)})}),Object(d.jsxs)("div",{class:"paddedView",children:[Object(d.jsx)("div",{class:"form",children:f.map((function(e,t){return Object(d.jsxs)("div",{class:"formElement",children:[Object(d.jsxs)("div",{class:"formLabel",children:[e.label,e.labelTooltip?Object(d.jsx)(S,{text:e.labelTooltip}):null]}),Object(d.jsx)("div",{class:"formInput",children:Object(d.jsx)(M,{column:e,onChange:function(e){w.current=Object(v.a)(Object(v.a)({},w.current),e)}})})]},t)}))}),Object(d.jsx)("div",{class:"button greenButton ".concat(I?"loading":""),onClick:E,children:I?"Sauvegarde en cours...":"Cr\xe9er"}),Object(d.jsx)("div",{class:"button",onClick:function(){return s.goBack()},children:"Annuler"})]})]})},P=function(){var e=Object(c.useContext)(u.a),t=Object(o.i)(),n=t.viewIndex,r=t.recordId,a=Object(o.g)(),i=e.views[n],s=Object(c.useState)(null),j=Object(l.a)(s,2),b=j[0],f=j[1],p=i.columns.filter((function(e){return e.dataType&&!1!==e.canEdit&&!e.hidden})),x=Object(c.useRef)({}),m=Object(c.useState)(!1),g=Object(l.a)(m,2),w=g[0],y=g[1];Object(c.useEffect)((function(){_.a.get("/record",{params:{viewIndex:n,recordId:r}}).then((function(e){x.current={},f(e.data)}))}),[n,r]);var C=function(){var e=Object(h.a)(O.a.mark((function e(){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.prev=1,e.next=4,_.a.post("/updateRecord",{viewIndex:n,primaryValue:r,data:x.current});case 4:y(!1),a.push("/record/".concat(n,"/").concat(r)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),e.t0.response.responseText&&window.swal({title:"Erreur",text:e.t0.response.responseText,dangerMode:!0}),y(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(d.jsxs)("div",{class:"view",children:[Object(d.jsx)("div",{class:"viewHeader",children:Object(d.jsx)("div",{class:"viewTitle",children:i.label})}),Object(d.jsx)("div",{class:"paddedView",children:b?Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)("div",{class:"form",children:p.map((function(e,t){return Object(d.jsxs)("div",{class:"formElement",children:[Object(d.jsxs)("div",{class:"formLabel",children:[e.label,e.labelTooltip?Object(d.jsx)(S,{text:e.labelTooltip}):null]}),Object(d.jsx)("div",{class:"formInput",children:Object(d.jsx)(M,{column:e,initialData:b,onChange:function(e){x.current=Object(v.a)(Object(v.a)({},x.current),e)}})})]},t)}))}),Object(d.jsx)("div",{class:"button greenButton ".concat(w?"loading":""),onClick:C,children:w?"Sauvegarde en cours...":"Sauvegarder"}),Object(d.jsx)("div",{class:"button",onClick:function(){return a.goBack()},children:"Annuler"})]}):null})]})},A=n(28),L=function(e){var t=e.view,n=e.viewIndex,r=e.subviewIndex,a=e.currentFilters,i=e.orderBy,s=e.isDesc,o=e.query,u=Object(c.useState)(!1),j=Object(l.a)(u,2),b=j[0],f=j[1];return Object(d.jsx)("div",{class:"downloadButton",onClick:function(){f(!0),_.a.post("/recordsExport",{viewIndex:n,subviewIndex:r,filters:a.map((function(e){return e.query})),orderBy:i,isDesc:s,query:o}).then((function(e){f(!1),window.download(e.data.content,t.label+".csv")}))},children:Object(d.jsx)("i",{class:"fa ".concat(b?"fa-spin fa-circle-notch":"fa-cloud-download")})})};function R(e){var t,n,r=Object(c.useRef)(null);return t=r,n=e.onOutsideClick,Object(c.useEffect)((function(){function e(e){t.current&&!t.current.contains(e.target)&&n()}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[t]),Object(d.jsx)("div",{ref:r,children:e.children})}var F=function(e){var t=e.view,n=e.refreshData,r=e.onAddFilter,a=Object(c.useState)(!1),i=Object(l.a)(a,2),s=i[0],o=i[1],u=Object(c.useState)(null),j=Object(l.a)(u,2),b=j[0],f=j[1],v=Object(c.useState)("contains"),p=Object(l.a)(v,2),O=p[0],h=p[1],x=Object(c.useState)(null),m=Object(l.a)(x,2),_=m[0],g=m[1];return Object(d.jsx)(R,{onOutsideClick:function(){return o(!1)},children:Object(d.jsxs)("div",{class:"button openFilterPopup",onClick:function(){return o(!s)},children:[Object(d.jsx)("i",{class:"fas fa-filter"})," Ajouter un filtre",s?Object(d.jsxs)("div",{class:"addFilterPopup",onClick:function(e){return e.stopPropagation()},children:[Object(d.jsx)("div",{class:"filterLabel",children:"Champ"}),Object(d.jsxs)("select",{onChange:function(e){return f(e.target.value)},children:[Object(d.jsx)("option",{value:"",children:"S\xe9lectionnez un champ"}),t.columns.filter((function(e){return(e.searchableName||e.name)&&"foreign"!==e.dataType&&"datalist"!==e.dataType})).map((function(e){var t=e.searchableName||e.name;return Object(d.jsx)("option",{value:t,children:e.label},t)}))]}),Object(d.jsx)("div",{class:"filterLabel",children:"Op\xe9rateur"}),Object(d.jsxs)("select",{onChange:function(e){return h(e.target.value)},children:[Object(d.jsx)("option",{value:"contains",children:"contient"}),Object(d.jsx)("option",{value:"notContains",children:"ne contient pas"}),Object(d.jsx)("option",{value:"startsWith",children:"commence par"}),Object(d.jsx)("option",{value:"endsWith",children:"finit par"}),Object(d.jsx)("option",{value:"is",children:"est"}),Object(d.jsx)("option",{value:"isNot",children:"n'est pas"}),Object(d.jsx)("option",{value:"largerThan",children:"est sup\xe9rieur \xe0"}),Object(d.jsx)("option",{value:"smallerThan",children:"est inf\xe9rieur \xe0"})]}),Object(d.jsx)("div",{class:"filterLabel",children:"Valeur"}),Object(d.jsx)("input",{onChange:function(e){return g(e.target.value)}}),Object(d.jsx)("div",{class:"button greenButton",onClick:function(){if(b&&_){var e,c=null===(e=t.columns.find((function(e){return(e.searchableName||e.name)===b})))||void 0===e?void 0:e.label;"contains"===O?r({label:c+" contient "+_,query:b+" LIKE '%"+_+"%'"}):"notContains"===O?r({label:c+" ne contient pas "+_,query:b+" NOT LIKE '%"+_+"%'"}):"is"===O?r({label:c+" est "+_,query:b+" = '"+_+"'"}):"isNot"===O?r({label:c+" n'est pas "+_,query:b+" != '"+_+"'"}):"startsWith"===O?r({label:c+" commence par "+_,query:b+" LIKE '"+_+"%'"}):"endsWith"===O?r({label:c+" finit par "+_,query:b+" LIKE '%"+_+"'"}):"largerThan"===O?r({label:c+" sup\xe9rieur \xe0 "+_,query:b+" >= "+_}):"smallerThan"===O&&r({label:c+" inf\xe9rieur \xe0 "+_,query:b+" <= "+_}),f(null),g(null),o(!1),n()}},children:"Ajouter"})]}):null]})})},B=function(e){var t,n,r=e.viewIndex,a=e.selectedRecordIds,i=e.refreshData,s=Object(c.useContext)(u.a),o=s.views[r],j=Object(c.useState)(!1),b=Object(l.a)(j,2),f=b[0],v=b[1];return!s.hideMultiselect&&(!1!==o.canDelete||(null===(t=o.customActions)||void 0===t?void 0:t.length)>0)?Object(d.jsx)(R,{onOutsideClick:function(){return v(!1)},children:Object(d.jsxs)("div",{class:"actionButtonsContainer",children:[Object(d.jsx)("div",{class:"button openBulkActionsButton",onClick:function(){return v(!f)},children:"Actions"}),f?Object(d.jsxs)("div",{class:"bulkActions",children:[null===(n=o.customActions)||void 0===n?void 0:n.map((function(e,t){return Object(d.jsx)("div",{class:"action recordAction",onClick:(n=t,function(){v(!1),_.a.post("customAction",{viewIndex:r,actionIndex:n,selectedRecordIds:a}).then((function(e){e.data.message&&alert(e.data.message),i()})).catch((function(){window.swal({title:"Erreur",text:"L'action a \xe9chou\xe9",dangerMode:!0})}))}),children:e.label});var n})),!1!==o.canDelete?Object(d.jsx)("div",{class:"action recordAction red",onClick:function(){window.swal({title:"\xcates-vous s\xfbr ?",text:"Une fois la suppression confirm\xe9e, il ne sera pas possible de revenir en arri\xe8re.",buttons:["Annuler","Oui"],dangerMode:!0}).then((function(e){e&&_.a.post("deleteRecords",{viewIndex:r,primaryValues:a}).then((function(){i()})).catch((function(){window.swal({title:"Erreur",text:"Suppression impossible",dangerMode:!0})}))}))},children:"Supprimer"}):null]}):null]})}):null},q=n(15),V=function(e,t,n){if(e.showAsPicture){var c=e.baseUrl+t[e.pathField];return t[e.pathField]?Object(d.jsx)("a",{href:c,target:"_blank",children:Object(d.jsx)("img",{src:c,style:{width:n?60:300,height:n?30:150,objectFit:"contain"}})}):null}if(e.formatValue)return Object(d.jsx)("div",{dangerouslySetInnerHTML:{__html:t["__formatValue-".concat(e.__id__,"__")]}});if(e.formattedValue)return Object(d.jsx)("div",{children:Object(q.a)(e.formattedValue,t)});if(e.action){if(e.actionDisplayCondition)if(!Object(q.a)(e.actionDisplayCondition,t))return"";var r=JSON.parse(JSON.stringify(e.data));for(var a in r)r[a]=Object(q.a)(r[a],t);return Object(d.jsx)("div",{class:"actionButton","data-route":'" + column.route + "',"data-data":'" + JSON.stringify(data) + "',children:e.action})}return"tinyint"===e.dataType?Object(d.jsx)("div",{children:1===t[e.name]?"Oui":"Non"}):"color"===e.dataType?Object(d.jsx)("div",{class:"colorPreview",style:{backgroundColor:t[e.name]}}):"richText"===e.dataType?Object(d.jsx)("div",{dangerouslySetInnerHTML:{__html:t[e.htmlField]}}):"select"===e.dataType&&e.options&&e.options.constructor==Object?Object(d.jsx)("div",{children:e.options[t[e.name]]}):Object(d.jsx)("div",{children:t[e.name]})},N=function(){var e,t,n=Object(o.i)(),r=n.viewIndex,a=n.subviewIndex,i=Object(o.g)(),j=Object(c.useState)(1),b=Object(l.a)(j,2),f=b[0],v=b[1],p=Object(c.useState)([]),O=Object(l.a)(p,2),h=O[0],x=O[1],m=Object(c.useState)(null),g=Object(l.a)(m,2),w=g[0],y=g[1],C=Object(c.useState)(null),I=Object(l.a)(C,2),k=I[0],E=I[1],D=Object(c.useState)(null),M=Object(l.a)(D,2),S=M[0],T=M[1],P=Object(c.useState)([]),R=Object(l.a)(P,2),q=R[0],N=R[1],U=Object(c.useState)(null),W=Object(l.a)(U,2),K=W[0],H=W[1],J=Object(c.useContext)(u.a),Q=J.views[r],z=null===(e=Q.columns)||void 0===e?void 0:e.filter((function(e){return!e.hideInTable&&!e.hidden}));function Y(){H(null),_.a.post("/records",{viewIndex:r,subviewIndex:a,page:f,filters:h.map((function(e){return e.query})),orderBy:w,isDesc:k,query:S}).then((function(e){H(e.data)}))}return Object(c.useEffect)((function(){v(1),T(null),y(null),E(null),q.length>0&&N([]),h.length>0&&x([])}),[r]),Object(c.useEffect)((function(){Y()}),[r,a,f,S,h,w,k]),Object(d.jsxs)("div",{class:"view",children:[Object(d.jsxs)("div",{class:"scrollable",children:[Object(d.jsxs)("div",{class:"viewHeader",children:[Object(d.jsx)("div",{class:"viewTitle",children:Q.label}),Object(d.jsxs)("div",{class:"viewHeaderActions",children:[Object(d.jsxs)("div",{class:"searchBarContainer",children:[Object(d.jsx)("input",{type:"text",placeholder:"Rechercher",class:"searchBar",onChange:function(e){return T(e.target.value)}}),Object(d.jsx)("div",{class:"searchBarIcon",children:Object(d.jsx)("i",{class:"fa fa-search"})})]}),Object(d.jsx)(B,{viewIndex:r,selectedRecordIds:q,refreshData:Y}),Object(d.jsx)(F,{view:Q,refreshData:Y,onAddFilter:function(e){return x([].concat(Object(A.a)(h),[e]))}}),Object(d.jsx)(L,{view:Q,viewIndex:r,subviewIndex:a,currentFilters:h,orderBy:w,isDesc:k,query:S}),Q.canCreate?Object(d.jsx)(s.b,{to:"/createRecord/".concat(r),children:Object(d.jsx)("div",{class:"plusButton",children:Object(d.jsx)("i",{class:"fa fa-plus"})})}):null]})]}),h.length>0?Object(d.jsx)("div",{class:"filtersContainer",children:h.map((function(e,t){return Object(d.jsxs)("div",{class:"filterItem",children:[Object(d.jsx)("div",{class:"filterItemLabel",children:e.label}),Object(d.jsx)("div",{class:"filterRemove",onClick:function(){x(h.filter((function(t){return t.query!==e.query})))},children:Object(d.jsx)("i",{class:"fa fa-times"})})]},t)}))}):null,Object(d.jsxs)("table",{class:"table",children:[Object(d.jsx)("thead",{children:Object(d.jsxs)("tr",{children:[J.hideMultiselect?null:Object(d.jsx)("th",{}),z.map((function(e,t){var n="foreign"===e.dataType||"datalist"===e.dataType?e.formattedValue:e.sortName||e.name;return Object(d.jsxs)("th",{class:n?"sortable":"",onClick:function(){n&&(y(n),E(w===n&&!k))},children:[e.label,n?Object(d.jsx)("div",{class:"columnSortIcon",children:Object(d.jsx)("i",{class:"fas fa-sort".concat(!0===k&&n===w?"-down":!1===k&&n===w?"-up":"")})}):null]},t)}))]})}),Object(d.jsxs)("tbody",{children:[K?null:Array.from({length:10}).map((function(e,t){return Object(d.jsx)("tr",{class:"record",children:Array.from({length:z.length+(J.hideMultiselect?0:1)}).map((function(e,t){return Object(d.jsx)("td",{children:" "},t)}))},t)})),null===K||void 0===K||null===(t=K.records)||void 0===t?void 0:t.map((function(e){var t=e[Q.primaryId];return Object(d.jsxs)("tr",{class:"record ".concat(Q.notClickable?"nonClickableRow":""),onClick:function(e){"A"!=e.target.tagName?Q.notClickable||i.push("/record/".concat(r,"/").concat(t)):e.stopPropagation()},children:[J.hideMultiselect?null:Object(d.jsx)("td",{class:"checkboxParent",onClick:function(e){N(q.includes(t)?q.filter((function(e){return e!==t})):[].concat(Object(A.a)(q),[t])),e.stopPropagation()},children:Object(d.jsx)("div",{class:"checkbox ".concat(q.includes(t)?"checked":"")})}),z.map((function(t,n){return Object(d.jsx)("td",{children:V(t,e,!0)},n)}))]},t)}))]})]})]}),Object(d.jsxs)("div",{class:"tableFooter",children:[Object(d.jsxs)("div",{class:"tableCounter",children:[(null===K||void 0===K?void 0:K.count)||"-"," ",Q.label]}),Object(d.jsxs)("div",{class:"paginator",children:[Object(d.jsx)("div",{class:"paginatorLeft",onClick:function(){return v(Math.max(1,f-1))},children:Object(d.jsx)("i",{class:"fas fa-caret-left"})}),Object(d.jsxs)("div",{class:"paginatorNumber",children:[f," / ",K?Math.ceil(K.count/(Q.limit||10)):"-"]}),Object(d.jsx)("div",{class:"paginatorRight",onClick:function(){return v(Math.min(f+1,Math.ceil(K.count/(Q.limit||10))))},children:Object(d.jsx)("i",{class:"fas fa-caret-right"})})]})]})]})},U=function(e){var t,n,r=e.viewIndex,a=e.record,i=e.refreshData,s=Object(c.useContext)(u.a).views[r],j=Object(c.useState)(!1),b=Object(l.a)(j,2),f=b[0],v=b[1],p=Object(o.g)(),x=function(){var e=Object(h.a)(O.a.mark((function e(){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.swal({title:"\xcates-vous s\xfbr ?",text:"Une fois la suppression confirm\xe9e, il ne sera pas possible de revenir en arri\xe8re.",buttons:["Annuler","Oui"],dangerMode:!0});case 2:if(!e.sent){e.next=14;break}return s.deleteCallback&&_.a.post(s.deleteCallback,{id:a[s.primaryId],data:a}),e.prev=5,e.next=8,_.a.post("/deleteRecord",{viewIndex:r,primaryValue:a[s.primaryId]});case 8:p.push("/records/".concat(r)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),window.swal({title:"Erreur",text:"Suppression impossible",dangerMode:!0});case 14:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(){return e.apply(this,arguments)}}();return!0===s.canDuplicate||!1!==s.canDelete||(null===(t=s.customActions)||void 0===t?void 0:t.length)>0?Object(d.jsx)(R,{onOutsideClick:function(){return v(!1)},children:Object(d.jsxs)("div",{class:"actionButtonsContainer",children:[Object(d.jsx)("div",{class:"button openActionsButton",onClick:function(){return v(!f)},children:"Actions"}),f?Object(d.jsxs)("div",{class:"actions",children:[null===(n=s.customActions)||void 0===n?void 0:n.map((function(e,t){return Object(d.jsx)("div",{class:"action recordAction",onClick:(n=t,function(){v(!1),_.a.post("customAction",{viewIndex:r,actionIndex:n,selectedRecordIds:[a[s.primaryId]]}).then((function(e){e.data.message&&alert(e.data.message),i()})).catch((function(){window.swal({title:"Erreur",text:"L'action a \xe9chou\xe9",dangerMode:!0})}))}),children:e.label});var n})),!0===s.canDuplicate?Object(d.jsx)("div",{class:"action recordAction duplicateRecord",children:"Dupliquer"}):null,!1!==s.canDelete?Object(d.jsx)("div",{class:"action recordAction red",onClick:x,children:"Supprimer"}):null]}):null]})}):null},W=function(){var e=Object(o.g)();return Object(d.jsx)("div",{class:"button backButton",onClick:function(){return e.goBack()},children:"Retour"})},K=function(e){var t=e.record,n=e.panel;return Object(d.jsx)("div",{class:"downloadPanelButton",onClick:function(){_.a.get("/customQuery",{params:{query:n.query||Object(q.a)(n.formattedQuery,t),primaryValue:2630}}).then((function(e){var t=e.data,c=[];c.push(Object.keys(t[0]).filter((function(e){return e!==n.primaryId})).join(","));var r,a=Object(x.a)(t);try{var i=function(){var e=r.value;c.push(Object.keys(e).filter((function(e){return e!==n.primaryId})).map((function(t){return n.formattedValues&&t in n.formattedValues?Object(q.a)(n.formattedValues[t],e):e[t]})).join(","))};for(a.s();!(r=a.n()).done;)i()}catch(l){a.e(l)}finally{a.f()}window.download(c.join("\r\n"),n.label+".csv")}))},children:Object(d.jsx)("i",{class:"fa fa-cloud-download"})})},H=function(e){var t=e.panel,n=e.record,r=e.view,a=Object(c.useState)(null),i=Object(l.a)(a,2),s=i[0],j=i[1],b=Object(o.g)(),f=Object(o.i)().viewIndex,v=Object(c.useContext)(u.a);Object(c.useEffect)((function(){p()}),[]);var p=function(){_.a.get("/customQuery",{params:{query:t.query||Object(q.a)(t.formattedQuery,n),primaryValue:n[r.primaryId]}}).then((function(e){j(e.data)}))},x=function(){var e=Object(h.a)(O.a.mark((function e(n){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.swal({title:"\xcates-vous s\xfbr ?",text:"Une fois la suppression confirm\xe9e, il ne sera pas possible de revenir en arri\xe8re.",buttons:["Annuler","Oui"],dangerMode:!0});case 2:if(!e.sent){e.next=13;break}return e.prev=4,e.next=7,_.a.post("/deleteRecordFromPanel",{viewIndex:f,panelId:t.__id__,primaryValue:n[t.primaryId]});case 7:p(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),window.swal({title:"Erreur",text:"Suppression impossible",dangerMode:!0});case 13:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t){return e.apply(this,arguments)}}();return Object(d.jsx)("div",{children:(null===s||void 0===s?void 0:s.length)>0?Object(d.jsxs)("table",{class:"table panelTable ".concat(t.folded?"folded":""),children:[Object(d.jsx)("thead",{children:Object(d.jsxs)("tr",{children:[Object.keys(s[0]).filter((function(e){return e!==t.primaryId})).map((function(e){return Object(d.jsx)("th",{children:e},e)})),t.canDelete?Object(d.jsx)("th",{}):null]})}),Object(d.jsx)("tbody",{children:s.map((function(e){return Object(d.jsxs)("tr",{class:"record ".concat(t.canShow?"":"nonClickableRow"),onClick:function(){var n=v.views.findIndex((function(e){return"table"===e.type&&e.tableName===t.tableName}));t.canShow&&b.push("/record/".concat(n,"/").concat(e[t.primaryId]))},children:[Object.keys(e).filter((function(e){return e!==t.primaryId})).map((function(n){return Object(d.jsx)("td",{children:Object(d.jsx)("div",{dangerouslySetInnerHTML:{__html:t.formattedValues&&n in t.formattedValues?Object(q.a)(t.formattedValues[n],e):e[n]}})},n)})),t.canDelete?Object(d.jsx)("td",{class:"deleteIconCell",children:Object(d.jsx)("div",{class:"deleteIcon",onClick:function(t){x(e),t.stopPropagation()},children:Object(d.jsx)("i",{class:"fa fa-minus"})})}):null]})}))})]}):0===(null===s||void 0===s?void 0:s.length)?Object(d.jsx)("div",{class:"noData panelTable ".concat(t.folded?"folded":""),children:"Aucune donn\xe9e"}):null})},J=function(e){var t=e.panel,n=e.record,r=e.view,a=Object(c.useState)(null),i=Object(l.a)(a,2),s=i[0],u=i[1],j=(Object(o.g)(),Object(o.i)().viewIndex);Object(c.useEffect)((function(){b()}),[t.query]);var b=function(){_.a.get("/customQuery",{params:{query:t.query,primaryValue:n[r.primaryId]}}).then((function(e){u(e.data)}))},f=function(){var e=Object(h.a)(O.a.mark((function e(n){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.swal({title:"\xcates-vous s\xfbr ?",text:"Une fois la suppression confirm\xe9e, il ne sera pas possible de revenir en arri\xe8re.",buttons:["Annuler","Oui"],dangerMode:!0});case 2:if(!e.sent){e.next=13;break}return e.prev=4,e.next=7,_.a.post("/deleteRecordFromPanel",{viewIndex:j,panelId:t.__id__,primaryValue:n[t.primaryId]});case 7:b(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),window.swal({title:"Erreur",text:"Suppression impossible",dangerMode:!0});case 13:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t){return e.apply(this,arguments)}}(),v=t.pathField||"Path";return Object(d.jsx)("div",{children:(null===s||void 0===s?void 0:s.length)>0?Object(d.jsx)("div",{class:"gallery",children:s.map((function(e){return Object(d.jsxs)("div",{class:"galleryPicture",children:[t.canDelete?Object(d.jsx)("div",{class:"deleteIcon",onClick:function(t){f(e),t.stopPropagation()},children:Object(d.jsx)("i",{class:"fa fa-minus"})}):null,Object(d.jsx)("a",{href:t.baseUrl+e[v],target:"_blank",children:Object(d.jsx)("img",{src:t.baseUrl+e[v],style:{width:"100%",height:150,objectFit:t.objectFit||"cover"},onerror:"this.style.height = 0"})})]},e[v])}))}):0===(null===s||void 0===s?void 0:s.length)?Object(d.jsx)("div",{class:"noData panelTable ".concat(t.folded?"folded":""),children:"Aucune donn\xe9e"}):null})},Q=function(e){var t=e.panel,n=e.record,r=e.view,a=Object(c.useRef)();Object(c.useEffect)((function(){window.google&&n&&(t.query?_.a.get("/customQuery",{query:t.query,primaryValue:n[r.primaryId]}).then((function(e){var n,c=null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n[0];c&&i(c.Lat,c.Lng,t.zoom||12)})):i(n[t.latitudeField],n[t.longitudeField],t.zoom||12))}),[n,window.google]);var i=function(e,t,n){var c=new window.google.maps.Map(a.current,{zoom:n,center:{lat:e,lng:t}});new window.google.maps.Marker({position:{lat:e,lng:t},map:c})};return Object(d.jsx)("div",{class:"map",ref:a})},z=function(){var e,t=Object(c.useContext)(u.a),n=Object(o.i)(),r=n.viewIndex,a=n.recordId,i=Object(c.useState)(null),j=Object(l.a)(i,2),b=j[0],f=j[1],v=t.views[r],p=null===(e=v.columns)||void 0===e?void 0:e.filter((function(e){return!e.hidden}));Object(c.useEffect)((function(){O()}),[r,a]);var O=function(){_.a.get("/record",{params:{viewIndex:r,recordId:a}}).then((function(e){f(e.data)}))};return Object(d.jsxs)("div",{class:"view backgroundBlue",children:[Object(d.jsxs)("div",{class:"viewHeader",children:[Object(d.jsx)("div",{class:"viewTitle",children:v.label}),Object(d.jsxs)("div",{class:"viewHeaderActions",children:[Object(d.jsx)("div",{class:"button adjacentButton prevButton",children:"\u25c4"}),Object(d.jsx)("div",{class:"button adjacentButton nextButton",children:"\u25ba"}),Object(d.jsx)(W,{}),Object(d.jsx)(U,{viewIndex:r,record:b,refreshData:O}),!1!==v.canEdit?Object(d.jsx)(s.b,{to:"/editRecord/".concat(r,"/").concat(a),children:Object(d.jsx)("div",{class:"button greenButton recordAction",children:"Modifier"})}):null]})]}),Object(d.jsx)("div",{class:"paddedView",children:Object(d.jsxs)("div",{class:"showContainer",children:[Object(d.jsxs)("div",{class:"panel detailsPanel",children:[Object(d.jsx)("div",{class:"panelTitle",children:"D\xe9tails"}),b?p.map((function(e,t){return Object(d.jsxs)("div",{class:"showRecordField",children:[Object(d.jsx)("div",{class:"formLabel",children:e.label}),Object(d.jsx)("div",{class:"formValue",children:V(e,b,!1)||"-"})]},t)})):null]}),v.recordViewPanels&&b?Object(d.jsx)("div",{class:"recordViewPanels",children:v.recordViewPanels.map((function(e,t){return Object(d.jsxs)("div",{class:"panel",children:[Object(d.jsxs)("div",{class:"panelHeader",children:[Object(d.jsx)("div",{class:"viewTitle",children:e.label}),Object(d.jsxs)("div",{class:"viewHeaderActions",children:[e.folded?Object(d.jsx)("div",{class:"button smallButton unfoldPanel",children:"Afficher"}):null,e.canCreate?Object(d.jsx)(s.b,{to:"/createRecord/".concat(r,"/").concat(t,"/").concat(a),children:Object(d.jsx)("div",{class:"plusButton",children:Object(d.jsx)("i",{class:"fa fa-plus"})})}):null,e.canDownload&&"table"===e.type?Object(d.jsx)(K,{record:b,panel:e}):null]})]}),"table"===e.type?Object(d.jsx)(H,{record:b,panel:e,view:v}):null,"gallery"===e.type?Object(d.jsx)(J,{record:b,panel:e,view:v}):null,"map"===e.type?Object(d.jsx)(Q,{record:b,panel:e,view:v}):null]},t)}))}):null]})})]})},Y=n.p+"static/media/logo.e407b9ca.png",$=function(e){var t=e.setIsAuthenticated,n=Object(c.useState)(""),r=Object(l.a)(n,2),a=r[0],i=r[1],s=Object(c.useState)(""),o=Object(l.a)(s,2),u=o[0],j=o[1],b=function(){var e=Object(h.a)(O.a.mark((function e(){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_.a.post("/login",{username:a,password:u});case 2:e.sent.data.success&&t(!0);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(d.jsx)("div",{class:"loginPanelBackground",children:Object(d.jsxs)("div",{class:"loginPanel",children:[Object(d.jsx)("div",{class:"loginLogoContainer",children:Object(d.jsx)("img",{class:"loginLogo",src:Y})}),Object(d.jsx)("label",{children:"Nom d'utilisateur"}),Object(d.jsx)("input",{type:"text",name:"username",onChange:function(e){return i(e.target.value)}}),Object(d.jsx)("label",{children:"Mot de passe"}),Object(d.jsx)("input",{type:"password",name:"password",onChange:function(e){return j(e.target.value)}}),Object(d.jsx)("button",{class:"button greenButton fullWidth",onClick:b,children:"Se connecter"})]})})},G=function(){var e=Object(c.useContext)(u.a),t=Object(o.i)().viewIndex,n=e.views[t];return Object(d.jsx)("div",{class:"view",children:Object(d.jsx)("iframe",{src:n.src})})},X=n(44),Z=n(40),ee=["componentPath","children"],te={react:function(){return{exports:r.a}},axios:function(){return{exports:_.a}},"styled-components":function(){return{exports:Z.a}}};function ne(e,t,n){var c=Object.create(n);return function n(r){if(r in c||t!==r){if(!(r in c))throw"Module '".concat(r,"' not found")}else{var a={exports:{}};c[r]=function(){return a},Function("require, exports, module",e)(n,a.exports,a)}return c[r]().exports}(t)}function ce(e){return re.apply(this,arguments)}function re(){return(re=Object(h.a)(O.a.mark((function e(t){var n,c;return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_.a.get("/customComponent",{params:{componentPath:t}});case 3:return n=e.sent,c=n.data,e.abrupt("return",{default:ne(c,"__moduleName__",te)});case 8:return e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",{default:function(){return Object(d.jsx)("div",{children:"Erreur de rendu"})}});case 12:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}var ae=function(e){var t=e.componentPath,n=e.children,a=Object(X.a)(e,ee),i=Object(c.useMemo)((function(){return r.a.lazy(Object(h.a)(O.a.mark((function e(){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ce(t));case 1:case"end":return e.stop()}}),e)}))))}),[t]);return Object(d.jsx)(c.Suspense,{fallback:null,children:Object(d.jsx)(i,Object(v.a)(Object(v.a)({},a),{},{children:n}))})},ie=r.a.memo(ae),le=function(){var e=Object(c.useContext)(u.a),t=Object(o.i)().viewIndex,n=e.views[t].componentPath;return Object(d.jsx)(ie,{componentPath:n})};_.a.defaults.withCredentials=!0,_.a.defaults.baseURL="/_HOMEPAGE_/api";var se=function(){var e=Object(c.useState)(null),t=Object(l.a)(e,2),n=t[0],r=t[1];return Object(c.useEffect)((function(){_.a.get("/isAuthenticated").then((function(e){r(e.data.isAuthenticated)}))}),[]),Object(d.jsx)("div",{id:"body",children:!0===n?Object(d.jsx)(u.b,{children:Object(d.jsxs)(s.a,{basename:"/_HOMEPAGE_",children:[Object(d.jsx)(b,{}),Object(d.jsxs)(o.d,{children:[Object(d.jsx)(o.b,{path:"/records/:viewIndex/:subviewIndex?",children:Object(d.jsx)(N,{})}),Object(d.jsx)(o.b,{path:"/record/:viewIndex/:recordId",children:Object(d.jsx)(z,{})}),Object(d.jsx)(o.b,{path:"/editRecord/:viewIndex/:recordId",children:Object(d.jsx)(P,{})}),Object(d.jsx)(o.b,{path:"/createRecord/:viewIndex/:panelIndex?/:recordId?",children:Object(d.jsx)(T,{})}),Object(d.jsx)(o.b,{path:"/iframe/:viewIndex",children:Object(d.jsx)(G,{})}),Object(d.jsx)(o.b,{path:"/customView/:viewIndex",children:Object(d.jsx)(le,{})}),Object(d.jsx)(o.b,{path:"/",children:Object(d.jsx)(f,{})})]})]})}):!1===n?Object(d.jsx)($,{setIsAuthenticated:r}):Object(d.jsx)("div",{class:"appLoading",children:Object(d.jsx)("i",{class:"fa fa-circle-notch fa-spin"})})})};i.a.render(Object(d.jsx)(r.a.StrictMode,{children:Object(d.jsx)(se,{})}),document.getElementById("root"))}},[[75,1,2]]]);
|
|
2
|
+
//# sourceMappingURL=main.50297a9d.chunk.js.map
|