@artibet/react-mui-components 3.7.27 → 3.7.28

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/modals/index.js CHANGED
@@ -1 +1 @@
1
- import e from"react";import{TextField as t,Typography as r,Autocomplete as n,Chip as o,InputAdornment as i,IconButton as l,Dialog as a,Zoom as u,DialogTitle as c,Stack as d,Box as s,Divider as m,DialogContent as f,DialogActions as v,Button as h,CircularProgress as p,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as E}from"react-hook-form";import{yupResolver as y}from"@hookform/resolvers/yup";import*as x from"yup";import{ChromePicker as w}from"react-color";import{toDate as C}from"date-fns";import"date-fns/locale";import S from"axios";import{NumericFormat as q}from"react-number-format";import{AdapterDateFns as L}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as k}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as W,renderDigitalClockTimeView as T,DatePicker as O,TimePicker as V}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as j,EditNoteRounded as R}from"@mui/icons-material";import z from"@mui/icons-material/WarningAmberRounded";import D from"@mui/icons-material/ErrorOutlineRounded";import B from"@mui/icons-material/CheckCircleOutlineRounded";function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function F(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}function N(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function l(e){F(i,n,o,l,a,"next",e)}function a(e){F(i,n,o,l,a,"throw",e)}l(void 0)}))}}function I(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(null,arguments)}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){I(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,l=Object.create(i.prototype),a=new O(n||[]);return o(l,"_invoke",{value:L(e,r,a)}),l}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var m="suspendedStart",f="suspendedYield",v="executing",h="completed",p={};function b(){}function g(){}function E(){}var y={};c(y,l,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(V([])));w&&w!==r&&n.call(w,l)&&(y=w);var C=E.prototype=b.prototype=Object.create(y);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function q(e,t){function r(o,i,l,a){var u=s(e[o],e,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,l,a)}),(function(e){r("throw",e,l,a)})):t.resolve(d).then((function(e){c.value=e,l(c)}),(function(e){return r("throw",e,l,a)}))}a(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function L(t,r,n){var o=m;return function(i,l){if(o===v)throw Error("Generator is already running");if(o===h){if("throw"===i)throw l;return{value:e,done:!0}}for(n.method=i,n.arg=l;;){var a=n.delegate;if(a){var u=k(a,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=s(t,r,n);if("normal"===c.type){if(o=n.done?h:f,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=h,n.method="throw",n.arg=c.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=s(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,p;var l=i.arg;return l?l.done?(r[t.resultName]=l.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):l:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function W(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(W,this),this.reset(!0)}function V(t){if(t||""===t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=E,o(C,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:g,configurable:!0}),g.displayName=c(E,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},S(q.prototype),c(q.prototype,a,(function(){return this})),t.AsyncIterator=q,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var l=new q(d(e,r,n,o),i);return t.isGeneratorFunction(r)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},S(C),c(C,u,"Generator"),c(C,l,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=V,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i],a=l.completion;if("root"===l.tryLoc)return o("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),c=n.call(l,"finallyLoc");if(u&&c){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return o(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var l=i?i.completion:{};return l.type=e,l.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:V(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),p}},t}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],X=function(r){var n=r.form,o=r.name,i=r.label,l=r.maxLength,a=void 0===l?255:l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,h=void 0===v||v,p=r.readonly,b=void 0!==p&&p,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,x=r.bold,w=void 0!==x&&x,C=H(r,U),S=n.control,q=n.formState.errors;return e.createElement(g,{name:o,control:S,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field,d=u.onChange,m=u.onBlur,v=u.value;return e.createElement(t,M({required:c,label:i,value:v,onChange:d,onBlur:m,error:h&&Boolean(null===(n=q[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:h&&(null===(l=q[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:s,autoFocus:f,slotProps:{input:{maxLength:a,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?y:""}}}},C))}})},$=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Z=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,l=r.label,a=void 0===l?"E-mail":l,u=r.maxLength,c=void 0===u?255:u,d=r.required,s=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,h=void 0!==v&&v,p=r.showErrors,b=void 0===p||p,E=r.readonly,y=void 0!==E&&E,x=r.readonlyBackgroundColor,w=void 0===x?"#dddddd":x,C=r.bold,S=void 0!==C&&C,q=H(r,$),L=n.control,k=n.formState.errors;return e.createElement(g,{name:i,control:L,rules:{required:s,disabled:f},render:function(r){var n,o,l=r.field,u=l.onChange,d=l.onBlur,m=l.value;return e.createElement(t,M({required:s,label:a,value:m,onChange:u,onBlur:d,error:b&&Boolean(null===(n=k[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=k[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:h,slotProps:{input:{maxLength:c,readOnly:y,sx:{fontWeight:S?"bold":"",backgroundColor:y?w:""}}}},q))}})},J=function(t){var n=t.label,o=void 0===n?"":n,i=t.color,l=void 0===i?"white":i,a=t.backgroundColor,u=void 0===a?"#888888":a,c=t.paddingX,d=void 0===c?"10px":c,s=t.paddingY,m=void 0===s?"5px":s,f=t.borderRadius,v=void 0===f?"10px":f,h=t.fontSize,p=void 0===h?"14px":h,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:d,paddingY:m,borderRadius:v,width:void 0===b?"auto":b,color:l,fontSize:p}};return e.createElement(r,{sx:g.text},o)},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],ee=function(r){var o=r.form,i=r.name,l=r.label,a=r.required,u=void 0!==a&&a,c=r.disabled,d=void 0!==c&&c,s=r.options,m=void 0===s?[]:s,f=r.valueKey,v=void 0===f?"id":f,h=r.labelKey,p=void 0===h?"label":h,b=r.maxLength,E=void 0===b?255:b,y=r.autofocus,x=void 0!==y&&y,w=r.noOptionsText,C=void 0===w?"Δεν υπάρχουν επιλογές":w,S=r.showErrors,q=void 0===S||S,L=r.size,k=void 0===L?"medium":L,W=r.readonly,T=void 0!==W&&W,O=r.readonlyBackgroundColor,V=void 0===O?"#dddddd":O,P=r.bold,j=void 0!==P&&P,R=H(r,Q),z=Y(e.useState(null),2),D=z[0],B=z[1],K=o.watch(i);e.useEffect((function(){B(m.find((function(e){return e[v]===K}))||null)}),[K]);var F=o.control,N=o.formState.errors;return e.createElement(g,{name:i,control:F,rules:{required:u,disabled:d},render:function(r){var o=r.field,a=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:k,label:l,fullWidth:!0,required:u,slotProps:{input:{maxLength:E,readOnly:T,sx:{fontWeight:j?"bold":"",backgroundColor:T?V:""}}},value:D?D.label:""}):e.createElement(n,{value:D,required:u,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:C,getOptionLabel:function(e){return e[p]},size:k,slotProps:{input:{maxLength:E,sx:{fontWeight:j?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,M({label:l,required:u,disabled:d,autoFocus:x,size:k,error:q&&Boolean(null===(n=N[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:q&&(null===(o=N[i])||void 0===o?void 0:o.message)},r,R))}})}})},te=function(e){return null==e||""===e},re=function(e){return null!=e&&""!==e},ne=function(e){return te(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!te(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],le=function(r){var i=r.form,l=r.name,a=r.label,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.options,f=void 0===m?[]:m,v=r.valueKey,h=void 0===v?"id":v,p=r.labelKey,b=void 0===p?"label":p,E=r.maxLength,y=void 0===E?255:E,x=r.autofocus,w=void 0!==x&&x,C=r.noOptionsText,S=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,L=void 0===q||q,k=H(r,ie),W=Y(e.useState([]),2),T=W[0],O=W[1],V=i.watch(l);e.useEffect((function(){O(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,V)})))}),[V]);var P=i.control,j=i.formState.errors;return e.createElement(g,{name:l,control:P,rules:{required:c,disabled:s},render:function(r){var i=r.field,u=i.onChange,d=i.onBlur;return i.value,e.createElement(n,{multiple:!0,value:T,required:c,onChange:function(e,t){return u(t)},options:f,isOptionEqualToValue:function(e,t){return e[h]===t[h]},noOptionsText:S,renderTags:function(t,r){return t.map((function(t,n){return e.createElement(o,M({variant:"outlined",label:t[b],size:"small"},r({index:n})))}))},renderInput:function(r){var n,o;return e.createElement(t,M({label:a,required:c,disabled:s,autoFocus:w,inputProps:{maxLength:y},error:L&&Boolean(null===(n=j[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:L&&(null===(o=j[l])||void 0===o?void 0:o.message)},r,k))}})}})},ae=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ue=e.forwardRef((function(r,o){var i=r.form,l=r.name,a=r.label,u=r.optionsUrl,c=r.renderOption,d=void 0===c?null:c,s=r.valueKey,m=void 0===s?"id":s,f=r.labelKey,v=void 0===f?"label":f,h=r.minChars,p=void 0===h?2:h,b=r.required,E=void 0!==b&&b,y=r.disabled,x=void 0!==y&&y,w=r.maxLength,C=void 0===w?255:w,q=r.autofocus,L=void 0!==q&&q,k=r.loadingText,W=void 0===k?"Ανάκτηση...":k,T=r.noOptionsText,O=void 0===T?"Δεν υπάρχουν επιλογές":T,V=r.placeholder,P=void 0===V?"":V,j=r.size,R=void 0===j?"medium":j,z=r.onChange,D=void 0===z?null:z,B=r.showErrors,K=void 0===B||B,F=r.readonly,I=void 0!==F&&F,A=r.readonlyBackgroundColor,_=void 0===A?"#dddddd":A,U=r.bold,X=void 0!==U&&U,$=H(r,ae),Z=Y(e.useState(null),2),J=Z[0],Q=Z[1],ee=Y(e.useState([]),2),te=ee[0],re=ee[1],ne=Y(e.useState(!1),2),oe=ne[0],ie=ne[1];e.useImperativeHandle(o,(function(){return{setValue:function(e){function t(){return(t=N(G().mark((function t(){var r;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ie(!0),t.next=3,S.get("".concat(u,"?id=").concat(e));case 3:r=t.sent,re(r.data),Q(r.data.find((function(e){return e[m]===i.getValues(l)}))||null),ie(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.setValue(l,e),function(){t.apply(this,arguments)}()}}}));var le=i.control,ue=i.formState.errors;e.useEffect((function(){if(i.getValues(l)){var e=function(){var e=N(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,S.get("".concat(u,"?id=").concat(i.getValues(l)));case 3:t=e.sent,re(t.data),Q(t.data.find((function(e){return e[m]===i.getValues(l)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var ce=function(){var e=N(G().mark((function e(t,r){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r||re([]),!(r.length<p)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,S.get("".concat(u,"?id=").concat(t||"","&token=").concat(r||""));case 6:n=e.sent,re(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),de=function(e,t){ce(i.getValues(l),t)};return e.createElement(g,{name:l,control:le,rules:{required:E,disabled:x},render:function(r){var o,i,u,c=r.field,s=c.onChange,f=c.onBlur;return c.value,I?e.createElement(t,{size:R,label:a,fullWidth:!0,required:E,slotProps:{input:{maxLength:C,readOnly:I,sx:{fontWeight:X?"bold":"",backgroundColor:I?_:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:(o=de,i=300,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u&&clearTimeout(u),u=setTimeout((function(){o.apply(void 0,t)}),i)}),onChange:function(e,t){Q(t),s(t?t[m]:null),D&&D(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:O,loadingText:W,loading:oe,required:E,size:R,renderInput:function(r){var n,o;return e.createElement(t,M({label:a,required:E,disabled:x,autoFocus:L,placeholder:P,error:K&&Boolean(null===(n=ue[l])||void 0===n?void 0:n.message),onBlur:f,variant:"outlined",fullWidth:!0,helperText:K&&(null===(o=ue[l])||void 0===o?void 0:o.message),size:R,maxLength:C},r,$))},renderOption:function(t,r,n){return d?d(t,r,n):e.createElement("li",M({},t,{key:r[m]}),r[v])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],de=function(r){var n=r.form,o=r.name,i=r.label,l=r.rows,a=void 0===l?5:l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,h=void 0===v||v,p=H(r,ce),b=n.control,E=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field,d=u.onChange,m=u.onBlur,v=u.value;return e.createElement(t,M({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,onChange:d,onBlur:m,error:h&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:h&&(null===(l=E[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:s,autoFocus:f},p))}})},se=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],me=function(r){var n=r.form,o=r.name,i=r.label,l=r.required,a=void 0!==l&&l,u=r.disabled,c=void 0!==u&&u;r.autofocus;var d=r.showErrors,s=void 0===d||d,m=r.readonly,f=void 0!==m&&m,v=r.readonlyBackgroundColor,h=void 0===v?"#dddddd":v,p=r.bold,b=void 0!==p&&p,E=H(r,se),y=n.control,x=n.formState.errors,w=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:y,rules:{required:a,disabled:c},render:function(r){var n,l,u=r.field;u.onChange,u.onBlur;var d=u.value;return e.createElement(q,M({customInput:t,variant:"outlined",label:i,required:a,disabled:c,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:w,error:s&&Boolean(null===(n=x[o])||void 0===n?void 0:n.message),helperText:s&&(null===(l=x[o])||void 0===l?void 0:l.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:b?"bold":"",backgroundColor:f?h:""}}}},E))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],ve=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,u=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,s=t.ampm,m=void 0!==s&&s,f=t.singleTimeColumn,v=void 0===f||f,h=t.hoursStep,p=void 0===h?1:h,b=t.minutesStep,E=void 0===b?15:b,y=t.secondsStep,x=void 0===y?30:y,w=H(t,fe),S=r.control,q=r.formState.errors;return e.createElement(k,{dateAdapter:L,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:l,disabled:u},render:function(t){var r,i,a=t.field;return e.createElement(W,{label:o,value:a.value?C(a.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:T}:null,timeSteps:{hours:p,minutes:E,seconds:x},slotProps:{textField:_(_({},w),{},{required:l,error:d&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},he=["form","name","label","required","disabled","autofocus","showErrors"],pe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,u=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,s=H(t,he),m=r.control,f=r.formState.errors;return e.createElement(k,{dateAdapter:L,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"}}},e.createElement(g,{name:n,control:m,rules:{required:l,disabled:u},render:function(t){var r,i,a=t.field;return e.createElement(O,{label:o,value:a.value?C(a.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return a.onChange(e)},slotProps:{textField:_(_({},s),{},{required:l,error:d&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ge=function(r){var n=r.form,o=r.name,i=r.label,l=r.allowNegative,a=void 0!==l&&l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,h=void 0===v||v,p=H(r,be),b=n.control,E=n.formState.errors,y=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field;u.onChange,u.onBlur;var d=u.value;return e.createElement(q,M({customInput:t,variant:"outlined",label:i,required:c,disabled:s,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:a,onValueChange:y,error:h&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),helperText:h&&(null===(l=E[o])||void 0===l?void 0:l.message),fullWidth:!0,autoFocus:f},p))}})},Ee=["form","name","label","required","disabled","showErrors"],ye=function(r){var n=r.form,o=r.name,a=r.label,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.showErrors,f=void 0===m||m,v=H(r,Ee),h=Y(e.useState(),2),p=h[0],b=h[1],E=e.useRef(null),y=n.control,x=n.formState.errors,w=function(){E.current.value=null,E.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:y,rules:{required:c,disabled:s},render:function(r){var u,d,m=r.field;return m.onChange,m.onBlur,m.value,e.createElement(t,M({sx:{input:{cursor:"pointer"}},onClick:w,required:c,label:a,value:p?p.name:"",error:f&&Boolean(null===(u=x[o])||void 0===u?void 0:u.message),fullWidth:!0,helperText:f&&(null===(d=x[o])||void 0===d?void 0:d.message),variant:"outlined",disabled:s,InputProps:{endAdornment:p&&e.createElement(i,{position:"end"},e.createElement(l,{onClick:function(e){return function(e){e.stopPropagation(),b(null),n.setValue(o,null)}(e)}},e.createElement(j,null))),readOnly:!0}},v))}}),e.createElement("input",{type:"file",ref:E,style:{display:"none"},onChange:function(e){return function(e){b(e),n.setValue(o,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},xe=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],we=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,l=void 0!==i&&i,a=t.hoursStep,u=void 0===a?1:a,c=t.minutesStep,d=void 0===c?15:c,s=t.secondsStep,m=void 0===s?30:s,f=t.singleTimeColumn,v=void 0===f||f,h=t.required,p=void 0!==h&&h,b=t.disabled,E=void 0!==b&&b;t.autofocus;var y=t.showErrors,x=void 0===y||y,w=H(t,xe),S=r.control,q=r.formState.errors;return e.createElement(k,{dateAdapter:L,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:p,disabled:E},render:function(t){var r,i,a=t.field;return e.createElement(V,{label:o,value:a.value?C(a.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:l,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:T}:null,timeSteps:{hours:u,minutes:d,seconds:m},slotProps:{textField:_(_({},w),{},{required:p,error:x&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:x&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Ce=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,L=t.requiredMessage,k=void 0===L?"Υποχρεωτικό πεδίο":L,W=t.okLabel,T=void 0===W?"ΚΑΤΑΧΩΡΗΣΗ":W,O=t.cancelLabel,V=void 0===O?"ΑΚΥΡΩΣΗ":O,P=t.maxLength,j=void 0===P?255:P,z=t.message,D=void 0===z?null:z,B=t.isLoading,K=void 0!==B&&B,F={text:l||""},N=x.object({text:q?x.string().max(j,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(j," χαρακτήρες")).required(k):x.string().max(j)}),I=E({defaultValues:F,resolver:y(N)});e.useEffect((function(){n&&(I.reset(F),I.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:I.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},D&&"string"!=typeof D&&e.createElement(s,{sx:{mb:2}},D),e.createElement(X,{form:I,name:"text",label:i,required:q,autofocus:!0,maxLength:j,sx:{mt:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(h,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},V),e.createElement(h,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},K?e.createElement(p,{size:20,sx:{color:"inherit"}}):T))))},Se=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qe=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,L=t.requiredMessage,k=void 0===L?"Υποχρεωτικό πεδίο":L,W=t.invalidMessage,T=void 0===W?"Μη έγκυρη μορφή email":W,O=t.okLabel,V=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,P=t.cancelLabel,j=void 0===P?"ΑΚΥΡΩΣΗ":P,z=t.maxLength,D=void 0===z?255:z,B=t.message,K=void 0===B?null:B,F=t.isLoading,N=void 0!==F&&F,I={email:l||""},M=x.object({email:q?x.string().matches(Se,T).required(k):x.string().matches(Se,T)}),A=E({defaultValues:I,resolver:y(M)});e.useEffect((function(){n&&(A.reset(I),A.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),K&&"string"==typeof K?e.createElement(r,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},K&&"string"!=typeof K&&e.createElement(s,{sx:{mb:2}},K),e.createElement(Z,{form:A,label:i,required:q,autofocus:!0,maxLength:D,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(h,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},j),e.createElement(h,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(p,{size:20,sx:{color:"inherit"}}):V))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var Le=function(t){var r=t.open,n=t.onSubmit,o=t.onCancel,i=t.title,l=void 0===i?"Επιλογή Χρώματος":i,u=t.color,s=void 0===u?"#000000":u,m=t.pickerWidth,p=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,E=t.paddingY,y=void 0===E?"10px":E,x=t.paddingX,C=void 0===x?"10px":x,S=t.okLabel,q=void 0===S?"ΚΑΤΑΧΩΡΗΣΗ":S,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L;t.isLoading;var W=Y(e.useState("#000000"),2),T=W[0],O=W[1];e.useEffect((function(){r&&O(s)}),[r,s]);return e.createElement(a,{open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),form.handleSubmit(n)())}},e.createElement(c,null,l),e.createElement(f,null,e.createElement(d,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:C,paddingY:y,label:T}),e.createElement(w,{width:p,color:T,onChange:function(e){return O(e.hex)}}))),e.createElement(v,null,e.createElement(h,{color:"success",onClick:function(){return n(T)}},q),e.createElement(h,{color:"error",onClick:function(){return o()}},k)))},ke=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.options,C=void 0===w?[]:w,S=t.valueKey,q=void 0===S?"id":S,L=t.labelKey,k=void 0===L?"label":L,W=t.required,T=void 0===W||W,O=t.size,V=void 0===O?"sm":O,P=t.requiredMessage,j=void 0===P?"Υποχρεωτικό πεδίο":P,z=t.okLabel,D=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,B=t.cancelLabel,K=void 0===B?"ΑΚΥΡΩΣΗ":B,F=t.isLoading,N=void 0!==F&&F,I={field:l||null},M=x.object({field:T?x.string().required(j):x.string().nullable()}),A=E({defaultValues:I,resolver:y(M)});e.useEffect((function(){n&&(A.reset(I),A.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:V,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),message&&"string"==typeof message?e.createElement(r,{variant:"caption",color:"text.secondary"},message):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.field)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(ee,{form:A,name:"field",label:i,options:C,valueKey:q,labelKey:k,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(h,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(h,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(p,{size:20,sx:{color:"inherit"}}):D))))},We=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=void 0===l?[]:l,g=t.onSubmit,w=t.onCancel,C=t.options,S=void 0===C?[]:C,q=t.valueKey,L=void 0===q?"id":q,k=t.labelKey,W=void 0===k?"label":k,T=t.required,O=void 0===T||T,V=t.size,P=void 0===V?"sm":V,j=t.requiredMessage,z=void 0===j?"Επιλέξτε τουλάχιστον μία τιμή":j,D=t.okLabel,B=void 0===D?"ΚΑΤΑΧΩΡΗΣΗ":D,K=t.cancelLabel,F=void 0===K?"ΑΚΥΡΩΣΗ":K,N=t.message,I=void 0===N?null:N,M=t.isLoading,A=void 0!==M&&M,_={field:b||[]},H=x.object({field:O?x.array().min(1,z):x.array()}),G=E({defaultValues:_,resolver:y(H)});e.useEffect((function(){n&&(G.reset(_),G.clearErrors())}),[n,b]);return e.createElement(a,{fullWidth:!0,maxWidth:P,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e.field)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},I&&"string"!=typeof I&&e.createElement(s,{sx:{mb:2}},I),e.createElement(le,{form:G,name:"field",label:i,options:S,valueKey:L,labelKey:W,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(h,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(h,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(p,{size:20,sx:{color:"inherit"}}):B))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,l=t.onCancel,d=t.confirmText,m=void 0===d?"ΕΠΙΒΕΒΑΙΩΣΗ":d,g=t.cancelText,E=void 0===g?"ΑΚΥΡΩΣΗ":g,y=t.isLoading,x=void 0!==y&&y,w=t.type,C=void 0===w?"warning":w,S={warning:{color:"warning.main",icon:e.createElement(z,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(D,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(B,{sx:{fontSize:40}})}}[C]||{color:"primary.main",icon:null};return e.createElement(a,{open:r,onClose:function(e,t){"backdropClick"!==t&&l()},slots:{transition:u},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(S.color,"20"),color:S.color,borderRadius:"50%",mb:2}},S.icon),e.createElement(c,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(f,null,e.createElement(b,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},o)),e.createElement(v,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(h,{fullWidth:!0,variant:"text",color:"inherit",onClick:l,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},E),e.createElement(h,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===C?"error":"primary",onClick:i,sx:{borderRadius:3,fontWeight:700,py:1}},x?e.createElement(p,{size:20,sx:{color:"inherit"}}):m)))},Oe=function(t){var n=t.open,o=t.title,i=t.label,l=t.message,b=void 0===l?null:l,g=t.value,w=t.onSubmit,C=t.onCancel,S=t.size,q=void 0===S?"sm":S,L=t.rows,k=void 0===L?5:L,W=t.required,T=void 0!==W&&W,O=t.requiredMessage,V=void 0===O?"Υποχρεωτικό πεδίο":O,P=t.okLabel,j=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,z=t.cancelLabel,D=void 0===z?"ΑΚΥΡΩΣΗ":z,B=t.isLoading,K=void 0!==B&&B,F={notes:g||""},N=x.object({notes:T?x.string().required(V):x.string()}),I=E({defaultValues:F,resolver:y(N)});e.useEffect((function(){n&&(I.reset(F),I.clearErrors())}),[n,g]);return e.createElement(a,{fullWidth:!0,maxWidth:q,open:n,onClose:function(e,t){"escapeKeyDown"===t&&C()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),b&&"string"==typeof b?e.createElement(r,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:I.handleSubmit((function(e){return w(e.notes)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(s,{sx:{mb:2}},b),e.createElement(de,{form:I,name:"notes",label:i,required:T,rows:k,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(h,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(h,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},K?e.createElement(p,{size:20,sx:{color:"inherit"}}):j))))},Ve=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,p=void 0===m||m,b=t.minValue,g=void 0===b?null:b,w=t.maxValue,C=void 0===w?null:w,S=t.requiredMessage,q=void 0===S?"Υποχρεωτικό πεδίο":S,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,W=t.cancelLabel,T=void 0===W?"ΑΚΥΡΩΣΗ":W;t.isLoading;var O={poso:re(i)?i:null},V=x.object({poso:x.number().when([],{is:function(e){return p},then:function(e){return e.required(q)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==g},then:function(e){return e.min(g,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ne(g)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==C},then:function(e){return e.max(C,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ne(C)))},otherwise:function(e){return e}})}),P=E({defaultValues:O,resolver:y(V)});return e.useEffect((function(){r&&(P.clearErrors(),P.setValue("poso",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),P.handleSubmit((function(e){return l(e.poso)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(me,{form:P,name:"poso",label:o,required:p,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(h,{color:"success",onClick:P.handleSubmit((function(e){return l(e.poso)}))},k),e.createElement(h,{color:"error",onClick:function(){return u()}},T)))},Pe=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,p=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S;t.isLoading;var L={datetime:i},k=x.object({datetime:p?x.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(g):x.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας")}),W=E({defaultValues:L,resolver:y(k)});return e.useEffect((function(){r&&(W.clearErrors(),W.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),W.handleSubmit((function(e){return l(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ve,{form:W,name:"datetime",label:o,required:p,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(h,{color:"success",onClick:W.handleSubmit((function(e){return l(e.datetime)}))},C),e.createElement(h,{color:"error",onClick:function(){return u()}},q)))},je=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,p=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S;t.isLoading;var L={datetime:i},k=x.object({datetime:p?x.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(g):x.date().typeError("Μη έγκυρη μορφή ημερομηνίας")}),W=E({defaultValues:L,resolver:y(k)});return e.useEffect((function(){r&&(W.clearErrors(),W.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),W.handleSubmit((function(e){return l(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(pe,{form:W,name:"datetime",label:o,required:p,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(h,{color:"success",onClick:W.handleSubmit((function(e){return l(e.datetime)}))},C),e.createElement(h,{color:"error",onClick:function(){return u()}},q)))},Re=[{id:!0,label:"ΝΑΙ"},{id:!1,label:"ΟΧΙ"}],ze=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,u=t.onSubmit,d=t.onCancel,s=t.required,m=void 0===s||s,p=t.info,b=void 0===p?"":p,g=t.size,w=void 0===g?"sm":g,C=t.requiredMessage,S=void 0===C?"Υποχρεωτικό πεδίο":C,q=t.okLabel,L=void 0===q?"ΚΑΤΑΧΩΡΗΣΗ":q,k=t.cancelLabel,W=void 0===k?"ΑΚΥΡΩΣΗ":k,T={field:l||null},O=x.object({field:m?x.boolean().required(S):x.boolean().nullable()}),V=E({defaultValues:T,resolver:y(O)});return e.useEffect((function(){n&&(V.clearErrors(),V.setValue("field",l,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[n,l]),e.createElement(a,{fullWidth:!0,maxWidth:w,open:n,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,b&&e.createElement(r,null,b),e.createElement(ee,{form:V,name:"field",label:i,options:Re,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(v,null,e.createElement(h,{color:"success",onClick:V.handleSubmit((function(e){return u(e.field)}))},L),e.createElement(h,{color:"error",onClick:function(){return d()}},W)))},De=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.allowNegative,s=void 0!==d&&d,m=t.required,p=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.size,C=void 0===w?"sm":w,S=t.minValue,q=void 0===S?null:S,L=t.maxValue,k=void 0===L?null:L,W=t.okLabel,T=void 0===W?"ΚΑΤΑΧΩΡΗΣΗ":W,O=t.cancelLabel,V=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var P={num:re(i)?i:null},j=x.object({num:x.number().when([],{is:function(e){return p},then:function(e){return e.required(g)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==q},then:function(e){return e.min(q,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(q))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==k},then:function(e){return e.max(k,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(k))},otherwise:function(e){return e}})}),R=E({defaultValues:P,resolver:y(j)});return e.useEffect((function(){r&&(R.clearErrors(),R.setValue("num",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),R.handleSubmit((function(e){return l(e.num)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ge,{form:R,name:"num",label:o,required:p,autofocus:!0,allowNegative:s,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(h,{color:"success",onClick:R.handleSubmit((function(e){return l(e.num)}))},T),e.createElement(h,{color:"error",onClick:function(){return u()}},V)))},Be=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.decimals,u=void 0===l?2:l,d=t.minValue,s=void 0===d?null:d,m=t.maxValue,p=void 0===m?null:m,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,L=t.requiredMessage,k=void 0===L?"Υποχρεωτικό πεδίο":L,W=t.okLabel,T=void 0===W?"ΚΑΤΑΧΩΡΗΣΗ":W,O=t.cancelLabel,V=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var P={field:re(i)?i:null},j=x.object({field:x.number().when([],{is:function(e){return q},then:function(e){return e.required(k)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==s},then:function(e){return e.min(s,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(s,u)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==p},then:function(e){return e.max(p,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(oe(p,u)))},otherwise:function(e){return e}})}),R=E({defaultValues:P,resolver:y(j)});return e.useEffect((function(){r&&(R.clearErrors(),R.setValue("field",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),R.handleSubmit((function(e){return b(e.field)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(me,{form:R,name:"field",label:o,required:q,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(h,{color:"success",onClick:R.handleSubmit((function(e){return b(e.field)}))},T),e.createElement(h,{color:"error",onClick:function(){return g()}},V)))},Ke=function(t){var r=t.open,n=t.title,o=t.message,i=t.onClose,l=t.closeText,u=void 0===l?"ΟΚ":l;return e.createElement(a,{open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(b,null,o)),e.createElement(v,null,e.createElement(h,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},Fe=function(t){var r=t.open,n=t.title,o=void 0===n?"Νέο Αρχείο":n,i=t.description,l=void 0===i||i,u=t.descriptionLabel,s=void 0===u?"Περιγραφή Αρχείου":u,m=t.fileSelectLabel,p=void 0===m?"Επιλογή Αρχείου":m,b=t.maxFileName,g=void 0===b?255:b,w=t.onSubmit,C=t.onCancel;t.isLoading;var S=x.object({descr:l?x.string().required("Παρακαλώ συμπληρώστε την περιγραφή του αρχείου").max(g,"Η περιγραφή δεν πρέπει να υπερβαίνει τους ".concat(g," χαρακτήρες")):x.string(),filename:x.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),q=E({defaultValues:{descr:"",filename:null},resolver:y(S)});return e.useEffect((function(){r&&(q.clearErrors(),q.setValue("descr",""),q.setValue("filename",null))}),[r]),e.createElement(a,{maxWidth:"sm",fullWidth:!0,open:r,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,e.createElement(d,{sx:{marginTop:2},gap:3},l&&e.createElement(X,{form:q,name:"descr",label:s,required:!0,autofocus:!0}),e.createElement(ye,{form:q,name:"filename",label:p,required:!0}))),e.createElement(v,null,e.createElement(h,{color:"success",onClick:q.handleSubmit(w)},"ΚΑΤΑΧΩΡΗΣΗ"),e.createElement(h,{color:"error",onClick:function(){return C()}},"ΑΚΥΡΩΣΗ")))},Ne=function(t){var r=t.open,n=t.title,o=t.label,i=t.optionsUrl,l=t.value,u=t.onSubmit,d=t.onCancel,s=t.valueKey,m=void 0===s?"id":s,p=t.labelKey,b=void 0===p?"label":p,g=t.required,w=void 0===g||g,C=t.size,S=void 0===C?"sm":C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.minChars,W=void 0===k?1:k,T=t.okLabel,O=void 0===T?"ΚΑΤΑΧΩΡΗΣΗ":T,V=t.cancelLabel,P=void 0===V?"ΑΚΥΡΩΣΗ":V;t.isLoading;var j={field:l||null},R=x.object({field:w?x.string().required(L):x.string().nullable()}),z=E({defaultValues:j,resolver:y(R)});return e.useEffect((function(){r&&(z.clearErrors(),z.setValue("field",l,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,l]),e.createElement(a,{fullWidth:!0,maxWidth:S,open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ue,{form:z,name:"field",label:o,optionsUrl:i,minChars:W,valueKey:m,labelKey:b,required:w,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(h,{color:"success",onClick:z.handleSubmit(u)},O),e.createElement(h,{color:"error",onClick:function(){return d()}},P)))},Ie=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,p=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S,L={datetime:i},k=x.object({datetime:p?x.date().typeError("Μη έγκυρη μορφή ώρας").required(g):x.date().typeError("Μη έγκυρη μορφή ώρας")}),W=E({defaultValues:L,resolver:y(k)});return e.useEffect((function(){r&&(W.clearErrors(),W.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),W.handleSubmit((function(e){return l(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(we,{form:W,name:"datetime",label:o,required:p,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(h,{color:"success",onClick:W.handleSubmit((function(e){return l(e.datetime)}))},C),e.createElement(h,{color:"error",onClick:function(){return u()}},q)))};export{Ne as AutocompleteApiModalForm,ke as AutocompleteModalForm,We as AutocompleteMultiModalForm,Te as ConfirmationDialog,Ve as CurrencyModalForm,je as DateModalForm,Pe as DatetimeModalForm,Be as DecimalModalForm,qe as EmailModalForm,De as IntegerModalForm,Ke as MessageDialog,Oe as NotesModalForm,Le as PickColorModalForm,Fe as SelectFileModalForm,Ce as TextModalForm,Ie as TimeModalForm,ze as YesNoModalForm};
1
+ import e from"react";import{TextField as t,Typography as r,Autocomplete as n,Chip as o,InputAdornment as i,IconButton as l,Dialog as a,Zoom as u,DialogTitle as c,Stack as d,Box as s,Divider as m,DialogContent as f,DialogActions as v,Button as p,CircularProgress as h,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as E}from"react-hook-form";import{yupResolver as y}from"@hookform/resolvers/yup";import*as x from"yup";import{ChromePicker as w}from"react-color";import{toDate as C}from"date-fns";import"date-fns/locale";import S from"axios";import{NumericFormat as q}from"react-number-format";import{AdapterDateFns as L}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as k}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as W,renderDigitalClockTimeView as T,DatePicker as O,TimePicker as V}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as j,EditNoteRounded as R}from"@mui/icons-material";import z from"@mui/icons-material/WarningAmberRounded";import D from"@mui/icons-material/ErrorOutlineRounded";import B from"@mui/icons-material/CheckCircleOutlineRounded";function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function F(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}function N(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function l(e){F(i,n,o,l,a,"next",e)}function a(e){F(i,n,o,l,a,"throw",e)}l(void 0)}))}}function I(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(null,arguments)}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){I(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,l=Object.create(i.prototype),a=new O(n||[]);return o(l,"_invoke",{value:L(e,r,a)}),l}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var m="suspendedStart",f="suspendedYield",v="executing",p="completed",h={};function b(){}function g(){}function E(){}var y={};c(y,l,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(V([])));w&&w!==r&&n.call(w,l)&&(y=w);var C=E.prototype=b.prototype=Object.create(y);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function q(e,t){function r(o,i,l,a){var u=s(e[o],e,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,l,a)}),(function(e){r("throw",e,l,a)})):t.resolve(d).then((function(e){c.value=e,l(c)}),(function(e){return r("throw",e,l,a)}))}a(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function L(t,r,n){var o=m;return function(i,l){if(o===v)throw Error("Generator is already running");if(o===p){if("throw"===i)throw l;return{value:e,done:!0}}for(n.method=i,n.arg=l;;){var a=n.delegate;if(a){var u=k(a,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=s(t,r,n);if("normal"===c.type){if(o=n.done?p:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=p,n.method="throw",n.arg=c.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=s(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var l=i.arg;return l?l.done?(r[t.resultName]=l.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):l:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function W(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(W,this),this.reset(!0)}function V(t){if(t||""===t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=E,o(C,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:g,configurable:!0}),g.displayName=c(E,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},S(q.prototype),c(q.prototype,a,(function(){return this})),t.AsyncIterator=q,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var l=new q(d(e,r,n,o),i);return t.isGeneratorFunction(r)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},S(C),c(C,u,"Generator"),c(C,l,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=V,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i],a=l.completion;if("root"===l.tryLoc)return o("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),c=n.call(l,"finallyLoc");if(u&&c){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return o(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var l=i?i.completion:{};return l.type=e,l.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:V(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],X=function(r){var n=r.form,o=r.name,i=r.label,l=r.maxLength,a=void 0===l?255:l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=r.readonly,b=void 0!==h&&h,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,x=r.bold,w=void 0!==x&&x,C=H(r,U),S=n.control,q=n.formState.errors;return e.createElement(g,{name:o,control:S,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field,d=u.onChange,m=u.onBlur,v=u.value;return e.createElement(t,M({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=q[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=q[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:s,autoFocus:f,slotProps:{input:{maxLength:a,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?y:""}}}},C))}})},$=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Z=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,l=r.label,a=void 0===l?"E-mail":l,u=r.maxLength,c=void 0===u?255:u,d=r.required,s=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,h=r.showErrors,b=void 0===h||h,E=r.readonly,y=void 0!==E&&E,x=r.readonlyBackgroundColor,w=void 0===x?"#dddddd":x,C=r.bold,S=void 0!==C&&C,q=H(r,$),L=n.control,k=n.formState.errors;return e.createElement(g,{name:i,control:L,rules:{required:s,disabled:f},render:function(r){var n,o,l=r.field,u=l.onChange,d=l.onBlur,m=l.value;return e.createElement(t,M({required:s,label:a,value:m,onChange:u,onBlur:d,error:b&&Boolean(null===(n=k[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=k[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:y,sx:{fontWeight:S?"bold":"",backgroundColor:y?w:""}}}},q))}})},J=function(t){var n=t.label,o=void 0===n?"":n,i=t.color,l=void 0===i?"white":i,a=t.backgroundColor,u=void 0===a?"#888888":a,c=t.paddingX,d=void 0===c?"10px":c,s=t.paddingY,m=void 0===s?"5px":s,f=t.borderRadius,v=void 0===f?"10px":f,p=t.fontSize,h=void 0===p?"14px":p,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:d,paddingY:m,borderRadius:v,width:void 0===b?"auto":b,color:l,fontSize:h}};return e.createElement(r,{sx:g.text},o)},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],ee=function(r){var o=r.form,i=r.name,l=r.label,a=r.required,u=void 0!==a&&a,c=r.disabled,d=void 0!==c&&c,s=r.options,m=void 0===s?[]:s,f=r.valueKey,v=void 0===f?"id":f,p=r.labelKey,h=void 0===p?"label":p,b=r.maxLength,E=void 0===b?255:b,y=r.autofocus,x=void 0!==y&&y,w=r.noOptionsText,C=void 0===w?"Δεν υπάρχουν επιλογές":w,S=r.showErrors,q=void 0===S||S,L=r.size,k=void 0===L?"medium":L,W=r.readonly,T=void 0!==W&&W,O=r.readonlyBackgroundColor,V=void 0===O?"#dddddd":O,P=r.bold,j=void 0!==P&&P,R=H(r,Q),z=Y(e.useState(null),2),D=z[0],B=z[1],K=o.watch(i);e.useEffect((function(){B(m.find((function(e){return e[v]===K}))||null)}),[K]);var F=o.control,N=o.formState.errors;return e.createElement(g,{name:i,control:F,rules:{required:u,disabled:d},render:function(r){var o=r.field,a=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:k,label:l,fullWidth:!0,required:u,slotProps:{input:{maxLength:E,readOnly:T,sx:{fontWeight:j?"bold":"",backgroundColor:T?V:""}}},value:D?D.label:""}):e.createElement(n,{value:D,required:u,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:k,slotProps:{input:{maxLength:E,sx:{fontWeight:j?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,M({label:l,required:u,disabled:d,autoFocus:x,size:k,error:q&&Boolean(null===(n=N[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:q&&(null===(o=N[i])||void 0===o?void 0:o.message)},r,R))}})}})},te=function(e){return null==e||""===e},re=function(e){return null!=e&&""!==e},ne=function(e){return te(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!te(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],le=function(r){var i=r.form,l=r.name,a=r.label,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.options,f=void 0===m?[]:m,v=r.valueKey,p=void 0===v?"id":v,h=r.labelKey,b=void 0===h?"label":h,E=r.maxLength,y=void 0===E?255:E,x=r.autofocus,w=void 0!==x&&x,C=r.noOptionsText,S=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,L=void 0===q||q,k=H(r,ie),W=Y(e.useState([]),2),T=W[0],O=W[1],V=i.watch(l);e.useEffect((function(){O(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,V)})))}),[V]);var P=i.control,j=i.formState.errors;return e.createElement(g,{name:l,control:P,rules:{required:c,disabled:s},render:function(r){var i=r.field,u=i.onChange,d=i.onBlur;return i.value,e.createElement(n,{multiple:!0,value:T,required:c,onChange:function(e,t){return u(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:S,renderTags:function(t,r){return t.map((function(t,n){return e.createElement(o,M({variant:"outlined",label:t[b],size:"small"},r({index:n})))}))},renderInput:function(r){var n,o;return e.createElement(t,M({label:a,required:c,disabled:s,autoFocus:w,inputProps:{maxLength:y},error:L&&Boolean(null===(n=j[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:L&&(null===(o=j[l])||void 0===o?void 0:o.message)},r,k))}})}})},ae=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ue=e.forwardRef((function(r,o){var i=r.form,l=r.name,a=r.label,u=r.optionsUrl,c=r.renderOption,d=void 0===c?null:c,s=r.valueKey,m=void 0===s?"id":s,f=r.labelKey,v=void 0===f?"label":f,p=r.minChars,h=void 0===p?2:p,b=r.required,E=void 0!==b&&b,y=r.disabled,x=void 0!==y&&y,w=r.maxLength,C=void 0===w?255:w,q=r.autofocus,L=void 0!==q&&q,k=r.loadingText,W=void 0===k?"Ανάκτηση...":k,T=r.noOptionsText,O=void 0===T?"Δεν υπάρχουν επιλογές":T,V=r.placeholder,P=void 0===V?"":V,j=r.size,R=void 0===j?"medium":j,z=r.onChange,D=void 0===z?null:z,B=r.showErrors,K=void 0===B||B,F=r.readonly,I=void 0!==F&&F,A=r.readonlyBackgroundColor,_=void 0===A?"#dddddd":A,U=r.bold,X=void 0!==U&&U,$=H(r,ae),Z=Y(e.useState(null),2),J=Z[0],Q=Z[1],ee=Y(e.useState([]),2),te=ee[0],re=ee[1],ne=Y(e.useState(!1),2),oe=ne[0],ie=ne[1];e.useImperativeHandle(o,(function(){return{setValue:function(e){function t(){return(t=N(G().mark((function t(){var r;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ie(!0),t.next=3,S.get("".concat(u,"?id=").concat(e));case 3:r=t.sent,re(r.data),Q(r.data.find((function(e){return e[m]===i.getValues(l)}))||null),ie(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.setValue(l,e),function(){t.apply(this,arguments)}()}}}));var le=i.control,ue=i.formState.errors;e.useEffect((function(){if(i.getValues(l)){var e=function(){var e=N(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,S.get("".concat(u,"?id=").concat(i.getValues(l)));case 3:t=e.sent,re(t.data),Q(t.data.find((function(e){return e[m]===i.getValues(l)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var ce=function(){var e=N(G().mark((function e(t,r){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r||re([]),!(r.length<h)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,S.get("".concat(u,"?id=").concat(t||"","&token=").concat(r||""));case 6:n=e.sent,re(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),de=function(e,t){ce(i.getValues(l),t)};return e.createElement(g,{name:l,control:le,rules:{required:E,disabled:x},render:function(r){var o,i,u,c=r.field,s=c.onChange,f=c.onBlur;return c.value,I?e.createElement(t,{size:R,label:a,fullWidth:!0,required:E,slotProps:{input:{maxLength:C,readOnly:I,sx:{fontWeight:X?"bold":"",backgroundColor:I?_:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:(o=de,i=300,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u&&clearTimeout(u),u=setTimeout((function(){o.apply(void 0,t)}),i)}),onChange:function(e,t){Q(t),s(t?t[m]:null),D&&D(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:O,loadingText:W,loading:oe,required:E,size:R,renderInput:function(r){var n,o;return e.createElement(t,M({label:a,required:E,disabled:x,autoFocus:L,placeholder:P,error:K&&Boolean(null===(n=ue[l])||void 0===n?void 0:n.message),onBlur:f,variant:"outlined",fullWidth:!0,helperText:K&&(null===(o=ue[l])||void 0===o?void 0:o.message),size:R,maxLength:C},r,$))},renderOption:function(t,r,n){return d?d(t,r,n):e.createElement("li",M({},t,{key:r[m]}),r[v])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],de=function(r){var n=r.form,o=r.name,i=r.label,l=r.rows,a=void 0===l?5:l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=H(r,ce),b=n.control,E=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field,d=u.onChange,m=u.onBlur,v=u.value;return e.createElement(t,M({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,onChange:d,onBlur:m,error:p&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=E[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:s,autoFocus:f},h))}})},se=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],me=function(r){var n=r.form,o=r.name,i=r.label,l=r.required,a=void 0!==l&&l,u=r.disabled,c=void 0!==u&&u;r.autofocus;var d=r.showErrors,s=void 0===d||d,m=r.readonly,f=void 0!==m&&m,v=r.readonlyBackgroundColor,p=void 0===v?"#dddddd":v,h=r.bold,b=void 0!==h&&h,E=H(r,se),y=n.control,x=n.formState.errors,w=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:y,rules:{required:a,disabled:c},render:function(r){var n,l,u=r.field;u.onChange,u.onBlur;var d=u.value;return e.createElement(q,M({customInput:t,variant:"outlined",label:i,required:a,disabled:c,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:w,error:s&&Boolean(null===(n=x[o])||void 0===n?void 0:n.message),helperText:s&&(null===(l=x[o])||void 0===l?void 0:l.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:b?"bold":"",backgroundColor:f?p:""}}}},E))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],ve=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,u=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,s=t.ampm,m=void 0!==s&&s,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,h=void 0===p?1:p,b=t.minutesStep,E=void 0===b?15:b,y=t.secondsStep,x=void 0===y?30:y,w=H(t,fe),S=r.control,q=r.formState.errors;return e.createElement(k,{dateAdapter:L,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:l,disabled:u},render:function(t){var r,i,a=t.field;return e.createElement(W,{label:o,value:a.value?C(a.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:T}:null,timeSteps:{hours:h,minutes:E,seconds:x},slotProps:{textField:_(_({},w),{},{required:l,error:d&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},pe=["form","name","label","required","disabled","autofocus","showErrors"],he=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,u=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,s=H(t,pe),m=r.control,f=r.formState.errors;return e.createElement(k,{dateAdapter:L,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"}}},e.createElement(g,{name:n,control:m,rules:{required:l,disabled:u},render:function(t){var r,i,a=t.field;return e.createElement(O,{label:o,value:a.value?C(a.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return a.onChange(e)},slotProps:{textField:_(_({},s),{},{required:l,error:d&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ge=function(r){var n=r.form,o=r.name,i=r.label,l=r.allowNegative,a=void 0!==l&&l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=H(r,be),b=n.control,E=n.formState.errors,y=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field;u.onChange,u.onBlur;var d=u.value;return e.createElement(q,M({customInput:t,variant:"outlined",label:i,required:c,disabled:s,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:a,onValueChange:y,error:p&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),helperText:p&&(null===(l=E[o])||void 0===l?void 0:l.message),fullWidth:!0,autoFocus:f},h))}})},Ee=["form","name","label","required","disabled","showErrors"],ye=function(r){var n=r.form,o=r.name,a=r.label,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.showErrors,f=void 0===m||m,v=H(r,Ee),p=Y(e.useState(),2),h=p[0],b=p[1],E=e.useRef(null),y=n.control,x=n.formState.errors,w=function(){E.current.value=null,E.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:y,rules:{required:c,disabled:s},render:function(r){var u,d,m=r.field;return m.onChange,m.onBlur,m.value,e.createElement(t,M({sx:{input:{cursor:"pointer"}},onClick:w,required:c,label:a,value:h?h.name:"",error:f&&Boolean(null===(u=x[o])||void 0===u?void 0:u.message),fullWidth:!0,helperText:f&&(null===(d=x[o])||void 0===d?void 0:d.message),variant:"outlined",disabled:s,InputProps:{endAdornment:h&&e.createElement(i,{position:"end"},e.createElement(l,{onClick:function(e){return function(e){e.stopPropagation(),b(null),n.setValue(o,null)}(e)}},e.createElement(j,null))),readOnly:!0}},v))}}),e.createElement("input",{type:"file",ref:E,style:{display:"none"},onChange:function(e){return function(e){b(e),n.setValue(o,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},xe=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],we=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,l=void 0!==i&&i,a=t.hoursStep,u=void 0===a?1:a,c=t.minutesStep,d=void 0===c?15:c,s=t.secondsStep,m=void 0===s?30:s,f=t.singleTimeColumn,v=void 0===f||f,p=t.required,h=void 0!==p&&p,b=t.disabled,E=void 0!==b&&b;t.autofocus;var y=t.showErrors,x=void 0===y||y,w=H(t,xe),S=r.control,q=r.formState.errors;return e.createElement(k,{dateAdapter:L,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:h,disabled:E},render:function(t){var r,i,a=t.field;return e.createElement(V,{label:o,value:a.value?C(a.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:l,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:T}:null,timeSteps:{hours:u,minutes:d,seconds:m},slotProps:{textField:_(_({},w),{},{required:h,error:x&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:x&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Ce=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,L=t.requiredMessage,k=void 0===L?"Υποχρεωτικό πεδίο":L,W=t.okLabel,T=void 0===W?"ΚΑΤΑΧΩΡΗΣΗ":W,O=t.cancelLabel,V=void 0===O?"ΑΚΥΡΩΣΗ":O,P=t.maxLength,j=void 0===P?255:P,z=t.message,D=void 0===z?null:z,B=t.isLoading,K=void 0!==B&&B,F={text:l||""},N=x.object({text:q?x.string().max(j,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(j," χαρακτήρες")).required(k):x.string().max(j)}),I=E({defaultValues:F,resolver:y(N)});e.useEffect((function(){n&&(I.reset(F),I.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:I.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},D&&"string"!=typeof D&&e.createElement(s,{sx:{mb:2}},D),e.createElement(X,{form:I,name:"text",label:i,required:q,autofocus:!0,maxLength:j,sx:{mt:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},V),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},K?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Se=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qe=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,L=t.requiredMessage,k=void 0===L?"Υποχρεωτικό πεδίο":L,W=t.invalidMessage,T=void 0===W?"Μη έγκυρη μορφή email":W,O=t.okLabel,V=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,P=t.cancelLabel,j=void 0===P?"ΑΚΥΡΩΣΗ":P,z=t.maxLength,D=void 0===z?255:z,B=t.message,K=void 0===B?null:B,F=t.isLoading,N=void 0!==F&&F,I={email:l||""},M=x.object({email:q?x.string().matches(Se,T).required(k):x.string().matches(Se,T)}),A=E({defaultValues:I,resolver:y(M)});e.useEffect((function(){n&&(A.reset(I),A.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),K&&"string"==typeof K?e.createElement(r,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},K&&"string"!=typeof K&&e.createElement(s,{sx:{mb:2}},K),e.createElement(Z,{form:A,label:i,required:q,autofocus:!0,maxLength:D,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},j),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(h,{size:20,sx:{color:"inherit"}}):V))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var Le=function(t){var r=t.open,n=t.onSubmit,o=t.onCancel,i=t.title,l=void 0===i?"Επιλογή Χρώματος":i,u=t.color,s=void 0===u?"#000000":u,m=t.pickerWidth,h=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,E=t.paddingY,y=void 0===E?"10px":E,x=t.paddingX,C=void 0===x?"10px":x,S=t.okLabel,q=void 0===S?"ΚΑΤΑΧΩΡΗΣΗ":S,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L;t.isLoading;var W=Y(e.useState("#000000"),2),T=W[0],O=W[1];e.useEffect((function(){r&&O(s)}),[r,s]);return e.createElement(a,{open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),form.handleSubmit(n)())}},e.createElement(c,null,l),e.createElement(f,null,e.createElement(d,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:C,paddingY:y,label:T}),e.createElement(w,{width:h,color:T,onChange:function(e){return O(e.hex)}}))),e.createElement(v,null,e.createElement(p,{color:"success",onClick:function(){return n(T)}},q),e.createElement(p,{color:"error",onClick:function(){return o()}},k)))},ke=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.options,C=void 0===w?[]:w,S=t.valueKey,q=void 0===S?"id":S,L=t.labelKey,k=void 0===L?"label":L,W=t.required,T=void 0===W||W,O=t.size,V=void 0===O?"sm":O,P=t.requiredMessage,j=void 0===P?"Υποχρεωτικό πεδίο":P,z=t.okLabel,D=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,B=t.cancelLabel,K=void 0===B?"ΑΚΥΡΩΣΗ":B,F=t.message,N=void 0===F?null:F,I=t.isLoading,M=void 0!==I&&I,A={field:l||null},_=x.object({field:T?x.string().required(j):x.string().nullable()}),H=E({defaultValues:A,resolver:y(_)});e.useEffect((function(){n&&(H.reset(A),H.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:V,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),N&&"string"==typeof N?e.createElement(r,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return b(e.field)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(ee,{form:H,name:"field",label:i,options:C,valueKey:q,labelKey:k,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},M?e.createElement(h,{size:20,sx:{color:"inherit"}}):D))))},We=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=void 0===l?[]:l,g=t.onSubmit,w=t.onCancel,C=t.options,S=void 0===C?[]:C,q=t.valueKey,L=void 0===q?"id":q,k=t.labelKey,W=void 0===k?"label":k,T=t.required,O=void 0===T||T,V=t.size,P=void 0===V?"sm":V,j=t.requiredMessage,z=void 0===j?"Επιλέξτε τουλάχιστον μία τιμή":j,D=t.okLabel,B=void 0===D?"ΚΑΤΑΧΩΡΗΣΗ":D,K=t.cancelLabel,F=void 0===K?"ΑΚΥΡΩΣΗ":K,N=t.message,I=void 0===N?null:N,M=t.isLoading,A=void 0!==M&&M,_={field:b||[]},H=x.object({field:O?x.array().min(1,z):x.array()}),G=E({defaultValues:_,resolver:y(H)});e.useEffect((function(){n&&(G.reset(_),G.clearErrors())}),[n,b]);return e.createElement(a,{fullWidth:!0,maxWidth:P,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e.field)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},I&&"string"!=typeof I&&e.createElement(s,{sx:{mb:2}},I),e.createElement(le,{form:G,name:"field",label:i,options:S,valueKey:L,labelKey:W,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,l=t.onCancel,d=t.confirmText,m=void 0===d?"ΕΠΙΒΕΒΑΙΩΣΗ":d,g=t.cancelText,E=void 0===g?"ΑΚΥΡΩΣΗ":g,y=t.isLoading,x=void 0!==y&&y,w=t.type,C=void 0===w?"warning":w,S={warning:{color:"warning.main",icon:e.createElement(z,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(D,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(B,{sx:{fontSize:40}})}}[C]||{color:"primary.main",icon:null};return e.createElement(a,{open:r,onClose:function(e,t){"backdropClick"!==t&&l()},slots:{transition:u},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(S.color,"20"),color:S.color,borderRadius:"50%",mb:2}},S.icon),e.createElement(c,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(f,null,e.createElement(b,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},o)),e.createElement(v,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(p,{fullWidth:!0,variant:"text",color:"inherit",onClick:l,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},E),e.createElement(p,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===C?"error":"primary",onClick:i,sx:{borderRadius:3,fontWeight:700,py:1}},x?e.createElement(h,{size:20,sx:{color:"inherit"}}):m)))},Oe=function(t){var n=t.open,o=t.title,i=t.label,l=t.message,b=void 0===l?null:l,g=t.value,w=t.onSubmit,C=t.onCancel,S=t.size,q=void 0===S?"sm":S,L=t.rows,k=void 0===L?5:L,W=t.required,T=void 0!==W&&W,O=t.requiredMessage,V=void 0===O?"Υποχρεωτικό πεδίο":O,P=t.okLabel,j=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,z=t.cancelLabel,D=void 0===z?"ΑΚΥΡΩΣΗ":z,B=t.isLoading,K=void 0!==B&&B,F={notes:g||""},N=x.object({notes:T?x.string().required(V):x.string()}),I=E({defaultValues:F,resolver:y(N)});e.useEffect((function(){n&&(I.reset(F),I.clearErrors())}),[n,g]);return e.createElement(a,{fullWidth:!0,maxWidth:q,open:n,onClose:function(e,t){"escapeKeyDown"===t&&C()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),b&&"string"==typeof b?e.createElement(r,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:I.handleSubmit((function(e){return w(e.notes)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(s,{sx:{mb:2}},b),e.createElement(de,{form:I,name:"notes",label:i,required:T,rows:k,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},K?e.createElement(h,{size:20,sx:{color:"inherit"}}):j))))},Ve=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,h=void 0===m||m,b=t.minValue,g=void 0===b?null:b,w=t.maxValue,C=void 0===w?null:w,S=t.requiredMessage,q=void 0===S?"Υποχρεωτικό πεδίο":S,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,W=t.cancelLabel,T=void 0===W?"ΑΚΥΡΩΣΗ":W;t.isLoading;var O={poso:re(i)?i:null},V=x.object({poso:x.number().when([],{is:function(e){return h},then:function(e){return e.required(q)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==g},then:function(e){return e.min(g,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ne(g)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==C},then:function(e){return e.max(C,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ne(C)))},otherwise:function(e){return e}})}),P=E({defaultValues:O,resolver:y(V)});return e.useEffect((function(){r&&(P.clearErrors(),P.setValue("poso",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),P.handleSubmit((function(e){return l(e.poso)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(me,{form:P,name:"poso",label:o,required:h,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:P.handleSubmit((function(e){return l(e.poso)}))},k),e.createElement(p,{color:"error",onClick:function(){return u()}},T)))},Pe=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S;t.isLoading;var L={datetime:i},k=x.object({datetime:h?x.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(g):x.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας")}),W=E({defaultValues:L,resolver:y(k)});return e.useEffect((function(){r&&(W.clearErrors(),W.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),W.handleSubmit((function(e){return l(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ve,{form:W,name:"datetime",label:o,required:h,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:W.handleSubmit((function(e){return l(e.datetime)}))},C),e.createElement(p,{color:"error",onClick:function(){return u()}},q)))},je=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S;t.isLoading;var L={datetime:i},k=x.object({datetime:h?x.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(g):x.date().typeError("Μη έγκυρη μορφή ημερομηνίας")}),W=E({defaultValues:L,resolver:y(k)});return e.useEffect((function(){r&&(W.clearErrors(),W.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),W.handleSubmit((function(e){return l(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(he,{form:W,name:"datetime",label:o,required:h,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:W.handleSubmit((function(e){return l(e.datetime)}))},C),e.createElement(p,{color:"error",onClick:function(){return u()}},q)))},Re=[{id:!0,label:"ΝΑΙ"},{id:!1,label:"ΟΧΙ"}],ze=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,u=t.onSubmit,d=t.onCancel,s=t.required,m=void 0===s||s,h=t.info,b=void 0===h?"":h,g=t.size,w=void 0===g?"sm":g,C=t.requiredMessage,S=void 0===C?"Υποχρεωτικό πεδίο":C,q=t.okLabel,L=void 0===q?"ΚΑΤΑΧΩΡΗΣΗ":q,k=t.cancelLabel,W=void 0===k?"ΑΚΥΡΩΣΗ":k,T={field:l||null},O=x.object({field:m?x.boolean().required(S):x.boolean().nullable()}),V=E({defaultValues:T,resolver:y(O)});return e.useEffect((function(){n&&(V.clearErrors(),V.setValue("field",l,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[n,l]),e.createElement(a,{fullWidth:!0,maxWidth:w,open:n,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,b&&e.createElement(r,null,b),e.createElement(ee,{form:V,name:"field",label:i,options:Re,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:V.handleSubmit((function(e){return u(e.field)}))},L),e.createElement(p,{color:"error",onClick:function(){return d()}},W)))},De=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.allowNegative,s=void 0!==d&&d,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.size,C=void 0===w?"sm":w,S=t.minValue,q=void 0===S?null:S,L=t.maxValue,k=void 0===L?null:L,W=t.okLabel,T=void 0===W?"ΚΑΤΑΧΩΡΗΣΗ":W,O=t.cancelLabel,V=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var P={num:re(i)?i:null},j=x.object({num:x.number().when([],{is:function(e){return h},then:function(e){return e.required(g)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==q},then:function(e){return e.min(q,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(q))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==k},then:function(e){return e.max(k,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(k))},otherwise:function(e){return e}})}),R=E({defaultValues:P,resolver:y(j)});return e.useEffect((function(){r&&(R.clearErrors(),R.setValue("num",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),R.handleSubmit((function(e){return l(e.num)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ge,{form:R,name:"num",label:o,required:h,autofocus:!0,allowNegative:s,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:R.handleSubmit((function(e){return l(e.num)}))},T),e.createElement(p,{color:"error",onClick:function(){return u()}},V)))},Be=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.decimals,u=void 0===l?2:l,d=t.minValue,s=void 0===d?null:d,m=t.maxValue,h=void 0===m?null:m,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,L=t.requiredMessage,k=void 0===L?"Υποχρεωτικό πεδίο":L,W=t.okLabel,T=void 0===W?"ΚΑΤΑΧΩΡΗΣΗ":W,O=t.cancelLabel,V=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var P={field:re(i)?i:null},j=x.object({field:x.number().when([],{is:function(e){return q},then:function(e){return e.required(k)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==s},then:function(e){return e.min(s,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(s,u)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==h},then:function(e){return e.max(h,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(oe(h,u)))},otherwise:function(e){return e}})}),R=E({defaultValues:P,resolver:y(j)});return e.useEffect((function(){r&&(R.clearErrors(),R.setValue("field",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),R.handleSubmit((function(e){return b(e.field)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(me,{form:R,name:"field",label:o,required:q,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:R.handleSubmit((function(e){return b(e.field)}))},T),e.createElement(p,{color:"error",onClick:function(){return g()}},V)))},Ke=function(t){var r=t.open,n=t.title,o=t.message,i=t.onClose,l=t.closeText,u=void 0===l?"ΟΚ":l;return e.createElement(a,{open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(b,null,o)),e.createElement(v,null,e.createElement(p,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},Fe=function(t){var r=t.open,n=t.title,o=void 0===n?"Νέο Αρχείο":n,i=t.description,l=void 0===i||i,u=t.descriptionLabel,s=void 0===u?"Περιγραφή Αρχείου":u,m=t.fileSelectLabel,h=void 0===m?"Επιλογή Αρχείου":m,b=t.maxFileName,g=void 0===b?255:b,w=t.onSubmit,C=t.onCancel;t.isLoading;var S=x.object({descr:l?x.string().required("Παρακαλώ συμπληρώστε την περιγραφή του αρχείου").max(g,"Η περιγραφή δεν πρέπει να υπερβαίνει τους ".concat(g," χαρακτήρες")):x.string(),filename:x.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),q=E({defaultValues:{descr:"",filename:null},resolver:y(S)});return e.useEffect((function(){r&&(q.clearErrors(),q.setValue("descr",""),q.setValue("filename",null))}),[r]),e.createElement(a,{maxWidth:"sm",fullWidth:!0,open:r,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,e.createElement(d,{sx:{marginTop:2},gap:3},l&&e.createElement(X,{form:q,name:"descr",label:s,required:!0,autofocus:!0}),e.createElement(ye,{form:q,name:"filename",label:h,required:!0}))),e.createElement(v,null,e.createElement(p,{color:"success",onClick:q.handleSubmit(w)},"ΚΑΤΑΧΩΡΗΣΗ"),e.createElement(p,{color:"error",onClick:function(){return C()}},"ΑΚΥΡΩΣΗ")))},Ne=function(t){var n=t.open,o=t.title,i=t.label,l=t.optionsUrl,b=t.value,g=t.onSubmit,w=t.onCancel,C=t.valueKey,S=void 0===C?"id":C,q=t.labelKey,L=void 0===q?"label":q,k=t.required,W=void 0===k||k,T=t.size,O=void 0===T?"sm":T,V=t.requiredMessage,P=void 0===V?"Υποχρεωτικό πεδίο":V,j=t.minChars,z=void 0===j?1:j,D=t.okLabel,B=void 0===D?"ΚΑΤΑΧΩΡΗΣΗ":D,K=t.cancelLabel,F=void 0===K?"ΑΚΥΡΩΣΗ":K,N=t.message,I=void 0===N?null:N,M=t.isLoading,A=void 0!==M&&M,_={field:b||null},H=x.object({field:W?x.string().required(P):x.string().nullable()}),G=E({defaultValues:_,resolver:y(H)});e.useEffect((function(){n&&(G.reset(_),G.clearErrors())}),[n,b]);return e.createElement(a,{fullWidth:!0,maxWidth:O,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(R,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e.field)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},I&&"string"!=typeof I&&e.createElement(s,{sx:{mb:2}},I),e.createElement(ue,{form:G,name:"field",label:i,optionsUrl:l,minChars:z,valueKey:S,labelKey:L,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))},Ie=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S,L={datetime:i},k=x.object({datetime:h?x.date().typeError("Μη έγκυρη μορφή ώρας").required(g):x.date().typeError("Μη έγκυρη μορφή ώρας")}),W=E({defaultValues:L,resolver:y(k)});return e.useEffect((function(){r&&(W.clearErrors(),W.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),W.handleSubmit((function(e){return l(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(we,{form:W,name:"datetime",label:o,required:h,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:W.handleSubmit((function(e){return l(e.datetime)}))},C),e.createElement(p,{color:"error",onClick:function(){return u()}},q)))};export{Ne as AutocompleteApiModalForm,ke as AutocompleteModalForm,We as AutocompleteMultiModalForm,Te as ConfirmationDialog,Ve as CurrencyModalForm,je as DateModalForm,Pe as DatetimeModalForm,Be as DecimalModalForm,qe as EmailModalForm,De as IntegerModalForm,Ke as MessageDialog,Oe as NotesModalForm,Le as PickColorModalForm,Fe as SelectFileModalForm,Ce as TextModalForm,Ie as TimeModalForm,ze as YesNoModalForm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artibet/react-mui-components",
3
- "version": "3.7.27",
3
+ "version": "3.7.28",
4
4
  "description": "Various react components build with mui library",
5
5
  "main": "./core/index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- import e from"react";import{TextField as t,Autocomplete as r,Chip as n,Dialog as o,Zoom as i,DialogTitle as l,Stack as a,Box as s,Typography as c,Divider as d,DialogContent as u,DialogActions as m,Button as f,CircularProgress as v,DialogContentText as p,ListItem as b,Grid2 as x}from"@mui/material";import{router as g}from"@inertiajs/react";import{EditNoteRounded as h,ErrorOutline as E,Edit as y,ToggleOff as S,ToggleOn as W}from"@mui/icons-material";import{Controller as w,useForm as C}from"react-hook-form";import{yupResolver as z}from"@hookform/resolvers/yup";import*as q from"yup";import"react-color";import{format as T,parseISO as L,toDate as k}from"date-fns";import{el as O}from"date-fns/locale";import"axios";import"react-number-format";import{AdapterDateFns as j}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as R}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as I,renderDigitalClockTimeView as P}from"@mui/x-date-pickers";import K from"date-fns/locale/el";import F from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import D from"@mui/icons-material/CheckCircleOutlineRounded";function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function V(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(null,arguments)}function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Z=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Y=function(r){var n=r.form,o=r.name,i=r.label,l=r.maxLength,a=void 0===l?255:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=r.readonly,x=void 0!==b&&b,g=r.readonlyBackgroundColor,h=void 0===g?"#dddddd":g,E=r.bold,y=void 0!==E&&E,S=U(r,Z),W=n.control,C=n.formState.errors;return e.createElement(w,{name:o,control:W,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,A({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=C[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=C[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f,slotProps:{input:{maxLength:a,readOnly:x,sx:{fontWeight:y?"bold":"",backgroundColor:x?h:""}}}},S))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],J=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,l=r.label,a=void 0===l?"E-mail":l,s=r.maxLength,c=void 0===s?255:s,d=r.required,u=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,b=r.showErrors,x=void 0===b||b,g=r.readonly,h=void 0!==g&&g,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,S=r.bold,W=void 0!==S&&S,C=U(r,G),z=n.control,q=n.formState.errors;return e.createElement(w,{name:i,control:z,rules:{required:u,disabled:f},render:function(r){var n,o,l=r.field,s=l.onChange,d=l.onBlur,m=l.value;return e.createElement(t,A({required:u,label:a,value:m,onChange:s,onBlur:d,error:x&&Boolean(null===(n=q[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:x&&(null===(o=q[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:h,sx:{fontWeight:W?"bold":"",backgroundColor:h?y:""}}}},C))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],X=function(n){var o=n.form,i=n.name,l=n.label,a=n.required,s=void 0!==a&&a,c=n.disabled,d=void 0!==c&&c,u=n.options,m=void 0===u?[]:u,f=n.valueKey,v=void 0===f?"id":f,p=n.labelKey,b=void 0===p?"label":p,x=n.maxLength,g=void 0===x?255:x,h=n.autofocus,E=void 0!==h&&h,y=n.noOptionsText,S=void 0===y?"Δεν υπάρχουν επιλογές":y,W=n.showErrors,C=void 0===W||W,z=n.size,q=void 0===z?"medium":z,T=n.readonly,L=void 0!==T&&T,k=n.readonlyBackgroundColor,O=void 0===k?"#dddddd":k,j=n.bold,R=void 0!==j&&j,I=U(n,Q),P=$(e.useState(null),2),K=P[0],F=P[1],B=o.watch(i);e.useEffect((function(){F(m.find((function(e){return e[v]===B}))||null)}),[B]);var D=o.control,M=o.formState.errors;return e.createElement(w,{name:i,control:D,rules:{required:s,disabled:d},render:function(n){var o=n.field,a=o.onChange,c=o.onBlur;return o.value,L?e.createElement(t,{size:q,label:l,fullWidth:!0,required:s,slotProps:{input:{maxLength:g,readOnly:L,sx:{fontWeight:R?"bold":"",backgroundColor:L?O:""}}},value:K?K.label:""}):e.createElement(r,{value:K,required:s,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[b]},size:q,slotProps:{input:{maxLength:g,sx:{fontWeight:R?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,A({label:l,required:s,disabled:d,autoFocus:E,size:q,error:C&&Boolean(null===(n=M[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:C&&(null===(o=M[i])||void 0===o?void 0:o.message)},r,I))}})}})},_=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ee=function(o){var i=o.form,l=o.name,a=o.label,s=o.required,c=void 0!==s&&s,d=o.disabled,u=void 0!==d&&d,m=o.options,f=void 0===m?[]:m,v=o.valueKey,p=void 0===v?"id":v,b=o.labelKey,x=void 0===b?"label":b,g=o.maxLength,h=void 0===g?255:g,E=o.autofocus,y=void 0!==E&&E,S=o.noOptionsText,W=void 0===S?"Δεν υπάρχουν επιλογές":S,C=o.showErrors,z=void 0===C||C,q=U(o,_),T=$(e.useState([]),2),L=T[0],k=T[1],O=i.watch(l);e.useEffect((function(){k(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,O)})))}),[O]);var j=i.control,R=i.formState.errors;return e.createElement(w,{name:l,control:j,rules:{required:c,disabled:u},render:function(o){var i=o.field,s=i.onChange,d=i.onBlur;return i.value,e.createElement(r,{multiple:!0,value:L,required:c,onChange:function(e,t){return s(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:W,renderTags:function(t,r){return t.map((function(t,o){return e.createElement(n,A({variant:"outlined",label:t[x],size:"small"},r({index:o})))}))},renderInput:function(r){var n,o;return e.createElement(t,A({label:a,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:h},error:z&&Boolean(null===(n=R[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:z&&(null===(o=R[l])||void 0===o?void 0:o.message)},r,q))}})}})},te=["form","name","label","rows","required","disabled","autofocus","showErrors"],re=function(r){var n=r.form,o=r.name,i=r.label,l=r.rows,a=void 0===l?5:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=U(r,te),x=n.control,g=n.formState.errors;return e.createElement(w,{name:o,control:x,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,A({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,onChange:d,onBlur:m,error:p&&Boolean(null===(n=g[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=g[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f},b))}})},ne=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],oe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,s=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,u=t.ampm,m=void 0!==u&&u,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,b=void 0===p?1:p,x=t.minutesStep,g=void 0===x?15:x,h=t.secondsStep,E=void 0===h?30:h,y=U(t,ne),S=r.control,W=r.formState.errors;return e.createElement(R,{dateAdapter:j,adapterLocale:K,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(w,{name:n,control:S,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(I,{label:o,value:a.value?k(a.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:P}:null,timeSteps:{hours:b,minutes:g,seconds:E},slotProps:{textField:N(N({},y),{},{required:l,error:d&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ie=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,O=t.cancelLabel,j=void 0===O?"ΑΚΥΡΩΣΗ":O,R=t.maxLength,I=void 0===R?255:R,P=t.message,K=void 0===P?null:P,F=t.isLoading,B=void 0!==F&&F,D={text:b||""},M=q.object({text:W?q.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(T):q.string().max(I)}),V=C({defaultValues:D,resolver:z(M)});e.useEffect((function(){r&&(V.reset(D),V.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),K&&"string"==typeof K?e.createElement(c,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:V.handleSubmit((function(e){return x(e.text)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},K&&"string"!=typeof K&&e.createElement(s,{sx:{mb:2}},K),e.createElement(Y,{form:V,name:"text",label:p,required:W,autofocus:!0,maxLength:I,sx:{mt:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},j),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},le=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ae=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.invalidMessage,k=void 0===L?"Μη έγκυρη μορφή email":L,O=t.okLabel,j=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,R=t.cancelLabel,I=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.maxLength,K=void 0===P?255:P,F=t.message,B=void 0===F?null:F,D=t.isLoading,M=void 0!==D&&D,V={email:b||""},A=q.object({email:W?q.string().matches(le,k).required(T):q.string().matches(le,k)}),H=C({defaultValues:V,resolver:z(A)});e.useEffect((function(){r&&(H.reset(V),H.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),B&&"string"==typeof B?e.createElement(c,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return x(e.email)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(J,{form:H,label:p,required:W,autofocus:!0,maxLength:K,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},I),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},M?e.createElement(v,{size:20,sx:{color:"inherit"}}):j))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var se=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.options,y=void 0===E?[]:E,S=t.valueKey,W=void 0===S?"id":S,w=t.labelKey,T=void 0===w?"label":w,L=t.required,k=void 0===L||L,O=t.size,j=void 0===O?"sm":O,R=t.requiredMessage,I=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.okLabel,K=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,F=t.cancelLabel,B=void 0===F?"ΑΚΥΡΩΣΗ":F,D=t.isLoading,M=void 0!==D&&D,V={field:b||null},A=q.object({field:k?q.string().required(I):q.string().nullable()}),H=C({defaultValues:V,resolver:z(A)});e.useEffect((function(){r&&(H.reset(V),H.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:j,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),message&&"string"==typeof message?e.createElement(c,{variant:"caption",color:"text.secondary"},message):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return x(e.field)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},e.createElement(X,{form:H,name:"field",label:p,options:y,valueKey:W,labelKey:T,required:k,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},M?e.createElement(v,{size:20,sx:{color:"inherit"}}):K))))},ce=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=void 0===b?[]:b,g=t.onSubmit,E=t.onCancel,y=t.options,S=void 0===y?[]:y,W=t.valueKey,w=void 0===W?"id":W,T=t.labelKey,L=void 0===T?"label":T,k=t.required,O=void 0===k||k,j=t.size,R=void 0===j?"sm":j,I=t.requiredMessage,P=void 0===I?"Επιλέξτε τουλάχιστον μία τιμή":I,K=t.okLabel,F=void 0===K?"ΚΑΤΑΧΩΡΗΣΗ":K,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,M=t.message,V=void 0===M?null:M,A=t.isLoading,H=void 0!==A&&A,N={field:x||[]},U=q.object({field:O?q.array().min(1,P):q.array()}),$=C({defaultValues:N,resolver:z(U)});e.useEffect((function(){r&&($.reset(N),$.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:R,open:r,onClose:function(e,t){"escapeKeyDown"===t&&E()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),V&&"string"==typeof V?e.createElement(c,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:$.handleSubmit((function(e){return g(e.field)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},V&&"string"!=typeof V&&e.createElement(s,{sx:{mb:2}},V),e.createElement(ee,{form:$,name:"field",label:p,options:S,valueKey:w,labelKey:L,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),E()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},H?e.createElement(v,{size:20,sx:{color:"inherit"}}):F))))},de=function(t){var r=t.open,n=t.title,a=t.message,c=t.onConfirm,d=t.onCancel,b=t.confirmText,x=void 0===b?"ΕΠΙΒΕΒΑΙΩΣΗ":b,g=t.cancelText,h=void 0===g?"ΑΚΥΡΩΣΗ":g,E=t.isLoading,y=void 0!==E&&E,S=t.type,W=void 0===S?"warning":S,w={warning:{color:"warning.main",icon:e.createElement(F,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(D,{sx:{fontSize:40}})}}[W]||{color:"primary.main",icon:null};return e.createElement(o,{open:r,onClose:function(e,t){"backdropClick"!==t&&d()},slots:{transition:i},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(w.color,"20"),color:w.color,borderRadius:"50%",mb:2}},w.icon),e.createElement(l,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(u,null,e.createElement(p,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},a)),e.createElement(m,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(f,{fullWidth:!0,variant:"text",color:"inherit",onClick:d,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},h),e.createElement(f,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===W?"error":"primary",onClick:c,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(v,{size:20,sx:{color:"inherit"}}):x)))},ue=function(t){var r=t.open,n=t.title,p=t.label,b=t.message,x=void 0===b?null:b,g=t.value,E=t.onSubmit,y=t.onCancel,S=t.size,W=void 0===S?"sm":S,w=t.rows,T=void 0===w?5:w,L=t.required,k=void 0!==L&&L,O=t.requiredMessage,j=void 0===O?"Υποχρεωτικό πεδίο":O,R=t.okLabel,I=void 0===R?"ΚΑΤΑΧΩΡΗΣΗ":R,P=t.cancelLabel,K=void 0===P?"ΑΚΥΡΩΣΗ":P,F=t.isLoading,B=void 0!==F&&F,D={notes:g||""},M=q.object({notes:k?q.string().required(j):q.string()}),V=C({defaultValues:D,resolver:z(M)});e.useEffect((function(){r&&(V.reset(D),V.clearErrors())}),[r,g]);return e.createElement(o,{fullWidth:!0,maxWidth:W,open:r,onClose:function(e,t){"escapeKeyDown"===t&&y()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),x&&"string"==typeof x?e.createElement(c,{variant:"caption",color:"text.secondary"},x):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:V.handleSubmit((function(e){return E(e.notes)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},x&&"string"!=typeof x&&e.createElement(s,{sx:{mb:2}},x),e.createElement(re,{form:V,name:"notes",label:p,required:k,rows:T,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),y()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):I))))},me=function(t){var r=t.open,n=t.title,i=t.label,a=t.value,s=t.onSubmit,c=t.onCancel,d=t.size,v=void 0===d?"sm":d,p=t.required,b=void 0===p||p,x=t.requiredMessage,g=void 0===x?"Υποχρεωτικό πεδίο":x,h=t.okLabel,E=void 0===h?"ΚΑΤΑΧΩΡΗΣΗ":h,y=t.cancelLabel,S=void 0===y?"ΑΚΥΡΩΣΗ":y;t.isLoading;var W={datetime:a},w=q.object({datetime:b?q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(g):q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας")}),T=C({defaultValues:W,resolver:z(w)});return e.useEffect((function(){r&&(T.clearErrors(),T.setValue("datetime",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,a]),e.createElement(o,{fullWidth:!0,maxWidth:v,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),T.handleSubmit((function(e){return s(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(l,null,n),e.createElement(u,null,e.createElement(oe,{form:T,name:"datetime",label:i,required:b,autofocus:!0,sx:{marginTop:2}})),e.createElement(m,null,e.createElement(f,{color:"success",onClick:T.handleSubmit((function(e){return s(e.datetime)}))},E),e.createElement(f,{color:"error",onClick:function(){return c()}},S)))},fe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,R=void 0===j||j,I=$(e.useState(!1),2),P=I[0],K=I[1],F=!o&&h,B=$(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:F?"contained":"outlined",color:F?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(ie,{open:P,title:C,label:r,value:o,required:h,maxLength:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),K(!1)}})},onCancel:function(){return K(!1)},message:O,isLoading:D}))},ve=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,R=void 0===j||j,I=$(e.useState(!1),2),P=I[0],K=I[1],F=!o&&h,B=$(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:F?"contained":"outlined",color:F?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(ae,{open:P,title:C,label:r,value:o,required:h,maxLength:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),K(!1)}})},onCancel:function(){return K(!1)},message:O,isLoading:D}))},pe=function(t){var r,o=t.label,i=t.value,l=t.render,s=void 0===l?null:l,u=t.fieldName,m=void 0===u?null:u,v=t.editable,p=void 0!==v&&v,h=t.required,S=void 0===h||h,W=t.placeholder,w=void 0===W?"":W,C=t.modalTitle,z=void 0===C?"Επεξεργασία":C,q=t.updateUrl,k=void 0===q?null:q,j=t.message,R=void 0===j?null:j,I=t.hasDivider,P=void 0===I||I,K=$(e.useState(!1),2),F=K[0],B=K[1],D=!i&&S,M=$(e.useState(!1),2),V=M[0],A=M[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},o)),e.createElement(x,{size:{xs:12,sm:6}},S&&!i?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?T(L(r,{locale:O}),"dd/MM/yyyy, HH:mm"):"":w)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),B(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),P&&e.createElement(d,{component:"li"}),e.createElement(me,{open:F,title:z,label:o,value:i,required:S,onSubmit:function(e){A(!0),g.put(k,{field:m,value:e},{preserveScroll:!0,onFinish:function(){A(!1),B(!1)}})},onCancel:function(){return B(!1)},message:R,isLoading:V}))},be=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.rows,L=void 0===T?5:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,R=void 0===j||j,I=$(e.useState(!1),2),P=I[0],K=I[1],F=!o&&h,B=$(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:F?"contained":"outlined",color:F?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(ue,{open:P,title:C,label:r,value:o,required:h,rows:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),K(!1)}})},onCancel:function(){return K(!1)},message:O,isLoading:D}))},xe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,h=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,w=t.editable,C=void 0!==w&&w,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,O=void 0===k?"Επεξεργασία":k,j=t.updateUrl,R=void 0===j?null:j,I=t.message,P=void 0===I?null:I,K=t.hasDivider,F=void 0===K||K,B=$(e.useState(!1),2),D=B[0],M=B[1],V=null==o&&q,A=u.find((function(e){return e.id===o})),H=A?A.label:"",N=$(e.useState(!1),2),U=N[0],Z=N[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},H||L)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(se,{open:D,title:O,label:r,value:o,options:u,valueKey:v,labelKey:h,required:q,onSubmit:function(e){Z(!0),g.put(R,{field:W,value:e.field},{preserveScroll:!0,onFinish:function(){Z(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:U}))},ge=function(t){var r=t.label,n=t.value,o=t.render,i=void 0===o?null:o,l=t.fieldName,a=void 0===l?null:l,s=t.editable,u=void 0!==s&&s,m=t.activationLabel,v=void 0===m?"Ενεργοποίηση":m,p=t.deactivationLabel,h=void 0===p?"Απενεργοποίηση":p,E=t.activationMessage,y=void 0===E?"":E,w=t.deactivationMessage,C=void 0===w?"":w,z=t.updateUrl,q=void 0===z?null:z,T=t.hasDivider,L=void 0===T||T,k=$(e.useState(!1),2),O=k[0],j=k[1],R=$(e.useState(!1),2),I=R[0],P=R[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},i||e.createElement(c,{variant:"body1",fontWeight:500},n?1:0)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},u&&e.createElement(f,{size:"small",variant:"outlined",color:n?"error":"success",startIcon:n?e.createElement(S,{fontSize:"small"}):e.createElement(W,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},n?h:v)))),L&&e.createElement(d,{component:"li"}),e.createElement(de,{open:O,title:n?h:v,message:n?C:y,onConfirm:function(){P(!0),g.put(q,{field:a,value:n?0:1},{preserveScroll:!0,onFinish:function(){P(!1),j(!1)}})},onCancel:function(){return j(!1)},isLoading:I}))},he=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,h=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,w=t.editable,C=void 0!==w&&w,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,O=void 0===k?"Επεξεργασία":k,j=t.updateUrl,R=void 0===j?null:j,I=t.message,P=void 0===I?null:I,K=t.hasDivider,F=void 0===K||K,B=$(e.useState(!1),2),D=B[0],M=B[1],V=null==o&&q,A=$(e.useState(!1),2),H=A[0],N=A[1],U=u.filter((function(e){return o.some((function(t){return t[v]===e[v]}))})).map((function(e){return e[h]})).join(", ");return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},U||L)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(ce,{open:D,title:O,label:r,value:o,options:u,valueKey:v,labelKey:h,required:q,onSubmit:function(e){N(!0),g.put(R,{field:W,value:e.map((function(e){return e[v]}))},{preserveScroll:!0,onFinish:function(){N(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:H}))};export{he as AutocompleteMultiProperty,xe as AutocompleteProperty,pe as DateTimeProperty,ve as EmailProperty,fe as StringProperty,be as TextProperty,ge as ToggleProperty};
1
+ import e from"react";import{TextField as t,Autocomplete as r,Chip as n,Dialog as o,Zoom as i,DialogTitle as l,Stack as a,Box as s,Typography as c,Divider as d,DialogContent as u,DialogActions as m,Button as f,CircularProgress as v,DialogContentText as p,ListItem as b,Grid2 as x}from"@mui/material";import{router as g}from"@inertiajs/react";import{EditNoteRounded as h,ErrorOutline as E,Edit as y,ToggleOff as S,ToggleOn as W}from"@mui/icons-material";import{Controller as w,useForm as C}from"react-hook-form";import{yupResolver as z}from"@hookform/resolvers/yup";import*as q from"yup";import"react-color";import{format as T,parseISO as L,toDate as k}from"date-fns";import{el as O}from"date-fns/locale";import"axios";import"react-number-format";import{AdapterDateFns as j}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as R}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as I,renderDigitalClockTimeView as P}from"@mui/x-date-pickers";import K from"date-fns/locale/el";import F from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import D from"@mui/icons-material/CheckCircleOutlineRounded";function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function V(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(null,arguments)}function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Z=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Y=function(r){var n=r.form,o=r.name,i=r.label,l=r.maxLength,a=void 0===l?255:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=r.readonly,x=void 0!==b&&b,g=r.readonlyBackgroundColor,h=void 0===g?"#dddddd":g,E=r.bold,y=void 0!==E&&E,S=U(r,Z),W=n.control,C=n.formState.errors;return e.createElement(w,{name:o,control:W,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,A({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=C[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=C[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f,slotProps:{input:{maxLength:a,readOnly:x,sx:{fontWeight:y?"bold":"",backgroundColor:x?h:""}}}},S))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],J=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,l=r.label,a=void 0===l?"E-mail":l,s=r.maxLength,c=void 0===s?255:s,d=r.required,u=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,b=r.showErrors,x=void 0===b||b,g=r.readonly,h=void 0!==g&&g,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,S=r.bold,W=void 0!==S&&S,C=U(r,G),z=n.control,q=n.formState.errors;return e.createElement(w,{name:i,control:z,rules:{required:u,disabled:f},render:function(r){var n,o,l=r.field,s=l.onChange,d=l.onBlur,m=l.value;return e.createElement(t,A({required:u,label:a,value:m,onChange:s,onBlur:d,error:x&&Boolean(null===(n=q[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:x&&(null===(o=q[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:h,sx:{fontWeight:W?"bold":"",backgroundColor:h?y:""}}}},C))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],X=function(n){var o=n.form,i=n.name,l=n.label,a=n.required,s=void 0!==a&&a,c=n.disabled,d=void 0!==c&&c,u=n.options,m=void 0===u?[]:u,f=n.valueKey,v=void 0===f?"id":f,p=n.labelKey,b=void 0===p?"label":p,x=n.maxLength,g=void 0===x?255:x,h=n.autofocus,E=void 0!==h&&h,y=n.noOptionsText,S=void 0===y?"Δεν υπάρχουν επιλογές":y,W=n.showErrors,C=void 0===W||W,z=n.size,q=void 0===z?"medium":z,T=n.readonly,L=void 0!==T&&T,k=n.readonlyBackgroundColor,O=void 0===k?"#dddddd":k,j=n.bold,R=void 0!==j&&j,I=U(n,Q),P=$(e.useState(null),2),K=P[0],F=P[1],B=o.watch(i);e.useEffect((function(){F(m.find((function(e){return e[v]===B}))||null)}),[B]);var D=o.control,M=o.formState.errors;return e.createElement(w,{name:i,control:D,rules:{required:s,disabled:d},render:function(n){var o=n.field,a=o.onChange,c=o.onBlur;return o.value,L?e.createElement(t,{size:q,label:l,fullWidth:!0,required:s,slotProps:{input:{maxLength:g,readOnly:L,sx:{fontWeight:R?"bold":"",backgroundColor:L?O:""}}},value:K?K.label:""}):e.createElement(r,{value:K,required:s,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[b]},size:q,slotProps:{input:{maxLength:g,sx:{fontWeight:R?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,A({label:l,required:s,disabled:d,autoFocus:E,size:q,error:C&&Boolean(null===(n=M[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:C&&(null===(o=M[i])||void 0===o?void 0:o.message)},r,I))}})}})},_=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ee=function(o){var i=o.form,l=o.name,a=o.label,s=o.required,c=void 0!==s&&s,d=o.disabled,u=void 0!==d&&d,m=o.options,f=void 0===m?[]:m,v=o.valueKey,p=void 0===v?"id":v,b=o.labelKey,x=void 0===b?"label":b,g=o.maxLength,h=void 0===g?255:g,E=o.autofocus,y=void 0!==E&&E,S=o.noOptionsText,W=void 0===S?"Δεν υπάρχουν επιλογές":S,C=o.showErrors,z=void 0===C||C,q=U(o,_),T=$(e.useState([]),2),L=T[0],k=T[1],O=i.watch(l);e.useEffect((function(){k(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,O)})))}),[O]);var j=i.control,R=i.formState.errors;return e.createElement(w,{name:l,control:j,rules:{required:c,disabled:u},render:function(o){var i=o.field,s=i.onChange,d=i.onBlur;return i.value,e.createElement(r,{multiple:!0,value:L,required:c,onChange:function(e,t){return s(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:W,renderTags:function(t,r){return t.map((function(t,o){return e.createElement(n,A({variant:"outlined",label:t[x],size:"small"},r({index:o})))}))},renderInput:function(r){var n,o;return e.createElement(t,A({label:a,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:h},error:z&&Boolean(null===(n=R[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:z&&(null===(o=R[l])||void 0===o?void 0:o.message)},r,q))}})}})},te=["form","name","label","rows","required","disabled","autofocus","showErrors"],re=function(r){var n=r.form,o=r.name,i=r.label,l=r.rows,a=void 0===l?5:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=U(r,te),x=n.control,g=n.formState.errors;return e.createElement(w,{name:o,control:x,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,A({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,onChange:d,onBlur:m,error:p&&Boolean(null===(n=g[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=g[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f},b))}})},ne=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],oe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,s=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,u=t.ampm,m=void 0!==u&&u,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,b=void 0===p?1:p,x=t.minutesStep,g=void 0===x?15:x,h=t.secondsStep,E=void 0===h?30:h,y=U(t,ne),S=r.control,W=r.formState.errors;return e.createElement(R,{dateAdapter:j,adapterLocale:K,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(w,{name:n,control:S,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(I,{label:o,value:a.value?k(a.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:P}:null,timeSteps:{hours:b,minutes:g,seconds:E},slotProps:{textField:N(N({},y),{},{required:l,error:d&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ie=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,O=t.cancelLabel,j=void 0===O?"ΑΚΥΡΩΣΗ":O,R=t.maxLength,I=void 0===R?255:R,P=t.message,K=void 0===P?null:P,F=t.isLoading,B=void 0!==F&&F,D={text:b||""},M=q.object({text:W?q.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(T):q.string().max(I)}),V=C({defaultValues:D,resolver:z(M)});e.useEffect((function(){r&&(V.reset(D),V.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),K&&"string"==typeof K?e.createElement(c,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:V.handleSubmit((function(e){return x(e.text)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},K&&"string"!=typeof K&&e.createElement(s,{sx:{mb:2}},K),e.createElement(Y,{form:V,name:"text",label:p,required:W,autofocus:!0,maxLength:I,sx:{mt:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},j),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},le=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ae=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.invalidMessage,k=void 0===L?"Μη έγκυρη μορφή email":L,O=t.okLabel,j=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,R=t.cancelLabel,I=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.maxLength,K=void 0===P?255:P,F=t.message,B=void 0===F?null:F,D=t.isLoading,M=void 0!==D&&D,V={email:b||""},A=q.object({email:W?q.string().matches(le,k).required(T):q.string().matches(le,k)}),H=C({defaultValues:V,resolver:z(A)});e.useEffect((function(){r&&(H.reset(V),H.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),B&&"string"==typeof B?e.createElement(c,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return x(e.email)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(J,{form:H,label:p,required:W,autofocus:!0,maxLength:K,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},I),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},M?e.createElement(v,{size:20,sx:{color:"inherit"}}):j))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var se=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.options,y=void 0===E?[]:E,S=t.valueKey,W=void 0===S?"id":S,w=t.labelKey,T=void 0===w?"label":w,L=t.required,k=void 0===L||L,O=t.size,j=void 0===O?"sm":O,R=t.requiredMessage,I=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.okLabel,K=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,F=t.cancelLabel,B=void 0===F?"ΑΚΥΡΩΣΗ":F,D=t.message,M=void 0===D?null:D,V=t.isLoading,A=void 0!==V&&V,H={field:b||null},N=q.object({field:k?q.string().required(I):q.string().nullable()}),U=C({defaultValues:H,resolver:z(N)});e.useEffect((function(){r&&(U.reset(H),U.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:j,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),M&&"string"==typeof M?e.createElement(c,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit((function(e){return x(e.field)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},e.createElement(X,{form:U,name:"field",label:p,options:y,valueKey:W,labelKey:T,required:k,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(v,{size:20,sx:{color:"inherit"}}):K))))},ce=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=void 0===b?[]:b,g=t.onSubmit,E=t.onCancel,y=t.options,S=void 0===y?[]:y,W=t.valueKey,w=void 0===W?"id":W,T=t.labelKey,L=void 0===T?"label":T,k=t.required,O=void 0===k||k,j=t.size,R=void 0===j?"sm":j,I=t.requiredMessage,P=void 0===I?"Επιλέξτε τουλάχιστον μία τιμή":I,K=t.okLabel,F=void 0===K?"ΚΑΤΑΧΩΡΗΣΗ":K,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,M=t.message,V=void 0===M?null:M,A=t.isLoading,H=void 0!==A&&A,N={field:x||[]},U=q.object({field:O?q.array().min(1,P):q.array()}),$=C({defaultValues:N,resolver:z(U)});e.useEffect((function(){r&&($.reset(N),$.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:R,open:r,onClose:function(e,t){"escapeKeyDown"===t&&E()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),V&&"string"==typeof V?e.createElement(c,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:$.handleSubmit((function(e){return g(e.field)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},V&&"string"!=typeof V&&e.createElement(s,{sx:{mb:2}},V),e.createElement(ee,{form:$,name:"field",label:p,options:S,valueKey:w,labelKey:L,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),E()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},H?e.createElement(v,{size:20,sx:{color:"inherit"}}):F))))},de=function(t){var r=t.open,n=t.title,a=t.message,c=t.onConfirm,d=t.onCancel,b=t.confirmText,x=void 0===b?"ΕΠΙΒΕΒΑΙΩΣΗ":b,g=t.cancelText,h=void 0===g?"ΑΚΥΡΩΣΗ":g,E=t.isLoading,y=void 0!==E&&E,S=t.type,W=void 0===S?"warning":S,w={warning:{color:"warning.main",icon:e.createElement(F,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(D,{sx:{fontSize:40}})}}[W]||{color:"primary.main",icon:null};return e.createElement(o,{open:r,onClose:function(e,t){"backdropClick"!==t&&d()},slots:{transition:i},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(w.color,"20"),color:w.color,borderRadius:"50%",mb:2}},w.icon),e.createElement(l,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(u,null,e.createElement(p,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},a)),e.createElement(m,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(f,{fullWidth:!0,variant:"text",color:"inherit",onClick:d,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},h),e.createElement(f,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===W?"error":"primary",onClick:c,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(v,{size:20,sx:{color:"inherit"}}):x)))},ue=function(t){var r=t.open,n=t.title,p=t.label,b=t.message,x=void 0===b?null:b,g=t.value,E=t.onSubmit,y=t.onCancel,S=t.size,W=void 0===S?"sm":S,w=t.rows,T=void 0===w?5:w,L=t.required,k=void 0!==L&&L,O=t.requiredMessage,j=void 0===O?"Υποχρεωτικό πεδίο":O,R=t.okLabel,I=void 0===R?"ΚΑΤΑΧΩΡΗΣΗ":R,P=t.cancelLabel,K=void 0===P?"ΑΚΥΡΩΣΗ":P,F=t.isLoading,B=void 0!==F&&F,D={notes:g||""},M=q.object({notes:k?q.string().required(j):q.string()}),V=C({defaultValues:D,resolver:z(M)});e.useEffect((function(){r&&(V.reset(D),V.clearErrors())}),[r,g]);return e.createElement(o,{fullWidth:!0,maxWidth:W,open:r,onClose:function(e,t){"escapeKeyDown"===t&&y()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),x&&"string"==typeof x?e.createElement(c,{variant:"caption",color:"text.secondary"},x):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:V.handleSubmit((function(e){return E(e.notes)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},x&&"string"!=typeof x&&e.createElement(s,{sx:{mb:2}},x),e.createElement(re,{form:V,name:"notes",label:p,required:k,rows:T,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),y()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):I))))},me=function(t){var r=t.open,n=t.title,i=t.label,a=t.value,s=t.onSubmit,c=t.onCancel,d=t.size,v=void 0===d?"sm":d,p=t.required,b=void 0===p||p,x=t.requiredMessage,g=void 0===x?"Υποχρεωτικό πεδίο":x,h=t.okLabel,E=void 0===h?"ΚΑΤΑΧΩΡΗΣΗ":h,y=t.cancelLabel,S=void 0===y?"ΑΚΥΡΩΣΗ":y;t.isLoading;var W={datetime:a},w=q.object({datetime:b?q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(g):q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας")}),T=C({defaultValues:W,resolver:z(w)});return e.useEffect((function(){r&&(T.clearErrors(),T.setValue("datetime",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,a]),e.createElement(o,{fullWidth:!0,maxWidth:v,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),T.handleSubmit((function(e){return s(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(l,null,n),e.createElement(u,null,e.createElement(oe,{form:T,name:"datetime",label:i,required:b,autofocus:!0,sx:{marginTop:2}})),e.createElement(m,null,e.createElement(f,{color:"success",onClick:T.handleSubmit((function(e){return s(e.datetime)}))},E),e.createElement(f,{color:"error",onClick:function(){return c()}},S)))},fe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,R=void 0===j||j,I=$(e.useState(!1),2),P=I[0],K=I[1],F=!o&&h,B=$(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:F?"contained":"outlined",color:F?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(ie,{open:P,title:C,label:r,value:o,required:h,maxLength:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),K(!1)}})},onCancel:function(){return K(!1)},message:O,isLoading:D}))},ve=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,R=void 0===j||j,I=$(e.useState(!1),2),P=I[0],K=I[1],F=!o&&h,B=$(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:F?"contained":"outlined",color:F?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(ae,{open:P,title:C,label:r,value:o,required:h,maxLength:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),K(!1)}})},onCancel:function(){return K(!1)},message:O,isLoading:D}))},pe=function(t){var r,o=t.label,i=t.value,l=t.render,s=void 0===l?null:l,u=t.fieldName,m=void 0===u?null:u,v=t.editable,p=void 0!==v&&v,h=t.required,S=void 0===h||h,W=t.placeholder,w=void 0===W?"":W,C=t.modalTitle,z=void 0===C?"Επεξεργασία":C,q=t.updateUrl,k=void 0===q?null:q,j=t.message,R=void 0===j?null:j,I=t.hasDivider,P=void 0===I||I,K=$(e.useState(!1),2),F=K[0],B=K[1],D=!i&&S,M=$(e.useState(!1),2),V=M[0],A=M[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},o)),e.createElement(x,{size:{xs:12,sm:6}},S&&!i?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?T(L(r,{locale:O}),"dd/MM/yyyy, HH:mm"):"":w)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),B(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),P&&e.createElement(d,{component:"li"}),e.createElement(me,{open:F,title:z,label:o,value:i,required:S,onSubmit:function(e){A(!0),g.put(k,{field:m,value:e},{preserveScroll:!0,onFinish:function(){A(!1),B(!1)}})},onCancel:function(){return B(!1)},message:R,isLoading:V}))},be=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.rows,L=void 0===T?5:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,R=void 0===j||j,I=$(e.useState(!1),2),P=I[0],K=I[1],F=!o&&h,B=$(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:F?"contained":"outlined",color:F?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(ue,{open:P,title:C,label:r,value:o,required:h,rows:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),K(!1)}})},onCancel:function(){return K(!1)},message:O,isLoading:D}))},xe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,h=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,w=t.editable,C=void 0!==w&&w,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,O=void 0===k?"Επεξεργασία":k,j=t.updateUrl,R=void 0===j?null:j,I=t.message,P=void 0===I?null:I,K=t.hasDivider,F=void 0===K||K,B=$(e.useState(!1),2),D=B[0],M=B[1],V=null==o&&q,A=u.find((function(e){return e.id===o})),H=A?A.label:"",N=$(e.useState(!1),2),U=N[0],Z=N[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},H||L)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(se,{open:D,title:O,label:r,value:o,options:u,valueKey:v,labelKey:h,required:q,onSubmit:function(e){Z(!0),g.put(R,{field:W,value:e.field},{preserveScroll:!0,onFinish:function(){Z(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:U}))},ge=function(t){var r=t.label,n=t.value,o=t.render,i=void 0===o?null:o,l=t.fieldName,a=void 0===l?null:l,s=t.editable,u=void 0!==s&&s,m=t.activationLabel,v=void 0===m?"Ενεργοποίηση":m,p=t.deactivationLabel,h=void 0===p?"Απενεργοποίηση":p,E=t.activationMessage,y=void 0===E?"":E,w=t.deactivationMessage,C=void 0===w?"":w,z=t.updateUrl,q=void 0===z?null:z,T=t.hasDivider,L=void 0===T||T,k=$(e.useState(!1),2),O=k[0],j=k[1],R=$(e.useState(!1),2),I=R[0],P=R[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},i||e.createElement(c,{variant:"body1",fontWeight:500},n?1:0)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},u&&e.createElement(f,{size:"small",variant:"outlined",color:n?"error":"success",startIcon:n?e.createElement(S,{fontSize:"small"}):e.createElement(W,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},n?h:v)))),L&&e.createElement(d,{component:"li"}),e.createElement(de,{open:O,title:n?h:v,message:n?C:y,onConfirm:function(){P(!0),g.put(q,{field:a,value:n?0:1},{preserveScroll:!0,onFinish:function(){P(!1),j(!1)}})},onCancel:function(){return j(!1)},isLoading:I}))},he=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,h=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,w=t.editable,C=void 0!==w&&w,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,O=void 0===k?"Επεξεργασία":k,j=t.updateUrl,R=void 0===j?null:j,I=t.message,P=void 0===I?null:I,K=t.hasDivider,F=void 0===K||K,B=$(e.useState(!1),2),D=B[0],M=B[1],V=null==o&&q,A=$(e.useState(!1),2),H=A[0],N=A[1],U=u.filter((function(e){return o.some((function(t){return t[v]===e[v]}))})).map((function(e){return e[h]})).join(", ");return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},U||L)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(ce,{open:D,title:O,label:r,value:o,options:u,valueKey:v,labelKey:h,required:q,onSubmit:function(e){N(!0),g.put(R,{field:W,value:e.map((function(e){return e[v]}))},{preserveScroll:!0,onFinish:function(){N(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:H}))};export{he as AutocompleteMultiProperty,xe as AutocompleteProperty,pe as DateTimeProperty,ve as EmailProperty,fe as StringProperty,be as TextProperty,ge as ToggleProperty};