biblio-react 2.0.0-alpha144 → 2.0.0-alpha146

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/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=e(require("@mui/icons-material/Lock")),o=e(require("@mui/icons-material/VpnLock")),a=require("@mui/material"),i=require("react-admin"),l=require("react-router-dom"),s=require("@mui/material/styles"),u=require("prop-types"),c=e(u),d=e(require("@mui/icons-material/Add")),m=e(require("@mui/icons-material/Cancel")),f=e(require("@mui/icons-material/Delete")),p=e(require("@mui/icons-material/Edit")),g=e(require("@mui/material/Dialog")),v=e(require("@mui/material/DialogActions")),h=e(require("@mui/material/DialogContent")),E=e(require("@mui/material/DialogContentText")),b=e(require("@mui/material/DialogTitle")),x=e(require("@mui/material/Paper")),C=require("@mui/x-data-grid-premium"),y=require("react-hook-form"),T=require("react-redux"),S=require("react-query"),k=e(require("@mui/icons-material/Settings")),R=require("@mui/x-data-grid"),F=e(require("@mui/material/AppBar")),w=e(require("@mui/material/Slide")),B=e(require("@mui/material/Toolbar")),P=e(require("@mui/material/Typography")),I=e(require("@mui/icons-material/Create")),L=e(require("@mui/material/Divider")),M=e(require("@mui/material/Tab")),q=e(require("@mui/material/Tabs")),N=e(require("@mui/icons-material/ChevronLeft")),D=require("date-fns"),A=e(require("date-fns/locale/en-US")),_=e(require("date-fns/locale/es")),O=e(require("@mui/material/IconButton")),V=e(require("@mui/material/Tooltip")),G=e(require("@mui/material/Box")),j=e(require("@mui/icons-material/ExpandMore")),z=e(require("@mui/material/Avatar")),W=e(require("@mui/material/Button")),U=e(require("@mui/material/Card")),H=e(require("@mui/material/CardActions")),J=e(require("@mui/material/CircularProgress")),Q=e(require("@mui/material/Menu")),Y=e(require("@mui/material/MenuItem")),K=e(require("@mui/icons-material/RemoveRedEye")),Z=e(require("ra-language-english")),$=e(require("@blackbox-vision/ra-language-spanish")),X=e(require("@mui/material/Stack")),ee=require("@mui/icons-material"),te=e(require("@mui/icons-material/AddAPhoto")),ne=e(require("@mui/icons-material/Check")),re=e(require("@mui/icons-material/RemoveCircleOutline")),oe=e(require("@mui/icons-material/Search")),ae=e(require("@mui/icons-material/CheckCircle")),ie=e(require("@mui/icons-material/ErrorOutline")),le=e(require("react-draggable")),se=require("devextreme-react");function ue(){return(ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ce(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}var de=t.forwardRef(function(e,n){var s=i.useTranslate(),u=i.useUserMenu().onClose,c=i.useResourceDefinitions(),d=c.form_59;return[c.form_275?t.createElement(a.MenuItem,ue({component:l.Link,ref:n},e,{key:"/form_275",to:"/form_275",onClick:u}),t.createElement(a.ListItemIcon,null,t.createElement(r,null)),t.createElement(a.ListItemText,null,s("pos.change_pin"))):null,d?t.createElement(a.MenuItem,ue({component:l.Link,ref:n},e,{key:"/form_59",to:"/form_59",onClick:u}),t.createElement(a.ListItemIcon,null,t.createElement(o,null)),t.createElement(a.ListItemText,null,s("pos.change_password"))):null]}),me=function(){return t.createElement(i.UserMenu,null,t.createElement(de,null),t.createElement(i.Logout,null))},fe=function(e){var n=a.useMediaQuery(function(e){return e.breakpoints.up("sm")});return t.createElement(i.AppBar,ue({},e,{color:"secondary",userMenu:t.createElement(me,null)}),t.createElement(a.Typography,{variant:"h6",color:"inherit",sx:{flex:1,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},id:"react-admin-title"}),n&&t.createElement(a.Box,{component:"span",sx:{flex:1}}))},pe=t.createContext(),ge=function(e){var n=e.children,r=t.useState(!1),o=r[0],a=r[1],i=t.useState({}),l=i[0],s=i[1],u=t.useMemo(function(){return{open:o,props:l,show:function(e){s(e),a(!0)},hide:function(){return a(!1)}}},[o,l]);return t.createElement(pe.Provider,{value:u},n)},ve=function(){return t.useContext(pe)},he=t.createContext(),Ee=function(e){var n=e.children,r=t.useState(!1),o=r[0],a=r[1],i=t.useMemo(function(){return{open:o,show:function(){return a(!0)},hide:function(){return a(!1)}}},[o]);return t.createElement(he.Provider,{value:i},n)},be=function(){return t.useContext(he)},xe=function(e,t,n,r){return{type:"RELOAD_CB",payload:{id:e,method:t,params:n,callback:r}}},Ce=function(e,t){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:t}}},ye=function(e,t){return{type:"HIDE_INPUT",payload:{id:e,hidden:t}}},Te=function(e,t){return{type:"DISABLE_INPUT",payload:{id:e,disabled:t}}},Se=function(e,t){return{type:"REQUIRE_INPUT",payload:{id:e,required:t}}},ke=function(e,t){return{type:"ERROR_INPUT",payload:{id:e,error:t}}},Re=function(){var e=T.useDispatch();return t.useCallback(function(t,n,r,o){e(xe(t,n,r,o))},[e])},Fe=function(){var e=T.useDispatch();return t.useCallback(function(t,n){e(ye(t,n))},[e])},we=function(){var e=T.useDispatch();return t.useCallback(function(t,n){e(Te(t,n))},[e])},Be=function(){var e=T.useDispatch();return t.useCallback(function(t,n){e(Se(t,n))},[e])},Pe=function(){var e=T.useDispatch();return t.useCallback(function(t,n){e(ke(t,n))},[e])},Ie=function(e,t){var n=i.useDataProvider(),r=S.useMutation(function(t){return n.getJson(e,{method:t.method,params:t.params})},t);return{mutateAsync:r.mutateAsync,isLoading:r.isLoading}},Le=function(e){var n=Ie(e),r=n.mutateAsync,o=n.isLoading;return[t.useCallback(function(e,t,n){return r({method:e,params:t},{onSuccess:n,onError:n})},[]),o]},Me=function(e){return{}},qe=function(e){var t=i.useListContext(e),n=i.useNotify(),r=i.useRedirect(),o=i.useRefresh(),a=i.useResourceContext(e),l=i.useUnselectAll(a),s=ve(),u=i.useTranslate();return{ajax:Le(a)[0],data:t,notify:n,redirect:r,refresh:o,refetch:t.refetch,unselectAll:l,asistente:s,translate:u}},Ne=function(e){var t=Re(),n=Fe(),r=we(),o=Be(),a=Pe(),l=be(),s=i.useNotify(),u=i.useRedirect(),c=i.useResourceContext(e);return{ajax:Le(c)[0],notify:s,redirect:u,recargarComboBox:t,progress:l,setHidden:n,setDisable:r,setRequire:o,setError:a,etrs:e.etrs||{}}},De=function(e){var n=Re(),r=Fe(),o=we(),a=Be(),l=Pe(),s=be(),u=i.useNotify(),c=i.useRedirect(),d=y.useFormContext(),m=i.useResourceContext(e),f=Le(m),p=e.etrs||{},g=e.asisEtr||{},v=null==d?void 0:d.trigger;return{form:d,ajax:f[0],notify:u,redirect:c,recargarComboBox:n,progress:s,setHidden:t.useCallback(function(e,t){r(e,t),setTimeout(function(){v(e)})},[r,v]),setDisable:t.useCallback(function(e,t){o(e,t),setTimeout(function(){v(e)})},[o,v]),setRequire:t.useCallback(function(e,t){a(e,t),setTimeout(function(){v(e)})},[a,v]),setError:t.useCallback(function(e,t){l(e,t),setTimeout(function(){v(e)})},[l,v]),etrs:p,asisEtr:g}},Ae=t.createContext({}),_e=t.createContext(void 0),Oe=["hidden"],Ve=["hidden","useContenido"],Ge=["hidden"],je=function(e){var n=t.useContext(Ae),r=n.estado,o=n.isLoading,a=n.fichaProps,i=(void 0===a?{}:a)[e.source],l=void 0===i?{}:i,s=e.hidden,u=void 0!==s&&s,c=ce(e,Oe),d=l.hidden,m=l.useContenido,f=void 0===m?Me:m,p=ce(l,Ve),g=void 0!==d?d:u,v=f(ue({},c,{estado:r,hidden:g,isLoading:o},p)),h=v.hidden,E=ce(v,Ge);if(void 0===v)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:ue({},c,p,E),hidden:void 0!==h?h:g}},ze=["tipo","value"],We=function(e){var n=e.tipo,r=ce(e,ze),o=je(r),a=o.hidden,l=ue({},o.propsContenido);return!a&&("N"===n||"D"===n?t.createElement(i.NumberField,l):"F"===n?t.createElement(i.DateField,l):"Z"===n?t.createElement(i.DateField,ue({},l,{showTime:!0})):t.createElement(i.TextField,l))},Ue=function(e){var t=ue({},e);return delete t.id,t},He=function(e){var n=e.apiRef,r=e.source,o=e.enviarTodo;return t.useCallback(function(e,t){var a=Ue(e),i=n.current.getRowsCount()+1;n.current.updateRows([ue({},a,{id:i})]);var l=o?Array.from(n.current.getRowModels().values(),function(e){return ue({},e,{claveFila:"",estado:"N"})})||[]:t.getValues()[r]||[];o||l.push(ue({},a,{claveFila:"",estado:"N"})),t.setValue(r,l,{shouldDirty:!0})},[n,r])},Je=function(e){var n=e.apiRef,r=e.source,o=e.enviarTodo;return t.useCallback(function(e,t,a){var i,l,s="number"==typeof e?"N":"M",u=Ue(t);n.current.updateRows([ue({},u,{id:e})]);var c=o?Array.from(n.current.getRowModels().values(),function(e){return ue({},e,{estado:s})})||[]:a.getValues()[r]||[],d=c.findIndex(function(t){return t.id===e});c[d=-1===d?c.length:d]=ue({},u,{claveFila:"N"===(null===(i=c[d])||void 0===i?void 0:i.estado)?"":e,estado:"N"===(null===(l=c[d])||void 0===l?void 0:l.estado)?"N":"M"}),a.setValue(r,c,{shouldDirty:!0})},[n,r])},Qe=function(e){var n=e.apiRef,r=e.source,o=e.enviarTodo;return t.useCallback(function(e,t){var a=n.current.getRowModels().get(e);n.current.updateRows([{id:e,_action:"delete"}]);var i=o?Array.from(n.current.getRowModels().values(),function(e){return ue({},e,{estado:"B"})})||[]:t.getValues()[r]||[],l=i.findIndex(function(t){return t.claveFila===e});i[l=-1===l?i.length:l]=ue({},a,{estado:"B",claveFila:e}),"number"==typeof e&&i.splice(l,1),t.setValue(r,i,{shouldDirty:!0})},[n,r])},Ye=s.styled("div")(function(e){var t=e.theme;return{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%","& .ant-empty-img-1":{fill:"light"===t.palette.mode?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===t.palette.mode?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===t.palette.mode?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===t.palette.mode?"#fff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===t.palette.mode?"0.8":"0.08",fill:"light"===t.palette.mode?"#f5f5f5":"#fff"}}}),Ke=function(){return t.createElement(Ye,null,t.createElement("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(24 31.67)"},t.createElement("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),t.createElement("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),t.createElement("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),t.createElement("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),t.createElement("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),t.createElement("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},t.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),t.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),t.createElement(a.Box,{sx:{mt:1}},"No hay registros"))},Ze=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","enableLoad","apiRef"],$e=s.styled(i.Button,{name:"EtrDeleteButton",overridesResolver:function(e,t){return t.root}})(function(e){var t=e.theme;return{color:t.palette.primary.main,"&:hover":{backgroundColor:a.alpha(t.palette.primary.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}),Xe={},et=function(e){var n=y.useFormContext();return t.createElement(_e.Provider,{value:{form:n}},e.children)},tt=function(e){return t.createElement(g,{open:e.open,onClose:e.onClose,fullWidth:!0},t.createElement(b,null,e.labelEstado+" "+e.label),t.createElement(E,{component:"span"},t.createElement(i.Form,{mode:"onBlur",record:Xe,resource:e.resource,onSubmit:e.onSubmit},t.createElement(et,null,e.children))))};tt.propTypes={label:u.string,onClick:u.func,icon:u.any,open:u.bool,onClose:u.func,labelEstado:u.string,resource:u.any,save:u.func,render:u.func};var nt=function(e){var n=e.form,r=e.resource,o=e.estado,l=e.editors,s=e.recordPadre,u=e.camposClaveFila,c=e.setOpen,d=e.open,f=y.useFormState(),p=f.dirtyFields,g=f.isValid,E=t.useContext(Ae).fichaProps,b=E[e.source],x=void 0===b?{}:b,C=E.etrs,T=t.useContext(_e),S=x.onAfterRenderAsistente,k=De({resource:r,etrs:C,asisEtr:T});return t.useEffect(function(){d&&"function"==typeof S&&S(ue({},k,{form:n}))},[d]),t.createElement(t.Fragment,null,t.createElement(h,null,t.createElement(a.Stack,{spacing:4},t.Children.map(l,function(e,n){return t.cloneElement(e,ue({resource:r,estado:o,defaultValue:s[e.props.source]||"",fullWidth:!0,sx:{margin:0},disabled:"N"!==o&&-1!==u.indexOf(e.props.source)},x[e.props.source]))}))),t.createElement(v,null,t.createElement(i.SaveButton,{disabled:0===Object.keys(p).length||!g}),t.createElement(i.Button,{label:"ra.action.cancel",onClick:function(e){c(!1),e.stopPropagation()}},t.createElement(m,null))))},rt=function(e){var n=e.editors,r=e.record,o=e.camposClaveFila,a=e.label,l=e.source,s=e.enviarTodo,u=i.useSafeSetState(!1),c=u[0],m=u[1],f=i.useResourceContext(e),p=y.useFormContext(),g=C.useGridApiContext(),v=He({apiRef:g,source:l,enviarTodo:s}),h=i.useTranslate()("ra.action.create");return t.createElement(t.Fragment,null,t.createElement(i.Button,{onClick:function(e){m(!0),e.stopPropagation()}},t.createElement(d,null)),t.createElement(tt,{open:c,onClose:function(e){m(!1),e.stopPropagation()},labelEstado:h,label:a,resource:f,onSubmit:function(e,t){v(e,p),m(!1)}},t.createElement(nt,{source:l,form:p,resource:f,estado:"N",editors:n,recordPadre:r||{},camposClaveFila:o,open:c,setOpen:function(){m(!1)}})))},ot=function(e){var n=e.editors,r=e.camposClaveFila,o=e.resource,a=e.label,l=e.source,s=e.row,u=e.enviarTodo,c=i.useTranslate(),d=i.useSafeSetState(!1),m=d[0],f=d[1],g=C.useGridApiContext(),v=y.useFormContext(),h=Je({apiRef:g,source:l,enviarTodo:u}),E=c("ra.action.edit");return t.createElement(t.Fragment,null,t.createElement(i.Button,{onClick:function(e){f(!0),e.stopPropagation()}},t.createElement(p,null)),t.createElement(tt,{open:m,onClose:function(e){f(!1),e.stopPropagation()},labelEstado:E,label:a,resource:o,onSubmit:function(e,t){h(s.id,e,v),f(!1)}},t.createElement(nt,{source:l,form:v,resource:o,estado:"M",editors:n,recordPadre:s,camposClaveFila:r,open:m,setOpen:function(){f(!1)}})))},at=function(e){var n=e.confirmTitle,r=void 0===n?"ra.message.delete_title":n,o=e.confirmContent,a=void 0===o?"ra.message.delete_content":o,l=e.row,s=e.source,u=e.enviarTodo,c=i.useSafeSetState(!1),d=c[0],m=c[1],p=C.useGridApiContext(),g=y.useFormContext(),v=Qe({apiRef:p,source:s,enviarTodo:u});return t.createElement(t.Fragment,null,t.createElement($e,{key:"button",onClick:function(e){m(!0),e.stopPropagation()}},t.createElement(f,null)),t.createElement(i.Confirm,{isOpen:d,title:r,content:a,onConfirm:function(e){v(l.id,g)},onClose:function(e){m(!1),e.stopPropagation()}}))},it=a.createTheme({},C.esES),lt=["filterBy","sortModel","columns","reference","enableLoad","initialState"],st=a.createTheme({},C.esES),ut=t.forwardRef(function(e,n){return t.createElement(w,ue({direction:"up",ref:n},e))}),ct=function(e){var n=e.isLoading,r=i.useResourceContext(e),o=ve(),l=o.open,s=o.hide,u=o.props,c=u.title,d=u.controles,f=u.aceptar,p=u.tipo,g=void 0===p?"form":p;return"confirm"===g?t.createElement(i.Confirm,{isOpen:l,title:"Atención",content:d,onConfirm:f,onClose:function(){return s()}}):t.createElement(a.Dialog,{open:l,onClose:function(){return s()},fullWidth:!0,fullScreen:"vista"===g,maxWidth:"vista"===g?"lg":"sm",TransitionComponent:ut},"form"===g?t.createElement(t.Fragment,null,t.createElement(a.DialogTitle,{id:"draggable-dialog-title"},c),t.createElement(i.Form,{resource:r,onSubmit:f},t.createElement(a.DialogContent,{dividers:!0},t.createElement(a.Stack,{spacing:2},d)),t.createElement(a.DialogActions,null,t.createElement(i.Button,{label:"ra.action.cancel",disabled:n,onClick:function(){return s()}},t.createElement(m,null)),t.createElement(i.SaveButton,{disabled:n})))):t.createElement(t.Fragment,null,t.createElement(F,{sx:{position:"relative"}},t.createElement(B,{disableGutters:!0,variant:"dense"},t.createElement(P,{sx:{ml:2,flex:1},variant:"h6",component:"div"},c),t.createElement(i.Button,{label:"ra.action.cancel",disabled:n,onClick:function(){return s()},color:"inherit"},t.createElement(m,null)))),d))},dt=["alignIcon","children","className","disabled","label","color","size","to"],mt=["redirect","replace","state"],ft=function(e){var n=e.children,r=e.className,o=e.disabled,l=e.label,s=e.color,u=void 0===s?"primary":s,c=e.to,d=ce(e,dt),m=i.useTranslate(),f=l?m(l,{_:l}):void 0,p=pt(c);return l&&!o?t.createElement(a.Tooltip,{title:f},t.createElement(a.IconButton,ue({"aria-label":f,className:r,color:u,size:"large"},d,p),n)):t.createElement(a.IconButton,ue({className:r,color:u,disabled:o,size:"large"},d,p),n)};ft.propTypes={alignIcon:c.oneOf(["left","right"]),children:c.element,className:c.string,color:c.oneOfType([c.oneOf(["inherit","default","primary","secondary","error","info","success","warning"]),c.string]),disabled:c.bool,label:c.string,size:c.oneOf(["small","medium","large"])};var pt=function(e){if(null!=e){if("string"==typeof e)return{to:e};var t=e.redirect,n=e.replace,r=e.state;return{to:ce(e,mt),redirect:t,replace:n,state:r}}},gt=["icon","label","scrollToTop"],vt=function(e){return e.stopPropagation()},ht={true:{_scrollToTop:!0},false:{}},Et=t.createElement(d,null),bt=function(e){var n=e.icon,r=void 0===n?Et:n,o=e.label,a=void 0===o?"ra.action.create":o,s=e.scrollToTop,u=void 0===s||s,c=ce(e,gt),d=i.useResourceContext(e),m=i.useRecordContext(e),f=i.useCreatePath();return t.createElement(ft,ue({component:l.Link,to:f({type:"create",resource:d}),state:ue({record:m},ht[String(u)]),label:a,onClick:vt},c),r)},xt=["icon","label","scrollToTop"],Ct=function(e){return e.stopPropagation()},yt={true:{_scrollToTop:!0},false:{}},Tt=t.createElement(I,null),St=function(e){var n=e.icon,r=void 0===n?Tt:n,o=e.label,a=void 0===o?"ra.action.edit":o,s=e.scrollToTop,u=void 0===s||s,c=ce(e,xt),d=i.useResourceContext(e),m=i.useRecordContext(e),f=i.useCreatePath();return m?t.createElement(ft,ue({component:l.Link,to:f({type:"edit",resource:d,id:m.id}),state:yt[String(u)],label:a,onClick:Ct},c),r):null},kt=["actionButtons","bulkActionButtons","sx","columns","isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit","initialState","convertFilterModelToFilterValues","claveNuevo","mobileColumns"],Rt=["handler"],Ft=["key","handler","icon"],wt=function(e,t){return void 0===t||"function"==typeof t&&t(e)},Bt=a.createTheme({},C.esES),Pt=new Map([["is","is"],["not","not"],["after","after"],["onOrAfter","onOrAfter"],["before","before"],["onOrBefore","onOrBefore"],["eq","="],["neq","!="],["gt",">"],["gte",">="],["lt","<"],["lte","<="],["contains","contains"],["equals","equals"],["sw","startsWith"],["ew","endsWith"],["isEmpty","isEmpty"],["isNotEmpty","isNotEmpty"],["isAnyOf","isAnyOf"]]),It=new Map(Array.from(Pt,function(e){return[e[1],e[0]]})),Lt=function(e){return e.items.reduce(function(e,t){return void 0!==t.field&&t.operator&&(It.has(t.operator)?e[t.field+"_"+It.get(t.operator)]=t.value:e[t.field]=t.value),e},{})},Mt=function(e){var n=e.actionButtons,r=void 0===n?[]:n,o=e.bulkActionButtons,l=e.sx,s=e.columns,u=e.isRowEditable,c=e.hasEdit,d=e.initialState,m=e.convertFilterModelToFilterValues,f=void 0===m?Lt:m,p=e.claveNuevo,g=ce(e,kt),v=qe(e),h=i.useTranslate(),E=i.useResourceContext(e),b=i.useListContext(),x=b.data,y=void 0===x?[]:x,T=b.isLoading,S=b.selectedIds,k=b.onSelect,F=b.displayedFilters,w=b.setFilters,B=C.useGridApiRef(),P=C.useKeepGroupedColumnsHidden({apiRef:B,initialState:ue({},d,{pinnedColumns:{right:["actions"]}})}),I=s.map(function(e,t){return ue({},e,{headerName:""!==e.headerName?h("resources."+E+".fields."+e.field,{_:e.headerName}):e.headerName})}),L=r.length>0||c?I.concat([{field:"actions",type:"actions",width:100,hideable:!1,getActions:function(e){var n,o=B.current.getRowNode(e.id);return e.row.id?[].concat(c?[t.createElement(St,{record:e.row,disabled:!wt(e.row,u)})]:[],r.filter(function(e){return!!e}).map(function(n){var r=n.handler,o=ce(n,Rt);return t.createElement(R.GridActionsCellItem,ue({showInMenu:!0,onClick:function(t){return"function"==typeof r&&r(ue({},v,{record:e.row}),o.key)}},o))})):-1!==o.children[0].indexOf(p+"=")?[t.createElement(bt,{record:p?(n={},n[p]=o.children[0].split(p+"=")[1].replaceAll("[","").trim().split("AND")[0].trim(),n):void 0})]:[]}}]):I,M=t.isValidElement(o);return t.createElement(t.Fragment,null,t.createElement(ct,{isLoading:T}),t.createElement(i.DatagridRoot,{sx:l,className:i.DatagridClasses.root},M?t.createElement(i.BulkActionsToolbar,{selectedIds:S},o):null,t.createElement(a.Box,{sx:{height:"70vh",width:"100%"},className:i.DatagridClasses.tableWrapper},t.createElement(a.ThemeProvider,{theme:Bt},t.createElement(C.DataGridPremium,ue({sx:{display:"grid",gridTemplateRows:"70vh 1fr auto"},slots:{noRowsOverlay:Ke},columns:L,rows:y,apiRef:B,loading:T,hideFooterSelectedRowCount:!0,hideFooter:!0,disableMultipleRowSelection:!0,checkboxSelection:M,filterMode:"server",onFilterModelChange:function(e){w(f(e),F)},rowSelectionModel:S,onRowSelectionModelChange:function(e){T||(B.current.isRowSelected(e[0])?k([]):k(e))},isRowSelectable:function(e){return e.row.id},initialState:P},g))))))},qt=function(e){var n=e.sx,r=e.columns,o=e.actionButtons,l=void 0===o?[]:o,s=e.hasEdit,u=e.isRowEditable,c=e.primaryText,d=e.mobileColumns,m=void 0===d?"":d,f=c,p=qe(e),g=i.useListContext().isLoading;if(!c){var v=m?m.split(",").map(function(e){return r.find(function(t){return t.field===e})}):r;f=function(e){return t.createElement(a.Paper,{variant:"outlined",sx:{pt:2,pb:2,pl:2}},v.map(function(n){var r=n.field,o=n.headerName,i=n.valueGetter,l=n.type,s=void 0===l?"string":l,u=n.jsxMobile;return t.createElement(a.Box,null,u?u(e,n):"boolean"===s?t.createElement(a.Box,{component:"span",sx:{color:i({value:e[r]})?"green":"red"}},o):e[r])}),t.createElement(a.Box,null,l.filter(function(e){return!!e}).map(function(n){var r=n.key,o=n.handler,a=n.icon,l=void 0===a?t.createElement(k,null):a,s=ce(n,Ft);return t.createElement(i.Button,ue({onClick:function(t){return"function"==typeof o&&o(ue({},p,{record:e}),r)}},s),l)})))}}return t.createElement(t.Fragment,null,t.createElement(ct,{isLoading:g}),t.createElement(i.SimpleList,{linkType:function(e){return!(!s||!wt(e,u))&&"edit"},primaryText:f,sx:n}))},Nt=function(e){var n=a.useMediaQuery(function(e){return e.breakpoints.down("md")}),r=i.useResourceDefinition(e).hasEdit;!function(e){var n=e.onRenderGrilla,r=e.onLoadGrilla,o=i.useListContext().isLoading,a=qe(e);t.useEffect(function(){n&&n(a)},[]),t.useEffect(function(){o||r&&r(a)},[o])}(e);var o=e.desktopSize;return t.createElement(ge,null,t.createElement(n&&!1===(void 0!==o&&o)?qt:Mt,ue({},e,{hasEdit:r})))},Dt=["ids"],At=["filterValues","setFilters","tabs","GridComponent"],_t=["useFormulario"],Ot=function(e){var t=e.useFormulario,n=void 0===t?Me:t,r=ce(e,_t);return{fichaProps:ue({},n(r),{etrs:r.etrs})}},Vt=function(e,t){return i.useGetOne(e,{id:"-1"},t)},Gt=["className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","isLoading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","sort"],jt=["children","className","data","hasShow","hasList"],zt=function(e){return e.split("_")[1]},Wt=/^\d{2}\/\d{2}\/\d{4}$/,Ut=function(e){if(!(e instanceof Date)||isNaN(e.getDate()))return"";var t=e.getFullYear().toString(),n=(e.getMonth()+1).toString(),r=e.getDate().toString();return t+"-"+("00"+n).slice(-2)+"-"+("00"+r).slice(-2)},Ht=/^\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}$/,Jt=i.required(),Qt=[Jt,i.minValue(1)],Yt={form:"FormEtriek-form",tab:"FormEtriek-tab",contenido:"FormEtriek-contenido"},Kt=function(e){var t,n;return(n={})["& ."+Yt.form]={maxHeight:"70vh",overflow:"auto"},n["& ."+Yt.tab]={display:"block",maxHeight:"65vh",overflow:"auto"},n["& ."+Yt.contenido]=((t={})[e.breakpoints.up("xs")]={width:"100%"},t[e.breakpoints.up("md")]={width:"12vw","&.MuiAutocomplete-root":{width:"16vw"}},t),n},Zt=function(){},$t=function(e){var n=t.useContext(Ae).fichaProps.onBeforeSubmitFicha,r=Ne(e),o=i.useNotify(),a=i.useSaveContext().save,l=t.useCallback(function(e){try{var t=function(t){return"string"==typeof t?void o(t,{type:"error"}):void 0===t||t?a(e):void 0};return Promise.resolve(n?Promise.resolve(n(ue({form:{getValues:function(){return e}}},r),"N")).then(t):t(n))}catch(e){return Promise.reject(e)}},[n,o,Zt,a]);return"function"==typeof n?l:void 0},Xt=["useFormulario","enableLoad"],en=function(e){var n=e.enableLoad,r=void 0===n||n,o=ce(e,Xt),a=i.useResourceContext(e),l=Vt(a,{enabled:r}),s=l.data,u=l.isLoading,c=Ot(e).fichaProps,d=t.useMemo(function(){return{estado:"N",initialValues:s,isLoading:u,fichaProps:c}},[s,u,c]);return t.createElement(Ee,null,t.createElement(Ae.Provider,{value:d},t.createElement(i.Create,ue({redirect:"list"},o,null==c?void 0:c.panel))))};en.propTypes={useFormulario:c.func};var tn=s.styled(en,{name:"FormEtriek",overridesResolver:function(e,t){return t.root}})(function(e){return Kt(e.theme)});function nn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=nn(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function rn(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=nn(e))&&(r&&(r+=" "),r+=t);return r}var on=["classes","filterValues","handleSubmit","invalid","label","pristine","resource","saving","selectedIds","redirect"],an=["resource","redirect","className","icon","label"],ln=function(e){var n=i.useTranslate(),r=e.resource,o=e.className,a=e.icon,l=e.label,s=void 0===l?"ra.action.delete":l,u=ce(e,an),c=i.useRecordContext(),d=i.useDelete(r,{id:c.id}),m=d[0],f=d[1].isLoading;return t.createElement(V,{title:n("ra.action.delete")},t.createElement(O,ue({disabled:f,onClick:function(){return m()},label:s,className:rn("ra-delete-button",o),key:"button"},ce(u,on),{size:"large"}),a))};ln.defaultProps={redirect:"list",icon:t.createElement(f,null)};var sn=["useFormulario","mutationMode"],un=function(e){var t={};for(var n in e)"string"==typeof e[n]&&0===e[n].trim().length||(null==e[n]&&(e[n]=""),t[n]=e[n]);return t},cn=s.styled(function(e){var n=e.mutationMode,r=void 0===n?"pessimistic":n,o=ce(e,sn),a=i.useEditController(ue({mutationMode:r},o)),l=a.record,s=a.isLoading,u=Ot(e).fichaProps,c=t.useMemo(function(){return{estado:"M",initialValues:l,isLoading:s,fichaProps:u}},[l,s,u]);return t.createElement(Ee,null,t.createElement(Ae.Provider,{value:c},t.createElement(i.Edit,ue({mutationMode:r,transform:un},o,null==u?void 0:u.panel))))},{name:"FormEtriek",overridesResolver:function(e,t){return t.root}})(function(e){return Kt(e.theme)}),dn=t.forwardRef(function(e,n){var r=e.isOpen,o=e.onSubmit,a=e.onClose,l=e.title,s=e.dialogText,u=e.children,c=e.hasAccept,d=void 0===c||c,f=e.hasCancel,p=void 0===f||f,x=e.isLoading,C=void 0!==x&&x,y=i.useResourceContext(e),T=function(e){a&&a(e)};return t.createElement(g,{ref:n,open:r,fullWidth:!0,onClose:T,"aria-labelledby":"form-dialog-title"},t.createElement(b,{id:"form-dialog-title"},l),t.createElement(i.Form,{resource:y,onSubmit:o},t.createElement(h,{dividers:!0},t.createElement(E,null,s),t.createElement(G,{sx:{mt:2}},u)),(d||p)&&t.createElement(v,null,p&&t.createElement(i.Button,{label:"ra.action.cancel",disabled:C,onClick:function(e){return T(e)}},t.createElement(m,null)),d&&t.createElement(i.SaveButton,{alwaysEnable:!0,label:"Ok",disabled:C}))))}),mn={},fn={pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},pn=function(e){var n=be(),r=i.useResourceContext(e),o=t.useContext(Ae),l=o.estado,s=o.isLoading,u=o.initialValues,c=o.fichaProps,d=De({resource:r,etrs:c.etrs});return t.useEffect(function(){c.onRenderFicha&&c.onRenderFicha(d,l)},[]),t.useEffect(function(){s||c.onLoadFicha&&c.onLoadFicha(d,l,u)},[s]),t.createElement(a.CardContent,{sx:ue({},e.sx,n.open?fn:mn)},n.open&&t.createElement(a.CircularProgress,{sx:{position:"absolute",left:"50%",top:"50%"},thickness:4,size:50}),e.children)},gn=function(e){var n=t.useContext(Ae),r=n.initialValues,o=n.fichaProps.config,a=void 0===o?{}:o,l=$t(e);return r?t.createElement(i.SimpleForm,ue({mode:"onBlur"},e,{onSubmit:l,defaultValues:r,component:pn},a)):null};gn.propTypes=ue({},i.SimpleForm.propTypes);var vn=function(e){var n=e.handleToggle,r=e.isOpen,o=e.name,l=e.icon,u=e.children,c=e.dense,d=i.useTranslate(),m=i.useSidebarState()[0],f=t.createElement(a.MenuItem,{dense:c,onClick:n},t.createElement(a.ListItemIcon,{sx:{minWidth:5}},r?t.createElement(j,null):l),t.createElement(a.Typography,{variant:"inherit",color:"textSecondary"},d(o)));return t.createElement("div",null,m||r?f:t.createElement(a.Tooltip,{title:d(o),placement:"right"},f),t.createElement(a.Collapse,{in:r,timeout:"auto",unmountOnExit:!0},t.createElement(a.List,{dense:c,component:"div",disablePadding:!0,sx:{paddingLeft:(e.children.props.children[0]?e.children.props.children[0].key:"").startsWith("menu")?2:0,backgroundColor:function(e){return s.alpha(e.palette.secondary.light,.24)},"& a":{transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",paddingLeft:m?4:2}}},u)))},hn=["items","translate"],En=function(e){var n=e.dense,r=void 0!==n&&n,o=i.useTranslate(),l=t.useState({mnuPrueba:!1}),s=l[0],u=l[1],c=a.useMediaQuery(function(e){return e.breakpoints.down("sm")}),d=i.useSidebarState()[0],m=function e(n){var r=n.items,o=n.translate,a=ce(n,hn),l=a.state,s=a.handleToggle,u=a.dense;return r&&t.createElement("div",null,r.map(function(n){var r=n.name,c=n.menu,d=n.label;return c?t.createElement(vn,{key:r,name:d,handleToggle:function(){return s(r)},isOpen:l[r],icon:t.createElement(k,null),dense:u},e(ue({items:c,translate:o},a))):t.createElement(i.MenuItemLink,{key:r,to:"/"+r,primaryText:o("resources."+r+".name",{_:d}),dense:u,leftIcon:t.createElement(k,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){u(function(t){var n;return ue({},t,((n={})[e]=!t[e],n))})},state:s,activeClassName:"",iconClass:"",className:"",open:d,dense:r,translate:o});return t.createElement(a.Box,{sx:{width:d?230:50,marginTop:1,marginBottom:1,transition:function(e){return e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})}}},t.createElement(i.Menu,null,t.createElement(i.DashboardMenuItem,{primaryText:o("ra.page.dashboard")}),m,c&&t.createElement(i.MenuItemLink,{to:"/configuration",primaryText:o("pos.configuration"),leftIcon:t.createElement(k,null),dense:r})))},bn=["className","filters","hasCreate","children","hideFilterButton","jsBotonGrilla"],xn=function(e,t){alert("Falta implementar la función jsBotonGrilla")},Cn=["displayedFilters","filterValues","showFilter"],yn=["className","options","icon","label","disabled"],Tn=["fields","className","textAlign","sortable"],Sn=["useFormulario"],kn=s.styled(function(e){var n=ce(e,Sn),r=i.useShowController(n),o=r.record,a=r.isLoading,l=Ot(e).fichaProps,s=t.useMemo(function(){return{estado:"M",initialValues:o,isLoading:a,fichaProps:l}},[o,a,l]);return t.createElement(Ee,null,t.createElement(Ae.Provider,{value:s},t.createElement(i.Show,ue({},n,r,null==l?void 0:l.panel))))},{name:"FormEtriek",overridesResolver:function(e,t){return t.root}})(function(e){return Kt(e.theme)}),Rn=["icon","label","record","resource","scrollToTop"],Fn=function(e){var n=e.icon,r=void 0===n?Bn:n,o=e.label,a=void 0===o?"ra.action.show":o,s=e.scrollToTop,u=void 0===s||s,c=ce(e,Rn),d=i.useResourceContext(e),m=i.useRecordContext(e),f=i.useCreatePath();return m?t.createElement(ft,ue({component:l.Link,to:f({type:"show",resource:d,id:m.id}),state:wn[String(u)],label:a,onClick:Pn},c),r):null},wn={true:{_scrollToTop:!0},false:{}},Bn=t.createElement(K,null),Pn=function(e){return e.stopPropagation()};Fn.propTypes={icon:c.element,label:c.string,record:c.any,scrollToTop:c.bool};var In=t.memo(Fn,function(e,t){return e.resource===t.resource&&(e.record&&t.record?e.record.id===t.record.id:e.record==t.record)&&e.label===t.label&&e.disabled===t.disabled}),Ln=["children","className","component","formRootPathname","syncWithLocation","tabs","toolbar","onChange"],Mn=["record","resource"],qn=["onChange"],Nn=["criteriaMode","defaultValues","delayError","formRootPathname","mode","noValidate","onSubmit","record","resolver","reValidateMode","sanitizeEmptyValues","shouldFocusError","shouldUnregister","shouldUseNativeValidation","validate","warnWhenUnsavedChanges"],Dn=function(e){var n=e.children,r=e.className,o=e.component,s=void 0===o?_n:o,u=e.formRootPathname,c=e.syncWithLocation,d=void 0===c||c,m=e.tabs,f=void 0===m?An:m,p=e.toolbar,g=void 0===p?On:p,v=e.onChange,h=ce(e,Ln),E=l.useLocation(),b=l.useResolvedPath(""),x=i.useResourceContext(e),C=t.useState(0),y=C[0],T=C[1],S=t.useContext(Ae),k=De(ue({},e,{etrs:S.fichaProps.etrs})),R=t.useContext(Ae).estado,F=function(e,t){d||(T(t),v&&v(k,R,{newTab:t,prevTab:y,setTab:T},e))},w=function(){return t.cloneElement(f,{onChange:F,syncWithLocation:d,url:u,value:y},n)};return t.createElement(Vn,ue({className:rn("tabbed-form",r)},Gn(h)),d?t.createElement(l.Routes,null,t.createElement(l.Route,{path:"/*",element:w()})):w(),t.createElement(a.Divider,null),t.createElement(s,null,t.Children.map(n,function(e,n){if(!e)return null;var r=i.getTabbedFormTabFullPath(e,n),o=d?!l.matchPath(b.pathname+"/"+r,E.pathname):y!==n;return t.isValidElement(e)?t.cloneElement(e,{intent:"content",resource:x,hidden:o,value:d?r:n}):null})),!1!==g?g:null)},An=t.createElement(i.TabbedFormTabs,null),_n=function(e){return t.createElement(a.CardContent,null,e.children)},On=t.createElement(i.Toolbar,null),Vn=s.styled("div",{name:"RaTabbedForm",overridesResolver:function(e,t){return t.root}})(function(e){var t;return(t={})["& .MuiTab-root.RaTabbedForm-errorTabButton"]={color:e.theme.palette.error.main},t}),Gn=function(e){return ce(e,Mn)},jn=function(e){var n,r,o,a=ce(e,qn),s=(n=l.useLocation(),r=l.matchPath(":resource/create/*",n.pathname),o=l.matchPath(":resource/:id/*",n.pathname),r?r.pathnameBase:o?o.pathnameBase:"");return t.createElement(i.Form,ue({formRootPathname:s},a),t.createElement(Dn,ue({formRootPathname:s},zn(e))))};jn.Tab=i.FormTab;var zn=function(e){return ce(e,Nn)},Wn=function(e){var n=t.useContext(Ae),r=n.initialValues,o=n.fichaProps.config,a=void 0===o?{}:o,i=$t(e);return r?t.createElement(jn,ue({mode:"onBlur"},e,{onSubmit:i,defaultValues:r,component:pn},a)):null};Wn.defaultProps={syncWithLocation:!1};var Un=ue({},i.defaultTheme,{palette:ue({},i.defaultTheme.palette,{mode:"dark"}),components:ue({},i.defaultTheme.components,{MuiTextField:{defaultProps:{variant:"outlined"}},MuiFormControl:{defaultProps:{variant:"outlined"}},RaSidebar:{root:{drawerPaper:{position:"sticky"}}},RaRichTextInput:{root:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}})}),Hn={__proto__:null,lightTheme:ue({},i.defaultTheme,{palette:ue({},i.defaultTheme.palette,{mode:"light"}),components:ue({},i.defaultTheme.components,{MuiTextField:{defaultProps:{variant:"outlined"}},MuiFormControl:{defaultProps:{variant:"outlined"}},RaSidebar:{root:{drawerPaper:{position:"sticky"}}},RaRichTextInput:{root:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}})}),darkTheme:Un};Z.ra.page.empty="No records yet";var Jn=ue({},Z,{from_camera:"From camera",take_foto:"Take photo",login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});$.ra.notification.created="Datos guardados correctamente",$.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} seleccionados",$.ra.page.dashboard="Inicio",$.ra.page.empty="Sin registros todavía",$.ra.page.invite="¿Quiere agregar uno?",$.ra.page.list="%{name}",$.ra.page.edit="Editar %{name}",$.ra.action.back="Volver",$.ra.message.delete_title="Eliminar",$.ra.input.file.upload_single="Seleccione o arrastre archivo",$.ra.input.image.upload_single="Seleccione o arrastre imagen";var Qn=ue({},$,{from_camera:"Desde camara",take_foto:"Tomar foto",login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}});"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var Yn=function(e){var r=t.useState(!1),o=r[0],l=r[1],s=t.useState(!1),u=s[0],c=s[1],d=i.useNotify(),m=i.useTranslate(),f=e.field,p=e.sx;return t.useEffect(function(){o&&function(){try{var e=null,t=function(t,n){try{var r=Promise.resolve(navigator.mediaDevices.getUserMedia({video:!0,audio:!1})).then(function(t){e=t,document.getElementById("video").srcObject=e})}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}(0,function(e){d(e.message,{type:"error"}),l(!1)});Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[o]),n.createElement(t.Fragment,null,n.createElement(i.Confirm,{isOpen:o,loading:!o,maxWidth:"sm",title:"",content:n.createElement(a.Box,{display:"flex",flexDirection:"column"},n.createElement(a.Button,{variant:"outlined",disableElevation:!0,onClick:function(){var e=document.getElementById("video"),t=document.getElementById("canvas");t.getContext("2d").drawImage(e,0,0,t.width,t.height),c(!0)},startIcon:n.createElement(ee.PhotoCamera,null)},m("take_foto")),n.createElement("video",{id:"video",width:"320",height:"240",autoPlay:!0,style:{border:"solid 1px"}}),n.createElement("div",{id:"dataurl-container",style:{border:"dotted 1px",width:320,height:240,marginTop:4}},n.createElement("canvas",{id:"canvas",width:"320",height:"240"}))),onConfirm:function(e){u&&document.getElementById("canvas").toBlob(function(e){var t=document.getElementById("video"),n=document.getElementById(f),r=new DataTransfer,o=new File([e],f+"-img.jpg",{type:"image/jpeg",lastModified:(new Date).getTime()});r.items.add(o),n.files=r.files,n.dispatchEvent(new Event("change",{bubbles:!0})),t.srcObject.getTracks().forEach(function(e){return e.stop()}),c(!1),l(!1)},"image/jpeg")},onClose:function(){c(!1),l(!1)}}),n.createElement(V,{title:m("from_camera")},n.createElement(a.Button,{sx:p,onClick:function(){l(!0)}},n.createElement(te,null))))},Kn=["onFocus","onChange","onBlur","hidden","disabled","validate"],Zn=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],$n=["hidden","disabled","onFocus","onChange","onBlur","validate"],Xn=function(e){var n=e.source,r=t.useContext(Ae),o=r.estado,a=r.isLoading,l=r.fichaProps,s=void 0===l?{}:l,u=t.useContext(_e),c=void 0!==u,d=T.useSelector(function(e){var t=e.configInputs?e.configInputs.filter(function(e){return e.id===n}):[];return t[0]?t[0]:null})||{},m=d.disabled,f=d.hidden,p=d.error,g=!0===d.required?Jt:void 0,v="function"==typeof p?p:function(){return p},h=s[n],E=void 0===h?{}:h,b=s.etrs,x=e.onFocus,C=e.onChange,y=e.onBlur,S=e.hidden,k=void 0!==S&&S,R=e.disabled,F=void 0!==R&&R,w=e.validate,B=ce(e,Kn),P=i.useInput(e).field,I=E.onFocus,L=E.onBlur,M=E.onChange,q=E.hidden,N=E.disabled,D=E.useContenido,A=void 0===D?Me:D,_=E.validate,O=ce(E,Zn),V=c||void 0===q?k:q,G=c||void 0===N?F:N,j=c||void 0===I?x:I,z=c||void 0===L?y:L,W=c||void 0===M?C:M,U=De(ue({},e,{etrs:b,asisEtr:u})),H=A(ue({},B,{estado:o,hidden:V,isLoading:a,utils:U},O)),J=t.useRef(P.value);if(void 0===H)throw new Error("useContenido está devolviendo undefined para el contenido "+n+"\n Asegúrese de incluir una instrucción return al final de la función");var Q=H.hidden,Y=H.disabled,K=H.onFocus,Z=H.onChange,$=H.onBlur,X=H.validate,ee=ce(H,$n),te=K||j,ne=$||z,re=Z||W,oe=ue({},U,{prev:J.current}),ae=Array.isArray(w)?w:[w],ie=Array.isArray(_)?_:[_],le=Array.isArray(X)?X:[X];return{propsContenido:ue({sx:{mt:1,mb:1,ml:{xs:0,md:1},mr:{xs:0,md:1}},onFocus:function(e){te&&j(U,o,e),J.current=e.target.value},onBlur:function(e){return ne&&ne(oe,o,e)},onChange:function(e){return re&&re(oe,o,e)},helperText:!1,validate:[].concat(ae,ie,le,[g,v]).filter(function(e){return void 0!==e})},B,O,ee,{disabled:void 0!==m?m:void 0!==Y?Y:G}),hidden:void 0!==f?f:void 0!==Q?Q:V}},er=["options","disabled","tipo","camera","prefix"],tr=function(e,t){return e&&""!==e?"string"==typeof e?{src:t+"/"+e}:e instanceof Array?e.map(function(e){return{src:t+"/"+e}}):e:void 0},nr=["sx"],rr=["callback","sx","isTC","onChange"],or=["callback"],ar=t.forwardRef(function(e,n){return t.createElement(a.Tooltip,ue({ref:n},e))}),ir=function(e){var n,r=e.callback,o=e.sx,l=e.isTC,s=e.onChange,u=ce(e,rr),c=i.useChoicesContext(),d=c.isLoading,m=c.allChoices,f=t.useRef(null);return t.useEffect(function(){d||"function"==typeof r&&r(Object.values([m]))},[m,r,d]),t.createElement(ar,{title:(null===(n=f.current)||void 0===n?void 0:n.value)||"",placement:"top",arrow:!0},t.createElement(a.Box,{component:"span",sx:ue(l?{margin:1}:{display:{xs:"inherit",md:"inline-flex"},margin:1},o),width:l?{}:{xs:"100%",md:"auto"}},t.createElement(i.AutocompleteInput,ue({size:"small",sx:l?{width:"100% !important"}:{}},u,{onChange:function(e){s({target:{value:e}})},TextFieldProps:{inputRef:f}}))))},lr=function(e){var n,r,o=Xn(e),a=o.propsContenido,l=o.hidden,s=T.useDispatch(),u=e.source,c=e.reference,d=T.useSelector(function(e){var t=e.reload_cb?e.reload_cb.filter(function(e){return e.id===u}):[];return t[0]?t[0]:null}),m=t.useRef(d),f=null===d&&m.current?m.current:d;return f&&(n=f.callback,r=ce(f,or)),t.useEffect(function(){null!==d&&(m.current=d,s(Ce(u)))},[JSON.stringify(d)]),l?null:t.createElement(i.ReferenceInput,{reference:c,source:u,perPage:500,filter:r},t.createElement(ir,ue({},a,{callback:n,optionText:"etiqueta",optionValue:u})))},sr=function(e){return t.createElement(le,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(a.Paper,e))},ur={cursor:"move"},cr=function(e){var n=e.isOpen,r=e.isLoading,o=e.title,a=e.content,l=e.cancel,s=e.ConfirmIcon,u=e.CancelIcon,c=e.onClose,d=e.onConfirm,m=e.contentResource,f=e.translateOptions,p=void 0===f?{}:f,E=i.useTranslate(),x=i.useRecordSelection(m)[0],C=t.useCallback(function(e,t){e.stopPropagation(),d(e,x)},[x,d]),y=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(g,{open:n,onClose:c,onClick:y,fullWidth:!0,maxWidth:"lg",PaperComponent:sr,"aria-labelledby":"draggable-dialog-title"},t.createElement(b,{style:ur,id:"draggable-dialog-title"},E(o,ue({_:o},p))),t.createElement(h,{dividers:!0},a),t.createElement(v,null,t.createElement(W,{disabled:r,onClick:c},t.createElement(u,{sx:{paddingRight:"0.5em"}}),E(l,{_:l})),t.createElement(W,{disabled:r,onClick:function(e){return C(e,"yes")},autoFocus:!0},t.createElement(s,{sx:{paddingRight:"0.5em"}}),E("ra.action.confirm"))))};cr.propTypes={cancel:c.string,classes:c.object,confirm:c.string,confirmColor:c.string,ConfirmIcon:c.elementType,CancelIcon:c.elementType,content:c.node.isRequired,isOpen:c.bool,isLoading:c.bool,onClose:c.func.isRequired,onConfirm:c.func.isRequired,title:c.string.isRequired},cr.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:ae,CancelIcon:ie,isOpen:!1};var dr=["disabled","asistant","asistantResource","label","source","sx"],mr=function(){return t.createElement(t.Fragment,null)},fr={seleccion:[],all:!0,none:!1},pr=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},gr=function(e){return e},vr=function(e){return t.createElement(i.List,ue({},e,{hasCreate:!1,exporter:!1,perPage:50,empty:!1,title:" ",disableSyncWithLocation:!0}),t.createElement(i.Datagrid,{bulkActionButtons:t.createElement("span",null)},t.createElement(i.TextField,{source:"funced",sortable:!0,label:"Cédula"}),t.createElement(i.TextField,{source:"funpriape",sortable:!0,label:"Apellido"}),t.createElement(i.TextField,{source:"funprinom",sortable:!0,label:"Nombre"})))},hr={fillista:"empcod=-1"},Er=function(e){var n=t.useState(hr),r=n[0],o=n[1],l=i.useDataProvider(),s=t.useCallback(function(e){o({fillista:e.node.key})},[o]),u=t.useCallback(function(e){return l.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[l]);return t.createElement(a.Box,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},t.createElement(a.Box,{flexGrow:1},t.createElement(se.TreeView,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:s,createChildren:u})),t.createElement(a.Box,{flexGrow:2},t.createElement(vr,{resource:"form_224",filter:r})))},br=function(e){return t.createElement(le,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(a.Paper,e))},xr={cursor:"move"},Cr=function(e){var n=e.isOpen,r=e.isLoading,o=e.title,a=e.cancel,l=e.ConfirmIcon,s=e.CancelIcon,u=e.onClose,c=e.onConfirm,d=e.translateOptions,m=void 0===d?{}:d,f=i.useTranslate(),p=t.useCallback(function(e,t){e.stopPropagation(),c(e,t)},[c]),E=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(g,{open:n,onClose:u,onClick:E,fullWidth:!0,maxWidth:"lg",PaperComponent:br,"aria-labelledby":"draggable-dialog-title"},t.createElement(b,{style:xr,id:"draggable-dialog-title"},f(o,ue({_:o},m))),t.createElement(h,{dividers:!0},t.createElement(Er,null)),t.createElement(v,null,t.createElement(W,{disabled:r,onClick:u},t.createElement(s,{sx:{paddingRight:"0.5em"}}),f(a,{_:a})),t.createElement(W,{disabled:r,onClick:function(e){return p(e,"yes")},autoFocus:!0},t.createElement(l,{sx:{paddingRight:"0.5em"}}),f("ra.action.confirm"))))};Cr.propTypes={cancel:c.string,classes:c.object,confirm:c.string,confirmColor:c.string,ConfirmIcon:c.elementType,CancelIcon:c.elementType,isOpen:c.bool,isLoading:c.bool,onClose:c.func.isRequired,onConfirm:c.func.isRequired,title:c.string.isRequired},Cr.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:ae,CancelIcon:ie,isOpen:!1};var yr=["disabled","asistant","asistantResource","label","allowNone","source","sx"],Tr={seleccion:[],all:!0,none:!1},Sr=function(e){return String(e)===e?"Selección (1)":!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},kr=function(e){return e},Rr=["tipo"];exports.AppBar=fe,exports.Asistente=ct,exports.AsistenteContext=pe,exports.AsistenteProvider=ge,exports.BooleanField=function(e){var n=je(e),r=n.propsContenido,o=n.hidden,a=i.useRecordContext(),l=JSON.parse(JSON.stringify(a)),s=l[e.source];return l[e.source]=""!=s&&"0"!=s,!o&&t.createElement(i.BooleanField,ue({},r,{record:l}))},exports.Camino=function(e){var n=Xn(e),r=n.propsContenido,o=n.hidden,l=i.useTranslate(),s=a.useMediaQuery(function(e){return e.breakpoints.down("sm")}),u=r.options,c=void 0===u?{}:u,d=r.disabled,m=void 0!==d&&d,f=r.tipo,p=void 0===f?"file":f,g=r.camera,v=void 0===g||g,h=r.prefix,E=ce(r,er);return!o&&("image"===p?t.createElement(X,{direction:"row",alignItems:"flex-start",justifyContent:"flex-start",divider:t.createElement(L,{orientation:"vertical",variant:"middle",flexItem:!0})},t.createElement(i.ImageInput,ue({maxSize:5e6},E,{options:ue({disabled:m},c),format:function(e){return tr(e,h)},placeholder:l("ra.input.image.upload_single"),accept:"image/*",inputProps:{capture:"user"}}),t.createElement(i.ImageField,{source:"src",title:""})),!s&&t.createElement(Yn,{sx:{mt:3},field:E.source})):t.createElement(X,{direction:"row",alignItems:"flex-start",justifyContent:"flex-start",divider:t.createElement(L,{orientation:"vertical",variant:"middle",flexItem:!0})},t.createElement(i.FileInput,ue({maxSize:5e6},E,{options:ue({disabled:m},c),format:function(e){return tr(e,h)},placeholder:l("ra.input.file.upload_single")}),t.createElement(i.FileField,{download:!0,source:"src",title:"Ver adjunto",target:"_blank"})),v&&t.createElement(Yn,{sx:{mt:3},field:E.source})))},exports.CheckBox=function(e){var n=Xn(e),r=n.propsContenido,o=r.sx,a=ce(r,nr);return!n.hidden&&t.createElement(i.BooleanInput,ue({},a,{sx:ue({},o,{display:"inline-flex",margin:1})}))},exports.ComboBox=lr,exports.ComboBoxManual=function(e){var n=Xn(e);return!n.hidden&&t.createElement(i.SelectInput,n.propsContenido)},exports.CreateEtriek=tn,exports.CreateGridButton=bt,exports.DeleteButtonNoWarning=ln,exports.EditEtriek=cn,exports.EditGridButton=St,exports.EtrGrid=function(e){var n=e.filterBy,r=void 0===n?"":n,o=e.claves,l=e.sortModel,u=e.columns,c=e.reference,d=e.allowAdd,m=void 0===d||d,f=e.allowRemove,p=void 0===f||f,g=e.enableLoad,v=void 0===g||g,h=e.apiRef,E=ce(e,Ze),b=t.useState([]),y=b[0],T=b[1],S=i.useRecordContext(e),k=i.useInput(ue({defaultValue:""},e)).field,R=t.useContext(Ae),F=R.isLoading,w=(R.fichaProps[E.source]||{}).enviarTodo,B=void 0!==w&&w,P=t.useState(l),I=P[0],L=P[1],M=l[0],q=M.field,N=M.sort,D={};S&&r.split(",").forEach(function(e){e&&(D[e]=[{type:"string",comparison:"eq",value:S[e],field:e}])});var A=i.useGetList(c,{pagination:{page:1,perPage:200},sort:{field:q,order:N},filter:D},{enabled:v&&!F,onSuccess:function(e){T((null==e?void 0:e.data)||[])}}).isLoading,_=[].concat(u,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(ot,ue({},E,{enviarTodo:B,camposClaveFila:o,row:e.row}))}}]);m&&_.unshift({field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return t.createElement(rt,ue({},E,{enviarTodo:B,camposClaveFila:o}))}}),p&&_.push({field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(at,ue({},E,{enviarTodo:B,camposClaveFila:o,row:e.row}))}});var O=t.useMemo(function(){return _},[JSON.stringify(_)]);return t.createElement(x,{sx:{width:"100%",height:"40vh",borderRadius:0,marginTop:1}},t.createElement(a.StyledEngineProvider,{injectFirst:!0},t.createElement(s.ThemeProvider,{theme:it},t.createElement(t.Fragment,null,t.createElement(C.DataGridPremium,ue({apiRef:h,loading:A||F,sx:{"& .MuiDataGrid-columnsContainer":{backgroundColor:function(e){return"light"===e.palette.mode?"#fafafa":"#1d1d1d"}},"& .MuiDataGrid-iconSeparator":{display:"none"}},disableRowSelectionOnClick:!0,paginationModel:{page:1,pageSize:50},hideFooter:!0,rows:y,columns:O,sortModel:I,onSortModelChange:function(e){return L(e)},sortable:!1,resizable:!1,disableReorder:!0,disableExport:!0,filterable:!1,disableColumnMenu:!0,slots:{noRowsOverlay:Ke}},E)),t.createElement("input",ue({type:"hidden"},k))))))},exports.FichaActions=function(e){var n=e.children,r=e.className,o=e.data,a=e.hasShow,l=e.hasList,s=void 0===l||l,u=ce(e,jt);return t.createElement(i.TopToolbar,ue({className:r},ce(u,Gt)),n,s&&t.createElement(i.ListButton,{label:"ra.action.back",icon:t.createElement(N,null)}),a&&t.createElement(i.ShowButton,{record:o}))},exports.FichaContext=Ae,exports.FiltroFuncionarios=Cr,exports.FormClasses=Yt,exports.FormDialog=dn,exports.FormEtriek=gn,exports.GE=function(e){var n=e.filterBy,r=void 0===n?"":n,o=e.sortModel,l=e.columns,u=e.reference,c=e.enableLoad,d=void 0===c||c,m=e.initialState,f=ce(e,lt),p=t.useContext(Ae).isLoading,g=i.useRecordContext(),v=t.useState(o),h=v[0],E=v[1],b=o[0],y=b.field,T=b.sort,S=t.useMemo(function(){return[].concat(l)},[JSON.stringify(l)]),k={};g&&r.split(",").forEach(function(e){e&&(k[e]=[{type:"string",comparison:"eq",value:g[e],field:e}])});var R=t.useContext(Ae),F=R.estado,w=R.isLoading,B=R.fichaProps,P=void 0===B?{}:B,I=De(e),L=P[e.source],M=void 0===L?{}:L,q=M.useContenido,N=void 0===q?Me:q,D=M.restInitialProps,A=i.useGetList(u,{pagination:{page:1,perPage:200},sort:{field:y,order:T},filter:k},{enabled:d&&!p}),_=A.data,O=void 0===_?[]:_,V=A.isLoading,G=A.refetch,j=C.useGridApiRef(),z=C.useKeepGroupedColumnsHidden({apiRef:j,initialState:m});return N(ue({},f,{estado:F,hidden:e.hidden,isLoading:w,utils:I},D,{refetch:G,apiRef:j})),t.createElement(x,{sx:{width:"100%",height:"40vh",borderRadius:0,marginTop:1}},t.createElement(a.StyledEngineProvider,{injectFirst:!0},t.createElement(s.ThemeProvider,{theme:st},t.createElement(C.DataGridPremium,ue({apiRef:j,rows:O,columns:S,loading:V||p,sx:{"& .MuiDataGrid-columnsContainer":{backgroundColor:function(e){return"light"===e.palette.mode?"#fafafa":"#1d1d1d"}},"& .MuiDataGrid-iconSeparator":{display:"none"}},disableRowSelectionOnClick:!0,paginationModel:{page:1,pageSize:50},hideFooter:!0,sortModel:h,onSortModelChange:function(e){return E(e)},slots:{noRowsOverlay:Ke},initialState:z},f)))))},exports.GridButton=ft,exports.GrillaEtriek=Nt,exports.ImageField=function(e){var n=e.title,r=e.source,o=e.src,a=i.useRecordContext(e);return t.createElement(z,{title:n,src:o+"/"+a[r]})},exports.Layout=function(e){return t.createElement(i.Layout,ue({},e,{appBar:fe,menu:En}))},exports.ListActionsEtriek=function(e){var n=e.className,r=e.filters,o=e.children,a=e.hideFilterButton,l=void 0!==a&&a,s=e.jsBotonGrilla,u=void 0===s?xn:s,c=ce(e,bn),d=i.useListContext(e),m=d.sort,f=d.displayedFilters,p=d.filterValues,g=d.exporter,v=d.showFilter,h=d.total,E=i.useResourceContext(e),b=i.useResourceDefinition(e).hasCreate,x=t.useContext(i.FilterContext)||r,C=i.useListContext(e),y=ue({},qe(e),C);return delete c.hasCreate,t.useMemo(function(){return t.createElement(i.TopToolbar,ue({className:n},i.sanitizeListRestProps(c)),l?null:r?t.cloneElement(r,{resource:E,showFilter:v,displayedFilters:f,filterValues:p,context:"button"}):x&&t.createElement(i.FilterButton,null),b&&t.createElement(i.CreateButton,null),!1!==g&&t.createElement(i.ExportButton,{disabled:0===h,resource:E,sort:m,filterValues:p}),t.Children.map(o,function(e,n){return t.cloneElement(e,{onClick:e.props.options?null:function(t){e.props.onClick&&e.props.onClick(t),u(y,e.key)},options:e.props.options?e.props.options.map(function(t){return ue({},t,{onClick:function(n){e.props.onClick&&e.props.onClick(n),u(y,t.key)}})}):null})}))},[E,f,p,r,v,x,h,n,m,l,g,b])},exports.ListCheck=function(e){var n=Xn(e);return n.hidden?null:t.createElement(i.ReferenceArrayInput,{source:e.source,reference:e.reference},t.createElement(i.SelectArrayInput,ue({},n.propsContenido,{optionText:"etiqueta",optionValue:e.source})))},exports.Login=function(e){var n=e.loginBackgroundImage,o=e.nameSource,s=void 0===o?"username":o,u=e.passwordSource,c=void 0===u?"password":u,d=t.useState(!1),m=d[0],f=d[1],p=i.useTranslate(),g=p("ra.auth.sign_in"),v=i.useNotify(),h=i.useLogin(),E=l.useLocation();return t.createElement(i.Form,{onSubmit:function(e){f(!0),h(e,E.state?E.state.nextPathname:"/").catch(function(e){f(!1),v("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error",{type:"error",messageArgs:{_:"string"==typeof e?e:e&&e.message?e.message:void 0}})})},validate:function(e){var t={};return e[s]||(t[s]=p("ra.validation.required")),e[c]||(t[c]=p("ra.validation.required")),t}},t.createElement(a.Box,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:n,backgroundRepeat:"no-repeat",backgroundSize:"cover"}},t.createElement(U,{sx:{minWidth:300,marginTop:"6em"}},t.createElement(a.Box,{sx:{margin:"1em",display:"flex",justifyContent:"center"}},t.createElement(z,{sx:{backgroundColor:"secondary.main"}},t.createElement(r,null))),t.createElement(a.Box,{sx:{marginTop:"1em",marginBottom:"1em",display:"flex",justifyContent:"center",color:"grey.600"}},"Inicio de Sesión"),t.createElement(a.Box,{sx:{padding:"0 1em 1em 1em"}},t.createElement(a.Box,{sx:{marginTop:0}},t.createElement(i.TextInput,{autoFocus:!0,fullWidth:!0,name:s,label:p("ra.auth.username"),disabled:m})),t.createElement(a.Box,{sx:{marginTop:0}},t.createElement(i.PasswordInput,{name:c,label:p("ra.auth.password"),type:"password",disabled:m}))),t.createElement(H,{sx:{padding:"0 1em 1em 1em"}},t.createElement(W,{variant:"contained",type:"submit",color:"primary",disabled:m,fullWidth:!0},m&&t.createElement(J,{sx:{position:"absolute"},size:18,thickness:2}),g)))))},exports.Menu=En,exports.MenuButton=function(e){var n,r=e.options,o=void 0===r?[]:r,l=e.icon,s=e.label,u=e.disabled,c=ce(e,yn),d=t.useState(!1),m=d[0],f=d[1],p=t.useRef(),g=t.useState(0),v=g[0],h=g[1],E=i.useResourceContext(e);return t.createElement(a.Box,ue({sx:{display:"inline-block"}},ce(c,Cn)),t.createElement(i.Button,{size:"large",className:"add-filter",label:s,onClick:function(e){e.preventDefault(),f(!0),p.current=e.currentTarget},title:o[v].label,disabled:u},(null===(n=o[v])||void 0===n?void 0:n.icon)||l),t.createElement(Q,{open:m,anchorEl:p.current,onClose:function(e){p.current&&p.current.contains(e.target)||f(!1)}},o.map(function(e,n){return t.createElement(Y,{key:e.label,disabled:e.disabled,selected:n===v,onClick:function(t){!function(e,t){h(t),f(!1)}(0,n),e.onClick&&e.onClick(t,n)},resource:E,title:e.label},e.icon,t.createElement(a.Box,{component:"span",sx:{paddingRight:"4px"}}),t.createElement(i.FieldTitle,{label:e.label,resource:E}))})))},exports.MultiTextField=function(e){var n=e.fields,r=e.className,o=ce(e,Tn),a=n.campos,l=n.separador,s=void 0===l?"":l,u=n.secundario,c=void 0===u?[]:u,d=n.hasSecundario,m=i.useRecordContext(),f=a.map(function(e){return void 0!==m[e]?m[e]:e}).join(""+s);return t.createElement(P,ue({noWrap:!0,variant:"inherit",className:r},o),f,d&&t.createElement(P,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(m[e.campo]||"---")}).join(" ")))},exports.Password=function(e){var n=Xn(e);return!n.hidden&&t.createElement(i.PasswordInput,n.propsContenido)},exports.RadioButton=function(e){var n=Xn(e),r=n.propsContenido,o=n.hidden;return t.useContext(Ae).isLoading||o?null:t.createElement(i.ReferenceInput,{source:e.source,reference:e.reference},t.createElement(i.RadioButtonGroupInput,ue({},r,{optionText:"etiqueta",optionValue:e.source})))},exports.RadioButtonManual=function(e){var n=Xn(e);return!n.hidden&&t.createElement(i.RadioButtonGroupInput,n.propsContenido)},exports.Separador=function(e){var n=e.source;return!(T.useSelector(function(e){var t=e.configInputs?e.configInputs.filter(function(e){return e.id===n}):[];return t[0]?t[0]:null})||{}).hidden&&t.createElement(P,{variant:"h6",gutterBottom:!0,id:e.source},e.children)},exports.ShowEtriek=kn,exports.ShowGridButton=In,exports.SubMenu=vn,exports.TBSF=function(e){var n=e.disabled,r=e.label,o=void 0===r?"Funcionarios":r,l=e.allowNone,s=void 0===l||l,u=e.source,c=e.sx,d=ce(e,yr),m=i.useRecordSelection("form_224")[0],f=t.useState(!1),p=f[0],g=f[1],v=y.useFormContext();t.useEffect(function(){E()},[]);var h=t.useCallback(function(){g(!1)},[g]),E=function(e){v.setValue(u,{seleccion:[],all:!0,none:!1})};return t.createElement(t.Fragment,null,t.createElement(a.Box,{display:"flex",alignItems:"center",sx:ue({},c,{display:"inline-flex",margin:1})},t.createElement(i.TextInput,ue({defaultValue:Tr},d,{source:u,label:o,disabled:!0,parse:kr,format:Sr,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,s&&t.createElement(O,{onClick:function(e){v.setValue(u,{seleccion:[],all:!1,none:!0})},disabled:n,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(re,null)),t.createElement(O,{onClick:E,disabled:n,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement(ne,null)),t.createElement(O,{onClick:function(e){return g(!0)},disabled:n,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(oe,null)))}}))),t.createElement(Cr,{isOpen:p,title:"Selección de "+o,onConfirm:function(e,t){g(!1),v.setValue(u,{seleccion:m,all:!1,none:!1})},onClose:h}))},exports.TabbedFormEtriek=Wn,exports.TabbedGrillaEtriek=function(e){var n=e.filterValues,r=e.setFilters,o=e.tabs,a=o.ids,i=ce(o,Dt),l=e.GridComponent,s=void 0===l?Nt:l,u=ce(e,At),c=n.id;return t.createElement(t.Fragment,null,t.createElement(q,{value:c,indicatorColor:"primary",onChange:function(e,t){r(ue({},n,{id:t}))}},a.map(function(e){return t.createElement(M,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),t.createElement(L,null),t.createElement(s,ue({},u,i[c])))},exports.TextArea=function(e){var n=Xn(e);return!n.hidden&&t.createElement(i.TextInput,ue({multiline:!0},n.propsContenido))},exports.TextBox=function(e){var n=e.tipo,r=ce(e,Rr),o=Xn(r),a=o.propsContenido,l=o.hidden,s=y.useFormContext();t.useEffect(function(){a.value&&s.setValue(e.source,a.value)});var u=ue({},a);return l?null:"N"===n||"D"===n?t.createElement(i.NumberInput,u):"F"===n?t.createElement(i.DateInput,u):"Z"===n?t.createElement(i.DateTimeInput,u):t.createElement(i.TextInput,"H"===n?ue({},u,{type:"time"}):u)},exports.TextBoxSelection=function(e){var n=e.disabled,r=e.asistant,o=e.asistantResource,l=e.label,s=e.source,u=e.sx,c=ce(e,dr),d=t.useState(!1),m=d[0],f=d[1],p=y.useFormContext();t.useEffect(function(){v()},[]);var g=t.useCallback(function(){f(!1)},[f]),v=function(e){p.setValue(s,{seleccion:[],all:!0,none:!1})};return t.createElement(t.Fragment,null,t.createElement(a.Box,{display:"flex",alignItems:"center",sx:ue({},u,{display:"inline-flex",margin:1})},t.createElement(i.TextInput,ue({defaultValue:fr},c,{source:s,label:l,disabled:!0,parse:gr,format:pr,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,t.createElement(O,{onClick:function(e){p.setValue(s,{seleccion:[],all:!1,none:!0})},disabled:n,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(re,null)),t.createElement(O,{onClick:v,disabled:n,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement(ne,null)),t.createElement(O,{onClick:function(e){return f(!0)},disabled:n,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(oe,null)))}}))),t.createElement(cr,{isOpen:m,title:"Selección de "+l,contentResource:o,content:t.createElement(r,{bulkActionButtons:t.createElement(mr,null),hasCreate:!1,exporter:!1,resource:o}),onConfirm:function(e,t){f(!1),p.setValue(s,{seleccion:t,all:!1,none:!1})},onClose:g}))},exports.TextCombo=function(e){var n=e.source,r=e.label,o=e.sx;return Xn(e).hidden?null:t.createElement(a.Box,{sx:ue({},o,{display:"inline-flex",alignItems:"flex-start",marginLeft:{md:1},marginBottom:-1,width:{xs:"100%",md:"calc(24vw + 1em)"}})},t.createElement(i.TextInput,ue({},e,{label:"",source:n,sx:{flex:1,marginTop:1}})),t.createElement(lr,ue({},e,{source:n,label:r,isTC:!0,sx:{flex:3}})))},exports.TextField=We,exports.choicesEstado=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],exports.dateFormat=function(e){if(null==e||""===e)return"";if(e instanceof Date)return Ut(e);if(Wt.test(e)){var t=e.split("/");return t[2]+"-"+t[1]+"-"+t[0]}return Ut(new Date(e))},exports.dateFormatOptions={inputFormat:"dd/MM/yyyy"},exports.dateParser=function(e){if(!e)return"";var t=e.split("-");return t[2]+"/"+t[1]+"/"+t[0]},exports.dateTimeFormat=function(e){if(null==e||""===e)return"";if(e instanceof Date)return Ut(e);if(Ht.test(e)){var t=e.split(" "),n=t[0].split("/");return n[2]+"-"+n[1]+"-"+n[0]+" "+t[1]}return Ut(new Date(e))},exports.dateTimeParser=function(e){if(!e)return"";var t=e.split("T"),n=t[0].split("-");return n[2]+"/"+n[1]+"/"+n[0]+" "+t[1]},exports.dateTimeToString=function(e){return e.toLocaleString("es",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).replace(",","")},exports.dateToString=function(e){return e?String(e.getDate()).padStart(2,"0")+"/"+String(e.getMonth()+1).padStart(2,"0")+"/"+String(e.getFullYear()):""},exports.deleteRecargarComboBox=Ce,exports.descargarLink=function(e,t){var n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.setAttribute("href",e),n.setAttribute("download",t),n.click()},exports.enMessages=Jn,exports.esMessages=Qn,exports.etrFechaMayorQue=function(e){return function(t,n){var r=n[e];if(t&&r){var o=new Date(r.split("/").reverse().join("/")),a=new Date(t.split("/").reverse().join("/"));if(D.isAfter(o,a))return{message:"validation.greater_or_equal",args:{menor:r}}}}},exports.etrRequerido=Jt,exports.etrRequeridoNumerico=Qt,exports.getFormcodFromResource=zt,exports.localeOptions=function(e){return void 0===e&&(e="es"),{locale:"en"===e?A:_}},exports.recargarComboBox=xe,exports.renderCellComboBox=function(e,n,r){return function(o){var a;return t.createElement(i.ReferenceField,{reference:r,source:n,queryOptions:{meta:{etr:e}},record:(a={},a[n]=o.row[n],a)},t.createElement(We,{source:"etiqueta"}))}},exports.setDisableAction=Te,exports.setErrorAction=ke,exports.setHiddenAction=ye,exports.setRequireAction=Se,exports.stringToDate=function(e){if(!e)return"";var t=e.split("/").map(Number);return new Date(t[2],t[1]-1,t[0])},exports.stringToDateTime=function(e){if(!e)return"";var t=e.split(" "),n=t[1],r=t[0].split("/").map(Number),o=r[0],a=r[1],i=r[2],l=n.split(":").map(Number);return new Date(i,a-1,o,l[0],l[1])},exports.themes=Hn,exports.timeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var t=e.split(":"),n=new Date;return n.setHours(t[0]),n.setMinutes(t[1]),n.toString()}var r=/(\d{2}):(\d{2})/.exec(e);if(null!==r){var o=new Date;return o.setHours(r[0]),o.setMinutes(r[1]),o.toString()}},exports.timeParser=function(e,t){return e?e.split(" ")[4].substring(0,5):""},exports.useAjax=Le,exports.useContenidoController=Xn,exports.useEtrActions=function(e){var t=e.useFormulario()[e.source],n=ue({},e,{enviarTodo:!(null==t||!t.enviarTodo)});return{addRow:He(n),editRow:Je(n),deleteRow:Qe(n),clear:function(t){e.apiRef.current.setRows([]),t.setValue(e.source,"")},api:e.apiRef}},exports.useFieldController=je,exports.useFormProgress=be,exports.useFormSubmit=$t,exports.useGetJson=Ie,exports.useInitFicha=Ot,exports.useNuevo=Vt,exports.useReferenceLabel=function(e,t){var n=i.useResourceContext(),r=i.useGetOne("cb_"+zt(n)+"_"+e,{id:t}),o=r.data;return r.isLoading||r.error?"":(null==o?void 0:o.etiqueta)||""},exports.useUtils=De,exports.useUtilsGrilla=qe,exports.useUtilsSubmit=Ne;
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=e(require("@mui/icons-material/Lock")),o=e(require("@mui/icons-material/VpnLock")),a=require("@mui/material"),i=require("react-admin"),l=require("react-router-dom"),s=require("@mui/material/styles"),u=require("prop-types"),c=e(u),d=e(require("@mui/icons-material/Add")),m=e(require("@mui/icons-material/Cancel")),p=e(require("@mui/icons-material/Delete")),f=e(require("@mui/icons-material/Edit")),g=e(require("@mui/material/Dialog")),v=e(require("@mui/material/DialogActions")),h=e(require("@mui/material/DialogContent")),E=e(require("@mui/material/DialogContentText")),b=e(require("@mui/material/DialogTitle")),x=e(require("@mui/material/Paper")),C=require("@mui/x-data-grid-premium"),y=require("react-hook-form"),T=require("react-redux"),S=require("react-query"),k=e(require("@mui/icons-material/Settings")),R=require("@mui/x-data-grid"),F=e(require("@mui/material/AppBar")),w=e(require("@mui/material/Slide")),B=e(require("@mui/material/Toolbar")),P=e(require("@mui/material/Typography")),I=e(require("@mui/icons-material/Create")),L=e(require("@mui/material/Divider")),M=e(require("@mui/material/Tab")),q=e(require("@mui/material/Tabs")),N=e(require("@mui/icons-material/ChevronLeft")),D=require("date-fns"),A=e(require("date-fns/locale/en-US")),_=e(require("date-fns/locale/es")),O=e(require("@mui/material/IconButton")),V=e(require("@mui/material/Tooltip")),G=e(require("@mui/material/Box")),j=e(require("@mui/icons-material/ExpandMore")),z=e(require("@mui/material/Avatar")),W=e(require("@mui/material/Button")),U=e(require("@mui/material/Card")),H=e(require("@mui/material/CardActions")),J=e(require("@mui/material/CircularProgress")),Q=e(require("@mui/material/Menu")),Y=e(require("@mui/material/MenuItem")),K=e(require("@mui/icons-material/RemoveRedEye")),Z=e(require("ra-language-english")),$=e(require("@blackbox-vision/ra-language-spanish")),X=e(require("@mui/material/Stack")),ee=e(require("@mui/icons-material/Visibility")),te=e(require("@mui/icons-material/CloudDownload")),ne=e(require("@mui/material/Link")),re=require("@mui/icons-material"),oe=e(require("@mui/icons-material/AddAPhoto")),ae=e(require("@mui/icons-material/Check")),ie=e(require("@mui/icons-material/RemoveCircleOutline")),le=e(require("@mui/icons-material/Search")),se=e(require("@mui/icons-material/CheckCircle")),ue=e(require("@mui/icons-material/ErrorOutline")),ce=e(require("react-draggable")),de=require("devextreme-react");function me(){return(me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function pe(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}var fe=t.forwardRef(function(e,n){var s=i.useTranslate(),u=i.useUserMenu().onClose,c=i.useResourceDefinitions(),d=c.form_59;return[c.form_275?t.createElement(a.MenuItem,me({component:l.Link,ref:n},e,{key:"/form_275",to:"/form_275",onClick:u}),t.createElement(a.ListItemIcon,null,t.createElement(r,null)),t.createElement(a.ListItemText,null,s("pos.change_pin"))):null,d?t.createElement(a.MenuItem,me({component:l.Link,ref:n},e,{key:"/form_59",to:"/form_59",onClick:u}),t.createElement(a.ListItemIcon,null,t.createElement(o,null)),t.createElement(a.ListItemText,null,s("pos.change_password"))):null]}),ge=function(){return t.createElement(i.UserMenu,null,t.createElement(fe,null),t.createElement(i.Logout,null))},ve=function(e){var n=a.useMediaQuery(function(e){return e.breakpoints.up("sm")});return t.createElement(i.AppBar,me({},e,{color:"secondary",userMenu:t.createElement(ge,null)}),t.createElement(a.Typography,{variant:"h6",color:"inherit",sx:{flex:1,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},id:"react-admin-title"}),n&&t.createElement(a.Box,{component:"span",sx:{flex:1}}))},he=t.createContext(),Ee=function(e){var n=e.children,r=t.useState(!1),o=r[0],a=r[1],i=t.useState({}),l=i[0],s=i[1],u=t.useMemo(function(){return{open:o,props:l,show:function(e){s(e),a(!0)},hide:function(){return a(!1)}}},[o,l]);return t.createElement(he.Provider,{value:u},n)},be=function(){return t.useContext(he)},xe=t.createContext(),Ce=function(e){var n=e.children,r=t.useState(!1),o=r[0],a=r[1],i=t.useMemo(function(){return{open:o,show:function(){return a(!0)},hide:function(){return a(!1)}}},[o]);return t.createElement(xe.Provider,{value:i},n)},ye=function(){return t.useContext(xe)},Te=function(e,t,n,r){return{type:"RELOAD_CB",payload:{id:e,method:t,params:n,callback:r}}},Se=function(e,t){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:t}}},ke=function(e,t){return{type:"HIDE_INPUT",payload:{id:e,hidden:t}}},Re=function(e,t){return{type:"DISABLE_INPUT",payload:{id:e,disabled:t}}},Fe=function(e,t){return{type:"REQUIRE_INPUT",payload:{id:e,required:t}}},we=function(e,t){return{type:"ERROR_INPUT",payload:{id:e,error:t}}},Be=function(){var e=T.useDispatch();return t.useCallback(function(t,n,r,o){e(Te(t,n,r,o))},[e])},Pe=function(){var e=T.useDispatch();return t.useCallback(function(t,n){e(ke(t,n))},[e])},Ie=function(){var e=T.useDispatch();return t.useCallback(function(t,n){e(Re(t,n))},[e])},Le=function(){var e=T.useDispatch();return t.useCallback(function(t,n){e(Fe(t,n))},[e])},Me=function(){var e=T.useDispatch();return t.useCallback(function(t,n){e(we(t,n))},[e])},qe=function(e,t){var n=i.useDataProvider(),r=S.useMutation(function(t){return n.getJson(e,{method:t.method,params:t.params})},t);return{mutateAsync:r.mutateAsync,isLoading:r.isLoading}},Ne=function(e){var n=qe(e),r=n.mutateAsync,o=n.isLoading;return[t.useCallback(function(e,t,n){return r({method:e,params:t},{onSuccess:n,onError:n})},[]),o]},De=function(e){return{}},Ae=function(e){var t=i.useListContext(e),n=i.useNotify(),r=i.useRedirect(),o=i.useRefresh(),a=i.useResourceContext(e),l=i.useUnselectAll(a),s=be(),u=i.useTranslate();return{ajax:Ne(a)[0],data:t,notify:n,redirect:r,refresh:o,refetch:t.refetch,unselectAll:l,asistente:s,translate:u}},_e=function(e){var t=Be(),n=Pe(),r=Ie(),o=Le(),a=Me(),l=ye(),s=i.useNotify(),u=i.useRedirect(),c=i.useResourceContext(e);return{ajax:Ne(c)[0],notify:s,redirect:u,recargarComboBox:t,progress:l,setHidden:n,setDisable:r,setRequire:o,setError:a,etrs:e.etrs||{}}},Oe=function(e){var n=Be(),r=Pe(),o=Ie(),a=Le(),l=Me(),s=ye(),u=i.useNotify(),c=i.useRedirect(),d=y.useFormContext(),m=i.useResourceContext(e),p=Ne(m),f=e.etrs||{},g=e.asisEtr||{},v=null==d?void 0:d.trigger;return{form:d,ajax:p[0],notify:u,redirect:c,recargarComboBox:n,progress:s,setHidden:t.useCallback(function(e,t){r(e,t),setTimeout(function(){v(e)})},[r,v]),setDisable:t.useCallback(function(e,t){o(e,t),setTimeout(function(){v(e)})},[o,v]),setRequire:t.useCallback(function(e,t){a(e,t),setTimeout(function(){v(e)})},[a,v]),setError:t.useCallback(function(e,t){l(e,t),setTimeout(function(){v(e)})},[l,v]),etrs:f,asisEtr:g}},Ve=t.createContext({}),Ge=t.createContext(void 0),je=["hidden"],ze=["hidden","useContenido"],We=["hidden"],Ue=function(e){var n=t.useContext(Ve),r=n.estado,o=n.isLoading,a=n.fichaProps,i=(void 0===a?{}:a)[e.source],l=void 0===i?{}:i,s=e.hidden,u=void 0!==s&&s,c=pe(e,je),d=l.hidden,m=l.useContenido,p=void 0===m?De:m,f=pe(l,ze),g=void 0!==d?d:u,v=p(me({},c,{estado:r,hidden:g,isLoading:o},f)),h=v.hidden,E=pe(v,We);if(void 0===v)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:me({},c,f,E),hidden:void 0!==h?h:g}},He=["tipo","value"],Je=function(e){var n=e.tipo,r=pe(e,He),o=Ue(r),a=o.hidden,l=me({},o.propsContenido);return!a&&("N"===n||"D"===n?t.createElement(i.NumberField,l):"F"===n?t.createElement(i.DateField,l):"Z"===n?t.createElement(i.DateField,me({},l,{showTime:!0})):t.createElement(i.TextField,l))},Qe=function(e){var t=me({},e);return delete t.id,t},Ye=function(e){var n=e.apiRef,r=e.source,o=e.enviarTodo;return t.useCallback(function(e,t){var a=Qe(e),i=n.current.getRowsCount()+1;n.current.updateRows([me({},a,{id:i})]);var l=o?Array.from(n.current.getRowModels().values(),function(e){return me({},e,{claveFila:"",estado:"N"})})||[]:t.getValues()[r]||[];o||l.push(me({},a,{claveFila:"",_id:i,estado:"N"})),t.setValue(r,l,{shouldDirty:!0})},[n,r])},Ke=function(e){var n=e.apiRef,r=e.source,o=e.enviarTodo;return t.useCallback(function(e,t,a){var i,l,s="number"==typeof e?"N":"M",u=Qe(t);n.current.updateRows([me({},u,{id:e})]);var c=o?Array.from(n.current.getRowModels().values(),function(e){return me({},e,{estado:s})})||[]:a.getValues()[r]||[],d=c.findIndex(function(t){return"number"==typeof e?t._id===e:t.claveFila===e});c[d=-1===d?0:d]=me({},u,{claveFila:"N"===(null===(i=c[d])||void 0===i?void 0:i.estado)?"":e,_id:e,estado:"N"===(null===(l=c[d])||void 0===l?void 0:l.estado)?"N":"M"}),a.setValue(r,c,{shouldDirty:!0})},[n,r])},Ze=function(e){var n=e.apiRef,r=e.source,o=e.enviarTodo;return t.useCallback(function(e,t){var a=n.current.getRowModels().get(e);n.current.updateRows([{id:e,_action:"delete"}]);var i=o?Array.from(n.current.getRowModels().values(),function(e){return me({},e,{estado:"B"})})||[]:t.getValues()[r]||[],l=i.findIndex(function(t){return t.claveFila===e});i[l=-1===l?i.length:l]=me({},a,{estado:"B",claveFila:e}),"number"==typeof e&&i.splice(l,1),t.setValue(r,i,{shouldDirty:!0})},[n,r])},$e=s.styled("div")(function(e){var t=e.theme;return{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%","& .ant-empty-img-1":{fill:"light"===t.palette.mode?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===t.palette.mode?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===t.palette.mode?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===t.palette.mode?"#fff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===t.palette.mode?"0.8":"0.08",fill:"light"===t.palette.mode?"#f5f5f5":"#fff"}}}),Xe=function(){return t.createElement($e,null,t.createElement("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(24 31.67)"},t.createElement("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),t.createElement("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),t.createElement("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),t.createElement("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),t.createElement("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),t.createElement("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},t.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),t.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),t.createElement(a.Box,{sx:{mt:1}},"No hay registros"))},et=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","enableLoad","apiRef"],tt=s.styled(i.Button,{name:"EtrDeleteButton",overridesResolver:function(e,t){return t.root}})(function(e){var t=e.theme;return{color:t.palette.primary.main,"&:hover":{backgroundColor:a.alpha(t.palette.primary.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}),nt={},rt=function(e){var n=y.useFormContext();return t.createElement(Ge.Provider,{value:{form:n}},e.children)},ot=function(e){return t.createElement(g,{open:e.open,onClose:e.onClose,fullWidth:!0},t.createElement(b,null,e.labelEstado+" "+e.label),t.createElement(E,{component:"span"},t.createElement(i.Form,{mode:"onBlur",record:nt,resource:e.resource,onSubmit:e.onSubmit},t.createElement(rt,null,e.children))))};ot.propTypes={label:u.string,onClick:u.func,icon:u.any,open:u.bool,onClose:u.func,labelEstado:u.string,resource:u.any,save:u.func,render:u.func};var at=function(e){var n=e.form,r=e.resource,o=e.estado,l=e.editors,s=e.recordPadre,u=e.camposClaveFila,c=e.setOpen,d=e.open,p=y.useFormState(),f=p.dirtyFields,g=p.isValid,E=t.useContext(Ve).fichaProps,b=E[e.source],x=void 0===b?{}:b,C=E.etrs,T=t.useContext(Ge),S=x.onAfterRenderAsistente,k=Oe({resource:r,etrs:C,asisEtr:T});return t.useEffect(function(){d&&"function"==typeof S&&S(me({},k,{form:n}))},[d]),t.createElement(t.Fragment,null,t.createElement(h,null,t.createElement(a.Stack,{spacing:4},t.Children.map(l,function(e,n){return t.cloneElement(e,me({resource:r,estado:o,defaultValue:s[e.props.source]||"",fullWidth:!0,sx:{margin:0},disabled:"N"!==o&&-1!==u.indexOf(e.props.source)},x[e.props.source]))}))),t.createElement(v,null,t.createElement(i.SaveButton,{disabled:0===Object.keys(f).length||!g}),t.createElement(i.Button,{label:"ra.action.cancel",onClick:function(e){c(!1),e.stopPropagation()}},t.createElement(m,null))))},it=function(e){var n=e.editors,r=e.record,o=e.camposClaveFila,a=e.label,l=e.source,s=e.enviarTodo,u=i.useSafeSetState(!1),c=u[0],m=u[1],p=i.useResourceContext(e),f=y.useFormContext(),g=C.useGridApiContext(),v=Ye({apiRef:g,source:l,enviarTodo:s}),h=i.useTranslate()("ra.action.create");return t.createElement(t.Fragment,null,t.createElement(i.Button,{onClick:function(e){m(!0),e.stopPropagation()}},t.createElement(d,null)),t.createElement(ot,{open:c,onClose:function(e){m(!1),e.stopPropagation()},labelEstado:h,label:a,resource:p,onSubmit:function(e,t){v(e,f),m(!1)}},t.createElement(at,{source:l,form:f,resource:p,estado:"N",editors:n,recordPadre:r||{},camposClaveFila:o,open:c,setOpen:function(){m(!1)}})))},lt=function(e){var n=e.editors,r=e.camposClaveFila,o=e.resource,a=e.label,l=e.source,s=e.row,u=e.enviarTodo,c=i.useTranslate(),d=i.useSafeSetState(!1),m=d[0],p=d[1],g=C.useGridApiContext(),v=y.useFormContext(),h=Ke({apiRef:g,source:l,enviarTodo:u}),E=c("ra.action.edit");return t.createElement(t.Fragment,null,t.createElement(i.Button,{onClick:function(e){p(!0),e.stopPropagation()}},t.createElement(f,null)),t.createElement(ot,{open:m,onClose:function(e){p(!1),e.stopPropagation()},labelEstado:E,label:a,resource:o,onSubmit:function(e,t){h(s.id,e,v),p(!1)}},t.createElement(at,{source:l,form:v,resource:o,estado:"M",editors:n,recordPadre:s,camposClaveFila:r,open:m,setOpen:function(){p(!1)}})))},st=function(e){var n=e.confirmTitle,r=void 0===n?"ra.message.delete_title":n,o=e.confirmContent,a=void 0===o?"ra.message.delete_content":o,l=e.row,s=e.source,u=e.enviarTodo,c=i.useSafeSetState(!1),d=c[0],m=c[1],f=C.useGridApiContext(),g=y.useFormContext(),v=Ze({apiRef:f,source:s,enviarTodo:u});return t.createElement(t.Fragment,null,t.createElement(tt,{key:"button",onClick:function(e){m(!0),e.stopPropagation()}},t.createElement(p,null)),t.createElement(i.Confirm,{isOpen:d,title:r,content:a,onConfirm:function(e){v(l.id,g)},onClose:function(e){m(!1),e.stopPropagation()}}))},ut=a.createTheme({},C.esES),ct=["filterBy","sortModel","columns","reference","enableLoad","initialState"],dt=a.createTheme({},C.esES),mt=t.forwardRef(function(e,n){return t.createElement(w,me({direction:"up",ref:n},e))}),pt=function(e){var n=e.isLoading,r=i.useResourceContext(e),o=be(),l=o.open,s=o.hide,u=o.props,c=u.title,d=u.controles,p=u.aceptar,f=u.tipo,g=void 0===f?"form":f;return"confirm"===g?t.createElement(i.Confirm,{isOpen:l,title:"Atención",content:d,onConfirm:p,onClose:function(){return s()}}):t.createElement(a.Dialog,{open:l,onClose:function(){return s()},fullWidth:!0,fullScreen:"vista"===g,maxWidth:"vista"===g?"lg":"sm",TransitionComponent:mt},"form"===g?t.createElement(t.Fragment,null,t.createElement(a.DialogTitle,{id:"draggable-dialog-title"},c),t.createElement(i.Form,{resource:r,onSubmit:p},t.createElement(a.DialogContent,{dividers:!0},t.createElement(a.Stack,{spacing:2},d)),t.createElement(a.DialogActions,null,t.createElement(i.Button,{label:"ra.action.cancel",disabled:n,onClick:function(){return s()}},t.createElement(m,null)),t.createElement(i.SaveButton,{disabled:n})))):t.createElement(t.Fragment,null,t.createElement(F,{sx:{position:"relative"}},t.createElement(B,{disableGutters:!0,variant:"dense"},t.createElement(P,{sx:{ml:2,flex:1},variant:"h6",component:"div"},c),t.createElement(i.Button,{label:"ra.action.cancel",disabled:n,onClick:function(){return s()},color:"inherit"},t.createElement(m,null)))),d))},ft=["alignIcon","children","className","disabled","label","color","size","to"],gt=["redirect","replace","state"],vt=function(e){var n=e.children,r=e.className,o=e.disabled,l=e.label,s=e.color,u=void 0===s?"primary":s,c=e.to,d=pe(e,ft),m=i.useTranslate(),p=l?m(l,{_:l}):void 0,f=ht(c);return l&&!o?t.createElement(a.Tooltip,{title:p},t.createElement(a.IconButton,me({"aria-label":p,className:r,color:u,size:"large"},d,f),n)):t.createElement(a.IconButton,me({className:r,color:u,disabled:o,size:"large"},d,f),n)};vt.propTypes={alignIcon:c.oneOf(["left","right"]),children:c.element,className:c.string,color:c.oneOfType([c.oneOf(["inherit","default","primary","secondary","error","info","success","warning"]),c.string]),disabled:c.bool,label:c.string,size:c.oneOf(["small","medium","large"])};var ht=function(e){if(null!=e){if("string"==typeof e)return{to:e};var t=e.redirect,n=e.replace,r=e.state;return{to:pe(e,gt),redirect:t,replace:n,state:r}}},Et=["icon","label","scrollToTop"],bt=function(e){return e.stopPropagation()},xt={true:{_scrollToTop:!0},false:{}},Ct=t.createElement(d,null),yt=function(e){var n=e.icon,r=void 0===n?Ct:n,o=e.label,a=void 0===o?"ra.action.create":o,s=e.scrollToTop,u=void 0===s||s,c=pe(e,Et),d=i.useResourceContext(e),m=i.useRecordContext(e),p=i.useCreatePath();return t.createElement(vt,me({component:l.Link,to:p({type:"create",resource:d}),state:me({record:m},xt[String(u)]),label:a,onClick:bt},c),r)},Tt=["icon","label","scrollToTop"],St=function(e){return e.stopPropagation()},kt={true:{_scrollToTop:!0},false:{}},Rt=t.createElement(I,null),Ft=function(e){var n=e.icon,r=void 0===n?Rt:n,o=e.label,a=void 0===o?"ra.action.edit":o,s=e.scrollToTop,u=void 0===s||s,c=pe(e,Tt),d=i.useResourceContext(e),m=i.useRecordContext(e),p=i.useCreatePath();return m?t.createElement(vt,me({component:l.Link,to:p({type:"edit",resource:d,id:m.id}),state:kt[String(u)],label:a,onClick:St},c),r):null},wt=["actionButtons","bulkActionButtons","sx","columns","isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit","initialState","convertFilterModelToFilterValues","claveNuevo","mobileColumns"],Bt=["handler"],Pt=["key","handler","icon"],It=function(e,t){return void 0===t||"function"==typeof t&&t(e)},Lt=a.createTheme({},C.esES),Mt=new Map([["is","is"],["not","not"],["after","after"],["onOrAfter","onOrAfter"],["before","before"],["onOrBefore","onOrBefore"],["eq","="],["neq","!="],["gt",">"],["gte",">="],["lt","<"],["lte","<="],["contains","contains"],["equals","equals"],["sw","startsWith"],["ew","endsWith"],["isEmpty","isEmpty"],["isNotEmpty","isNotEmpty"],["isAnyOf","isAnyOf"]]),qt=new Map(Array.from(Mt,function(e){return[e[1],e[0]]})),Nt=function(e){return e.items.reduce(function(e,t){return void 0!==t.field&&t.operator&&(qt.has(t.operator)?e[t.field+"_"+qt.get(t.operator)]=t.value:e[t.field]=t.value),e},{})},Dt=function(e){var n=e.actionButtons,r=void 0===n?[]:n,o=e.bulkActionButtons,l=e.sx,s=e.columns,u=e.isRowEditable,c=e.hasEdit,d=e.initialState,m=e.convertFilterModelToFilterValues,p=void 0===m?Nt:m,f=e.claveNuevo,g=pe(e,wt),v=Ae(e),h=i.useTranslate(),E=i.useResourceContext(e),b=i.useListContext(),x=b.data,y=void 0===x?[]:x,T=b.isLoading,S=b.selectedIds,k=b.onSelect,F=b.displayedFilters,w=b.setFilters,B=C.useGridApiRef(),P=C.useKeepGroupedColumnsHidden({apiRef:B,initialState:me({},d,{pinnedColumns:{right:["actions"]}})}),I=s.map(function(e,t){return me({},e,{headerName:""!==e.headerName?h("resources."+E+".fields."+e.field,{_:e.headerName}):e.headerName})}),L=r.length>0||c?I.concat([{field:"actions",type:"actions",width:100,hideable:!1,getActions:function(e){var n,o=B.current.getRowNode(e.id);return e.row.id?[].concat(c?[t.createElement(Ft,{record:e.row,disabled:!It(e.row,u)})]:[],r.filter(function(e){return!!e}).map(function(n){var r=n.handler,o=pe(n,Bt);return t.createElement(R.GridActionsCellItem,me({showInMenu:!0,onClick:function(t){return"function"==typeof r&&r(me({},v,{record:e.row}),o.key)}},o))})):-1!==o.children[0].indexOf(f+"=")?[t.createElement(yt,{record:f?(n={},n[f]=o.children[0].split(f+"=")[1].replaceAll("[","").trim().split("AND")[0].trim(),n):void 0})]:[]}}]):I,M=t.isValidElement(o);return t.createElement(t.Fragment,null,t.createElement(pt,{isLoading:T}),t.createElement(i.DatagridRoot,{sx:l,className:i.DatagridClasses.root},M?t.createElement(i.BulkActionsToolbar,{selectedIds:S},o):null,t.createElement(a.Box,{sx:{height:"70vh",width:"100%"},className:i.DatagridClasses.tableWrapper},t.createElement(a.ThemeProvider,{theme:Lt},t.createElement(C.DataGridPremium,me({sx:{display:"grid",gridTemplateRows:"70vh 1fr auto"},slots:{noRowsOverlay:Xe},columns:L,rows:y,apiRef:B,loading:T,hideFooterSelectedRowCount:!0,hideFooter:!0,disableMultipleRowSelection:!0,checkboxSelection:M,filterMode:"server",onFilterModelChange:function(e){w(p(e),F)},rowSelectionModel:S,onRowSelectionModelChange:function(e){T||(B.current.isRowSelected(e[0])?k([]):k(e))},isRowSelectable:function(e){return e.row.id},initialState:P},g))))))},At=function(e){var n=e.sx,r=e.columns,o=e.actionButtons,l=void 0===o?[]:o,s=e.hasEdit,u=e.isRowEditable,c=e.primaryText,d=e.mobileColumns,m=void 0===d?"":d,p=c,f=Ae(e),g=i.useListContext().isLoading;if(!c){var v=m?m.split(",").map(function(e){return r.find(function(t){return t.field===e})}):r;p=function(e){return t.createElement(a.Paper,{variant:"outlined",sx:{pt:2,pb:2,pl:2}},v.map(function(n){var r=n.field,o=n.headerName,i=n.valueGetter,l=n.type,s=void 0===l?"string":l,u=n.jsxMobile;return t.createElement(a.Box,null,u?u(e,n):"boolean"===s?t.createElement(a.Box,{component:"span",sx:{color:i({value:e[r]})?"green":"red"}},o):e[r])}),t.createElement(a.Box,null,l.filter(function(e){return!!e}).map(function(n){var r=n.key,o=n.handler,a=n.icon,l=void 0===a?t.createElement(k,null):a,s=pe(n,Pt);return t.createElement(i.Button,me({onClick:function(t){return"function"==typeof o&&o(me({},f,{record:e}),r)}},s),l)})))}}return t.createElement(t.Fragment,null,t.createElement(pt,{isLoading:g}),t.createElement(i.SimpleList,{linkType:function(e){return!(!s||!It(e,u))&&"edit"},primaryText:p,sx:n}))},_t=function(e){var n=a.useMediaQuery(function(e){return e.breakpoints.down("md")}),r=i.useResourceDefinition(e).hasEdit;!function(e){var n=e.onRenderGrilla,r=e.onLoadGrilla,o=i.useListContext().isLoading,a=Ae(e);t.useEffect(function(){n&&n(a)},[]),t.useEffect(function(){o||r&&r(a)},[o])}(e);var o=e.desktopSize;return t.createElement(Ee,null,t.createElement(n&&!1===(void 0!==o&&o)?At:Dt,me({},e,{hasEdit:r})))},Ot=["ids"],Vt=["filterValues","setFilters","tabs","GridComponent"],Gt=["useFormulario"],jt=function(e){var t=e.useFormulario,n=void 0===t?De:t,r=pe(e,Gt);return{fichaProps:me({},n(r),{etrs:r.etrs})}},zt=function(e,t){return i.useGetOne(e,{id:"-1"},t)},Wt=["className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","isLoading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","sort"],Ut=["children","className","data","hasShow","hasList"],Ht=function(e){return e.split("_")[1]},Jt=/^\d{2}\/\d{2}\/\d{4}$/,Qt=function(e){if(!(e instanceof Date)||isNaN(e.getDate()))return"";var t=e.getFullYear().toString(),n=(e.getMonth()+1).toString(),r=e.getDate().toString();return t+"-"+("00"+n).slice(-2)+"-"+("00"+r).slice(-2)},Yt=/^\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}$/,Kt=i.required(),Zt=[Kt,i.minValue(1)],$t={form:"FormEtriek-form",tab:"FormEtriek-tab",contenido:"FormEtriek-contenido"},Xt=function(e){var t,n;return(n={})["& ."+$t.form]={maxHeight:"70vh",overflow:"auto"},n["& ."+$t.tab]={display:"block",maxHeight:"65vh",overflow:"auto"},n["& ."+$t.contenido]=((t={})[e.breakpoints.up("xs")]={width:"100%"},t[e.breakpoints.up("md")]={width:"12vw","&.MuiAutocomplete-root":{width:"16vw"}},t),n},en=function(){},tn=function(e){var n=t.useContext(Ve).fichaProps.onBeforeSubmitFicha,r=_e(e),o=i.useNotify(),a=i.useSaveContext().save,l=t.useCallback(function(e){try{var t=function(t){return"string"==typeof t?void o(t,{type:"error"}):void 0===t||t?a(e):void 0};return Promise.resolve(n?Promise.resolve(n(me({form:{getValues:function(){return e}}},r),"N")).then(t):t(n))}catch(e){return Promise.reject(e)}},[n,o,en,a]);return"function"==typeof n?l:void 0},nn=["useFormulario","enableLoad"],rn=function(e){var n=e.enableLoad,r=void 0===n||n,o=pe(e,nn),a=i.useResourceContext(e),l=zt(a,{enabled:r}),s=l.data,u=l.isLoading,c=jt(e).fichaProps,d=t.useMemo(function(){return{estado:"N",initialValues:s,isLoading:u,fichaProps:c}},[s,u,c]);return t.createElement(Ce,null,t.createElement(Ve.Provider,{value:d},t.createElement(i.Create,me({redirect:"list"},o,null==c?void 0:c.panel))))};rn.propTypes={useFormulario:c.func};var on=s.styled(rn,{name:"FormEtriek",overridesResolver:function(e,t){return t.root}})(function(e){return Xt(e.theme)});function an(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=an(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ln(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=an(e))&&(r&&(r+=" "),r+=t);return r}var sn=["classes","filterValues","handleSubmit","invalid","label","pristine","resource","saving","selectedIds","redirect"],un=["resource","redirect","className","icon","label"],cn=function(e){var n=i.useTranslate(),r=e.resource,o=e.className,a=e.icon,l=e.label,s=void 0===l?"ra.action.delete":l,u=pe(e,un),c=i.useRecordContext(),d=i.useDelete(r,{id:c.id}),m=d[0],p=d[1].isLoading;return t.createElement(V,{title:n("ra.action.delete")},t.createElement(O,me({disabled:p,onClick:function(){return m()},label:s,className:ln("ra-delete-button",o),key:"button"},pe(u,sn),{size:"large"}),a))};cn.defaultProps={redirect:"list",icon:t.createElement(p,null)};var dn=["useFormulario","mutationMode"],mn=function(e){var t={};for(var n in e)"string"==typeof e[n]&&0===e[n].trim().length||(null==e[n]&&(e[n]=""),t[n]=e[n]);return t},pn=s.styled(function(e){var n=e.mutationMode,r=void 0===n?"pessimistic":n,o=pe(e,dn),a=i.useEditController(me({mutationMode:r},o)),l=a.record,s=a.isLoading,u=jt(e).fichaProps,c=t.useMemo(function(){return{estado:"M",initialValues:l,isLoading:s,fichaProps:u}},[l,s,u]);return t.createElement(Ce,null,t.createElement(Ve.Provider,{value:c},t.createElement(i.Edit,me({mutationMode:r,transform:mn},o,null==u?void 0:u.panel))))},{name:"FormEtriek",overridesResolver:function(e,t){return t.root}})(function(e){return Xt(e.theme)}),fn=t.forwardRef(function(e,n){var r=e.isOpen,o=e.onSubmit,a=e.onClose,l=e.title,s=e.dialogText,u=e.children,c=e.hasAccept,d=void 0===c||c,p=e.hasCancel,f=void 0===p||p,x=e.isLoading,C=void 0!==x&&x,y=i.useResourceContext(e),T=function(e){a&&a(e)};return t.createElement(g,{ref:n,open:r,fullWidth:!0,onClose:T,"aria-labelledby":"form-dialog-title"},t.createElement(b,{id:"form-dialog-title"},l),t.createElement(i.Form,{resource:y,onSubmit:o},t.createElement(h,{dividers:!0},t.createElement(E,null,s),t.createElement(G,{sx:{mt:2}},u)),(d||f)&&t.createElement(v,null,f&&t.createElement(i.Button,{label:"ra.action.cancel",disabled:C,onClick:function(e){return T(e)}},t.createElement(m,null)),d&&t.createElement(i.SaveButton,{alwaysEnable:!0,label:"Ok",disabled:C}))))}),gn={},vn={pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},hn=function(e){var n=ye(),r=i.useResourceContext(e),o=t.useContext(Ve),l=o.estado,s=o.isLoading,u=o.initialValues,c=o.fichaProps,d=Oe({resource:r,etrs:c.etrs});return t.useEffect(function(){c.onRenderFicha&&c.onRenderFicha(d,l)},[]),t.useEffect(function(){s||c.onLoadFicha&&c.onLoadFicha(d,l,u)},[s]),t.createElement(a.CardContent,{sx:me({},e.sx,n.open?vn:gn)},n.open&&t.createElement(a.CircularProgress,{sx:{position:"absolute",left:"50%",top:"50%"},thickness:4,size:50}),e.children)},En=function(e){var n=t.useContext(Ve),r=n.initialValues,o=n.fichaProps.config,a=void 0===o?{}:o,l=tn(e);return r?t.createElement(i.SimpleForm,me({mode:"onBlur"},e,{onSubmit:l,defaultValues:r,component:hn},a)):null};En.propTypes=me({},i.SimpleForm.propTypes);var bn=function(e){var n=e.handleToggle,r=e.isOpen,o=e.name,l=e.icon,u=e.children,c=e.dense,d=i.useTranslate(),m=i.useSidebarState()[0],p=t.createElement(a.MenuItem,{dense:c,onClick:n},t.createElement(a.ListItemIcon,{sx:{minWidth:5}},r?t.createElement(j,null):l),t.createElement(a.Typography,{variant:"inherit",color:"textSecondary"},d(o)));return t.createElement("div",null,m||r?p:t.createElement(a.Tooltip,{title:d(o),placement:"right"},p),t.createElement(a.Collapse,{in:r,timeout:"auto",unmountOnExit:!0},t.createElement(a.List,{dense:c,component:"div",disablePadding:!0,sx:{paddingLeft:(e.children.props.children[0]?e.children.props.children[0].key:"").startsWith("menu")?2:0,backgroundColor:function(e){return s.alpha(e.palette.secondary.light,.24)},"& a":{transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",paddingLeft:m?4:2}}},u)))},xn=["items","translate"],Cn=function(e){var n=e.dense,r=void 0!==n&&n,o=i.useTranslate(),l=t.useState({mnuPrueba:!1}),s=l[0],u=l[1],c=a.useMediaQuery(function(e){return e.breakpoints.down("sm")}),d=i.useSidebarState()[0],m=function e(n){var r=n.items,o=n.translate,a=pe(n,xn),l=a.state,s=a.handleToggle,u=a.dense;return r&&t.createElement("div",null,r.map(function(n){var r=n.name,c=n.menu,d=n.label;return c?t.createElement(bn,{key:r,name:d,handleToggle:function(){return s(r)},isOpen:l[r],icon:t.createElement(k,null),dense:u},e(me({items:c,translate:o},a))):t.createElement(i.MenuItemLink,{key:r,to:"/"+r,primaryText:o("resources."+r+".name",{_:d}),dense:u,leftIcon:t.createElement(k,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){u(function(t){var n;return me({},t,((n={})[e]=!t[e],n))})},state:s,activeClassName:"",iconClass:"",className:"",open:d,dense:r,translate:o});return t.createElement(a.Box,{sx:{width:d?230:50,marginTop:1,marginBottom:1,transition:function(e){return e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})}}},t.createElement(i.Menu,null,t.createElement(i.DashboardMenuItem,{primaryText:o("ra.page.dashboard")}),m,c&&t.createElement(i.MenuItemLink,{to:"/configuration",primaryText:o("pos.configuration"),leftIcon:t.createElement(k,null),dense:r})))},yn=["className","filters","hasCreate","children","hideFilterButton","jsBotonGrilla"],Tn=function(e,t){alert("Falta implementar la función jsBotonGrilla")},Sn=["displayedFilters","filterValues","showFilter"],kn=["className","options","icon","label","disabled"],Rn=["fields","className","textAlign","sortable"],Fn=["useFormulario"],wn=s.styled(function(e){var n=pe(e,Fn),r=i.useShowController(n),o=r.record,a=r.isLoading,l=jt(e).fichaProps,s=t.useMemo(function(){return{estado:"M",initialValues:o,isLoading:a,fichaProps:l}},[o,a,l]);return t.createElement(Ce,null,t.createElement(Ve.Provider,{value:s},t.createElement(i.Show,me({},n,r,null==l?void 0:l.panel))))},{name:"FormEtriek",overridesResolver:function(e,t){return t.root}})(function(e){return Xt(e.theme)}),Bn=["icon","label","record","resource","scrollToTop"],Pn=function(e){var n=e.icon,r=void 0===n?Ln:n,o=e.label,a=void 0===o?"ra.action.show":o,s=e.scrollToTop,u=void 0===s||s,c=pe(e,Bn),d=i.useResourceContext(e),m=i.useRecordContext(e),p=i.useCreatePath();return m?t.createElement(vt,me({component:l.Link,to:p({type:"show",resource:d,id:m.id}),state:In[String(u)],label:a,onClick:Mn},c),r):null},In={true:{_scrollToTop:!0},false:{}},Ln=t.createElement(K,null),Mn=function(e){return e.stopPropagation()};Pn.propTypes={icon:c.element,label:c.string,record:c.any,scrollToTop:c.bool};var qn=t.memo(Pn,function(e,t){return e.resource===t.resource&&(e.record&&t.record?e.record.id===t.record.id:e.record==t.record)&&e.label===t.label&&e.disabled===t.disabled}),Nn=["children","className","component","formRootPathname","syncWithLocation","tabs","toolbar","onChange"],Dn=["record","resource"],An=["onChange"],_n=["criteriaMode","defaultValues","delayError","formRootPathname","mode","noValidate","onSubmit","record","resolver","reValidateMode","sanitizeEmptyValues","shouldFocusError","shouldUnregister","shouldUseNativeValidation","validate","warnWhenUnsavedChanges"],On=function(e){var n=e.children,r=e.className,o=e.component,s=void 0===o?Gn:o,u=e.formRootPathname,c=e.syncWithLocation,d=void 0===c||c,m=e.tabs,p=void 0===m?Vn:m,f=e.toolbar,g=void 0===f?jn:f,v=e.onChange,h=pe(e,Nn),E=l.useLocation(),b=l.useResolvedPath(""),x=i.useResourceContext(e),C=t.useState(0),y=C[0],T=C[1],S=t.useContext(Ve),k=Oe(me({},e,{etrs:S.fichaProps.etrs})),R=t.useContext(Ve).estado,F=function(e,t){d||(T(t),v&&v(k,R,{newTab:t,prevTab:y,setTab:T},e))},w=function(){return t.cloneElement(p,{onChange:F,syncWithLocation:d,url:u,value:y},n)};return t.createElement(zn,me({className:ln("tabbed-form",r)},Wn(h)),d?t.createElement(l.Routes,null,t.createElement(l.Route,{path:"/*",element:w()})):w(),t.createElement(a.Divider,null),t.createElement(s,null,t.Children.map(n,function(e,n){if(!e)return null;var r=i.getTabbedFormTabFullPath(e,n),o=d?!l.matchPath(b.pathname+"/"+r,E.pathname):y!==n;return t.isValidElement(e)?t.cloneElement(e,{intent:"content",resource:x,hidden:o,value:d?r:n}):null})),!1!==g?g:null)},Vn=t.createElement(i.TabbedFormTabs,null),Gn=function(e){return t.createElement(a.CardContent,null,e.children)},jn=t.createElement(i.Toolbar,null),zn=s.styled("div",{name:"RaTabbedForm",overridesResolver:function(e,t){return t.root}})(function(e){var t;return(t={})["& .MuiTab-root.RaTabbedForm-errorTabButton"]={color:e.theme.palette.error.main},t}),Wn=function(e){return pe(e,Dn)},Un=function(e){var n,r,o,a=pe(e,An),s=(n=l.useLocation(),r=l.matchPath(":resource/create/*",n.pathname),o=l.matchPath(":resource/:id/*",n.pathname),r?r.pathnameBase:o?o.pathnameBase:"");return t.createElement(i.Form,me({formRootPathname:s},a),t.createElement(On,me({formRootPathname:s},Hn(e))))};Un.Tab=i.FormTab;var Hn=function(e){return pe(e,_n)},Jn=function(e){var n=t.useContext(Ve),r=n.initialValues,o=n.fichaProps.config,a=void 0===o?{}:o,i=tn(e);return r?t.createElement(Un,me({mode:"onBlur"},e,{onSubmit:i,defaultValues:r,component:hn},a)):null};Jn.defaultProps={syncWithLocation:!1};var Qn=me({},i.defaultTheme,{palette:me({},i.defaultTheme.palette,{mode:"dark"}),components:me({},i.defaultTheme.components,{MuiTextField:{defaultProps:{variant:"outlined"}},MuiFormControl:{defaultProps:{variant:"outlined"}},RaSidebar:{root:{drawerPaper:{position:"sticky"}}},RaRichTextInput:{root:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}})}),Yn={__proto__:null,lightTheme:me({},i.defaultTheme,{palette:me({},i.defaultTheme.palette,{mode:"light"}),components:me({},i.defaultTheme.components,{MuiTextField:{defaultProps:{variant:"outlined"}},MuiFormControl:{defaultProps:{variant:"outlined"}},RaSidebar:{root:{drawerPaper:{position:"sticky"}}},RaRichTextInput:{root:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}})}),darkTheme:Qn};Z.ra.page.empty="No records yet";var Kn=me({},Z,{from_camera:"From camera",take_foto:"Take photo",login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});$.ra.notification.created="Datos guardados correctamente",$.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} seleccionados",$.ra.page.dashboard="Inicio",$.ra.page.empty="Sin registros todavía",$.ra.page.invite="¿Quiere agregar uno?",$.ra.page.list="%{name}",$.ra.page.edit="Editar %{name}",$.ra.action.back="Volver",$.ra.message.delete_title="Eliminar",$.ra.input.file.upload_single="Seleccione o arrastre archivo",$.ra.input.image.upload_single="Seleccione o arrastre imagen";var Zn=me({},$,{from_camera:"Desde camara",take_foto:"Tomar foto",login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}});"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var $n=function(e){var r=t.useState(!1),o=r[0],l=r[1],s=t.useState(!1),u=s[0],c=s[1],d=i.useNotify(),m=i.useTranslate(),p=e.field,f=e.sx;return t.useEffect(function(){o&&function(){try{var e=null,t=function(t,n){try{var r=Promise.resolve(navigator.mediaDevices.getUserMedia({video:!0,audio:!1})).then(function(t){e=t,document.getElementById("video").srcObject=e})}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}(0,function(e){d(e.message,{type:"error"}),l(!1)});Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[o]),n.createElement(t.Fragment,null,n.createElement(i.Confirm,{isOpen:o,loading:!o,maxWidth:"sm",title:"",content:n.createElement(a.Box,{display:"flex",flexDirection:"column"},n.createElement(a.Button,{variant:"outlined",disableElevation:!0,onClick:function(){var e=document.getElementById("video"),t=document.getElementById("canvas");t.getContext("2d").drawImage(e,0,0,t.width,t.height),c(!0)},startIcon:n.createElement(re.PhotoCamera,null)},m("take_foto")),n.createElement("video",{id:"video",width:"320",height:"240",autoPlay:!0,style:{border:"solid 1px"}}),n.createElement("div",{id:"dataurl-container",style:{border:"dotted 1px",width:320,height:240,marginTop:4}},n.createElement("canvas",{id:"canvas",width:"320",height:"240"}))),onConfirm:function(e){u&&document.getElementById("canvas").toBlob(function(e){var t=document.getElementById("video"),n=document.getElementById(p),r=new DataTransfer,o=new File([e],p+"-img.jpg",{type:"image/jpeg",lastModified:(new Date).getTime()});r.items.add(o),n.files=r.files,n.dispatchEvent(new Event("change",{bubbles:!0})),t.srcObject.getTracks().forEach(function(e){return e.stop()}),c(!1),l(!1)},"image/jpeg")},onClose:function(){c(!1),l(!1)}}),n.createElement(V,{title:m("from_camera")},n.createElement(a.Button,{sx:f,onClick:function(){l(!0)}},n.createElement(oe,null))))},Xn=["onFocus","onChange","onBlur","hidden","disabled","validate"],er=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],tr=["hidden","disabled","onFocus","onChange","onBlur","validate"],nr=function(e){var n=e.source,r=t.useContext(Ve),o=r.estado,a=r.isLoading,l=r.fichaProps,s=void 0===l?{}:l,u=t.useContext(Ge),c=void 0!==u,d=T.useSelector(function(e){var t=e.configInputs?e.configInputs.filter(function(e){return e.id===n}):[];return t[0]?t[0]:null})||{},m=d.disabled,p=d.hidden,f=d.error,g=!0===d.required?Kt:void 0,v="function"==typeof f?f:function(){return f},h=s[n],E=void 0===h?{}:h,b=s.etrs,x=e.onFocus,C=e.onChange,y=e.onBlur,S=e.hidden,k=void 0!==S&&S,R=e.disabled,F=void 0!==R&&R,w=e.validate,B=pe(e,Xn),P=i.useInput(e).field,I=E.onFocus,L=E.onBlur,M=E.onChange,q=E.hidden,N=E.disabled,D=E.useContenido,A=void 0===D?De:D,_=E.validate,O=pe(E,er),V=c||void 0===q?k:q,G=c||void 0===N?F:N,j=c||void 0===I?x:I,z=c||void 0===L?y:L,W=c||void 0===M?C:M,U=Oe(me({},e,{etrs:b,asisEtr:u})),H=A(me({},B,{estado:o,hidden:V,isLoading:a,utils:U},O)),J=t.useRef(P.value);if(void 0===H)throw new Error("useContenido está devolviendo undefined para el contenido "+n+"\n Asegúrese de incluir una instrucción return al final de la función");var Q=H.hidden,Y=H.disabled,K=H.onFocus,Z=H.onChange,$=H.onBlur,X=H.validate,ee=pe(H,tr),te=K||j,ne=$||z,re=Z||W,oe=me({},U,{prev:J.current}),ae=Array.isArray(w)?w:[w],ie=Array.isArray(_)?_:[_],le=Array.isArray(X)?X:[X];return{propsContenido:me({sx:{mt:1,mb:1,ml:{xs:0,md:1},mr:{xs:0,md:1}},onFocus:function(e){te&&j(U,o,e),J.current=e.target.value},onBlur:function(e){return ne&&ne(oe,o,e)},onChange:function(e){return re&&re(oe,o,e)},helperText:!1,validate:[].concat(ae,ie,le,[g,v]).filter(function(e){return void 0!==e})},B,O,ee,{disabled:void 0!==m?m:void 0!==Y?Y:G}),hidden:void 0!==p?p:void 0!==Q?Q:V}},rr=["options","disabled","tipo","camera","prefix","accept","download"],or=function(e,t){return e&&""!==e?"string"==typeof e?{src:t+"/"+e}:e instanceof Array?e.map(function(e){return{src:t+"/"+e}}):e:void 0},ar=["sx"],ir=["callback","sx","isTC","onChange"],lr=["callback"],sr=t.forwardRef(function(e,n){return t.createElement(a.Tooltip,me({ref:n},e))}),ur=function(e){var n,r=e.callback,o=e.sx,l=e.isTC,s=e.onChange,u=pe(e,ir),c=i.useChoicesContext(),d=c.isLoading,m=c.allChoices,p=t.useRef(null);return t.useEffect(function(){d||"function"==typeof r&&r(Object.values([m]))},[m,r,d]),t.createElement(sr,{title:(null===(n=p.current)||void 0===n?void 0:n.value)||"",placement:"top",arrow:!0},t.createElement(a.Box,{component:"span",sx:me(l?{margin:1}:{display:{xs:"inherit",md:"inline-flex"},margin:1},o),width:l?{}:{xs:"100%",md:"auto"}},t.createElement(i.AutocompleteInput,me({size:"small",sx:l?{width:"100% !important"}:{}},u,{onChange:function(e){s({target:{value:e}})},TextFieldProps:{inputRef:p}}))))},cr=function(e){var n,r,o=nr(e),a=o.propsContenido,l=o.hidden,s=T.useDispatch(),u=e.source,c=e.reference,d=T.useSelector(function(e){var t=e.reload_cb?e.reload_cb.filter(function(e){return e.id===u}):[];return t[0]?t[0]:null}),m=t.useRef(d),p=null===d&&m.current?m.current:d;return p&&(n=p.callback,r=pe(p,lr)),t.useEffect(function(){null!==d&&(m.current=d,s(Se(u)))},[JSON.stringify(d)]),l?null:t.createElement(i.ReferenceInput,{reference:c,source:u,perPage:500,filter:r},t.createElement(ur,me({},a,{callback:n,optionText:"etiqueta",optionValue:u})))},dr=function(e){return t.createElement(ce,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(a.Paper,e))},mr={cursor:"move"},pr=function(e){var n=e.isOpen,r=e.isLoading,o=e.title,a=e.content,l=e.cancel,s=e.ConfirmIcon,u=e.CancelIcon,c=e.onClose,d=e.onConfirm,m=e.contentResource,p=e.translateOptions,f=void 0===p?{}:p,E=i.useTranslate(),x=i.useRecordSelection(m)[0],C=t.useCallback(function(e,t){e.stopPropagation(),d(e,x)},[x,d]),y=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(g,{open:n,onClose:c,onClick:y,fullWidth:!0,maxWidth:"lg",PaperComponent:dr,"aria-labelledby":"draggable-dialog-title"},t.createElement(b,{style:mr,id:"draggable-dialog-title"},E(o,me({_:o},f))),t.createElement(h,{dividers:!0},a),t.createElement(v,null,t.createElement(W,{disabled:r,onClick:c},t.createElement(u,{sx:{paddingRight:"0.5em"}}),E(l,{_:l})),t.createElement(W,{disabled:r,onClick:function(e){return C(e,"yes")},autoFocus:!0},t.createElement(s,{sx:{paddingRight:"0.5em"}}),E("ra.action.confirm"))))};pr.propTypes={cancel:c.string,classes:c.object,confirm:c.string,confirmColor:c.string,ConfirmIcon:c.elementType,CancelIcon:c.elementType,content:c.node.isRequired,isOpen:c.bool,isLoading:c.bool,onClose:c.func.isRequired,onConfirm:c.func.isRequired,title:c.string.isRequired},pr.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:se,CancelIcon:ue,isOpen:!1};var fr=["disabled","asistant","asistantResource","label","source","sx"],gr=function(){return t.createElement(t.Fragment,null)},vr={seleccion:[],all:!0,none:!1},hr=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},Er=function(e){return e},br=function(e){return t.createElement(i.List,me({},e,{hasCreate:!1,exporter:!1,perPage:50,empty:!1,title:" ",disableSyncWithLocation:!0}),t.createElement(i.Datagrid,{bulkActionButtons:t.createElement("span",null)},t.createElement(i.TextField,{source:"funced",sortable:!0,label:"Cédula"}),t.createElement(i.TextField,{source:"funpriape",sortable:!0,label:"Apellido"}),t.createElement(i.TextField,{source:"funprinom",sortable:!0,label:"Nombre"})))},xr={fillista:"empcod=-1"},Cr=function(e){var n=t.useState(xr),r=n[0],o=n[1],l=i.useDataProvider(),s=t.useCallback(function(e){o({fillista:e.node.key})},[o]),u=t.useCallback(function(e){return l.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[l]);return t.createElement(a.Box,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},t.createElement(a.Box,{flexGrow:1},t.createElement(de.TreeView,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:s,createChildren:u})),t.createElement(a.Box,{flexGrow:2},t.createElement(br,{resource:"form_224",filter:r})))},yr=function(e){return t.createElement(ce,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(a.Paper,e))},Tr={cursor:"move"},Sr=function(e){var n=e.isOpen,r=e.isLoading,o=e.title,a=e.cancel,l=e.ConfirmIcon,s=e.CancelIcon,u=e.onClose,c=e.onConfirm,d=e.translateOptions,m=void 0===d?{}:d,p=i.useTranslate(),f=t.useCallback(function(e,t){e.stopPropagation(),c(e,t)},[c]),E=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(g,{open:n,onClose:u,onClick:E,fullWidth:!0,maxWidth:"lg",PaperComponent:yr,"aria-labelledby":"draggable-dialog-title"},t.createElement(b,{style:Tr,id:"draggable-dialog-title"},p(o,me({_:o},m))),t.createElement(h,{dividers:!0},t.createElement(Cr,null)),t.createElement(v,null,t.createElement(W,{disabled:r,onClick:u},t.createElement(s,{sx:{paddingRight:"0.5em"}}),p(a,{_:a})),t.createElement(W,{disabled:r,onClick:function(e){return f(e,"yes")},autoFocus:!0},t.createElement(l,{sx:{paddingRight:"0.5em"}}),p("ra.action.confirm"))))};Sr.propTypes={cancel:c.string,classes:c.object,confirm:c.string,confirmColor:c.string,ConfirmIcon:c.elementType,CancelIcon:c.elementType,isOpen:c.bool,isLoading:c.bool,onClose:c.func.isRequired,onConfirm:c.func.isRequired,title:c.string.isRequired},Sr.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:se,CancelIcon:ue,isOpen:!1};var kr=["disabled","asistant","asistantResource","label","allowNone","source","sx"],Rr={seleccion:[],all:!0,none:!1},Fr=function(e){return String(e)===e?"Selección (1)":!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},wr=function(e){return e},Br=["tipo"];exports.AppBar=ve,exports.Asistente=pt,exports.AsistenteContext=he,exports.AsistenteProvider=Ee,exports.BooleanField=function(e){var n=Ue(e),r=n.propsContenido,o=n.hidden,a=i.useRecordContext(),l=JSON.parse(JSON.stringify(a)),s=l[e.source];return l[e.source]=""!=s&&"0"!=s,!o&&t.createElement(i.BooleanField,me({},r,{record:l}))},exports.Camino=function(e){var n,r=nr(e),o=r.propsContenido,l=r.hidden,s=i.useTranslate(),u=i.useRecordContext(e),c=a.useMediaQuery(function(e){return e.breakpoints.down("sm")}),d=y.useFormContext().getValues,m=o.options,p=void 0===m?{}:m,f=o.disabled,g=void 0!==f&&f,v=o.tipo,h=void 0===v?"file":v,E=o.camera,b=void 0===E||E,x=o.prefix,C=o.accept,T=void 0===C?"":C,S=pe(o,rr),k=null===(n=d()[S.source])||void 0===n?void 0:n.src,R=null!=k?k:x+"/"+u[S.source];return!l&&("image"===h?t.createElement(X,{direction:"row",alignItems:"flex-start",justifyContent:"flex-start",divider:t.createElement(L,{orientation:"vertical",variant:"middle",flexItem:!0})},t.createElement(i.ImageInput,me({maxSize:5e6},S,{options:me({disabled:g},p),format:function(e){return or(e,x)},placeholder:s("ra.input.image.upload_single"),accept:"image/*",inputProps:{capture:"user"}}),t.createElement(i.ImageField,{source:"src",title:""})),!c&&t.createElement($n,{sx:{mt:3},field:S.source})):t.createElement(X,{direction:"row",alignItems:"flex-start",justifyContent:"flex-start",divider:t.createElement(L,{orientation:"vertical",variant:"middle",flexItem:!0})},t.createElement(i.FileInput,me({maxSize:5e6},S,{options:me({disabled:g},p),format:function(e){return or(e,x)},placeholder:s("ra.input.file.upload_single"),accept:T}),t.createElement(G,{sx:{display:"inline-block",ml:1}},t.createElement(O,{component:ne,href:R,target:"_blank",size:"small",title:"Ver adjunto"},t.createElement(ee,{color:"primary"})),t.createElement(O,{sx:{ml:1},component:ne,href:R,download:!0,target:"_blank",size:"small",title:"Descargar adjunto"},t.createElement(te,{color:"success"})))),b&&t.createElement($n,{sx:{mt:3},field:S.source})))},exports.CheckBox=function(e){var n=nr(e),r=n.propsContenido,o=r.sx,a=pe(r,ar);return!n.hidden&&t.createElement(i.BooleanInput,me({},a,{sx:me({},o,{display:"inline-flex",margin:1})}))},exports.ComboBox=cr,exports.ComboBoxManual=function(e){var n=nr(e);return!n.hidden&&t.createElement(i.SelectInput,n.propsContenido)},exports.CreateEtriek=on,exports.CreateGridButton=yt,exports.DeleteButtonNoWarning=cn,exports.EditEtriek=pn,exports.EditGridButton=Ft,exports.EtrGrid=function(e){var n=e.filterBy,r=void 0===n?"":n,o=e.claves,l=e.sortModel,u=e.columns,c=e.reference,d=e.allowAdd,m=void 0===d||d,p=e.allowRemove,f=void 0===p||p,g=e.enableLoad,v=void 0===g||g,h=e.apiRef,E=pe(e,et),b=t.useState([]),T=b[0],S=b[1],k=i.useRecordContext(e),R=y.useFormContext(),F=i.useInput(me({defaultValue:""},e)).field,w=t.useContext(Ve),B=w.isLoading,P=(w.fichaProps[E.source]||{}).enviarTodo,I=void 0!==P&&P,L=t.useState(l),M=L[0],q=L[1],N=l[0],D=N.field,A=N.sort,_={};k&&r.split(",").forEach(function(e){e&&(_[e]=[{type:"string",comparison:"eq",value:k[e],field:e}])});var O=i.useGetList(c,{pagination:{page:1,perPage:200},sort:{field:D,order:A},filter:_},{enabled:v&&!B,onSuccess:function(e){R.setValue(E.source,""),S((null==e?void 0:e.data)||[])}}).isLoading,V=[].concat(u,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(lt,me({},E,{enviarTodo:I,camposClaveFila:o,row:e.row}))}}]);m&&V.unshift({field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return t.createElement(it,me({},E,{enviarTodo:I,camposClaveFila:o}))}}),f&&V.push({field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(st,me({},E,{enviarTodo:I,camposClaveFila:o,row:e.row}))}});var G=t.useMemo(function(){return V},[JSON.stringify(V)]);return t.createElement(x,{sx:{width:"100%",height:"40vh",borderRadius:0,marginTop:1}},t.createElement(a.StyledEngineProvider,{injectFirst:!0},t.createElement(s.ThemeProvider,{theme:ut},t.createElement(t.Fragment,null,t.createElement(C.DataGridPremium,me({apiRef:h,loading:O||B,sx:{"& .MuiDataGrid-columnsContainer":{backgroundColor:function(e){return"light"===e.palette.mode?"#fafafa":"#1d1d1d"}},"& .MuiDataGrid-iconSeparator":{display:"none"}},disableRowSelectionOnClick:!0,paginationModel:{page:1,pageSize:50},hideFooter:!0,rows:T,columns:G,sortModel:M,onSortModelChange:function(e){return q(e)},sortable:!1,resizable:!1,disableReorder:!0,disableExport:!0,filterable:!1,disableColumnMenu:!0,slots:{noRowsOverlay:Xe}},E)),t.createElement("input",me({type:"hidden"},F))))))},exports.FichaActions=function(e){var n=e.children,r=e.className,o=e.data,a=e.hasShow,l=e.hasList,s=void 0===l||l,u=pe(e,Ut);return t.createElement(i.TopToolbar,me({className:r},pe(u,Wt)),n,s&&t.createElement(i.ListButton,{label:"ra.action.back",icon:t.createElement(N,null)}),a&&t.createElement(i.ShowButton,{record:o}))},exports.FichaContext=Ve,exports.FiltroFuncionarios=Sr,exports.FormClasses=$t,exports.FormDialog=fn,exports.FormEtriek=En,exports.GE=function(e){var n=e.filterBy,r=void 0===n?"":n,o=e.sortModel,l=e.columns,u=e.reference,c=e.enableLoad,d=void 0===c||c,m=e.initialState,p=pe(e,ct),f=t.useContext(Ve).isLoading,g=i.useRecordContext(),v=t.useState(o),h=v[0],E=v[1],b=o[0],y=b.field,T=b.sort,S=t.useMemo(function(){return[].concat(l)},[JSON.stringify(l)]),k={};g&&r.split(",").forEach(function(e){e&&(k[e]=[{type:"string",comparison:"eq",value:g[e],field:e}])});var R=t.useContext(Ve),F=R.estado,w=R.isLoading,B=R.fichaProps,P=void 0===B?{}:B,I=Oe(e),L=P[e.source],M=void 0===L?{}:L,q=M.useContenido,N=void 0===q?De:q,D=M.restInitialProps,A=i.useGetList(u,{pagination:{page:1,perPage:200},sort:{field:y,order:T},filter:k},{enabled:d&&!f}),_=A.data,O=void 0===_?[]:_,V=A.isLoading,G=A.refetch,j=C.useGridApiRef(),z=C.useKeepGroupedColumnsHidden({apiRef:j,initialState:m});return N(me({},p,{estado:F,hidden:e.hidden,isLoading:w,utils:I},D,{refetch:G,apiRef:j})),t.createElement(x,{sx:{width:"100%",height:"40vh",borderRadius:0,marginTop:1}},t.createElement(a.StyledEngineProvider,{injectFirst:!0},t.createElement(s.ThemeProvider,{theme:dt},t.createElement(C.DataGridPremium,me({apiRef:j,rows:O,columns:S,loading:V||f,sx:{"& .MuiDataGrid-columnsContainer":{backgroundColor:function(e){return"light"===e.palette.mode?"#fafafa":"#1d1d1d"}},"& .MuiDataGrid-iconSeparator":{display:"none"}},disableRowSelectionOnClick:!0,paginationModel:{page:1,pageSize:50},hideFooter:!0,sortModel:h,onSortModelChange:function(e){return E(e)},slots:{noRowsOverlay:Xe},initialState:z},p)))))},exports.GridButton=vt,exports.GrillaEtriek=_t,exports.ImageField=function(e){var n=e.title,r=e.source,o=e.src,a=i.useRecordContext(e);return t.createElement(z,{title:n,src:o+"/"+a[r]})},exports.Layout=function(e){return t.createElement(i.Layout,me({},e,{appBar:ve,menu:Cn}))},exports.ListActionsEtriek=function(e){var n=e.className,r=e.filters,o=e.children,a=e.hideFilterButton,l=void 0!==a&&a,s=e.jsBotonGrilla,u=void 0===s?Tn:s,c=pe(e,yn),d=i.useListContext(e),m=d.sort,p=d.displayedFilters,f=d.filterValues,g=d.exporter,v=d.showFilter,h=d.total,E=i.useResourceContext(e),b=i.useResourceDefinition(e).hasCreate,x=t.useContext(i.FilterContext)||r,C=i.useListContext(e),y=me({},Ae(e),C);return delete c.hasCreate,t.useMemo(function(){return t.createElement(i.TopToolbar,me({className:n},i.sanitizeListRestProps(c)),l?null:r?t.cloneElement(r,{resource:E,showFilter:v,displayedFilters:p,filterValues:f,context:"button"}):x&&t.createElement(i.FilterButton,null),b&&t.createElement(i.CreateButton,null),!1!==g&&t.createElement(i.ExportButton,{disabled:0===h,resource:E,sort:m,filterValues:f}),t.Children.map(o,function(e,n){return t.cloneElement(e,{onClick:e.props.options?null:function(t){e.props.onClick&&e.props.onClick(t),u(y,e.key)},options:e.props.options?e.props.options.map(function(t){return me({},t,{onClick:function(n){e.props.onClick&&e.props.onClick(n),u(y,t.key)}})}):null})}))},[E,p,f,r,v,x,h,n,m,l,g,b])},exports.ListCheck=function(e){var n=nr(e);return n.hidden?null:t.createElement(i.ReferenceArrayInput,{source:e.source,reference:e.reference},t.createElement(i.SelectArrayInput,me({},n.propsContenido,{optionText:"etiqueta",optionValue:e.source})))},exports.Login=function(e){var n=e.loginBackgroundImage,o=e.nameSource,s=void 0===o?"username":o,u=e.passwordSource,c=void 0===u?"password":u,d=t.useState(!1),m=d[0],p=d[1],f=i.useTranslate(),g=f("ra.auth.sign_in"),v=i.useNotify(),h=i.useLogin(),E=l.useLocation();return t.createElement(i.Form,{onSubmit:function(e){p(!0),h(e,E.state?E.state.nextPathname:"/").catch(function(e){p(!1),v("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error",{type:"error",messageArgs:{_:"string"==typeof e?e:e&&e.message?e.message:void 0}})})},validate:function(e){var t={};return e[s]||(t[s]=f("ra.validation.required")),e[c]||(t[c]=f("ra.validation.required")),t}},t.createElement(a.Box,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:n,backgroundRepeat:"no-repeat",backgroundSize:"cover"}},t.createElement(U,{sx:{minWidth:300,marginTop:"6em"}},t.createElement(a.Box,{sx:{margin:"1em",display:"flex",justifyContent:"center"}},t.createElement(z,{sx:{backgroundColor:"secondary.main"}},t.createElement(r,null))),t.createElement(a.Box,{sx:{marginTop:"1em",marginBottom:"1em",display:"flex",justifyContent:"center",color:"grey.600"}},"Inicio de Sesión"),t.createElement(a.Box,{sx:{padding:"0 1em 1em 1em"}},t.createElement(a.Box,{sx:{marginTop:0}},t.createElement(i.TextInput,{autoFocus:!0,fullWidth:!0,name:s,label:f("ra.auth.username"),disabled:m})),t.createElement(a.Box,{sx:{marginTop:0}},t.createElement(i.PasswordInput,{name:c,label:f("ra.auth.password"),type:"password",disabled:m}))),t.createElement(H,{sx:{padding:"0 1em 1em 1em"}},t.createElement(W,{variant:"contained",type:"submit",color:"primary",disabled:m,fullWidth:!0},m&&t.createElement(J,{sx:{position:"absolute"},size:18,thickness:2}),g)))))},exports.Menu=Cn,exports.MenuButton=function(e){var n,r=e.options,o=void 0===r?[]:r,l=e.icon,s=e.label,u=e.disabled,c=pe(e,kn),d=t.useState(!1),m=d[0],p=d[1],f=t.useRef(),g=t.useState(0),v=g[0],h=g[1],E=i.useResourceContext(e);return t.createElement(a.Box,me({sx:{display:"inline-block"}},pe(c,Sn)),t.createElement(i.Button,{size:"large",className:"add-filter",label:s,onClick:function(e){e.preventDefault(),p(!0),f.current=e.currentTarget},title:o[v].label,disabled:u},(null===(n=o[v])||void 0===n?void 0:n.icon)||l),t.createElement(Q,{open:m,anchorEl:f.current,onClose:function(e){f.current&&f.current.contains(e.target)||p(!1)}},o.map(function(e,n){return t.createElement(Y,{key:e.label,disabled:e.disabled,selected:n===v,onClick:function(t){!function(e,t){h(t),p(!1)}(0,n),e.onClick&&e.onClick(t,n)},resource:E,title:e.label},e.icon,t.createElement(a.Box,{component:"span",sx:{paddingRight:"4px"}}),t.createElement(i.FieldTitle,{label:e.label,resource:E}))})))},exports.MultiTextField=function(e){var n=e.fields,r=e.className,o=pe(e,Rn),a=n.campos,l=n.separador,s=void 0===l?"":l,u=n.secundario,c=void 0===u?[]:u,d=n.hasSecundario,m=i.useRecordContext(),p=a.map(function(e){return void 0!==m[e]?m[e]:e}).join(""+s);return t.createElement(P,me({noWrap:!0,variant:"inherit",className:r},o),p,d&&t.createElement(P,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(m[e.campo]||"---")}).join(" ")))},exports.Password=function(e){var n=nr(e);return!n.hidden&&t.createElement(i.PasswordInput,n.propsContenido)},exports.RadioButton=function(e){var n=nr(e),r=n.propsContenido,o=n.hidden;return t.useContext(Ve).isLoading||o?null:t.createElement(i.ReferenceInput,{source:e.source,reference:e.reference},t.createElement(i.RadioButtonGroupInput,me({},r,{optionText:"etiqueta",optionValue:e.source})))},exports.RadioButtonManual=function(e){var n=nr(e);return!n.hidden&&t.createElement(i.RadioButtonGroupInput,n.propsContenido)},exports.Separador=function(e){var n=e.source;return!(T.useSelector(function(e){var t=e.configInputs?e.configInputs.filter(function(e){return e.id===n}):[];return t[0]?t[0]:null})||{}).hidden&&t.createElement(P,{variant:"h6",gutterBottom:!0,id:e.source},e.children)},exports.ShowEtriek=wn,exports.ShowGridButton=qn,exports.SubMenu=bn,exports.TBSF=function(e){var n=e.disabled,r=e.label,o=void 0===r?"Funcionarios":r,l=e.allowNone,s=void 0===l||l,u=e.source,c=e.sx,d=pe(e,kr),m=i.useRecordSelection("form_224")[0],p=t.useState(!1),f=p[0],g=p[1],v=y.useFormContext();t.useEffect(function(){E()},[]);var h=t.useCallback(function(){g(!1)},[g]),E=function(e){v.setValue(u,{seleccion:[],all:!0,none:!1})};return t.createElement(t.Fragment,null,t.createElement(a.Box,{display:"flex",alignItems:"center",sx:me({},c,{display:"inline-flex",margin:1})},t.createElement(i.TextInput,me({defaultValue:Rr},d,{source:u,label:o,disabled:!0,parse:wr,format:Fr,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,s&&t.createElement(O,{onClick:function(e){v.setValue(u,{seleccion:[],all:!1,none:!0})},disabled:n,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(ie,null)),t.createElement(O,{onClick:E,disabled:n,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement(ae,null)),t.createElement(O,{onClick:function(e){return g(!0)},disabled:n,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(le,null)))}}))),t.createElement(Sr,{isOpen:f,title:"Selección de "+o,onConfirm:function(e,t){g(!1),v.setValue(u,{seleccion:m,all:!1,none:!1})},onClose:h}))},exports.TabbedFormEtriek=Jn,exports.TabbedGrillaEtriek=function(e){var n=e.filterValues,r=e.setFilters,o=e.tabs,a=o.ids,i=pe(o,Ot),l=e.GridComponent,s=void 0===l?_t:l,u=pe(e,Vt),c=n.id;return t.createElement(t.Fragment,null,t.createElement(q,{value:c,indicatorColor:"primary",onChange:function(e,t){r(me({},n,{id:t}))}},a.map(function(e){return t.createElement(M,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),t.createElement(L,null),t.createElement(s,me({},u,i[c])))},exports.TextArea=function(e){var n=nr(e);return!n.hidden&&t.createElement(i.TextInput,me({multiline:!0},n.propsContenido))},exports.TextBox=function(e){var n=e.tipo,r=pe(e,Br),o=nr(r),a=o.propsContenido,l=o.hidden,s=y.useFormContext();t.useEffect(function(){a.value&&s.setValue(e.source,a.value)});var u=me({},a);return l?null:"N"===n||"D"===n?t.createElement(i.NumberInput,u):"F"===n?t.createElement(i.DateInput,u):"Z"===n?t.createElement(i.DateTimeInput,u):t.createElement(i.TextInput,"H"===n?me({},u,{type:"time"}):u)},exports.TextBoxSelection=function(e){var n=e.disabled,r=e.asistant,o=e.asistantResource,l=e.label,s=e.source,u=e.sx,c=pe(e,fr),d=t.useState(!1),m=d[0],p=d[1],f=y.useFormContext();t.useEffect(function(){v()},[]);var g=t.useCallback(function(){p(!1)},[p]),v=function(e){f.setValue(s,{seleccion:[],all:!0,none:!1})};return t.createElement(t.Fragment,null,t.createElement(a.Box,{display:"flex",alignItems:"center",sx:me({},u,{display:"inline-flex",margin:1})},t.createElement(i.TextInput,me({defaultValue:vr},c,{source:s,label:l,disabled:!0,parse:Er,format:hr,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,t.createElement(O,{onClick:function(e){f.setValue(s,{seleccion:[],all:!1,none:!0})},disabled:n,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(ie,null)),t.createElement(O,{onClick:v,disabled:n,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement(ae,null)),t.createElement(O,{onClick:function(e){return p(!0)},disabled:n,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(le,null)))}}))),t.createElement(pr,{isOpen:m,title:"Selección de "+l,contentResource:o,content:t.createElement(r,{bulkActionButtons:t.createElement(gr,null),hasCreate:!1,exporter:!1,resource:o}),onConfirm:function(e,t){p(!1),f.setValue(s,{seleccion:t,all:!1,none:!1})},onClose:g}))},exports.TextCombo=function(e){var n=e.source,r=e.label,o=e.sx;return nr(e).hidden?null:t.createElement(a.Box,{sx:me({},o,{display:"inline-flex",alignItems:"flex-start",marginLeft:{md:1},marginBottom:-1,width:{xs:"100%",md:"calc(24vw + 1em)"}})},t.createElement(i.TextInput,me({},e,{label:"",source:n,sx:{flex:1,marginTop:1}})),t.createElement(cr,me({},e,{source:n,label:r,isTC:!0,sx:{flex:3}})))},exports.TextField=Je,exports.choicesEstado=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],exports.dateFormat=function(e){if(null==e||""===e)return"";if(e instanceof Date)return Qt(e);if(Jt.test(e)){var t=e.split("/");return t[2]+"-"+t[1]+"-"+t[0]}return Qt(new Date(e))},exports.dateFormatOptions={inputFormat:"dd/MM/yyyy"},exports.dateParser=function(e){if(!e)return"";var t=e.split("-");return t[2]+"/"+t[1]+"/"+t[0]},exports.dateTimeFormat=function(e){if(null==e||""===e)return"";if(e instanceof Date)return Qt(e);if(Yt.test(e)){var t=e.split(" "),n=t[0].split("/");return n[2]+"-"+n[1]+"-"+n[0]+" "+t[1]}return Qt(new Date(e))},exports.dateTimeParser=function(e){if(!e)return"";var t=e.split("T"),n=t[0].split("-");return n[2]+"/"+n[1]+"/"+n[0]+" "+t[1]},exports.dateTimeToString=function(e){return e.toLocaleString("es",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).replace(",","")},exports.dateToString=function(e){return e?String(e.getDate()).padStart(2,"0")+"/"+String(e.getMonth()+1).padStart(2,"0")+"/"+String(e.getFullYear()):""},exports.deleteRecargarComboBox=Se,exports.descargarLink=function(e,t){var n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.setAttribute("href",e),n.setAttribute("download",t),n.click()},exports.enMessages=Kn,exports.esMessages=Zn,exports.etrFechaMayorQue=function(e){return function(t,n){var r=n[e];if(t&&r){var o=new Date(r.split("/").reverse().join("/")),a=new Date(t.split("/").reverse().join("/"));if(D.isAfter(o,a))return{message:"validation.greater_or_equal",args:{menor:r}}}}},exports.etrRequerido=Kt,exports.etrRequeridoNumerico=Zt,exports.getFormcodFromResource=Ht,exports.localeOptions=function(e){return void 0===e&&(e="es"),{locale:"en"===e?A:_}},exports.recargarComboBox=Te,exports.renderCellComboBox=function(e,n,r){return function(o){var a;return t.createElement(i.ReferenceField,{reference:r,source:n,queryOptions:{meta:{etr:e}},record:(a={},a[n]=o.row[n],a)},t.createElement(Je,{source:"etiqueta"}))}},exports.setDisableAction=Re,exports.setErrorAction=we,exports.setHiddenAction=ke,exports.setRequireAction=Fe,exports.stringToDate=function(e){if(!e)return"";var t=e.split("/").map(Number);return new Date(t[2],t[1]-1,t[0])},exports.stringToDateTime=function(e){if(!e)return"";var t=e.split(" "),n=t[1],r=t[0].split("/").map(Number),o=r[0],a=r[1],i=r[2],l=n.split(":").map(Number);return new Date(i,a-1,o,l[0],l[1])},exports.themes=Yn,exports.timeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var t=e.split(":"),n=new Date;return n.setHours(t[0]),n.setMinutes(t[1]),n.toString()}var r=/(\d{2}):(\d{2})/.exec(e);if(null!==r){var o=new Date;return o.setHours(r[0]),o.setMinutes(r[1]),o.toString()}},exports.timeParser=function(e,t){return e?e.split(" ")[4].substring(0,5):""},exports.useAjax=Ne,exports.useContenidoController=nr,exports.useEtrActions=function(e){var t=e.useFormulario()[e.source],n=me({},e,{enviarTodo:!(null==t||!t.enviarTodo)});return{addRow:Ye(n),editRow:Ke(n),deleteRow:Ze(n),clear:function(t){e.apiRef.current.setRows([]),t.setValue(e.source,"")},api:e.apiRef}},exports.useFieldController=Ue,exports.useFormProgress=ye,exports.useFormSubmit=tn,exports.useGetJson=qe,exports.useInitFicha=jt,exports.useNuevo=zt,exports.useReferenceLabel=function(e,t){var n=i.useResourceContext(),r=i.useGetOne("cb_"+Ht(n)+"_"+e,{id:t}),o=r.data;return r.isLoading||r.error?"":(null==o?void 0:o.etiqueta)||""},exports.useUtils=Oe,exports.useUtilsGrilla=Ae,exports.useUtilsSubmit=_e;
2
2
  //# sourceMappingURL=index.js.map