@ssplib/react-components 0.0.322 → 0.0.324
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/components/form/radio/Radio.d.ts +19 -0
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.esm.js +2 -2
- package/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/stories/Radio.stories.d.ts +7 -0
package/index.esm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{Grid as n,Typography as o,Box as i,Stack as a,Button as l,FormControlLabel as s,Checkbox as c,Card as d,InputLabel as u,TextField as m,SvgIcon as p,useTheme as f,useMediaQuery as h,LinearProgress as g,TableContainer as y,Paper as b,CircularProgress as v,Switch as x,Autocomplete as C,MobileStepper as w,SwipeableDrawer as k,Modal as S,Menu as E,MenuItem as Y,Skeleton as O,IconButton as M,Collapse as D,PaginationItem as V,Alert as I,FormControl as A,Select as T,AppBar as j,Avatar as N}from"@mui/material";import{FileDownload as $,ReportProblemRounded as R,PendingRounded as P,FilterAlt as F,KeyboardArrowDown as z,ExpandLess as L,ExpandMore as W,Refresh as B,KeyboardArrowUp as _}from"@mui/icons-material";import*as q from"react";import U,{createContext as K,useContext as X,useCallback as G,useState as H,useEffect as J,useMemo as Z,useRef as Q}from"react";import ee from"@mui/material/Typography";import te from"lodash.get";import{LocalizationProvider as re,DatePicker as ne,TimePicker as oe}from"@mui/x-date-pickers";import{AdapterDayjs as ie}from"@mui/x-date-pickers/AdapterDayjs";import ae from"dayjs";import"dayjs/locale/pt-br";import le from"lodash.hasin";import{useFormContext as se,useForm as ce}from"react-hook-form";import de from"axios";import{useDropzone as ue}from"react-dropzone";import me from"@emotion/styled";import{ThemeContext as pe}from"@emotion/react";import fe from"@mui/icons-material/CameraAlt";import he from"@mui/icons-material/Delete";import ge from"@mui/icons-material/Done";import ye from"@mui/icons-material/InsertDriveFile";import be from"@mui/icons-material/PictureAsPdf";import ve from"@mui/material/InputLabel";import{IMaskInput as xe}from"react-imask";import{useQuery as Ce}from"react-query";import we from"@mui/icons-material/KeyboardArrowLeft";import ke from"@mui/icons-material/KeyboardArrowRight";import Se from"@mui/icons-material/Save";import{LoadingButton as Ee}from"@mui/lab";import{toast as Ye,ToastContainer as Oe}from"react-toastify";import Me from"@mui/icons-material/ContentPasteOutlined";import De from"@mui/icons-material/Clear";import Ve from"@mui/icons-material/FileDownload";import Ie from"@mui/icons-material/NavigateNextRounded";import Ae from"@mui/icons-material/Search";import Te from"@mui/material/Grid";import je from"@mui/material/Pagination";import Ne from"@mui/material/TextField";import $e from"jszip";import Re from"@mui/icons-material/CloseRounded";import Pe from"tinycolor2";import Fe from"lodash.clonedeep";import*as ze from"xlsx";import Le from"next/dynamic";import We from"@mui/icons-material/KeyboardArrowDown";import Be from"@mui/icons-material/LogoutOutlined";import _e from"@mui/icons-material/Menu";import qe from"@mui/icons-material/Person";import Ue from"@mui/material/LinearProgress";import Ke from"next/image";import Xe from"next/link";import{useRouter as Ge}from"next/router";import He from"keycloak-js";import{getCookie as Je,deleteCookie as Ze,setCookie as Qe}from"cookies-next";import et from"jwt-decode";function tt({title:r}){return e(n,{paddingY:1,item:!0,marginTop:1,marginBottom:3,xs:12,children:[t(o,{textTransform:"uppercase",fontWeight:600,children:r}),t(i,{sx:{backgroundColor:"#94A3B8",height:6,borderRadius:1}})]})}function rt({name:r,title:l,tag:s,xs:c=12,md:d,lg:u}){let m=s&&"Distrital"===s?"#BFDBFE":"Estadual"===s?"#BBF7D0":"Federal"===s?"#FEF08A":"Internacional"===s?"#FED7AA":"Não"===s?"#FECACA":"#BBF7D0";return t(n,{paddingBottom:3,item:!0,xs:c,md:d,lg:u,paddingRight:2,children:e(a,{spacing:1,children:[e(a,{spacing:1,direction:"row",children:[t(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l}),s&&t(o,{sx:{backgroundColor:m,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:s})]}),r&&t(i,{children:"false"===String(r)?"Não":"true"===String(r)?"Sim":""===String(r)?"":r?String(r):"Não informado"})]})})}function nt({title:r,xs:i=12,tag:l,md:s,lg:c,paddingBottom:d=3}){let u=l&&"Não"===l?"#FECACA":"Sim"===l?"#BBF7D0":"#E2E8F0";return t(n,{paddingBottom:d,item:!0,xs:i,md:s,lg:c,paddingRight:2,children:e(a,{spacing:1,direction:"row",children:[t(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,fontSize:16,children:r}),l&&t(o,{sx:{backgroundColor:u,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l})]})})}const ot=/*#__PURE__*/K({});function it({title:r,name:i,md:s,fileURL:c,fileExt:d="pdf"}){const{user:u}=X(ot);return t(n,{paddingBottom:3,paddingRight:3,md:s,children:e(a,{spacing:1,sx:{backgroundColor:"#F8FAFC",paddingY:1,paddingX:3,borderRadius:2,border:1,borderColor:"#CBD5E1"},children:[t(o,{fontWeight:600,sx:{textAlign:"center"},children:r}),e(a,{direction:"row",spacing:2,alignItems:"center",children:[t($,{sx:{fill:"red"}}),t(o,{children:i})]}),t(a,{alignItems:"center",children:t(l,{variant:"outlined",color:"error",size:"small",endIcon:t($,{}),onClick:()=>fetch(c,{method:"GET",headers:{Authorization:`Bearer ${u?.token}`}}).then(e=>e.blob()).then(e=>{var t=window.URL.createObjectURL(e);const r=document.createElement("a");r.href=t,r.download=i.split(".")[0]+`.${d}`,r.click()}),children:"Baixar"})})]})})}const at=/*#__PURE__*/K(null);function lt({name:e,title:r,defaultValue:o=!1,xs:i=12,sm:a,md:l,onChange:d}){const u=X(at),m=G(t=>{u?.formSetValue(e,!u?.formGetValues(e))},[u,e]);return t(n,{item:!0,xs:i,sm:a,md:l,children:t(s,{control:t(c,{size:"small",defaultChecked:o}),label:r,...u?.formRegister(e),onChange:d,onClick:m})})}function st(e){let t=[];return e.forEach(e=>{if(e.props){if(e.props.children){const r=st(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(t=t.concat(r))}e.props.name&&t.push(e.props.name)}}),t}function ct({customText:r="Selecione pelo menos 1 opção",...o}){const[i,a]=H(!1),[l,s]=H(!0),c=X(at),d=/*#__PURE__*/U.cloneElement(o.children,{onChange:()=>{i&&!c.formGetValues(d.props.name)&&s(!1)}});return e(n,{container:!0,sx:{padding:1,borderRadius:2},children:[t("input",{type:"text",...c.formRegister(o.name,{validate:(e,t)=>{if(i&&l)return!0;const n=st(Array.isArray(o.children)?o.children:[o.children]);let d=!1;return n.forEach(e=>{c.formGetValues(e)&&(d=!0)}),!!d||(a(!0),s(!0),r)}}),hidden:!0}),d,t(n,{item:!0,xs:12,children:i&&l&&o.content})]})}function dt({name:r,title:o,customWarning:i,defaultValue:a=!1,xs:l=12,sm:u,md:m}){const p=X(at);return e(n,{item:!0,xs:l,sm:u,md:m,children:[t(s,{control:t(c,{size:"small",...p.formRegister(r),defaultChecked:a}),label:o}),p.formWatch(r)&&t(d,{sx:{bgcolor:"#FFFBF5",color:"#F59E0B",padding:1,paddingLeft:2},children:i||e(ee,{children:[t("b",{children:"Atenção"})," ",t("i",{children:o})," possui regras específicas."]})})]})}function ut(e){let t=[];return e.forEach(e=>{if(e.props){if(e.props.children){const r=ut(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(t=t.concat(r))}e.props.name&&t.push(e.props.name)}}),t}function mt({customText:r="Selecione pelo menos 1 opção",...i}){const a=X(at);return e(n,{container:!0,sx:{border:te(a.errors,i.name)?"2px solid #a51c30":"",padding:1,borderRadius:2},children:[t("input",{type:"text",...a.formRegister(i.name,{validate:(e,t)=>{const n=ut(Array.isArray(i.children)?i.children:[i.children]);let o=!1;return n.forEach((e,t)=>{a.formGetValues(e)&&(o=!0)}),!!o||r}}),hidden:!0},1),i.children,t(n,{item:!0,xs:12,children:t(o,{sx:{color:"#a51c30",fontSize:16,paddingLeft:1},children:te(a.errors,i.name)?.message})})]})}function pt({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:p,defaultValue:f,persistValue:h,maxDt:g,...y}){const b=X(at),[v,x]=H(void 0!==f?ae(f,"DD/MM/YYYY"):void 0);return J(()=>{void 0!==v&&b.formSetValue(i,v?v.format("DD/MM/YYYY"):v)},[v]),J(()=>{if(!h)return()=>{b.formUnregister(i)}},[]),t(r,{children:e(n,{item:!0,xs:s,sm:c,md:d,children:[l&&t(u,{required:a,children:l}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{minDate:ae(p,"DD/MM/YYYY"),maxDate:ae(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{x(e)},disableHighlightToday:!0,sx:{outline:te(b.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(m,{size:"small",...e,...b?.formRegister(i,{validate:(e,t)=>!le(t,i)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<10&&a?"A data precisa seguir o padrão DD/MM/AAAA":!p||ae(p,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(p,"DD/MM/YYYY").isBefore(ae(e,"DD/MM/YYYY"))?!g||ae(g,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(g,"DD/MM/YYYY").isAfter(ae(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${p} e antes de ${g}`),shouldUnregister:!0}),fullWidth:!0})}),t(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:te(b.errors,i)?.message})]})]})})}function ft({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:p,defaultValue:f,persistValue:h,maxDt:g,...y}){const b=se(),[v,x]=H(void 0!==f?ae(f,"DD/MM/YYYY"):void 0);return J(()=>{void 0!==v&&b.setValue(i,v?v.format("DD/MM/YYYY"):v)},[v]),J(()=>{if(!h)return()=>{b.unregister(i)}},[]),t(r,{children:e(n,{item:!0,xs:s,sm:c,md:d,children:[l&&t(u,{required:a,children:l}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{minDate:ae(p,"DD/MM/YYYY"),maxDate:ae(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{x(void 0)},disableHighlightToday:!0,sx:{outline:te(b.formState.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(m,{size:"small",...e,...b?.register(i,{validate:(e,t)=>!le(t,i)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<10&&a?"A data precisa seguir o padrão DD/MM/AAAA":!p||ae(p,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(p,"DD/MM/YYYY").isBefore(ae(e,"DD/MM/YYYY"))?!g||ae(g,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(g,"DD/MM/YYYY").isAfter(ae(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${p} e antes de ${g}`),shouldUnregister:!0}),fullWidth:!0})}),t(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:te(b.formState.errors,i)?.message})]})]})})}function ht({name:r,required:i=!1,title:a,defaultValue:l="",xs:s=12,sm:c,md:d}){const p=X(at),[f,h]=H(l?ae(l,"HH:mm"):null);return J(()=>{p.formSetValue(r,f?f.format("HH:mm"):f)},[f]),J(()=>()=>{p.formUnregister(r)},[]),e(n,{item:!0,xs:s,sm:c,md:d,children:[a&&t(u,{required:i,children:a}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(oe,{value:f,ampm:!1,onChange:e=>{h(e)},sx:{outline:te(p.errors,r)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(m,{size:"small",...e,...p?.formRegister(r,{validate:(e,t)=>!le(t,r)||(e||(e=""),e.length<=0&&i?"Este campo é obrigatório":e.length<5&&i?"A hora precisa seguir o padrão HH:MM":void 0),shouldUnregister:!0}),fullWidth:!0})}),t(o,{sx:{color:"#a51c30",fontSize:15,paddingLeft:1},children:te(p.errors,r)?.message})]})]})}function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gt.apply(null,arguments)}function yt(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function bt(e){if(!yt(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=bt(e[r])}),t}function vt(e,t,r={clone:!0}){const n=r.clone?gt({},e):e;return yt(e)&&yt(t)&&Object.keys(t).forEach(o=>{"__proto__"!==o&&(n[o]=yt(t[o])&&o in e&&yt(e[o])?vt(e[o],t[o],r):r.clone&&yt(t[o])?bt(t[o]):t[o])}),n}function xt(e){var t={exports:{}};return e(t,t.exports),t.exports}var Ct="function"==typeof Symbol&&Symbol.for,wt=Ct?Symbol.for("react.element"):60103,kt=Ct?Symbol.for("react.portal"):60106,St=Ct?Symbol.for("react.fragment"):60107,Et=Ct?Symbol.for("react.strict_mode"):60108,Yt=Ct?Symbol.for("react.profiler"):60114,Ot=Ct?Symbol.for("react.provider"):60109,Mt=Ct?Symbol.for("react.context"):60110,Dt=Ct?Symbol.for("react.async_mode"):60111,Vt=Ct?Symbol.for("react.concurrent_mode"):60111,It=Ct?Symbol.for("react.forward_ref"):60112,At=Ct?Symbol.for("react.suspense"):60113,Tt=Ct?Symbol.for("react.suspense_list"):60120,jt=Ct?Symbol.for("react.memo"):60115,Nt=Ct?Symbol.for("react.lazy"):60116,$t=Ct?Symbol.for("react.block"):60121,Rt=Ct?Symbol.for("react.fundamental"):60117,Pt=Ct?Symbol.for("react.responder"):60118,Ft=Ct?Symbol.for("react.scope"):60119;function zt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case wt:switch(e=e.type){case Dt:case Vt:case St:case Yt:case Et:case At:return e;default:switch(e=e&&e.$$typeof){case Mt:case It:case Nt:case jt:case Ot:return e;default:return t}}case kt:return t}}}function Lt(e){return zt(e)===Vt}var Wt={AsyncMode:Dt,ConcurrentMode:Vt,ContextConsumer:Mt,ContextProvider:Ot,Element:wt,ForwardRef:It,Fragment:St,Lazy:Nt,Memo:jt,Portal:kt,Profiler:Yt,StrictMode:Et,Suspense:At,isAsyncMode:function(e){return Lt(e)||zt(e)===Dt},isConcurrentMode:Lt,isContextConsumer:function(e){return zt(e)===Mt},isContextProvider:function(e){return zt(e)===Ot},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===wt},isForwardRef:function(e){return zt(e)===It},isFragment:function(e){return zt(e)===St},isLazy:function(e){return zt(e)===Nt},isMemo:function(e){return zt(e)===jt},isPortal:function(e){return zt(e)===kt},isProfiler:function(e){return zt(e)===Yt},isStrictMode:function(e){return zt(e)===Et},isSuspense:function(e){return zt(e)===At},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===St||e===Vt||e===Yt||e===Et||e===At||e===Tt||"object"==typeof e&&null!==e&&(e.$$typeof===Nt||e.$$typeof===jt||e.$$typeof===Ot||e.$$typeof===Mt||e.$$typeof===It||e.$$typeof===Rt||e.$$typeof===Pt||e.$$typeof===Ft||e.$$typeof===$t)},typeOf:zt},Bt=xt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var p=e.type;switch(p){case c:case d:case o:case a:case i:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case u:case h:case f:case l:return g;default:return t}}case n:return t}}}var C=d,w=s,k=l,S=r,E=u,Y=o,O=h,M=f,D=n,V=a,I=i,A=m,T=!1;function j(e){return x(e)===d}t.AsyncMode=c,t.ConcurrentMode=C,t.ContextConsumer=w,t.ContextProvider=k,t.Element=S,t.ForwardRef=E,t.Fragment=Y,t.Lazy=O,t.Memo=M,t.Portal=D,t.Profiler=V,t.StrictMode=I,t.Suspense=A,t.isAsyncMode=function(e){return T||(T=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),j(e)||x(e)===c},t.isConcurrentMode=j,t.isContextConsumer=function(e){return x(e)===s},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===u},t.isFragment=function(e){return x(e)===o},t.isLazy=function(e){return x(e)===h},t.isMemo=function(e){return x(e)===f},t.isPortal=function(e){return x(e)===n},t.isProfiler=function(e){return x(e)===a},t.isStrictMode=function(e){return x(e)===i},t.isSuspense=function(e){return x(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===a||e===i||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===f||e.$$typeof===l||e.$$typeof===s||e.$$typeof===u||e.$$typeof===y||e.$$typeof===b||e.$$typeof===v||e.$$typeof===g)},t.typeOf=x}()}),_t=xt(function(e){e.exports="production"===process.env.NODE_ENV?Wt:Bt}),qt=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable,Xt=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var a in r=Object(arguments[i]))Ut.call(r,a)&&(o[a]=r[a]);if(qt){n=qt(r);for(var l=0;l<n.length;l++)Kt.call(r,n[l])&&(o[n[l]]=r[n[l]])}}return o},Gt=Function.call.bind(Object.prototype.hasOwnProperty),Ht="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Jt=Gt,Zt=function(){};if("production"!==process.env.NODE_ENV){var Qt=Ht,er={},tr=Jt;Zt=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function rr(e,t,r,n,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(tr(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](t,i,n,r,null,Qt)}catch(e){a=e}if(!a||a instanceof Error||Zt((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in er)){er[a.message]=!0;var s=o?o():"";Zt("Failed "+r+" type: "+a.message+(null!=s?s:""))}}}rr.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(er={})};var nr=rr,or=function(){};function ir(){return null}function ar(){}function lr(){}"production"!==process.env.NODE_ENV&&(or=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),lr.resetWarningCache=ar;var sr,cr=xt(function(e){e.exports="production"!==process.env.NODE_ENV?function(e){var t="function"==typeof Symbol&&Symbol.iterator,r="<<anonymous>>",n={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(ir),arrayOf:function(e){return a(function(t,r,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new i("Invalid "+o+" `"+a+"` of type `"+d(l)+"` supplied to `"+n+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,n,o,a+"["+s+"]",Ht);if(c instanceof Error)return c}return null})},element:a(function(t,r,n,o,a){var l=t[r];return e(l)?null:new i("Invalid "+o+" `"+a+"` of type `"+d(l)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:a(function(e,t,r,n,o){var a=e[t];return _t.isValidElementType(a)?null:new i("Invalid "+n+" `"+o+"` of type `"+d(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,o,a,l){return t[n]instanceof e?null:new i("Invalid "+a+" `"+l+"` of type `"+((s=t[n]).constructor&&s.constructor.name?s.constructor.name:r)+"` supplied to `"+o+"`, expected instance of `"+(e.name||r)+"`.");var s})},node:a(function(e,t,r,n,o){return c(e[t])?null:new i("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,r,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var l=t[r],s=d(l);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+n+"`, expected an object.");for(var c in l)if(Jt(l,c)){var u=e(l,c,n,o,a+"."+c,Ht);if(u instanceof Error)return u}return null})},oneOf:function(e){return Array.isArray(e)?a(function(t,r,n,a,l){for(var s=t[r],c=0;c<e.length;c++)if(o(s,e[c]))return null;var d=JSON.stringify(e,function(e,t){return"symbol"===u(t)?String(t):t});return new i("Invalid "+a+" `"+l+"` of value `"+String(s)+"` supplied to `"+n+"`, expected one of "+d+".")}):("production"!==process.env.NODE_ENV&&or(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),ir)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&or("Invalid argument supplied to oneOfType, expected an instance of array."),ir;for(var t=0;t<e.length;t++){var r=e[t];if("function"!=typeof r)return or("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(r)+" at index "+t+"."),ir}return a(function(t,r,n,o,a){for(var l=[],s=0;s<e.length;s++){var c=(0,e[s])(t,r,n,o,a,Ht);if(null==c)return null;c.data&&Jt(c.data,"expectedType")&&l.push(c.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+n+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,r,n,o,a){var l=t[r],c=d(l);if("object"!==c)return new i("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(n,o,a,m,u(p));var f=p(l,m,n,o,a+"."+m,Ht);if(f)return f}return null})},exact:function(e){return a(function(t,r,n,o,a){var l=t[r],c=d(l);if("object"!==c)return new i("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");var m=Xt({},t[r],e);for(var p in m){var f=e[p];if(Jt(e,p)&&"function"!=typeof f)return s(n,o,a,p,u(f));if(!f)return new i("Invalid "+o+" `"+a+"` key `"+p+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(t[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(l,p,n,o,a+"."+p,Ht);if(h)return h}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,o,a,l,s,c){if(a=a||r,s=s||o,c!==Ht){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}return null==n[o]?t?new i(null===n[o]?"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(n,o,a,l,s)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return a(function(t,r,n,o,a,l){var s=t[r];return d(s)!==e?new i("Invalid "+o+" `"+a+"` of type `"+u(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,r,n,o){return new i((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function c(r){switch(typeof r){case"number":case"string":case"undefined":return!0;case"boolean":return!r;case"object":if(Array.isArray(r))return r.every(c);if(null===r||e(r))return!0;var n=function(e){var r=e&&(t&&e[t]||e["@@iterator"]);if("function"==typeof r)return r}(r);if(!n)return!1;var o,i=n.call(r);if(n!==r.entries){for(;!(o=i.next()).done;)if(!c(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function d(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function u(e){if(null==e)return""+e;var t=d(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=u(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,n.checkPropTypes=nr,n.resetWarningCache=nr.resetWarningCache,n.PropTypes=n,n}(_t.isElement):function(){function e(e,t,r,n,o,i){if(i!==Ht){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:lr,resetWarningCache:ar};return r.PropTypes=r,r}()}),dr=Symbol.for("react.element"),ur=Symbol.for("react.portal"),mr=Symbol.for("react.fragment"),pr=Symbol.for("react.strict_mode"),fr=Symbol.for("react.profiler"),hr=Symbol.for("react.provider"),gr=Symbol.for("react.context"),yr=Symbol.for("react.server_context"),br=Symbol.for("react.forward_ref"),vr=Symbol.for("react.suspense"),xr=Symbol.for("react.suspense_list"),Cr=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),kr=Symbol.for("react.offscreen");function Sr(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case dr:switch(e=e.type){case mr:case fr:case pr:case vr:case xr:return e;default:switch(e=e&&e.$$typeof){case yr:case gr:case br:case wr:case Cr:case hr:return e;default:return t}}case ur:return t}}}sr=Symbol.for("react.module.reference");var Er={ContextConsumer:gr,ContextProvider:hr,Element:dr,ForwardRef:br,Fragment:mr,Lazy:wr,Memo:Cr,Portal:ur,Profiler:fr,StrictMode:pr,Suspense:vr,SuspenseList:xr,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Sr(e)===gr},isContextProvider:function(e){return Sr(e)===hr},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===dr},isForwardRef:function(e){return Sr(e)===br},isFragment:function(e){return Sr(e)===mr},isLazy:function(e){return Sr(e)===wr},isMemo:function(e){return Sr(e)===Cr},isPortal:function(e){return Sr(e)===ur},isProfiler:function(e){return Sr(e)===fr},isStrictMode:function(e){return Sr(e)===pr},isSuspense:function(e){return Sr(e)===vr},isSuspenseList:function(e){return Sr(e)===xr},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===mr||e===fr||e===pr||e===vr||e===xr||e===kr||"object"==typeof e&&null!==e&&(e.$$typeof===wr||e.$$typeof===Cr||e.$$typeof===hr||e.$$typeof===gr||e.$$typeof===br||e.$$typeof===sr||void 0!==e.getModuleId)},typeOf:Sr},Yr=xt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var h=e.type;switch(h){case o:case a:case i:case u:case m:return h;default:var g=h&&h.$$typeof;switch(g){case c:case s:case d:case f:case p:case l:return g;default:return t}}case n:return t}}}e=Symbol.for("react.module.reference");var y=l,b=r,v=d,x=o,C=f,w=p,k=n,S=a,E=i,Y=u,O=m,M=!1,D=!1;t.ContextConsumer=s,t.ContextProvider=y,t.Element=b,t.ForwardRef=v,t.Fragment=x,t.Lazy=C,t.Memo=w,t.Portal=k,t.Profiler=S,t.StrictMode=E,t.Suspense=Y,t.SuspenseList=O,t.isAsyncMode=function(e){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},t.isConcurrentMode=function(e){return D||(D=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},t.isContextConsumer=function(e){return g(e)===s},t.isContextProvider=function(e){return g(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return g(e)===d},t.isFragment=function(e){return g(e)===o},t.isLazy=function(e){return g(e)===f},t.isMemo=function(e){return g(e)===p},t.isPortal=function(e){return g(e)===n},t.isProfiler=function(e){return g(e)===a},t.isStrictMode=function(e){return g(e)===i},t.isSuspense=function(e){return g(e)===u},t.isSuspenseList=function(e){return g(e)===m},t.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===a||t===i||t===u||t===m||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===p||t.$$typeof===l||t.$$typeof===s||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)},t.typeOf=g}()}),Or=xt(function(e){e.exports="production"===process.env.NODE_ENV?Er:Yr});const Mr=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Dr(e,t=""){return e.displayName||e.name||function(e){const t=`${e}`.match(Mr);return t&&t[1]||""}(e)||t}function Vr(e,t,r){const n=Dr(t);return e.displayName||(""!==n?`${r}(${n})`:r)}function Ir(e){if("string"!=typeof e)throw new Error("production"!==process.env.NODE_ENV?"MUI: `capitalize(string)` expects a string argument.":function(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Ar(e,t){const r=gt({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=gt({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},i&&Object.keys(i)?o&&Object.keys(o)?(r[n]=gt({},i),Object.keys(o).forEach(e=>{r[n][e]=Ar(o[e],i[e])})):r[n]=i:r[n]=o}else void 0===r[n]&&(r[n]=e[n])}),r}const Tr=e=>e;var jr=(()=>{let e=Tr;return{configure(t){e=t},generate:t=>e(t),reset(){e=Tr}}})();const Nr={active:"active",checked:"checked",completed:"completed",disabled:"disabled",readOnly:"readOnly",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function $r(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}const Rr=["values","unit","step"];var Pr={borderRadius:4},Fr="production"!==process.env.NODE_ENV?cr.oneOfType([cr.number,cr.string,cr.object,cr.array]):{};function zr(e,t){return t?vt(e,t,{clone:!1}):e}const Lr={xs:0,sm:600,md:900,lg:1200,xl:1536},Wr={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Lr[e]}px)`};function Br(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||Wr;return t.reduce((n,o,i)=>(n[e.up(e.keys[i])]=r(t[i]),n),{})}if("object"==typeof t){const e=n.breakpoints||Wr;return Object.keys(t).reduce((n,o)=>(-1!==Object.keys(e.values||Lr).indexOf(o)?n[e.up(o)]=r(t[o],o):n[o]=t[o],n),{})}return r(t)}function _r(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,r)=>(t[e.up(r)]={},t),{}))||{}}function qr(e,t){return e.reduce((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e},t)}function Ur({values:e,breakpoints:t,base:r}){const n=r||function(e,t){if("object"!=typeof e)return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((t,n)=>{n<e.length&&(r[t]=!0)}):n.forEach(t=>{null!=e[t]&&(r[t]=!0)}),r}(e,t),o=Object.keys(n);if(0===o.length)return e;let i;return o.reduce((t,r,n)=>(Array.isArray(e)?(t[r]=null!=e[n]?e[n]:e[i],i=n):"object"==typeof e?(t[r]=null!=e[r]?e[r]:e[i],i=r):t[r]=e,t),{})}function Kr(e,t,r=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&r){const r=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=r)return r}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function Xr(e,t,r,n=r){let o;return o="function"==typeof e?e(r):Array.isArray(e)?e[r]||n:Kr(e,r)||n,t&&(o=t(o,n,e)),o}function Gr(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=e=>{if(null==e[t])return null;const i=e[t],a=Kr(e.theme,n)||{};return Br(e,i,e=>{let n=Xr(a,o,e);return e===n&&"string"==typeof e&&(n=Xr(a,o,`${t}${"default"===e?"":Ir(e)}`,e)),!1===r?n:{[r]:n}})};return i.propTypes="production"!==process.env.NODE_ENV?{[t]:Fr}:{},i.filterProps=[t],i}const Hr={m:"margin",p:"padding"},Jr={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Zr={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Qr=function(){const e={};return t=>(void 0===e[t]&&(e[t]=(e=>{if(e.length>2){if(!Zr[e])return[e];e=Zr[e]}const[t,r]=e.split(""),n=Hr[t],o=Jr[r]||"";return Array.isArray(o)?o.map(e=>n+e):[n+o]})(t)),e[t])}(),en=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],tn=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],rn=[...en,...tn];function nn(e,t,r,n){var o;const i=null!=(o=Kr(e,t,!1))?o:r;return"number"==typeof i?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${e}.`),i*e):Array.isArray(i)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>i.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${e} > ${i.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join("\n"))),i[e]):"function"==typeof i?i:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}function on(e){return nn(e,"spacing",8,"spacing")}function an(e,t){if("string"==typeof t||null==t)return t;const r=e(Math.abs(t));return t>=0?r:"number"==typeof r?-r:`-${r}`}function ln(e,t){const r=on(e.theme);return Object.keys(e).map(n=>function(e,t,r,n){if(-1===t.indexOf(r))return null;const o=function(e,t){return r=>e.reduce((e,n)=>(e[n]=an(t,r),e),{})}(Qr(r),n);return Br(e,e[r],o)}(e,t,n,r)).reduce(zr,{})}function sn(e){return ln(e,en)}function cn(e){return ln(e,tn)}function dn(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(r=>{e[r]=t}),e),{}),r=e=>Object.keys(e).reduce((r,n)=>t[n]?zr(r,t[n](e)):r,{});return r.propTypes="production"!==process.env.NODE_ENV?e.reduce((e,t)=>Object.assign(e,t.propTypes),{}):{},r.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),r}function un(e){return"number"!=typeof e?e:`${e}px solid`}sn.propTypes="production"!==process.env.NODE_ENV?en.reduce((e,t)=>(e[t]=Fr,e),{}):{},sn.filterProps=en,cn.propTypes="production"!==process.env.NODE_ENV?tn.reduce((e,t)=>(e[t]=Fr,e),{}):{},cn.filterProps=tn,"production"===process.env.NODE_ENV||rn.reduce((e,t)=>(e[t]=Fr,e),{});const mn=Gr({prop:"border",themeKey:"borders",transform:un}),pn=Gr({prop:"borderTop",themeKey:"borders",transform:un}),fn=Gr({prop:"borderRight",themeKey:"borders",transform:un}),hn=Gr({prop:"borderBottom",themeKey:"borders",transform:un}),gn=Gr({prop:"borderLeft",themeKey:"borders",transform:un}),yn=Gr({prop:"borderColor",themeKey:"palette"}),bn=Gr({prop:"borderTopColor",themeKey:"palette"}),vn=Gr({prop:"borderRightColor",themeKey:"palette"}),xn=Gr({prop:"borderBottomColor",themeKey:"palette"}),Cn=Gr({prop:"borderLeftColor",themeKey:"palette"}),wn=e=>{if(null!=e.borderRadius){const t=nn(e.theme,"shape.borderRadius",4,"borderRadius");return Br(e,e.borderRadius,e=>({borderRadius:an(t,e)}))}return null};wn.propTypes="production"!==process.env.NODE_ENV?{borderRadius:Fr}:{},wn.filterProps=["borderRadius"],dn(mn,pn,fn,hn,gn,yn,bn,vn,xn,Cn,wn);const kn=e=>{if(null!=e.gap){const t=nn(e.theme,"spacing",8,"gap");return Br(e,e.gap,e=>({gap:an(t,e)}))}return null};kn.propTypes="production"!==process.env.NODE_ENV?{gap:Fr}:{},kn.filterProps=["gap"];const Sn=e=>{if(null!=e.columnGap){const t=nn(e.theme,"spacing",8,"columnGap");return Br(e,e.columnGap,e=>({columnGap:an(t,e)}))}return null};Sn.propTypes="production"!==process.env.NODE_ENV?{columnGap:Fr}:{},Sn.filterProps=["columnGap"];const En=e=>{if(null!=e.rowGap){const t=nn(e.theme,"spacing",8,"rowGap");return Br(e,e.rowGap,e=>({rowGap:an(t,e)}))}return null};function Yn(e,t){return"grey"===t?t:e}function On(e){return e<=1&&0!==e?100*e+"%":e}En.propTypes="production"!==process.env.NODE_ENV?{rowGap:Fr}:{},En.filterProps=["rowGap"],dn(kn,Sn,En,Gr({prop:"gridColumn"}),Gr({prop:"gridRow"}),Gr({prop:"gridAutoFlow"}),Gr({prop:"gridAutoColumns"}),Gr({prop:"gridAutoRows"}),Gr({prop:"gridTemplateColumns"}),Gr({prop:"gridTemplateRows"}),Gr({prop:"gridTemplateAreas"}),Gr({prop:"gridArea"})),dn(Gr({prop:"color",themeKey:"palette",transform:Yn}),Gr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Yn}),Gr({prop:"backgroundColor",themeKey:"palette",transform:Yn}));const Mn=Gr({prop:"width",transform:On}),Dn=e=>null!=e.maxWidth?Br(e,e.maxWidth,t=>{var r,n,o;return{maxWidth:(null==(r=e.theme)||null==(n=r.breakpoints)||null==(o=n.values)?void 0:o[t])||Lr[t]||On(t)}}):null;Dn.filterProps=["maxWidth"];const Vn=Gr({prop:"minWidth",transform:On}),In=Gr({prop:"height",transform:On}),An=Gr({prop:"maxHeight",transform:On}),Tn=Gr({prop:"minHeight",transform:On});Gr({prop:"size",cssProperty:"width",transform:On}),Gr({prop:"size",cssProperty:"height",transform:On}),dn(Mn,Dn,Vn,In,An,Tn,Gr({prop:"boxSizing"}));var jn={border:{themeKey:"borders",transform:un},borderTop:{themeKey:"borders",transform:un},borderRight:{themeKey:"borders",transform:un},borderBottom:{themeKey:"borders",transform:un},borderLeft:{themeKey:"borders",transform:un},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:wn},color:{themeKey:"palette",transform:Yn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Yn},backgroundColor:{themeKey:"palette",transform:Yn},p:{style:cn},pt:{style:cn},pr:{style:cn},pb:{style:cn},pl:{style:cn},px:{style:cn},py:{style:cn},padding:{style:cn},paddingTop:{style:cn},paddingRight:{style:cn},paddingBottom:{style:cn},paddingLeft:{style:cn},paddingX:{style:cn},paddingY:{style:cn},paddingInline:{style:cn},paddingInlineStart:{style:cn},paddingInlineEnd:{style:cn},paddingBlock:{style:cn},paddingBlockStart:{style:cn},paddingBlockEnd:{style:cn},m:{style:sn},mt:{style:sn},mr:{style:sn},mb:{style:sn},ml:{style:sn},mx:{style:sn},my:{style:sn},margin:{style:sn},marginTop:{style:sn},marginRight:{style:sn},marginBottom:{style:sn},marginLeft:{style:sn},marginX:{style:sn},marginY:{style:sn},marginInline:{style:sn},marginInlineStart:{style:sn},marginInlineEnd:{style:sn},marginBlock:{style:sn},marginBlockStart:{style:sn},marginBlockEnd:{style:sn},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:kn},rowGap:{style:En},columnGap:{style:Sn},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:On},maxWidth:{style:Dn},minWidth:{transform:On},height:{transform:On},maxHeight:{transform:On},minHeight:{transform:On},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const Nn=function(){function e(e,t,r,n){const o={[e]:t,theme:r},i=n[e];if(!i)return{[e]:t};const{cssProperty:a=e,themeKey:l,transform:s,style:c}=i;if(null==t)return null;if("typography"===l&&"inherit"===t)return{[e]:t};const d=Kr(r,l)||{};return c?c(o):Br(o,t,t=>{let r=Xr(d,s,t);return t===r&&"string"==typeof t&&(r=Xr(d,s,`${e}${"default"===t?"":Ir(t)}`,t)),!1===a?r:{[a]:r}})}return function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const a=null!=(n=i.unstable_sxConfig)?n:jn;function l(r){let n=r;if("function"==typeof r)n=r(i);else if("object"!=typeof r)return r;if(!n)return null;const o=_r(i.breakpoints),l=Object.keys(o);let s=o;return Object.keys(n).forEach(r=>{const o="function"==typeof(l=n[r])?l(i):l;var l;if(null!=o)if("object"==typeof o)if(a[r])s=zr(s,e(r,o,i,a));else{const e=Br({theme:i},o,e=>({[r]:e}));!function(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),r=new Set(t);return e.every(e=>r.size===Object.keys(e).length)}(e,o)?s=zr(s,e):s[r]=t({sx:o,theme:i})}else s=zr(s,e(r,o,i,a))}),qr(l,s)}return Array.isArray(o)?o.map(l):l(o)}}();Nn.filterProps=["sx"];var $n=Nn;const Rn=["breakpoints","palette","spacing","shape"];function Pn(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,a=$r(e,Rn),l=function(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=$r(e,Rr),i=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>gt({},e,{[t.key]:t.val}),{})})(t),a=Object.keys(i);function l(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r})`}function s(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-n/100}${r})`}function c(e,o){const i=a.indexOf(o);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==i&&"number"==typeof t[a[i]]?t[a[i]]:o)-n/100}${r})`}return gt({keys:a,values:i,up:l,down:s,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):l(e)},not:function(e){const t=a.indexOf(e);return 0===t?l(a[1]):t===a.length-1?s(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:r},o)}(r),s=function(e=8){if(e.mui)return e;const t=on({spacing:e}),r=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map(e=>{const r=t(e);return"number"==typeof r?`${r}px`:r}).join(" "));return r.mui=!0,r}(o);let c=vt({breakpoints:l,direction:"ltr",components:{},palette:gt({mode:"light"},n),spacing:s,shape:gt({},Pr,i)},a);return c=t.reduce((e,t)=>vt(e,t),c),c.unstable_sxConfig=gt({},jn,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return $n({sx:e,theme:this})},c}const Fn=Pn(),zn=["sx"];function Ln(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ln(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Wn(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ln(e))&&(n&&(n+=" "),n+=t);return n}const Bn=["variant"];function _n(e){return 0===e.length}function qn(e){const{variant:t}=e,r=$r(e,Bn);let n=t||"";return Object.keys(r).sort().forEach(t=>{n+="color"===t?_n(n)?e[t]:Ir(e[t]):`${_n(n)?t:Ir(t)}${Ir(e[t].toString())}`}),n}const Un=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Kn(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const Xn=Pn();function Gn({defaultTheme:e,theme:t,themeId:r}){return 0===Object.keys(t).length?e:t[r]||t}const Hn=function(e={}){const{themeId:t,defaultTheme:r=Xn,rootShouldForwardProp:n=Kn,slotShouldForwardProp:o=Kn}=e,i=e=>$n(gt({},e,{theme:Gn(gt({},e,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(e,a={})=>{(e=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=e.__emotion_styles.filter(e=>!(null!=e&&e.__mui_systemSx)))})(e);const{name:l,slot:s,skipVariantsResolver:c,skipSx:d,overridesResolver:u}=a,m=$r(a,Un),p=void 0!==c?c:s&&"Root"!==s||!1,f=d||!1;let h;var g;"production"!==process.env.NODE_ENV&&l&&(h=`${l}-${g=s||"Root",g.charAt(0).toLowerCase()+g.slice(1)}`);let y=Kn;"Root"===s?y=n:s?y=o:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(y=void 0);const b=function(e,t){const r=me(e,t);return"production"!==process.env.NODE_ENV?(...t)=>{const n="string"==typeof e?`"${e}"`:"component";return 0===t.length?console.error([`MUI: Seems like you called \`styled(${n})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n")):t.some(e=>void 0===e)&&console.error(`MUI: the styled(${n})(...args) API requires all its args to be defined.`),r(...t)}:r}(e,gt({shouldForwardProp:y,label:h},m)),v=(n,...o)=>{const a=o?o.map(e=>"function"==typeof e&&e.__emotion_real!==e?n=>e(gt({},n,{theme:Gn(gt({},n,{defaultTheme:r,themeId:t}))})):e):[];let c=n;l&&u&&a.push(e=>{const n=Gn(gt({},e,{defaultTheme:r,themeId:t})),o=((e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null)(l,n);if(o){const t={};return Object.entries(o).forEach(([r,o])=>{t[r]="function"==typeof o?o(gt({},e,{theme:n})):o}),u(e,t)}return null}),l&&!p&&a.push(e=>{const n=Gn(gt({},e,{defaultTheme:r,themeId:t}));return((e,t,r,n)=>{var o,i;const{ownerState:a={}}=e,l=[],s=null==r||null==(o=r.components)||null==(i=o[n])?void 0:i.variants;return s&&s.forEach(r=>{let n=!0;Object.keys(r.props).forEach(t=>{a[t]!==r.props[t]&&e[t]!==r.props[t]&&(n=!1)}),n&&l.push(t[qn(r.props)])}),l})(e,((e,t)=>{let r=[];t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants);const n={};return r.forEach(e=>{const t=qn(e.props);n[t]=e.style}),n})(l,n),n,l)}),f||a.push(i);const d=a.length-o.length;if(Array.isArray(n)&&d>0){const e=new Array(d).fill("");c=[...n,...e],c.raw=[...n.raw,...e]}else"function"==typeof n&&n.__emotion_real!==n&&(c=e=>n(gt({},e,{theme:Gn(gt({},e,{defaultTheme:r,themeId:t}))})));const m=b(c,...a);if("production"!==process.env.NODE_ENV){let t;l&&(t=`${l}${s||""}`),void 0===t&&(t=`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return Dr(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Or.ForwardRef:return Vr(e,e.render,"ForwardRef");case Or.Memo:return Vr(e,e.type,"memo");default:return}}}(e)})`),m.displayName=t}return e.muiName&&(m.muiName=e.muiName),m};return b.withConfig&&(v.withConfig=b.withConfig),v}}();var Jn=Hn;function Zn(e){const{theme:t,name:r,props:n}=e;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?Ar(t.components[r].defaultProps,n):n}const Qn=["component","direction","spacing","divider","children","className","useFlexGap"],eo=Pn(),to=Jn("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function ro(e){return function({props:e,name:t,defaultTheme:r,themeId:n}){let o=function(e=Fn){return function(e=null){const t=q.useContext(pe);return t&&0!==Object.keys(t).length?t:e}(e)}(r);return n&&(o=o[n]||o),Zn({theme:o,name:t,props:e})}({props:e,name:"MuiStack",defaultTheme:eo})}function no(e,t){const r=q.Children.toArray(e).filter(Boolean);return r.reduce((e,n,o)=>(e.push(n),o<r.length-1&&e.push(/*#__PURE__*/q.cloneElement(t,{key:`separator-${o}`})),e),[])}const oo=({ownerState:e,theme:t})=>{let r=gt({display:"flex",flexDirection:"column"},Br({theme:t},Ur({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e})));if(e.spacing){const n=on(t),o=Object.keys(t.breakpoints.values).reduce((t,r)=>(("object"==typeof e.spacing&&null!=e.spacing[r]||"object"==typeof e.direction&&null!=e.direction[r])&&(t[r]=!0),t),{}),i=Ur({values:e.direction,base:o}),a=Ur({values:e.spacing,base:o});"object"==typeof i&&Object.keys(i).forEach((e,t,r)=>{i[e]||(i[e]=t>0?i[r[t-1]]:"column")}),r=vt(r,Br({theme:t},a,(t,r)=>{return e.useFlexGap?{gap:an(n,t)}:{"& > :not(style) + :not(style)":{margin:0,[`margin${o=r?i[r]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[o]}`]:an(n,t)}};var o}))}return r=function(e,...t){const r=_r(e),n=[r,...t].reduce((e,t)=>vt(e,t),{});return qr(Object.keys(r),n)}(t.breakpoints,r),r},io=function(e={}){const{createStyledComponent:r=to,useThemeProps:n=ro,componentName:o="MuiStack"}=e,i=r(oo),a=/*#__PURE__*/q.forwardRef(function(e,r){const a=function(e){const{sx:t}=e,r=$r(e,zn),{systemProps:n,otherProps:o}=(e=>{var t,r;const n={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(r=e.theme)?void 0:r.unstable_sxConfig)?t:jn;return Object.keys(e).forEach(t=>{o[t]?n.systemProps[t]=e[t]:n.otherProps[t]=e[t]}),n})(r);let i;return i=Array.isArray(t)?[n,...t]:"function"==typeof t?(...e)=>{const r=t(...e);return yt(r)?gt({},n,r):n}:gt({},n,t),gt({},o,{sx:i})}(n(e)),{component:l="div",direction:s="column",spacing:c=0,divider:d,children:u,className:m,useFlexGap:p=!1}=a,f=$r(a,Qn),h={direction:s,spacing:c,useFlexGap:p},g=function(e,t,r){const n={};return Object.keys(e).forEach(t=>{n[t]=e[t].reduce((e,t)=>{if(t){const n=(e=>function(e,t,r="Mui"){const n=Nr[t];return n?`${r}-${n}`:`${jr.generate(e)}-${t}`}(o,e))(t);""!==n&&e.push(n),r&&r[t]&&e.push(r[t])}return e},[]).join(" ")}),n}({root:["root"]},0,{});/*#__PURE__*/
|
|
2
|
-
return t(i,gt({as:l,ownerState:h,ref:r,className:Wn(g.root,m)},f,{children:d?no(u,d):u}))});return"production"!==process.env.NODE_ENV&&(a.propTypes={children:cr.node,direction:cr.oneOfType([cr.oneOf(["column-reverse","column","row-reverse","row"]),cr.arrayOf(cr.oneOf(["column-reverse","column","row-reverse","row"])),cr.object]),divider:cr.node,spacing:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.number,cr.string])),cr.number,cr.object,cr.string]),sx:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.func,cr.object,cr.bool])),cr.func,cr.object])}),a}();"production"!==process.env.NODE_ENV&&(io.propTypes={children:cr.node,component:cr.elementType,direction:cr.oneOfType([cr.oneOf(["column-reverse","column","row-reverse","row"]),cr.arrayOf(cr.oneOf(["column-reverse","column","row-reverse","row"])),cr.object]),divider:cr.node,spacing:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.number,cr.string])),cr.number,cr.object,cr.string]),sx:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.func,cr.object,cr.bool])),cr.func,cr.object]),useFlexGap:cr.bool});var ao=io;function lo(r){return t(p,{...r,children:e("svg",{width:"26",height:"34",viewBox:"0 0 26 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M24.9717 11.5L14.8333 1.36165C14.5757 1.10371 14.2262 0.958634 13.8617 0.958313H5.66667C4.32953 0.958313 3.04717 1.48949 2.10167 2.43498C1.15617 3.38048 0.625 4.66285 0.625 5.99998V28C0.625 29.3371 1.15617 30.6195 2.10167 31.565C3.04717 32.5105 4.32953 33.0416 5.66667 33.0416H20.3333C21.6705 33.0416 22.9528 32.5105 23.8983 31.565C24.8438 30.6195 25.375 29.3371 25.375 28V12.4166C25.3606 12.0713 25.2166 11.744 24.9717 11.5ZM15.2917 5.65165L20.6817 11.0416H15.2917V5.65165ZM20.3333 30.2916H5.66667C5.05888 30.2916 4.47598 30.0502 4.04621 29.6204C3.61644 29.1907 3.375 28.6078 3.375 28V5.99998C3.375 5.39219 3.61644 4.8093 4.04621 4.37953C4.47598 3.94976 5.05888 3.70831 5.66667 3.70831H12.5417V12.4166C12.5464 12.7798 12.6928 13.1268 12.9496 13.3837C13.2065 13.6405 13.5535 13.7869 13.9167 13.7916H22.625V28C22.625 28.6078 22.3836 29.1907 21.9538 29.6204C21.524 30.0502 20.9411 30.2916 20.3333 30.2916Z",fill:"#fff"}),t("path",{d:"M15.7317 22.225C14.6044 21.5176 13.756 20.4425 13.33 19.1817C13.7248 18.0021 13.8439 16.7478 13.6784 15.515C13.6255 15.2044 13.474 14.9191 13.2464 14.7013C13.0187 14.4835 12.727 14.3448 12.4144 14.3058C12.1018 14.2667 11.7849 14.3293 11.5107 14.4844C11.2364 14.6394 11.0194 14.8786 10.8917 15.1667C10.683 16.6487 10.8403 18.1594 11.35 19.5667C10.6537 21.1933 9.87664 22.7842 9.02169 24.3333C7.72002 25.0667 5.94169 26.1667 5.66669 27.4317C5.44669 28.4583 7.37169 31.0983 10.6534 25.3783C12.1126 24.8366 13.6072 24.3956 15.1267 24.0583C16.2499 24.7005 17.5029 25.0827 18.7934 25.1767C19.0897 25.1843 19.3816 25.1043 19.6325 24.9465C19.8835 24.7887 20.0822 24.5603 20.2036 24.2899C20.3251 24.0195 20.3639 23.7193 20.3152 23.4269C20.2666 23.1345 20.1325 22.8631 19.93 22.6467C19.16 21.8583 16.8684 22.0783 15.7317 22.225ZM6.96836 27.725C7.48213 26.8458 8.16063 26.0739 8.96669 25.4517C7.72002 27.4317 6.96836 27.78 6.96836 27.7433V27.725ZM12.3217 15.24C12.7984 15.24 12.7617 17.3483 12.4317 17.9167C12.1831 17.0521 12.1454 16.1405 12.3217 15.2583V15.24ZM10.7267 24.1867C11.3478 23.0533 11.887 21.877 12.34 20.6667C12.8257 21.5704 13.5012 22.3585 14.32 22.9767C13.09 23.2848 11.888 23.6956 10.7267 24.205V24.1867ZM19.3434 23.8567C19.3434 23.8567 19.0134 24.26 16.905 23.3433C19.1967 23.1967 19.5817 23.7283 19.3434 23.875V23.8567Z",fill:"#fff"})]})})}function so(r){return t(p,{...r,children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M20 8.70001H4C3.90151 8.70001 3.80398 8.68061 3.71299 8.64292C3.62199 8.60523 3.53931 8.54999 3.46967 8.48034C3.40003 8.4107 3.34478 8.32802 3.30709 8.23703C3.2694 8.14603 3.25 8.0485 3.25 7.95001C3.25 7.85152 3.2694 7.75399 3.30709 7.663C3.34478 7.57201 3.40003 7.48933 3.46967 7.41968C3.53931 7.35004 3.62199 7.29479 3.71299 7.2571C3.80398 7.21941 3.90151 7.20001 4 7.20001H20C20.1989 7.20001 20.3897 7.27903 20.5303 7.41968C20.671 7.56033 20.75 7.7511 20.75 7.95001C20.75 8.14892 20.671 8.33969 20.5303 8.48034C20.3897 8.621 20.1989 8.70001 20 8.70001Z",fill:"white"}),t("path",{d:"M16.44 20.75H7.56C7.24309 20.7717 6.92503 20.7302 6.62427 20.628C6.3235 20.5259 6.04601 20.365 5.80788 20.1548C5.56975 19.9446 5.37572 19.6891 5.23704 19.4034C5.09836 19.1176 5.01779 18.8071 5 18.49V7.99998C5 7.80107 5.07902 7.61031 5.21967 7.46965C5.36032 7.329 5.55109 7.24998 5.75 7.24998C5.94891 7.24998 6.13968 7.329 6.28033 7.46965C6.42098 7.61031 6.5 7.80107 6.5 7.99998V18.49C6.5 18.9 6.97 19.25 7.5 19.25H16.38C16.94 19.25 17.38 18.9 17.38 18.49V7.99998C17.38 7.78516 17.4653 7.57913 17.6172 7.42723C17.7691 7.27532 17.9752 7.18998 18.19 7.18998C18.4048 7.18998 18.6109 7.27532 18.7628 7.42723C18.9147 7.57913 19 7.78516 19 7.99998V18.49C18.9822 18.8071 18.9016 19.1176 18.763 19.4034C18.6243 19.6891 18.4303 19.9446 18.1921 20.1548C17.954 20.365 17.6765 20.5259 17.3757 20.628C17.075 20.7302 16.7569 20.7717 16.44 20.75ZM16.56 7.74998C16.4611 7.75133 16.363 7.73285 16.2714 7.69563C16.1798 7.65842 16.0966 7.60323 16.0267 7.53331C15.9568 7.4634 15.9016 7.38018 15.8644 7.28858C15.8271 7.19698 15.8087 7.09885 15.81 6.99998V5.50998C15.81 5.09999 15.33 4.74998 14.81 4.74998H9.22C8.67 4.74998 8.22 5.09999 8.22 5.50998V6.99998C8.22 7.1989 8.14098 7.38966 8.00033 7.53031C7.85968 7.67097 7.66891 7.74998 7.47 7.74998C7.27109 7.74998 7.08032 7.67097 6.93967 7.53031C6.79902 7.38966 6.72 7.1989 6.72 6.99998V5.50998C6.75872 4.8813 7.04203 4.29275 7.50929 3.87035C7.97655 3.44795 8.5906 3.22527 9.22 3.24998H14.78C15.4145 3.21717 16.0362 3.4362 16.51 3.85944C16.9838 4.28267 17.2713 4.87586 17.31 5.50998V6.99998C17.3113 7.09931 17.2929 7.19792 17.2558 7.29007C17.2187 7.38222 17.1637 7.46608 17.0939 7.53679C17.0241 7.6075 16.941 7.66364 16.8493 7.70195C16.7577 7.74027 16.6593 7.75999 16.56 7.75998V7.74998Z",fill:"white"}),t("path",{d:"M10.22 17C10.0219 16.9974 9.8326 16.9175 9.6925 16.7774C9.55241 16.6373 9.47256 16.4481 9.46997 16.25V11.72C9.46997 11.5211 9.54899 11.3303 9.68964 11.1896C9.83029 11.049 10.0211 10.97 10.22 10.97C10.4189 10.97 10.6096 11.049 10.7503 11.1896C10.891 11.3303 10.97 11.5211 10.97 11.72V16.24C10.9713 16.3393 10.9529 16.4379 10.9158 16.5301C10.8787 16.6222 10.8236 16.7061 10.7539 16.7768C10.6841 16.8475 10.601 16.9036 10.5093 16.9419C10.4177 16.9803 10.3193 17 10.22 17Z",fill:"white"}),t("path",{d:"M13.78 17C13.5811 17 13.3904 16.921 13.2497 16.7803C13.109 16.6396 13.03 16.4489 13.03 16.25V11.72C13.03 11.5211 13.109 11.3303 13.2497 11.1896C13.3904 11.049 13.5811 10.97 13.78 10.97C13.9789 10.97 14.1697 11.049 14.3104 11.1896C14.451 11.3303 14.53 11.5211 14.53 11.72V16.24C14.53 16.4398 14.4513 16.6316 14.311 16.7739C14.1706 16.9161 13.9799 16.9973 13.78 17Z",fill:"white"})]})})}function co(e){const t=1048576;return e<t?`${(e/1024).toFixed(1)}KB`:`${(e/t).toFixed(1)}MB`}function uo({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:m=!1,apiURL:p,sizeLimit:y=4,xs:b=12,sm:v,md:x,route:C="",tstToken:w="",dropZoneOptions:k}){const{getRootProps:S,getInputProps:E}=ue({multiple:m,useFsAccessApi:!0,onDrop:e=>{V(-1),e.filter(e=>!(e.size/1048576>y&&(P(`Por favor, escolha um arquivo com tamanho inferior a ${y} MB`),setTimeout(()=>{P("")},3e3),1))).forEach((e,t)=>{let r=Date.now()+t;const n=new FormData;n.append("files",e),n.append("tipoArquivo",s),de.post(p,n,{onUploadProgress:t=>{const n=Math.round(100*t.loaded/t.total);V(n),n>=100&&A(t=>[...t,{id:r,name:e.name,loading:!0,error:!1,file:e,size:e.size}])},headers:{Authorization:`Bearer ${""===w?O?O.token:"":w}`}}).then(e=>{if(e.status>200){const t=te(e.data,C,e.data)[0].coSeqArquivo;Y.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:t,CO_TIPO_ARQUIVO:parseInt(s)}]),j(e=>[...e,r]);const n={};n[r]=t,$(e=>({...e,...n}))}else V(-1),F(r)}).catch(e=>{console.log(e),V(-1),F(r)})})},...k||{}}),Y=X(at),{user:O}=X(ot),M=f();h(M.breakpoints.only("xs"));const[D,V]=H(-1),[I,A]=H([]),[T,j]=H([]),[N,$]=H({}),[R,P]=H(""),F=(e,t,r)=>{A(I.filter(t=>t.id!==e)),r&&Y.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==r)),t||(P("Erro ao enviar arquivo. Verifique o formato e tente mais tarde."),setTimeout(()=>{P("")},3e3))};return J(()=>{const e=new DataTransfer;I.forEach(t=>{e.items.add(t.file)}),Y?.formSetValue(a,e.files)},[I,Y,a]),J(()=>()=>{Y.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(s)))},[]),t(n,{item:!0,xs:b,sm:v,md:x,sx:{width:"100%"},children:e(i,{bgcolor:"white",p:2,borderRadius:"8px",color:"#1E293B",children:[t(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(ao,{...S({className:"dropzone"}),bgcolor:"#EFEFEF",justifyContent:"center",alignItems:"center",textAlign:"center",borderRadius:"6px",py:8,border:"solid 1.5px #989898",sx:{borderStyle:"dashed",cursor:"pointer"},children:[t("input",{...E(),...Y.formRegister(a,{validate:(e,t)=>{if((e.length&&T.length)<=0&&d)return"O campo de arquivo é obrigatório"}})}),e(ao,{spacing:2,alignItems:"center",children:[e(i,{children:[t(o,{fontWeight:600,fontSize:18,children:"Arraste seus arquivos até aqui"}),t(o,{children:"ou selecione arquivos que estão no seu computador"})]}),t(l,{variant:"contained",sx:{backgroundColor:"#64748B",pointerEvents:"none",borderRadius:"8px",width:"fit-content"},children:"Selecionar"}),e(o,{fontWeight:300,children:["Tamanho máximo por arquivo ",y,"MB"]})]})]}),e(o,{pt:2,fontSize:16,fontWeight:600,children:["Você selecionou ",I.length," arquivo",I.length>1?"s":"","."]}),e(ao,{width:"100%",marginTop:1,spacing:1,children:[I.map(r=>e(ao,{direction:"row",justifyContent:"space-between",border:"solid 1px #E2E8F0",borderRadius:2,p:1,children:[e(ao,{direction:"row",children:[t(ao,{direction:"row",justifyContent:"center",alignItems:"center",minWidth:30,pr:1.5,children:t(lo,{sx:{filter:"invert(42%) sepia(86%) saturate(2412%) hue-rotate(326deg) brightness(86%) contrast(102%)",transform:"scale(1.5)",width:30}})}),e(ao,{children:[t(o,{fontWeight:600,children:r.name}),t(o,{fontSize:14,children:co(r.size)})]})]}),t(l,{size:"small",startIcon:t(so,{}),variant:"contained",onClick:e=>{return t=r.id,void(Object.keys(N).includes(t.toString())&&fetch(`${p}/${N[t]}`,{method:"DELETE",headers:{Authorization:`Bearer ${""===w?O?O.token:"":w}`}}).then(e=>{e.ok||F(t,!0,N[t]),200===e.status&&F(t,!0,N[t])}).catch(e=>console.log(e)));var t},sx:{height:40,backgroundColor:"#DE3F50",borderRadius:"8px"},children:"Remover"})]})),D>0&&D<100&&t(g,{value:D,sx:{backgroundColor:"#103D6A",".MuiLinearProgress-bar":{backgroundColor:"#BDDDFA"}}})]}),R&&e(r,{children:[t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,paddingTop:2,children:R}),t("br",{})]}),te(Y?.errors,a)&&t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})})}function mo({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:m=!1,apiURL:p,route:g="",sizeLimit:x=4,xs:C=12,sm:w,md:k}){const S=X(at),{user:E}=X(ot),Y=f(),O=h(Y.breakpoints.only("xs")),[M,D]=H([]),[V,I]=H([]),[A,T]=H({}),[j,N]=H(""),$=G(e=>{const t=e.target.files,r=Object.keys(t).map(e=>t[e]);D([...M,...r.filter(e=>!(e.size/1048576>x&&(N(`Por favor, escolha um arquivo com tamanho inferior a ${x} MB`),setTimeout(()=>{N("")},3e3),1))).map((e,t)=>{let r=Date.now()+t;const n=new FormData;return n.append("files",e),n.append("tipoArquivo",s),fetch(p,{method:"POST",body:n,headers:{Authorization:`Bearer ${E?E.token:""}`}}).then(e=>{e.ok?e.json().then(e=>{if(e.status&&200===e.status.status){const t=te(e,g,e)[0].coSeqArquivo;S.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:t,CO_TIPO_ARQUIVO:parseInt(s)}]),I(e=>[...e,r]);const n={};n[r]=t,T(e=>({...e,...n}))}else R(r)}):R(r)}).catch(e=>{R(r)}),{id:r,name:e.name,loading:!0,error:!1,file:e}})])},[M,S]),R=(e,t,r)=>{D(M.filter(t=>t.id!==e)),r&&S.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==r)),t||(N("Erro ao enviar arquivo. Tente novamente mais tarde"),setTimeout(()=>{N("")},3e3))};return J(()=>{const e=new DataTransfer;M.forEach(t=>{e.items.add(t.file)}),S?.formSetValue(a,e.files)},[M,S,a]),J(()=>()=>{S.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(s)))},[]),e(n,{item:!0,xs:C,sm:w,md:k,sx:{width:"100%"},children:[t(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(i,{sx:{backgroundColor:"#e2eafc",padding:1,borderRadius:1,marginTop:1},children:[t("input",{id:a,type:"file",multiple:m,...S?.formRegister(a,{validate:(e,t)=>{if((e.length&&V.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:$,accept:".pdf",style:{display:"none"}}),t("input",{id:a+"foto",type:"file",capture:"environment",multiple:m,...S?.formRegister(a,{validate:(e,t)=>{if((e.length&&V.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:$,accept:".jpg, .png, .jpeg",style:{display:"none"}}),e(i,{sx:{display:{sx:"block",md:"flex"}},children:[t(i,{sx:{width:"100%",marginRight:{xs:0,md:1},marginBottom:{xs:1,md:0}},children:!m&&M.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(ye,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"}):t("label",{htmlFor:a,children:t(l,{variant:"contained",disableElevation:!0,startIcon:t(ye,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"})})}),t(i,{sx:{width:"100%"},children:!m&&M.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(fe,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:O?"Tirar Foto":"Escolher Imagem"}):t("label",{htmlFor:a+"foto",children:t(l,{variant:"contained",disableElevation:!0,startIcon:t(fe,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:O?"Tirar Foto":"Escolher Imagem"})})})]}),e(o,{fontWeight:600,paddingY:1,color:"black",children:["Você selecionou ",M.length," arquivo",M.length>1&&"s"]}),M.length>0&&t(y,{component:b,children:t(ao,{direction:"column",children:M.map(r=>e(ao,{direction:"row",justifyContent:"space-between",padding:.5,children:[t(i,{children:e(ao,{direction:"row",spacing:2,children:[V.includes(r.id)?t(ge,{sx:{fill:"#06d6a0"}}):t(v,{size:22,sx:{color:"black"}}),t(be,{color:"error"}),t(o,{fontWeight:600,children:r.name})]})}),t(i,{children:V.includes(r.id)&&t(l,{variant:"contained",size:"small",sx:{textTransform:"none",backgroundColor:"#d1495b","&:hover":{backgroundColor:"#c1121f"}},onClick:e=>{return t=r.id,void(Object.keys(A).includes(t.toString())&&fetch(`${p}/${A[t]}`,{method:"DELETE",headers:{Authorization:`Bearer ${E?.token}`}}).then(e=>{e.ok||R(t,!0,A[t]),200===e.status&&R(t,!0,A[t])}).catch(e=>console.log(e)));var t},startIcon:t(he,{}),children:"Remover"})})]},r.name))})}),j&&e(r,{children:[t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,paddingTop:2,children:j}),t("br",{})]}),te(S?.errors,a)&&t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})]})}function po({defaultChecked:r=!1,...n}){const i=X(at);J(()=>{i?.formSetValue(n.name,r)},[]);const l=Z(()=>n.overrideYes||"Sim",[n.overrideYes]),c=Z(()=>n.overrideNo||"Não",[n.overrideNo]);return e(a,{sx:{alignItems:"center",justifyContent:"center"},children:[n.title&&t(u,{children:n.title}),t(s,{control:t(x,{defaultChecked:r,...i?.formRegister(n.name)}),label:t(o,{width:25,sx:{userSelect:"none",fontWeight:600},children:i?.formWatch(n.name)?l:c}),sx:{paddingLeft:1}})]})}var fo=/*#__PURE__*/U.memo(po);function ho({invert:e=!1,hasCheckValue:n=!1,...o}){const i=X(at);return J(()=>()=>{(n?e:i.formWatch(o.switchId)===e)&&o.unregisterNameList.forEach(e=>i.formUnregister(e))},[o.unregisterNameList]),t(r,{})}function go({invert:n=!1,checkValue:o,...i}){const a=X(at);return t(r,{children:(o?a?.formWatch(i.switchId)===o!==n:a?.formWatch(i.switchId)!==n)&&e(r,{children:[t(ho,{switchId:i.switchId,unregisterNameList:i.unregisterNameList,hasCheckValue:!!o,invert:o?a?.formWatch(i.switchId)===o!==n:n}),i.children]})})}const yo=/*#__PURE__*/U.forwardRef(function(e,r){const{onChange:n,onMask:o,maskValue:i,setMaskValue:a,watchValue:l,imaskConfig:s,...c}=e,[d,u]=H(s.mask);delete c.value;const m=Q(null),[p,f]=H(""),h=X(at);return J(()=>{l&&f(l)},[l]),J(()=>{h.formSetValue(c.name,m.current.element.value)},[p]),delete c.watchValue,t(xe,{...c,mask:d,value:p,ref:m,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{f(e),t.updateValue(),o&&o(e,u)},...s})});function bo(e){const n=X(at),[o,i]=H("");return t(r,{children:t(m,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:yo,inputProps:{onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue,imaskConfig:e.imaskConfig}},disabled:e.disabled,fullWidth:!0})})}function vo({type:r="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:p=!1,watchValue:f,...h}){const g=X(at);return J(()=>{void 0!==f&&g.formSetValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&t(u,{htmlFor:"campo",required:h.required,children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.errors,h.name),a=i?.message,d=!!i,u={...g?.formRegister(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if(h.customValidate){const e=h.customValidate(n,t);if(e)return e}if("cnpj"===r){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&h.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===r||"password"===r||"number"===r){if(n.length>s)return`Limite máximo de ${s} caracteres`;if(n.length<l&&h.required)return`Limite mínimo de ${l} caracteres`}else if("email"===r){if(n.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===r){if((n.length<14||n.length>14&&n.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===r&&n.length<14&&h.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white"}};switch(r){case"input":case"email":return t(m,{...u,defaultValue:c,disabled:p});case"password":return t(m,{...u,type:"password",disabled:p});case"number":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:o},watchValue:f,disabled:p});case"cep":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000-000"},watchValue:f,disabled:p});case"phone":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"(00) [9]0000-0000"},watchValue:f,disabled:p});case"sei":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:p});case"cpf_cnpj":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:[{mask:"000.000.000-00"},{mask:"00.000.000/0000-00"}],dispatch:(e,t)=>(t.value+e).replace(/\D/g,"").length>11?t.compiledMasks[1]:t.compiledMasks[0]},watchValue:f,disabled:p});case"cpf":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"000.000.000-00"},watchValue:f,disabled:p});case"cnpj":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00.000.000/0000-00"},watchValue:f,disabled:p});case"rg":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000[000000]"},watchValue:f,disabled:p})}})()]})}var xo=/*#__PURE__*/U.memo(vo);function Co({name:r,required:o=!1,title:i,defaultChecked:l=!1,xs:s=12,unregisterNameList:c,sm:d,md:u,...m}){const p=`${r}-switch`;return e(n,{item:!0,xs:s,sm:d,md:u,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),e(a,{direction:"row",children:[t(fo,{name:p,defaultChecked:l}),t(go,{switchId:p,unregisterNameList:c,children:t(vo,{name:"ddd",type:"input"})})]})]})}function wo({name:r,required:o=!1,title:i,customPlaceholder:a,url:l,xs:s=12,sm:c,md:d,dataPath:u=""}){const p=X(at),{user:f}=X(ot),[h,g]=H([]);Ce(`autocomplete-${r}`,()=>fetch(l,{headers:{Authorization:`Bearer ${f?f.token:""}`}}).then(e=>e.json().then(e=>g(y(e)))));const y=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]),b=G((e,t)=>{p?.formSetValue(r,t?t.id:""),p?.formTrigger(r)},[p,r]);return e(n,{item:!0,xs:s,sm:c,md:d,children:[i&&t(ve,{required:o,children:i}),t("input",{type:"text",...p?.formRegister(r,{validate:(e,t)=>{if(e.length<=0&&o)return"Este campo é obrigatório"}}),hidden:!0}),t(C,{options:h,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:b,renderInput:e=>t(m,{...e,placeholder:a,size:"small",error:!!te(p?.errors,r),helperText:te(p?.errors,r)?.message})})]})}let ko=!0;function So({name:r,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:p=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const v=X(at),[x,w]=H(!0),[k,S]=H([]),[E,Y]=H("Carregando..."),[O,M]=H(null),[D,V]=H(null),[I,A]=H(null),{user:T}=X(ot),j=function(e,t,n=!1){try{return Promise.resolve(function(o,i){try{var a=(A(null),Promise.resolve(fetch(e,{method:"GET",headers:{Authorization:`Bearer ${T?.token}`}})).then(function(e){if(!e.ok){const t=401===e.status?"Sessão expirada. Faça login novamente.":403===e.status?"Acesso negado. Verifique suas permissões.":e.status>=500?"Erro interno do servidor. Tente novamente mais tarde.":"Erro ao carregar dados";return A(t),Y(t),void w(!1)}return Promise.resolve(e.json()).then(function(e){const o=te(e,t,e);if(n){const e=o.filter(e=>e.id===c);e.length>0?(S(o),w(!1),v.formSetValue(r,c),M(e[0])):(A("Valor padrão inválido"),Y("Erro ao carregar dados. Valor inválido"),w(!1))}else S(o),w(!1)})}))}catch(e){return i(e)}return a&&a.then?a.then(void 0,i):a}(0,function(e){console.error("Network error:",e),A("Erro de conexão. Verifique sua internet e tente novamente."),Y("Erro de conexão. Verifique sua internet e tente novamente."),w(!1)}))}catch(e){return Promise.reject(e)}};function N(){(c||!l)&&k.length>0||(w(!0),S([]),a&&Y(a),j(o,d,!1))}return J(()=>{c&&j(o,d,!0)},[]),J(()=>{g&&ko&&(V(g),v.formSetValue(r,g.id),p(g.id))},[g]),c&&k.length<=0&&!O?t(n,{item:!0,xs:f,sm:h,md:y,children:t(m,{size:"small",fullWidth:!0,placeholder:E,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,md:y,children:[i&&t(u,{required:s,children:i}),t("input",{type:"text",...v?.formRegister(r,{validate:(e,t)=>e?e.length<=0&&s?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),t(C,{value:D,loading:x,loadingText:E,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(ko=!1,e)return V(e),v.formSetValue(r,e.id),void p(e.id);V(null),v.formSetValue(r,""),p(void 0)}(t),renderInput:e=>t(m,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:N,error:!!te(v?.errors,r)||!!I,helperText:te(v?.errors,r)?.message||I}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}let Eo=!0;function Yo({name:r,title:o,required:i=!1,list:a,defaultValue:l,onChange:s=()=>{},xs:c=12,sm:d,watchValue:p,forceUpdate:f=!1,md:h}){const g=X(at),[y,b]=H(null);return J(()=>{l&&g?.formSetValue(r,l.id)},[]),J(()=>{p&&(Eo||f)?(b(p),g.formSetValue(r,p.id),s(p.id)):void 0===p&&(Eo||f)&&(b(null),g.formSetValue(r,void 0),s(void 0))},[p]),e(n,{item:!0,xs:c,sm:d,md:h,children:[o&&t(u,{required:i,children:o}),t("input",{type:"text",...g?.formRegister(r,{validate:(e,t)=>e?e?.length<=0&&i?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),t(C,{value:y,options:a,defaultValue:l,getOptionLabel:e=>e.label?e.label.toString():"Não Encontrado",isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(Eo=!1,e)return b(e),g.formSetValue(r,e.id),void s(e.id);b(null),g.formSetValue(r,""),s(void 0)}(t),renderInput:e=>t(m,{...e,size:"small",fullWidth:!0,placeholder:o,error:!!te(g?.errors,r),helperText:te(g?.errors,r)?.message}),size:"small",sx:{bgcolor:"white"},fullWidth:!0})]})}let Oo=!0;function Mo({name:r,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:p=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const v=se(),[x,w]=H(!0),[k,S]=H([]),[E,Y]=H("Carregando..."),[O,M]=H(null),[D,V]=H(null),{user:I}=X(ot);function A(){(c||!l)&&k.length>0||(w(!0),S([]),a&&Y(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${I?.token}`}}).then(e=>{e.ok?e.json().then(e=>{S(te(e,d,e)),w(!1)}):Y("Erro ao carregar dados")}))}return J(()=>{c&&fetch(o,{method:"GET",headers:{Authorization:`Bearer ${I?.token}`}}).then(e=>{e.ok?(console.log("llll"),e.json().then(e=>{let t=te(e,d,e).filter(e=>e.id===c);t.length>0?(S(te(e,d,e)),w(!1),v.setValue(r,c),M(t[0])):Y("Erro ao carregar dados. Valor inválido")})):Y("Erro ao carregar dados")})},[]),J(()=>{g&&Oo&&(V(g),v.setValue(r,g.id),p(g.id))},[g]),c&&k.length<=0&&!O?t(n,{item:!0,xs:f,sm:h,md:y,children:t(m,{size:"small",fullWidth:!0,placeholder:E,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,md:y,children:[i&&t(u,{required:s,children:i}),t("input",{type:"text",...v?.register(r,{validate:(e,t)=>{if(e.length<=0&&s)return"Este campo é obrigatório"}}),hidden:!0}),t(C,{value:D,loading:x,loadingText:E,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(Oo=!1,e)return V(e),v.setValue(r,e.id),void p(e.id);V(null),v.setValue(r,""),p(void 0)}(t),renderInput:e=>t(m,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:A,error:!!te(v.formState.errors,r),helperText:te(v.formState.errors,r)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}const Do=/*#__PURE__*/U.forwardRef(function(e,r){const{onChange:n,maskProps:o,onMask:i,maskValue:a,setMaskValue:l,watchValue:s,...c}=e,[d,u]=H(o.mask);delete c.value;const m=Q(null),[p,f]=H(""),h=se();return J(()=>{s&&f(s)},[s]),J(()=>{h.setValue(c.name,m.current.element.value)},[p]),delete c.watchValue,t(xe,{...c,...o,mask:d,value:p,ref:m,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{f(e),t.updateValue(),i&&i(e,u)}})});function Vo(e){const n=X(at),[o,i]=H("");return t(r,{children:t(m,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:Do,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function Io({type:r="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:p=!1,watchValue:f,...h}){const g=se();return J(()=>{void 0!==f&&g.setValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&t(u,{htmlFor:"campo",required:h.required,children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.formState.errors,h.name),a=i?.message,d=!!i,u={...g?.register(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if("cnpj"===r){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&h.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===r||"password"===r||"number"===r){if(n.length>s)return`Limite máximo de ${s} caracteres`;if(n.length<l&&h.required)return`Limite mínimo de ${l} caracteres`}else if("email"===r){if(n.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===r){if((n.length<14||n.length>14&&n.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===r&&n.length<14&&h.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white"}};switch(r){case"input":case"email":return t(m,{...u,defaultValue:c,disabled:p});case"password":return t(m,{...u,type:"password",disabled:p});case"number":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:f,disabled:p});case"cep":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:f,disabled:p});case"phone":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:f,disabled:p});case"sei":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:p});case"cpf_cnpj":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00[0]"},onMask:(e,t)=>{t(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:f,disabled:p});case"cpf":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:f,disabled:p});case"cnpj":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:f,disabled:p});case"rg":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:f,disabled:p})}})()]})}var Ao=/*#__PURE__*/U.memo(Io);function To({name:r,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:p=255,md:f,...h}){const g=se();return J(()=>{g.setValue(r,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),t(m,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.register(r,{validate:(e,t)=>o&&e.length<=0?"Este campo é obrigatório":e.length>p?`Limite máximo de ${p} caracteres`:e.length<u&&o?`Limite mínimo de ${u} caracteres`:void 0}),error:!!te(g.formState.errors,r),helperText:te(g.formState.errors,r)?.message,sx:{bgcolor:"white"},placeholder:a||i})]})}function jo({name:r,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:p=255,md:f,...h}){const g=X(at);return J(()=>{g.formSetValue(r,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),t(m,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.formRegister(r,{validate:(e,t)=>o&&e.length<=0?"Este campo é obrigatório":e.length>p?`Limite máximo de ${p} caracteres`:e.length<u&&o?`Limite mínimo de ${u} caracteres`:void 0}),error:!!te(g.errors,r),helperText:te(g.errors,r)?.message,sx:{bgcolor:"white"},placeholder:a||i})]})}function No({name:r,required:o=!1,xs:l=12,sm:s,md:d}){const u=X(at),p=`switch-${r}`;return J(()=>{u.formWatch(p)||u.formSetValue(r,void 0)},[u]),t(n,{item:!0,xs:l,sm:s,md:d,children:e(a,{direction:"row",children:[t(i,{children:t(c,{size:"small",...u.formRegister(p),sx:{paddingLeft:0,margin:0}})}),u.formWatch(p)?t(m,{size:"small",...u.formRegister(r,{validate:(e,t)=>{if(!0===u.formWatch(p)&&(!e||e.length<=0&&o))return"Este campo não pode ser vazio"}}),required:!0,error:!!te(u.errors,r),helperText:te(u.errors,r)?.message,placeholder:"Outro"}):t(m,{size:"small",disabled:!0,placeholder:"Outro"})]})})}const $o=(e,t)=>{if(!e||Object.keys(e).length<=0)return[];if(!e[t])return[];let r=Object.keys(e[t]).map(e=>`${t}.${e}`);return e.files&&(r=[...r,...Object.keys(e.files).map(e=>`files.${e}`)]),r};function Ro({debugLog:r=!1,test:n=!1,testConfig:o={},customMarginBottom:s=10,...c}){c.children=Array.isArray(c.children)?c.children.filter((e,t)=>e):c.children;const d=Array.isArray(c.children)?c.children.length:1,u=X(at),m=Q(null),p=f(),[g,y]=H(0),b=(Array.isArray(c.children)?c.children:[c.children]).map((e,t)=>/*#__PURE__*/U.cloneElement(e,{...e.props,prefix:t})),v=d;return e(i,{children:[n&&t(a,{direction:"row",justifyContent:"end",children:t(l,{variant:"contained",color:"error",onClick:()=>{Object.keys(o).forEach((e,t)=>{const r=o[Number(e)];Object.keys(r).forEach(t=>{u.formUnregister(`${e}.${t}`),u.formSetValue(`${e}.${t}`,r[t])}),t<Object.keys(o).length-1&&new Promise(e=>setTimeout(e,100)).then(()=>{m.current?.click()})})},children:"EXCLUIR BANCO PRODUÇÃO"})}),e(a,{sx:{padding:2,marginBottom:s},children:[t(i,{children:b.map((e,r)=>t(i,{hidden:!(g===r),children:b[r]},"formsB"+r))}),t(w,{variant:"text",steps:v,position:h(p.breakpoints.only("xs"))?"bottom":"static",activeStep:g,sx:{paddingTop:2,paddingBottom:4,paddingX:0},backButton:t(l,{variant:"contained",startIcon:t(we,{}),onClick:()=>{y(e=>e-1)},disabled:0===g,sx:{textTransform:"none"},children:"Voltar"}),nextButton:g<v-1?t(l,{variant:"contained",endIcon:t(ke,{}),onClick:function(){try{return r&&console.log(u.formGetValues()),Promise.resolve(u.formTrigger($o(u.formGetValues(),g))).then(function(e){e?y(e=>e+1):Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"})})}catch(e){return Promise.reject(e)}},sx:{textTransform:"none"},ref:m,children:"Próximo"}):t(i,{children:t(Ee,{variant:"contained",type:"submit",loading:u.submiting,loadingPosition:"start",startIcon:t(Se,{}),onClick:e=>function(e){try{return Promise.resolve(u.formTrigger($o(u.formGetValues(),g))).then(function(t){t||(e.preventDefault(),Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"}))})}catch(e){return Promise.reject(e)}}(e),sx:{textTransform:"none",backgroundColor:"#22C55E","&:hover":{backgroundColor:"#48cf7a"}},children:t("span",{children:"Salvar"})})})})]})]})}var Po=/*#__PURE__*/U.memo(Ro);function Fo(e,t,r){if(!e.props)return e;const n=e.props.children;if(!n)/*#__PURE__*/return U.cloneElement(e,{...e.props,name:`${t}.${e.props.name}`,key:e.props.name?`${t}.${e.props.name}`:`noListing-${r}-${t}-${e.props.name}`});let o;if(Array.isArray(n)){let e=[];n.forEach((n,o)=>{e.push(Fo(n,t,r+(o+1)))}),o=e}else o=Fo(n,t,r+1);/*#__PURE__*/return U.cloneElement(e,{...e.props,children:o,name:`${t}.${e.props.name}`,key:e.props.name?`${t}.${e.props.name}`:`noListing-${r}-${t}-${e.props.name}`})}function zo({optional:o=!1,title:l,prefix:s=0,optionalMessage:c,defaultChecked:d,...u}){const m=X(at),p=`switch-${s}`,f=(Array.isArray(u.children)?u.children:[u.children]).map((e,t)=>e&&Fo(e,s,t));return e(i,{children:[t(n,{item:!0,xs:12,children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",spacing:2,children:[t(i,{sx:{marginTop:.6},children:t(a,{sx:{backgroundColor:"#E6F8EB",borderRadius:"100%",height:"35px",width:"35px"},justifyContent:"center",alignItems:"center",children:t(Me,{sx:{height:"18px",fill:"#01BA35"}})})}),t(ee,{variant:"h6",fontWeight:600,fontSize:28,fontFamily:"Inter",sx:{color:"#1E293B",paddingBottom:4},children:l})]}),t(i,{hidden:!o,children:t(fo,{name:p,defaultChecked:!o||d,overrideNo:u.overrideSwitchNo,overrideYes:u.overrideSwitchYes})})]})}),t(a,{spacing:2,children:o?m.formWatch(p)?t(n,{container:!0,spacing:1,children:f}):t(a,{justifyContent:"center",alignItems:"center",children:t(ee,{fontFamily:"Inter",fontSize:22,paddingY:8,textAlign:"center",children:c||e(r,{children:[t("b",{children:l})," é opcional. ",t("br",{}),"Marque a opção acima caso haja necessidade."]})})}):t(n,{container:!0,spacing:1,children:f})})]})}var Lo=/*#__PURE__*/U.memo(zo);let Wo={open:()=>{},close:()=>{},openReparented:()=>{},reparent:()=>t(r,{})};function Bo(){const[n,l]=H(!1),[s,c]=H(null),d=()=>l(!1);Q(null);const u=f(),m=h(u.breakpoints.up("sm")),[p,g]=H({}),[y,b]=H(-1321465654);return J(()=>{Wo.open=e=>{e&&c(e),b(-1321465654),l(!0)},Wo.reparent=(e,n)=>(g(o=>({...o,[n]:t(r,{children:e})})),t(r,{})),Wo.openReparented=e=>{b(e),c(null),l(!0)},Wo.close=d},[l]),t(r,{children:m?t(S,{open:n,onClose:d,children:e(i,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",borderRadius:2,bgcolor:"white",border:"1px solid #454545",boxShadow:24},children:[t(i,{onClick:d,width:"fit-content",height:"fit-content",position:"absolute",right:0,top:0,margin:.6,sx:{":hover":{transform:"scale(1.03)",transition:"all 500ms",cursor:"pointer"}},children:t(Re,{sx:{transform:"scale(.9)"}})}),e(i,{overflow:"auto",maxHeight:"90vh",p:2,marginTop:4,borderTop:"solid 1px gray",bgcolor:"#F9F9F9",borderRadius:2,children:[s,p[y]]})]})}):e(k,{anchor:"bottom",open:n,onClose:d,onOpen:()=>{},PaperProps:{sx:{bgcolor:"transparent"}},children:[t(a,{direction:"row",onClick:d,maxHeight:"8vh",height:"8vh",justifyContent:"center",alignItems:"center",children:t(o,{fontWeight:600,color:"white",children:"Clique fora para fechar"})}),e(i,{p:2,maxHeight:"92vh",bgcolor:"white",overflow:"auto",children:[s,p[y]]})]})})}function _o({customColor:e="#383838",customFontColor:r="white",...n}){const o=Pe(e);return t(l,{...n,sx:{bgcolor:o.toHexString(),color:Pe(r).toHexString(),":hover":{bgcolor:o.darken(10).toHexString()},boxShadow:"none",borderRadius:3,textTransform:"capitalize",paddingX:2},size:"small",children:n.children})}function qo({data:n=[],...o}){const[i,a]=U.useState(null),l=Boolean(i),s=()=>{a(null)};return e(r,{children:[t(_o,{...o.btProps,onClick:e=>{a(e.currentTarget)},children:o.children}),t(E,{id:"basic-menu",anchorEl:i,open:l,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:n.map(e=>t(Y,{onClick:t=>{e.onClick&&e.onClick(),s()},children:e.name}))})]})}function Uo(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function Ko(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}let Xo=[],Go=!1,Ho="",Jo=!1,Zo={},Qo="";function ei({mediaQueryLG:n,columns:o,emptyMsg:s={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:c="",tableName:d="Dados",csv:u,columnSize:m,action:p,useKC:y=!0,statusKeyName:v="",csvExcludeKeys:x=[],csvExcludeKeysCSV:C=[],csvExcludeKeysAll:w=[],csvCustomKeyNames:k={},csvExcludeValidate:S=(e,t)=>!1,csvButtonTitle:E="Salvar .CSV",csvNoZipText:Y="Salvar .CSV",csvAllButtonTitle:I="Salvar todos em CSV",removeQuotes:A=!1,normalize:T=!1,csvShowAllButton:j=!1,csvWithoutZip:N=!1,itemCount:$=10,csvUpper:B=!1,csvZipFileNamesKey:q="",generateCsvZip:U=!1,hideTitleCSV:K=!1,csvExcludeUpper:Z=[],multipleDataPath:re="",expandTextMaxLength:ne=50,collapsedSize:oe=53,customMargin:ie=4,customMarginMobile:le=0,filtersFunc:se,filters:ce=[],orderBy:de=[],customErrorMsg:ue,customTableStyle:me={},id:pe,initialData:fe=null,isLoading:he,alwaysExpanded:ge=!1}){const[ye,be]=H(null),[ve,xe]=H(fe),{user:Ce,userLoaded:we}=X(ot),[ke,Se]=H([]),[Ee,Ye]=H([]),[Oe,Me]=H($),[Re,Pe]=H(0),[Fe,ze]=H(1),[Le,We]=H(1);H("");const[Be,_e]=H({}),[qe,Ue]=H({}),[Ke,Xe]=H({}),[Ge,He]=H("filterKey"),Je=f(),Ze=h(Je.breakpoints.only("xs")),Qe=Q(null),et=h(Je.breakpoints.up(2e3));Ho=`tableFilter_${pe}`,Qo=`tableFilterCache_${pe}`,Zo=se??{},localStorage.getItem(Qo)||localStorage.setItem(Qo,JSON.stringify(ce)),localStorage.getItem(Qo)!==JSON.stringify(ce)&&(localStorage.setItem(Qo,JSON.stringify(ce)),localStorage.removeItem(Ho));const tt=G(e=>{if(e.length<=0)return 1;let t=e.length/Oe;return t=t<1?1:t,Math.ceil(t)},[Oe]),rt=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,c):void 0,[]);J(()=>{if(ye||!rt(ve))return;const e=rt(ve);Se(e),Ye(e),ze(tt(e)),localStorage.getItem(Ho)&&dt(JSON.parse(localStorage.getItem(Ho)))},[Oe,ve,tt,ye]),J(()=>{Pe(Le-1)},[Le]);const nt=G((e,t)=>{We(t)},[]),it=G(()=>{const e=Re*Oe;return ke.slice(e,e+Oe)},[ke,Oe,Re]),at=G((e,t=!1)=>{if(e.preventDefault(),ke.length<=0)return;const r=Object.keys(ke[0]);if(U&&t){const e=r.filter(e=>!x.includes(e)),t=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=new $e,i={};ke.forEach(e=>{i[e[q]]||(i[e[q]]=[]),i[e[q]].push(e)}),Object.keys(i).forEach(n=>{const a=[];i[n].forEach(t=>{let n=!0;if(r.forEach(e=>{S(e,t[e])&&(n=!1)}),n){const r=e.map(e=>{if("string"==typeof t[e]){let r=B?t[e].toUpperCase():t[e];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=lt(t[e]).slice(1,-1),n=B&&!Z.includes(e)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return t[e]}).join(",");a.push(r)}});const l=K?a.join("\n"):"\ufeff"+t+a.join("\n");a.length>0&&o.file(`${n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}.csv`,l)});var n=window.document.createElement("a");o.generateAsync({type:"base64"}).then(e=>{n.setAttribute("href","data:application/zip;base64,"+e),n.setAttribute("download",`${u?.fileName}.zip`),n.click()})}else{let e=r.filter(e=>!C.includes(e)).map(e=>e===re?"hrTermino":e);""!==re&&(e=["dtInicio","hrInicio",...e]);const t=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=[];ke.forEach(t=>{let n=!0;if(r.forEach(e=>{S(e,t[e])&&(n=!1)}),n){const r=e.map(e=>{if("dtInicio"===e)return"{dtInicio}";if("hrInicio"===e)return"{hrInicio}";if("hrTermino"===e)return"{hrTermino}";if("string"==typeof t[e]){let r=B&&!Z.includes(e)?t[e].toUpperCase():t[e];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=lt(t[e]).slice(1,-1),n=B&&!Z.includes(e)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return t[e]}).join(",");if(""!==re){const e=t[re];e&&e.forEach(e=>{o.push(r.replace("{dtInicio}",e.dtInicio).replace("{hrInicio}",e.hrInicio).replace("{hrTermino}",e.hrTermino))})}else o.push(r)}});const i=t+o.join("\n");(n=window.document.createElement("a")).setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(i)),n.setAttribute("download",`${u?.fileName}.csv`),n.click()}},[ke]);function lt(e){let t=[];if("object"==typeof e&&!Array.isArray(e)&&null!==e)for(let[r,n]of Object.entries(e))"object"!=typeof n||Array.isArray(n)||null===n?n&&t.push(r):t.push(r+": "+lt(n));return"["+t.join(" - ")+"]"}const st=G(e=>{if(e.preventDefault(),ke.length<=0)return;const t=Object.keys(ke[0]).filter(e=>!w.includes(e)),r=t.join(",")+"\n",n=ke.map(e=>t.map(t=>{if("tbRa"===t)return e[t].NO_CIDADE;if("rlEventoData"===t)return`${e[t][0].DT_INICIO} - ${e[t][0].HR_INICIO}`;if("string"==typeof e[t]){let r=B&&!Z.includes(t)?e[t].toUpperCase():e[t];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof e[t]&&!Array.isArray(e[t])&&null!==e[t]){let r=lt(e[t]).slice(1,-1),n=B&&!Z.includes(t)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return e[t]}).join(",")).join("\n"),o=r+n;var i=window.document.createElement("a");i.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(o)),i.setAttribute("download",`${u?.fileName}.csv`),i.click()},[ke]);function ct(){Se(Xo),Ye(Xo),ze(tt(Xo)),Pe(0),We(1),localStorage.removeItem(Ho),He((new Date).getTime().toString())}function dt(e){if(!Xo)return;let t=JSON.parse(JSON.stringify(Xo));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let r=[];switch(e.type){case"number":switch(e.operator){case"igual":t.forEach(t=>{Number(te(t,e.keyName,""))===Number(e.value)&&r.push(t)});break;case"maior que":t.forEach(t=>{Number(te(t,e.keyName,""))>Number(e.value)&&r.push(t)});break;case"menor que":t.forEach(t=>{Number(te(t,e.keyName,""))<Number(e.value)&&r.push(t)})}break;case"string":switch(console.log("ata: ",e.operator),e.operator){case"igual":t.forEach(t=>{const n=te(t,e.keyName,"");e.useList?Ko(n)===Ko(e.value.id)&&r.push(t):Ko(n)===Ko(e.value)&&r.push(t)});break;case"contem":t.forEach(t=>{const n=te(t,e.keyName,"");n&&(e.useList?Ko(n).includes(Ko(e.value.id))&&r.push(t):Ko(n).includes(Ko(e.value))&&r.push(t))});break;case"tem um dos":t.forEach(t=>{const n=te(t,e.keyName,"");n&&e.value.map(e=>Ko(e.id)).includes(Ko(n))&&r.push(t)})}break;case"date":switch(e.operator){case"data exata":t.forEach(t=>{const n=ae(te(t,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");t.forEach(t=>{const i=ae(te(t,e.keyName,""),"DD/MM/YYYY");(i.isAfter(n)||i.isSame(n))&&(i.isBefore(o)||i.isSame(o))&&r.push(t)})}break;case"dates":switch(e.operator){case"data inicio":t.forEach(t=>{const n=Zo[e.customFunc](te(t,e.keyName,""))??[];n.length<=0||ae(n[0],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"data fim":t.forEach(t=>{const n=Zo[e.customFunc](te(t,e.keyName,""))??[];n.length<=0||ae(n[n.length-1],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"tem a data":t.forEach(t=>{(Zo[e.customFunc](te(t,e.keyName,""))??[]).includes(e.value)&&r.push(t)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");t.forEach(t=>{const i=Zo[e.customFunc](te(t,e.keyName,""))??[];let a=!1;i.forEach(e=>{if(a)return;const t=ae(e,"DD/MM/YYYY");t.isValid()&&(t.isAfter(n)||t.isSame(n))&&(t.isBefore(o)||t.isSame(o))&&(a=!0)}),a&&r.push(t)})}}t=r}),Se(t),ze(tt(t)),Pe(0),We(1),localStorage.setItem(Ho,JSON.stringify(e)),Ye(t)}return J(()=>{const e=Re*Oe,t=ke.slice(e,e+Oe);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n?.keyName,"")??"Não Informado").toString().length>=ne})}),Ue(r)},[ke,Oe,Re]),J(()=>{console.log(Qe.current)},[Qe.current]),ye?t(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(ee,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===ye.status&&"Acesso negado",500===ye.status&&e(i,{fontWeight:500,textAlign:"center",children:[t(R,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),t(i,{children:ue||e(r,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",t("br",{}),t("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",t("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})}):he?t(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[t(P,{sx:{fill:"#5e5e5e"}}),e(ee,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",d]})]}),t(g,{color:"inherit"}),Array(10).fill("").map(r=>t(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(r=>e(i,{children:[t(O,{width:60}),t(O,{width:120})]}))}))]})}):!we&&y?t(g,{}):e(r,{children:[e(i,{marginX:Ze?le:ie,bgcolor:"white",p:2,borderRadius:6,...me,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[t(Ne,{InputProps:{startAdornment:t(Ae,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){console.log(Ee);const t=e.target.value;if(""===t)return Se(Ee),void ze(tt(rt(ke)));const r=rt(ke),n=[];r.forEach(e=>{const r=[];if(Object.keys(e).map(t=>{let n=te(e,t,"")??"";"number"==typeof n&&(n=n.toString()),"string"==typeof n&&r.push(n)}),r.length<=0)return;let o=!1;r.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(t.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(t.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(t.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(t.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(t.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(t.toLowerCase())||"pre aprovado".includes(t.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(t.toLowerCase())&&(o=!0))}Uo(e.toLowerCase()).includes(Uo(t.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),Se(n),ze(tt(n)),Pe(0),We(1)},fullWidth:!0,placeholder:`Pesquisar ${d}`}),ce.length>0&&t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>Wo.open(t(ti,{reset:ct,filtrar:dt,baseFilters:[...ce],filters:localStorage.getItem(Ho)?JSON.parse(localStorage.getItem(Ho)):[...ce]},Ge)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:t(a,{direction:"row",borderRadius:5,padding:0,children:t("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[t(qo,{data:de.map(e=>({name:e.label,onClick:()=>function(e){let t=[...ke];t.sort((t,r)=>{const n="string"===e.type?te(t,e.key,""):Number(te(t,e.key,0)),o="string"===e.type?te(r,e.key,""):Number(te(r,e.key,0));if(Jo){if(n<o)return-1;if(n>o)return 1}else{if(n>o)return-1;if(n<o)return 1}return 0}),Jo=!Jo,Se(t)}(e)})),btProps:{startIcon:t(z,{}),fullWidth:!0},children:"Ordenar"}),t(l,{variant:"contained",fullWidth:!0,startIcon:t(Go?_:z,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let t=0;t<$;t++)e[t]=!Go;Xe(e),_e(e),Go=!Go},children:Go?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(ee,{fontWeight:600,textAlign:"end",children:["Registro de ",d,"s"]}),t(a,{justifyContent:"center",children:e(ee,{children:["Exibindo ",Re*Oe+1,"-",Re*Oe+1+it().length-1," de ",ke.length]})})]})]}),localStorage.getItem(Ho)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(Ho)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(r=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[t(ee,{fontWeight:700,children:r.label}),t(ee,{fontStyle:"italic",children:r.operator}),t(ee,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(r.value)?r.value.map(e=>e.label).join(" - "):"object"==typeof r.value?r.value.label:"entre"===r.operator?`${r.value?r.value:"Antes"} e ${r.value2?r.value2:"Depois"}`:r.value.toString()}),t(M,{onClick:e=>{let t=JSON.parse(localStorage.getItem(Ho)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),dt(t)},size:"small",sx:{padding:0},children:t(De,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:it().length<=0?t(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:t(ee,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:Ce?s.user:s.public})}):it().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:ge?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Te,{container:!0,spacing:Ze?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Te,{item:!0,xs:12,md:et?12/m*(o.size?o.size:1):n?n.all:12/m*(o.size?o.size:1),sx:{overflow:"hidden"},children:[t(i,{sx:{width:"max-content",paddingX:1},children:t(ee,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),t(i,{paddingLeft:1,position:"relative",children:t(D,{in:ge||!0===Be[c],collapsedSize:ge?"auto":oe,onExited:e=>Xe(e=>({...e,[c]:!1})),children:t(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(te(s,o.keyName),s):e(r,{children:[t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")}),t(i,{position:"absolute",top:0,children:ge||Ke[c]?te(s,o?.keyName,""):(te(s,o?.keyName,"")??"").toString().length>=ne?t(r,{children:(te(s,o?.keyName,"")??"").toString().substring(0,ne)+"..."}):te(s,o?.keyName,"")})]})})})})]},String(o?.keyName)+c)),t(Te,{item:!0,xs:12,md:et?12/m:n?n.action:12/m,children:t(a,{direction:"row",alignItems:"center",justifyContent:Ze?"start":"flex-end",sx:{height:"100%",paddingBottom:Ze?2:0},children:p(s)})}),qe[c]&&!ge&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{_e(e=>({...e,[c]:!e[c]})),Xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(Be[c]?L:W,{}),children:Be[c]?"Ver Menos":"Ver Mais"})})]})},c))}),it().length>0&&t(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:u&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[N&&t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:at,sx:{backgroundColor:"#5a88b0",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:Y}),j&&t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:st,sx:{backgroundColor:"#64748B",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:I}),t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>at(e,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:E})]})})]}),t(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[t(l,{onClick:e=>We(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t(je,{renderItem:e=>"page"===e.type?t(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:t(V,{...e}),count:Fe,siblingCount:Ze?0:6,size:"large",onChange:nt,page:Le,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),t(l,{onClick:e=>We(e=>e<Fe?e+1:Fe),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5)"}})})]})})]})}function ti({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,m]=H(!1),[p,f]=U.useState(null),h=Boolean(p);return e(i,{width:{xs:"inherit",md:850},children:[t(E,{open:h,onClose:()=>{f(null)},anchorEl:p,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(B,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Wo.close()},children:"Limpar"})]}),t(i,{marginBottom:1,children:t(I,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),t(a,{children:u?c.map((e,r)=>t(ri,{filterValue:e,setReset:m,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}})):t(i,{children:c.map((e,r)=>t(ri,{filterValue:e,setReset:m,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}}))})}),t(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:t(l,{variant:"contained",color:"success",startIcon:t(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Wo.close()},children:"Filtrar"})})]})}function ri({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=f(),u=h(d.breakpoints.only("xs"));return J(()=>{n(s)},[s]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!u&&t(ee,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:r.label}),e(A,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(T,{onChange:e=>{const t=e.target.value;c(e=>({...e,operator:t,value:""})),l(t)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:r.operators.map(e=>t(Y,{value:e,children:e}))})]}),t(ni,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function ni({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t(Ne,{type:"number",size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(n.useList)switch(o){case"tem um dos":return t(C,{multiple:!0,id:"tags-standard",onChange:(e,t)=>{a(t.length<=0?"":t)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>t(Ne,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return t(i,{width:"100%",children:t(C,{options:n.useList,onChange:(e,t)=>{a(t)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,t)=>e.label===t.label,renderInput:e=>t(Ne,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t(Ne,{size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(o){case"data exata":case"data fim":case"data inicio":case"tem a data":return t(re,{adapterLocale:"pt-br",dateAdapter:ie,children:t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Ne,{...e,size:"small",fullWidth:!0})})});case"entre":return e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Ne,{...e,size:"small",fullWidth:!0})}),t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?ae(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Ne,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}var oi=/*#__PURE__*/U.memo(ei);function ii({customErrorMsg:n,error:a}){return t(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(o,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===a.status&&"Acesso negado",500===a.status&&e(i,{fontWeight:500,textAlign:"center",children:[t(R,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),t(i,{children:n||e(r,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",t("br",{}),t("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",t("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})})}function ai({tableName:r}){return t(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[t(P,{sx:{fill:"#5e5e5e"}}),e(ee,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",r]})]}),t(g,{color:"inherit"}),Array(10).fill("").map(r=>t(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(r=>e(i,{children:[t(O,{width:60}),t(O,{width:120})]}))}))]})})}const li=(e,t)=>{if(e.length<=0)return 1;let r=e.length/t;return r=r<1?1:r,Math.ceil(r)};function si(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function ci(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function di({filterData:e,startData:t,filtersFuncData:r={},localTableName:n="",setCurrentPage:o,setList:i,setListClone:a,setListPage:l,setPagCount:s,itemsCount:c}){if(!t)return;let d=JSON.parse(JSON.stringify(t));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let t=[];switch(e.type){case"number":switch(e.operator){case"igual":d.forEach(r=>{Number(te(r,e.keyName,""))===Number(e.value)&&t.push(r)});break;case"maior que":d.forEach(r=>{Number(te(r,e.keyName,""))>Number(e.value)&&t.push(r)});break;case"menor que":d.forEach(r=>{Number(te(r,e.keyName,""))<Number(e.value)&&t.push(r)})}break;case"string":switch(e.operator){case"igual":d.forEach(r=>{const n=te(r,e.keyName,"");e.useList?ci(n)===ci(e.value.id)&&t.push(r):ci(n)===ci(e.value)&&t.push(r)});break;case"contem":d.forEach(r=>{const n=te(r,e.keyName,"");n&&(e.useList?ci(n).includes(ci(e.value.id))&&t.push(r):ci(n).includes(ci(e.value))&&t.push(r))});break;case"tem um dos":d.forEach(r=>{const n=te(r,e.keyName,"");n&&e.value.map(e=>ci(e.id)).includes(ci(n))&&t.push(r)})}break;case"date":switch(e.operator){case"data exata":d.forEach(r=>{const n=ae(te(r,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"entre":const r=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),n=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(o=>{const i=ae(te(o,e.keyName,""),"DD/MM/YYYY");(i.isAfter(r)||i.isSame(r))&&(i.isBefore(n)||i.isSame(n))&&t.push(o)})}break;case"dates":switch(e.operator){case"data inicio":d.forEach(n=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||ae(o[0],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(n)});break;case"data fim":d.forEach(n=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||(console.log(o),ae(o[o.length-1],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(n))});break;case"tem a data":d.forEach(n=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.includes(e.value)&&t.push(n)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(i=>{const a=(r[e.customFunc](te(i,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);let l=!1;a.forEach(e=>{if(l)return;const t=ae(e,"DD/MM/YYYY");t.isValid()&&(t.isAfter(n)||t.isSame(n))&&(t.isBefore(o)||t.isSame(o))&&(l=!0)}),l&&t.push(i)})}}d=t}),i(d),s(li(d,c)),o(0),l(1),localStorage.setItem(n,JSON.stringify(e)),a(d)}function ui({order:e,list:t,orderAsc:r=!1}){const n=Fe(t).sort((t,n)=>{const o="string"===e.type?te(t,e.key,""):Number(te(t,e.key,0)),i="string"===e.type?te(n,e.key,""):Number(te(n,e.key,0));if(r){if(o<i)return-1;if(o>i)return 1}else{if(o>i)return-1;if(o<i)return 1}return 0});return n}function mi({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,m]=H(!1),[p,f]=U.useState(null),h=Boolean(p);return e(i,{width:{xs:"inherit",md:850},children:[t(E,{open:h,onClose:()=>{f(null)},anchorEl:p,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(B,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Wo.close()},children:"Limpar"})]}),t(i,{marginBottom:1,children:t(I,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),t(a,{children:u?c.map((e,r)=>t(pi,{filterValue:e,setReset:m,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}})):t(i,{children:c.map((e,r)=>t(pi,{filterValue:e,setReset:m,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}}))})}),t(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:t(l,{variant:"contained",color:"success",startIcon:t(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Wo.close()},children:"Filtrar"})})]})}function pi({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=f(),u=h(d.breakpoints.only("xs"));return J(()=>{n(s)},[s]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!u&&t(ee,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:r.label}),e(A,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(T,{onChange:e=>{const t=e.target.value;c(e=>({...e,operator:t,value:""})),l(t)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:r.operators.map(e=>t(Y,{value:e,children:e}))})]}),t(fi,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function fi({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t(Ne,{type:"number",size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(n.useList)switch(o){case"tem um dos":return t(C,{multiple:!0,id:"tags-standard",onChange:(e,t)=>{a(t.length<=0?"":t)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>t(Ne,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return t(i,{width:"100%",children:t(C,{options:n.useList,onChange:(e,t)=>{a(t)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,t)=>e.label===t.label,renderInput:e=>t(Ne,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t(Ne,{size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(o){case"data exata":case"data fim":case"data inicio":case"tem a data":return t(re,{adapterLocale:"pt-br",dateAdapter:ie,children:t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Ne,{...e,size:"small",fullWidth:!0})})});case"entre":return e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Ne,{...e,size:"small",fullWidth:!0})}),t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?ae(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Ne,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}let hi=!1,gi="",yi={},bi="";function vi({mediaQueryLG:n,columns:o,csvConfig:s,fetchFunc:c,emptyMsg:d={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:u="",tableName:m="Dado",columnSize:p,action:y,useKC:v=!0,itemCount:x=10,expandTextMaxLength:C=50,collapsedSize:w=53,customMargin:k=4,customMarginMobile:S=0,filtersFunc:E,filters:Y=[],orderBy:O=[],customErrorMsg:I,customTableStyle:A={},id:T,initialData:j=null,isExpandable:N=!0,alwaysExpanded:$=!1}){const[R,P]=H(!1),[B,q]=H(null),[U,K]=H(j),{user:Z,userLoaded:re}=X(ot),[ne,oe]=H([]),[ie,ae]=H([]),[le,se]=H(x),[ce,de]=H(0),[ue,me]=H(1),[pe,fe]=H(1),[he,ge]=H({}),[ye,be]=H({}),[ve,xe]=H({}),[Ce,we]=H("filterKey"),ke=f(),Se=h(ke.breakpoints.only("xs")),Ee=Q(U),Ye=Q("true"===localStorage.getItem(`order-${T}`)||!1),Oe=h(ke.breakpoints.up(2e3));gi=`tableFilter_${T}`,bi=`tableFilterCache_${T}`,yi=E??{},localStorage.getItem(bi)||localStorage.setItem(bi,JSON.stringify(Y)),localStorage.getItem(bi)!==JSON.stringify(Y)&&(localStorage.setItem(bi,JSON.stringify(Y)),localStorage.removeItem(gi)),J(()=>{q(null),c&&(!re&&v||(P(!0),c().then(e=>e.ok?e.json().then(e=>{if(204===e.statusCode)K({body:{data:[]}}),Ee.current=[];else if(403===e.statusCode)q({status:e.statusCode});else{let t=u?te(e,u):e;if(t&&Array.isArray(t)){let e=t;if(localStorage.getItem(`order-data-${T}`))try{e=ui({order:JSON.parse(localStorage.getItem(`order-data-${T}`)),list:t,orderAsc:Ye.current})}catch(e){console.log(e)}else O.length>0&&(e=ui({order:O[0],list:t,orderAsc:Ye.current}));K(e),Ee.current=JSON.parse(JSON.stringify(e))}else K({body:{data:[]}}),Ee.current=[]}P(!1)}):(q({status:500}),void P(!1))).catch(e=>{q({status:500})})))},[re,c]);const Me=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]);J(()=>{if(R||B||!Me(U))return;let e=Me(U);oe(e),ae(e),me(li(e,le)),localStorage.getItem(gi)&&di({filterData:JSON.parse(localStorage.getItem(gi)),filtersFuncData:yi,localTableName:gi,setCurrentPage:de,setList:oe,setListClone:ae,setListPage:fe,setPagCount:me,startData:Ee.current,itemsCount:le})},[le,R,U,B]),J(()=>{de(pe-1)},[pe]);const $e=G((e,t)=>{fe(t)},[]),Re=G(()=>{const e=ce*le;return ne.slice(e,e+le)},[ne,le,ce]);function Pe(){oe(Ee.current),ae(Ee.current),me(li(Ee.current,le)),de(0),fe(1),localStorage.removeItem(gi),we((new Date).getTime().toString())}J(()=>{const e=ce*le,t=ne.slice(e,e+le);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n.keyName,"")??"Não Informado").toString().length>=C})}),be(r)},[ne,le,ce]);const Fe=(e,t=!1)=>{s&&function(e,t,r){try{if(e.length<=0)return Promise.resolve();let n=[];t.downloadAll&&t.customAll?n=t.customAll(e,r):!t.downloadAll&&t.customFiltered?n=t.customFiltered(e,r):e.forEach(e=>{const o={};t.map.forEach(n=>{if(n.useFilterValue&&!t.downloadAll&&!n.onlyAll){const t=r.filter(e=>e.label==n.useFilterValue.label&&n.useFilterValue.operators.includes(e.operator)),i=t.length>0&&t.reduce(e=>e.value).value||void 0;return void(o[n.name]=i||te(e,n.key))}n.onlyFilter||(o[n.name]=te(e,n.key))}),n.push(o)});const o=ze.utils.json_to_sheet(n),i=ze.utils.book_new();return ze.utils.book_append_sheet(i,o,t.fileName),ze.writeFile(i,`${t.fileName}.xlsx`),Promise.resolve()}catch(e){return Promise.reject(e)}}(e,{...s,...t?{downloadAll:!0}:{}},JSON.parse(localStorage.getItem(gi)??"[]")||[])},Le=e=>{di({filterData:e,filtersFuncData:yi,localTableName:gi,setCurrentPage:de,setList:oe,setListClone:ae,setListPage:fe,setPagCount:me,startData:Ee.current,itemsCount:le})};return B?t(ii,{customErrorMsg:I,error:B}):R?t(ai,{tableName:m}):!re&&v?t(g,{}):e(r,{children:[e(i,{marginX:Se?S:k,bgcolor:"white",p:2,borderRadius:6,...A,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[t(Ne,{InputProps:{startAdornment:t(Ae,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){const t=e.target.value;if(""===t)return oe(ie),void me(li(Me(ne),le));const r=[];ie.forEach(e=>{const n=[];if(Object.keys(e).map(t=>{let r=te(e,t,"")??"";"number"==typeof r&&(r=r.toString()),"string"==typeof r&&n.push(r)}),n.length<=0)return;let o=!1;n.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(t.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(t.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(t.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(t.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(t.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(t.toLowerCase())||"pre aprovado".includes(t.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(t.toLowerCase())&&(o=!0))}si(e.toLowerCase()).includes(si(t.toLowerCase()))&&(o=!0)}),o&&r.push(e)}),oe(r),me(li(r,le)),de(0),fe(1)},fullWidth:!0,placeholder:`Pesquisar ${m}`}),t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>Wo.open(t(mi,{reset:Pe,filtrar:e=>Le(e),baseFilters:[...Y],filters:localStorage.getItem(gi)?JSON.parse(localStorage.getItem(gi)):[...Y]},Ce)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:t(a,{direction:"row",borderRadius:5,padding:0,children:t("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[O.length>0&&t(qo,{data:O.map(e=>({name:e.label,onClick:()=>(e=>{Ye.current=!Ye.current;const t=ui({order:e,list:ne,orderAsc:Ye.current});localStorage.setItem(`order-${T}`,Ye.current.toString()),localStorage.setItem(`order-data-${T}`,JSON.stringify(e)),oe(t)})(e)})),btProps:{startIcon:t(z,{}),fullWidth:!0},children:"Ordenar"}),N&&!$&&t(l,{variant:"contained",fullWidth:!0,startIcon:t(hi?_:z,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let t=0;t<x;t++)e[t]=!hi;xe(e),ge(e),hi=!hi},children:hi?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(ee,{fontWeight:600,textAlign:"end",children:["Registro de ",m,"s"]}),t(a,{justifyContent:"center",children:e(ee,{children:["Exibindo ",ce*le+1,"-",ce*le+1+Re().length-1," de ",ne.length]})})]})]}),localStorage.getItem(gi)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(gi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(r=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[t(ee,{fontWeight:700,children:r.label}),t(ee,{fontStyle:"italic",children:r.operator}),t(ee,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(r.value)?r.value.map(e=>e.label).join(" - "):"object"==typeof r.value?r.value.label:"entre"===r.operator?`${r.value?r.value:"Antes"} e ${r.value2?r.value2:"Depois"}`:r.value.toString()}),t(M,{onClick:e=>{let t=JSON.parse(localStorage.getItem(gi)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),Le(t)},size:"small",sx:{padding:0},children:t(De,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:Re().length<=0?t(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:t(ee,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:Z?d.user:d.public})}):Re().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:$?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Te,{container:!0,spacing:Se?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Te,{item:!0,xs:12,md:Oe?12/p*(o.size?o.size:1):n?n.all:12/p*(o.size?o.size:1),sx:{overflow:"hidden"},children:[t(i,{sx:{width:"max-content",paddingX:1},children:t(ee,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),t(i,{paddingLeft:1,position:"relative",children:t(D,{in:$||!0===he[c],collapsedSize:$?"auto":w,onExited:e=>xe(e=>({...e,[c]:!1})),children:t(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(te(s,o.keyName),s):e(r,{children:[t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")}),t(i,{position:"absolute",top:0,children:$||ve[c]?te(s,o.keyName,""):(te(s,o.keyName,"")??"").toString().length>=C?t(r,{children:(te(s,o.keyName,"")??"").toString().substring(0,C)+"..."}):te(s,o.keyName,"")})]})})})})]},o.keyName+c)),t(Te,{item:!0,xs:12,md:Oe?12/p:n?n.action:12/p,children:t(a,{direction:"row",alignItems:"center",justifyContent:Se?"start":"flex-end",sx:{height:"100%",paddingBottom:Se?2:0},children:y(s)})}),ye[c]&&!$&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{ge(e=>({...e,[c]:!e[c]})),xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(he[c]?L:W,{}),children:he[c]?"Ver Menos":"Ver Mais"})})]})},c))}),Re().length>0&&t(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:s&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[JSON.parse(localStorage.getItem(gi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).length>0&&t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>Fe(ne),sx:{backgroundColor:"#a5a5a5",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Filtrados"}),t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>Fe(Ee.current,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Tabela"})]})})]}),t(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[t(l,{onClick:e=>fe(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t(je,{renderItem:e=>"page"===e.type?t(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:t(V,{...e}),count:ue,siblingCount:Se?0:6,size:"large",onChange:$e,page:pe,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),t(l,{onClick:e=>fe(e=>e<ue?e+1:ue),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5)"}})})]})})]})}var xi=/*#__PURE__*/U.memo(vi);const Ci=Le(()=>import("./Map-31d95a26.js").then(e=>e.Map),{ssr:!1});function wi({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:m,menuItems:p,paddingBottom:f=0,logoutMsg:h="Sair",logoutFunc:g,...y}){let b;u&&(b=Ge());const{user:v,login:x,logout:C,type:w}=X(ot),[k,S]=H(null),[O,D]=H(null),V=Boolean(k),I=Boolean(O),[A,T]=H(!1),$=G(e=>{S(e.currentTarget)},[]),R=G(()=>{S(null)},[]),P=G((e,t)=>{T(!0),S(null),b?b.push({pathname:t}).finally(()=>T(!1)):T(!1)},[b]);return e(r,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[t(j,{position:"relative",elevation:0,sx:{backgroundColor:"#F1F5F9",color:"black",paddingY:1,paddingX:{xs:1,md:4}},children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",md:"flex"},width:"100%"},children:[t(Xe,{href:"/",children:u?t(Ke,{src:c,alt:s,width:40,height:40}):t("img",{src:c,height:35})}),t(i,{children:t(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),t(i,{sx:{display:{xs:"flex",md:"none"}},children:n.length>0&&e(r,{children:[t(M,{onClick:$,children:t(_e,{})}),t(E,{open:V,onClose:R,anchorEl:k,children:n.map(e=>t(Y,{onClick:t=>P(t,e.path),children:t(o,{textTransform:"capitalize",children:e.name})},`navmenu${e}`))})]})}),e(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{md:"100%"}},children:[t(a,{direction:"row",spacing:2,sx:{display:{xs:"none",md:"flex"}},children:n.map(e=>t(i,{sx:{a:{color:"#2c7da0",textDecoration:"none",textTransform:"capitalize","&:hover":{color:"#90e0ef"}}},children:t(l,{onClick:t=>{return r=e.path,T(!0),void(b?b.push({pathname:r}).finally(()=>T(!1)):T(!1));var r},sx:{textTransform:"capitalize"},children:e.name})},`navigation${e.path}`))}),e(a,{direction:"row",spacing:2,children:[t(i,{children:m}),v?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[t(N,{sx:{width:30,height:30},src:v.image}),e(E,{open:I,onClose:e=>D(null),anchorEl:O,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[p,t(Y,{onClick:function(e){try{function t(){C()}D(null);const r=function(){if(g){const e=function(e,t){try{var r=Promise.resolve(g()).then(function(){})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[t(Be,{sx:{fill:"#545454"}}),t(o,{textTransform:"capitalize",children:h})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>D(e.currentTarget),sx:{userSelect:"none"},children:[t(o,{children:"Olá,"}),t(o,{fontWeight:600,children:v?.given_name}),t(We,{})]})]}):t(l,"govbr"===w?{variant:"contained",size:"small",startIcon:t(qe,{}),onClick:x,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:t(qe,{}),onClick:x,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})]})]})}),A&&t(Ue,{})]}),t(i,{paddingBottom:f})]})}function ki({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:m,menuItems:p,color:h="blue",route:g="/teste/89",paddingBottom:y=0,logoutMsg:b="Sair",customBgColor:v="#FFFFFF",logoutFunc:x,...C}){const w=f(),k=n.length<=3?"md":"lg";let S;u&&(S=Ge());const{user:O,login:D,logout:V,type:I}=X(ot),[A,T]=H(null),[$,R]=H(null),P=Boolean(A),F=Boolean($),[z,L]=H(!1),W=G(e=>{T(e.currentTarget)},[]),B=G(()=>{T(null)},[]),_=G((e,t)=>{L(!0),T(null),S?S.push({pathname:t}).finally(()=>L(!1)):L(!1)},[S]);return e(r,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[t(j,{position:"relative",elevation:0,sx:{color:w.palette.getContrastText(v),paddingX:{xs:1,[k]:4},bgcolor:v},children:e(a,{direction:"row",justifyContent:"space-between",bgcolor:v,children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",[k]:"flex"},width:"100%"},children:[t(Xe,{href:"/",children:u?t(Ke,{src:c,alt:s,width:40,height:40}):t("img",{src:c,height:35})}),t(i,{children:t(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),t(a,{direction:"row",width:"100%",justifyContent:"center",alignItems:"center",spacing:2,sx:{display:{xs:"none",[k]:"flex"}},children:n.map((e,r)=>{const n=function(e,t){return"/"===t?e===t:e.startsWith(t)}(u?S?.pathname??"":g,e.path);return t(i,{paddingX:3,paddingY:.8,borderRadius:50,bgcolor:n?h:"transparent",color:n?"#fff":"inherit",sx:{transition:"all 0.2s ease-in-out",":hover":{backgroundColor:n?h:"rgba(0,0,0,0.05)",cursor:"pointer",userSelect:"none",filter:n?"brightness(1.1)":"none"}},onClick:t=>{var r;u&&console.log("pathname:",S?.pathname,":=",e.path),r=e.path,L(!0),S?S.push({pathname:r}).finally(()=>L(!1)):L(!1)},children:t(a,{justifyContent:"center",children:t(o,{fontWeight:n?600:500,whiteSpace:"nowrap",children:e.name})})},JSON.stringify({x:e,index:r}))})}),t(i,{sx:{display:{xs:"flex",[k]:"none"}},children:n.length>0&&e(r,{children:[t(M,{onClick:W,children:t(_e,{})}),t(E,{open:P,onClose:B,anchorEl:A,children:n.map((e,r)=>t(Y,{onClick:t=>_(t,e.path),children:t(o,{textTransform:"capitalize",children:e.name})},JSON.stringify({x:e,index:r})))})]})}),t(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{[k]:"100%"}},paddingY:1,children:e(a,{direction:"row",spacing:2,children:[t(i,{children:m}),O?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[t(N,{sx:{width:30,height:30},src:O.image}),e(E,{open:F,onClose:e=>R(null),anchorEl:$,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[p,t(Y,{onClick:function(e){try{function t(){V()}R(null);const r=function(){if(x){const e=function(e,t){try{var r=Promise.resolve(x()).then(function(){})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[t(Be,{sx:{fill:"#545454"}}),t(o,{textTransform:"capitalize",children:b})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>R(e.currentTarget),sx:{userSelect:"none"},children:[t(o,{children:"Olá,"}),t(o,{fontWeight:600,children:O.given_name}),t(We,{})]})]}):t(l,"govbr"===I?{variant:"contained",size:"small",startIcon:t(qe,{}),onClick:D,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:t(qe,{}),onClick:D,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})})]})}),z&&t(Ue,{})]}),t(i,{paddingBottom:y})]})}function Si({children:e,onSubmit:r,formMethod:n="GET",submiting:o=!1}){const{register:i,handleSubmit:a,control:l,formState:s,reset:c,watch:d,trigger:u,setValue:m,unregister:p,getValues:f}=ce(),[h,g]=H([]);return t(at.Provider,{value:{formRegister:i,formWatch:d,formReset:c,formControl:l,formSetValue:m,formTrigger:u,formUnregister:p,formGetValues:f,formHandleSubmit:a,setFilesUid:g,formState:s,errors:s?.errors,submiting:o},children:t("form",{method:n,onSubmit:a(e=>r(e,h),()=>Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",position:"top-right",theme:"colored"})),children:e})})}function Ei({url:e,realm:r,clientId:n,children:o,type:i="ad",resource_name:a="eventos-front",redirectUri:l=""}){const[s,c]=H(),[d,u]=H(!1),[m,p]=H(null),f=Ge(),h=!!s;return J(()=>{const t=new He({url:e,realm:r,clientId:n});p(t),t.onTokenExpired=function(){try{console.log("token expired");const e=function(e,r){try{var n=Promise.resolve(t.updateToken(5)).then(function(e){e&&c(e=>({...e,token:t.token})),console.log(e?"Token was refreshed":"Token is still valid")})}catch(e){return r(e)}return n&&n.then?n.then(void 0,r):n}(0,function(e){console.log("Failed to refresh token",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},t.init({onLoad:"check-sso",pkceMethod:"S256"}).then(e=>{if(u(!0),e){const e=t.tokenParsed;console.log("TOKEN-> ",e);const r={...e,token:t.token,roles:((e?.resource_access??{})[a]??[]).roles};c(r),console.info("Authenticated!!!")}else console.log("NAO AUTENTICADO")},()=>{console.error("Authenticated Failed")}).catch(e=>console.log(e));const o=f.query.status;o&&"success"===o&&window.history.replaceState(null,"","/")},[]),t(ot.Provider,{value:{user:s,isAuth:h,userLoaded:d,login:function(){console.log("Tentando logar..."),console.log("KC: ",{instancia:m,logado:m?.authenticated,client_id:m?.clientId}),m?.login({redirectUri:l})},logout:function(){u(!1),m?.logout(),c(null),localStorage.removeItem("user-data.img")},saveUserData:()=>{},type:i},children:o})}const Yi="nextauth.token",Oi="user-data.img";function Mi({children:e,AUTH_URL:r,oidcConfig:n,redirectURL:o,validateTokenRoute:i,testToken:a,testIP:l,logoutURL:s=o}){const c=n.authority+"/authorize?response_type=code&client_id="+n.client_id+"&scope="+n.scope+"&redirect_uri="+n.redirect_uri,[d,u]=H(),[m,p]=H(!1),f=Ge(),h=!!d;function g(){p(!1),f.replace(s).finally(()=>{u(null),Ze(Yi),localStorage.removeItem(Oi),p(!0)})}return J(()=>{const e=Je(Yi);e?fetch(`${r}${i}`,{method:"POST",headers:{Authorization:`Bearer ${e}`}}).then(t=>{if(t.ok){const t=et(e),r=localStorage.getItem(Oi);u({name:t.given_name,image:r??"",roles:t.roles.map(e=>e.code),token:e}),p(!0)}else g()}):p(!0)},[]),t(ot.Provider,{value:{user:d,isAuth:h,userLoaded:m,login:function(){if(!location||"localhost"!==location.hostname&&location.hostname!==l)p(!1),f.replace(c);else{const e=a;Qe(Yi,e),u({name:"Teste",image:"",roles:[1],token:e}),f.replace(o).finally(()=>p(!0))}},logout:g,saveUserData:function(e){try{const t=e.ssp_token;Qe(Yi,t);const r=et(t),n=et(e.id_token);return Promise.resolve(fetch(n.picture,{headers:{Authorization:`Bearer ${e.access_token}`}}).then(e=>{200===e.status&&e.blob().then(e=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{const e=n.result;localStorage.setItem(Oi,e),u({name:r.name,image:e,roles:r.roles.map(e=>e.code),token:t}),f.replace(o).finally(()=>p(!0))}}),u({name:r.name,image:"",roles:r.roles.map(e=>e.code),token:t}),f.replace(o).finally(()=>p(!0))})).then(function(){f.replace(o).finally(()=>p(!0))})}catch(e){return Promise.reject(e)}},type:"govbr"},children:e})}function Di(n){return e(r,{children:[t(Bo,{}),n.children,t(Oe,{position:"bottom-right",theme:"colored"})]})}export{Yi as AUTH_COOKIE_NAME,Co as ActiveInput,ot as AuthContext,wo as AutoComplete,_o as Button,tt as Category,lt as CheckBox,ct as CheckBoxAdditional,dt as CheckBoxWarning,pt as DatePicker,uo as DropFileUpload,So as FetchAutoComplete,rt as Field,nt as FieldLabel,it as File,mo as FileUpload,Yo as FixedAutoComplete,at as FormContext,Si as FormProvider,ft as GenericDatePicker,Mo as GenericFetchAutoComplete,Ao as GenericInput,Vo as GenericMaskInput,To as GenericMultInput,oi as GenericTable,xo as Input,Ei as KeycloakAuthProvider,Wo as MODAL,Ci as Map,bo as MaskInput,qo as Menu,jo as MultInput,wi as NavBar,Mi as OAuthProvider,No as OtherCheckBox,mt as RequiredCheckBoxGroup,Di as SspComponentsProvider,Po as Stepper,Lo as StepperBlock,fo as Switch,go as SwitchWatch,ki as TabNavBar,xi as Table,ht as TimePicker,ho as ToggleVisibility};
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{Grid as n,Typography as o,Box as i,Stack as a,Button as l,FormControlLabel as s,Checkbox as c,Card as d,InputLabel as u,TextField as p,SvgIcon as m,useTheme as f,useMediaQuery as h,LinearProgress as g,TableContainer as y,Paper as b,CircularProgress as x,Switch as v,Autocomplete as C,MobileStepper as w,SwipeableDrawer as k,Modal as E,Menu as S,MenuItem as D,Skeleton as Y,IconButton as M,Collapse as O,PaginationItem as I,Alert as V,FormControl as T,Select as A,AppBar as F,Avatar as R}from"@mui/material";import{FileDownload as j,ErrorOutline as N,ReportProblemRounded as $,PendingRounded as P,FilterAlt as z,KeyboardArrowDown as B,ExpandLess as W,ExpandMore as L,Refresh as _,KeyboardArrowUp as q}from"@mui/icons-material";import*as U from"react";import K,{createContext as X,useContext as H,useCallback as G,useState as J,useEffect as Z,useMemo as Q,useRef as ee}from"react";import re from"@mui/material/Typography";import te from"lodash.get";import{LocalizationProvider as ne,DatePicker as oe,TimePicker as ie}from"@mui/x-date-pickers";import{AdapterDayjs as ae}from"@mui/x-date-pickers/AdapterDayjs";import le from"dayjs";import"dayjs/locale/pt-br";import se from"lodash.hasin";import{useFormContext as ce,useForm as de}from"react-hook-form";import ue from"axios";import{useDropzone as pe}from"react-dropzone";import me from"@emotion/styled";import{ThemeContext as fe}from"@emotion/react";import he from"@mui/icons-material/CameraAlt";import ge from"@mui/icons-material/Delete";import ye from"@mui/icons-material/Done";import be from"@mui/icons-material/InsertDriveFile";import xe from"@mui/icons-material/PictureAsPdf";import ve from"@mui/material/InputLabel";import{IMaskInput as Ce}from"react-imask";import{useQuery as we}from"react-query";import ke from"@mui/icons-material/KeyboardArrowLeft";import Ee from"@mui/icons-material/KeyboardArrowRight";import Se from"@mui/icons-material/Save";import{LoadingButton as De}from"@mui/lab";import{toast as Ye,ToastContainer as Me}from"react-toastify";import Oe from"@mui/icons-material/ContentPasteOutlined";import Ie from"@mui/icons-material/Clear";import Ve from"@mui/icons-material/FileDownload";import Te from"@mui/icons-material/NavigateNextRounded";import Ae from"@mui/icons-material/Search";import Fe from"@mui/material/Grid";import Re from"@mui/material/Pagination";import je from"@mui/material/TextField";import Ne from"jszip";import $e from"@mui/icons-material/CloseRounded";import Pe from"tinycolor2";import ze from"lodash.clonedeep";import*as Be from"xlsx";import We from"next/dynamic";import Le from"@mui/icons-material/KeyboardArrowDown";import _e from"@mui/icons-material/LogoutOutlined";import qe from"@mui/icons-material/Menu";import Ue from"@mui/icons-material/Person";import Ke from"@mui/material/LinearProgress";import Xe from"next/image";import He from"next/link";import{useRouter as Ge}from"next/router";import Je from"keycloak-js";import{getCookie as Ze,deleteCookie as Qe,setCookie as er}from"cookies-next";import rr from"jwt-decode";function tr({title:t}){return e(n,{paddingY:1,item:!0,marginTop:1,marginBottom:3,xs:12,children:[r(o,{textTransform:"uppercase",fontWeight:600,children:t}),r(i,{sx:{backgroundColor:"#94A3B8",height:6,borderRadius:1}})]})}function nr({name:t,title:l,tag:s,xs:c=12,md:d,lg:u}){let p=s&&"Distrital"===s?"#BFDBFE":"Estadual"===s?"#BBF7D0":"Federal"===s?"#FEF08A":"Internacional"===s?"#FED7AA":"Não"===s?"#FECACA":"#BBF7D0";return r(n,{paddingBottom:3,item:!0,xs:c,md:d,lg:u,paddingRight:2,children:e(a,{spacing:1,children:[e(a,{spacing:1,direction:"row",children:[r(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l}),s&&r(o,{sx:{backgroundColor:p,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:s})]}),t&&r(i,{children:"false"===String(t)?"Não":"true"===String(t)?"Sim":""===String(t)?"":t?String(t):"Não informado"})]})})}function or({title:t,xs:i=12,tag:l,md:s,lg:c,paddingBottom:d=3}){let u=l&&"Não"===l?"#FECACA":"Sim"===l?"#BBF7D0":"#E2E8F0";return r(n,{paddingBottom:d,item:!0,xs:i,md:s,lg:c,paddingRight:2,children:e(a,{spacing:1,direction:"row",children:[r(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,fontSize:16,children:t}),l&&r(o,{sx:{backgroundColor:u,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l})]})})}const ir=/*#__PURE__*/X({});function ar({title:t,name:i,md:s,fileURL:c,fileExt:d="pdf"}){const{user:u}=H(ir);return r(n,{paddingBottom:3,paddingRight:3,md:s,children:e(a,{spacing:1,sx:{backgroundColor:"#F8FAFC",paddingY:1,paddingX:3,borderRadius:2,border:1,borderColor:"#CBD5E1"},children:[r(o,{fontWeight:600,sx:{textAlign:"center"},children:t}),e(a,{direction:"row",spacing:2,alignItems:"center",children:[r(j,{sx:{fill:"red"}}),r(o,{children:i})]}),r(a,{alignItems:"center",children:r(l,{variant:"outlined",color:"error",size:"small",endIcon:r(j,{}),onClick:()=>fetch(c,{method:"GET",headers:{Authorization:`Bearer ${u?.token}`}}).then(e=>e.blob()).then(e=>{var r=window.URL.createObjectURL(e);const t=document.createElement("a");t.href=r,t.download=i.split(".")[0]+`.${d}`,t.click()}),children:"Baixar"})})]})})}const lr=/*#__PURE__*/X(null);function sr({name:e,title:t,defaultValue:o=!1,xs:i=12,sm:a,md:l,onChange:d}){const u=H(lr),p=G(r=>{u?.formSetValue(e,!u?.formGetValues(e))},[u,e]);return r(n,{item:!0,xs:i,sm:a,md:l,children:r(s,{control:r(c,{size:"small",defaultChecked:o}),label:t,...u?.formRegister(e),onChange:d,onClick:p})})}function cr(e){let r=[];return e.forEach(e=>{if(e.props){if(e.props.children){const t=cr(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(r=r.concat(t))}e.props.name&&r.push(e.props.name)}}),r}function dr({customText:t="Selecione pelo menos 1 opção",...o}){const[i,a]=J(!1),[l,s]=J(!0),c=H(lr),d=/*#__PURE__*/K.cloneElement(o.children,{onChange:()=>{i&&!c.formGetValues(d.props.name)&&s(!1)}});return e(n,{container:!0,sx:{padding:1,borderRadius:2},children:[r("input",{type:"text",...c.formRegister(o.name,{validate:(e,r)=>{if(i&&l)return!0;const n=cr(Array.isArray(o.children)?o.children:[o.children]);let d=!1;return n.forEach(e=>{c.formGetValues(e)&&(d=!0)}),!!d||(a(!0),s(!0),t)}}),hidden:!0}),d,r(n,{item:!0,xs:12,children:i&&l&&o.content})]})}function ur({name:t,title:o,customWarning:i,defaultValue:a=!1,xs:l=12,sm:u,md:p}){const m=H(lr);return e(n,{item:!0,xs:l,sm:u,md:p,children:[r(s,{control:r(c,{size:"small",...m.formRegister(t),defaultChecked:a}),label:o}),m.formWatch(t)&&r(d,{sx:{bgcolor:"#FFFBF5",color:"#F59E0B",padding:1,paddingLeft:2},children:i||e(re,{children:[r("b",{children:"Atenção"})," ",r("i",{children:o})," possui regras específicas."]})})]})}function pr(e){let r=[];return e.forEach(e=>{if(e.props){if(e.props.children){const t=pr(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(r=r.concat(t))}e.props.name&&r.push(e.props.name)}}),r}function mr({customText:t="Selecione pelo menos 1 opção",...a}){const l=H(lr);return e(n,{container:!0,sx:{border:te(l.errors,a.name)?"2px solid #d32f2f":"",padding:1,borderRadius:2},children:[r("input",{type:"text",...l.formRegister(a.name,{validate:(e,r)=>{const n=pr(Array.isArray(a.children)?a.children:[a.children]);let o=!1;return n.forEach((e,r)=>{l.formGetValues(e)&&(o=!0)}),!!o||t}}),hidden:!0},1),a.children,te(l.errors,a.name)&&r(n,{item:!0,xs:12,children:e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:1,border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:te(l.errors,a.name)?.message})]})})]})}function fr({name:a,required:l=!1,title:s,xs:c=12,sm:d,md:m,minDt:f,defaultValue:h,persistValue:g,maxDt:y,...b}){const x=H(lr),[v,C]=J(void 0!==h?le(h,"DD/MM/YYYY"):void 0);return Z(()=>{void 0!==v&&x.formSetValue(a,v?v.format("DD/MM/YYYY"):v)},[v]),Z(()=>{if(!g)return()=>{x.formUnregister(a)}},[]),r(t,{children:e(n,{item:!0,xs:c,sm:d,md:m,children:[s&&r(u,{required:l,children:s}),e(ne,{adapterLocale:"pt-br",dateAdapter:ae,children:[r(oe,{minDate:le(f,"DD/MM/YYYY"),maxDate:le(y,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{C(e)},disableHighlightToday:!0,sx:{outline:te(x.errors,a)?"1px solid transparent":"",backgroundColor:"white",width:"100%","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"error.main",borderWidth:"2px"}},div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...x?.formRegister(a,{validate:(e,r)=>!se(r,a)||(e||(e=""),e.length<=0&&l?"Este campo é obrigatório":e.length<10&&l?"A data precisa seguir o padrão DD/MM/AAAA":!f||le(f,"DD/MM/YYYY").isSame(le(e,"DD/MM/YYYY"))||le(f,"DD/MM/YYYY").isBefore(le(e,"DD/MM/YYYY"))?!y||le(y,"DD/MM/YYYY").isSame(le(e,"DD/MM/YYYY"))||le(y,"DD/MM/YYYY").isAfter(le(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${f} e antes de ${y}`),shouldUnregister:!0}),fullWidth:!0})}),te(x.errors,a)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:te(x.errors,a)?.message})]})]})]})})}function hr({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:m,defaultValue:f,persistValue:h,maxDt:g,...y}){const b=ce(),[x,v]=J(void 0!==f?le(f,"DD/MM/YYYY"):void 0);return Z(()=>{void 0!==x&&b.setValue(i,x?x.format("DD/MM/YYYY"):x)},[x]),Z(()=>{if(!h)return()=>{b.unregister(i)}},[]),r(t,{children:e(n,{item:!0,xs:s,sm:c,md:d,children:[l&&r(u,{required:a,children:l}),e(ne,{adapterLocale:"pt-br",dateAdapter:ae,children:[r(oe,{minDate:le(m,"DD/MM/YYYY"),maxDate:le(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:x,onChange:e=>{v(void 0)},disableHighlightToday:!0,sx:{outline:te(b.formState.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...b?.register(i,{validate:(e,r)=>!se(r,i)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<10&&a?"A data precisa seguir o padrão DD/MM/AAAA":!m||le(m,"DD/MM/YYYY").isSame(le(e,"DD/MM/YYYY"))||le(m,"DD/MM/YYYY").isBefore(le(e,"DD/MM/YYYY"))?!g||le(g,"DD/MM/YYYY").isSame(le(e,"DD/MM/YYYY"))||le(g,"DD/MM/YYYY").isAfter(le(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${m} e antes de ${g}`),shouldUnregister:!0}),fullWidth:!0})}),r(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:te(b.formState.errors,i)?.message})]})]})})}function gr({name:t,required:a=!1,title:l,defaultValue:s="",xs:c=12,sm:d,md:m}){const f=H(lr),[h,g]=J(s?le(s,"HH:mm"):null);return Z(()=>{f.formSetValue(t,h?h.format("HH:mm"):h)},[h]),Z(()=>()=>{f.formUnregister(t)},[]),e(n,{item:!0,xs:c,sm:d,md:m,children:[l&&r(u,{required:a,children:l}),e(ne,{adapterLocale:"pt-br",dateAdapter:ae,children:[r(ie,{value:h,ampm:!1,onChange:e=>{g(e)},sx:{outline:te(f.errors,t)?"1px solid transparent":"",backgroundColor:"white",width:"100%","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"error.main",borderWidth:"2px"}},div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...f?.formRegister(t,{validate:(e,r)=>!se(r,t)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<5&&a?"A hora precisa seguir o padrão HH:MM":void 0),shouldUnregister:!0}),fullWidth:!0})}),te(f.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:te(f.errors,t)?.message})]})]})]})}function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},yr.apply(null,arguments)}function br(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function xr(e){if(!br(e))return e;const r={};return Object.keys(e).forEach(t=>{r[t]=xr(e[t])}),r}function vr(e,r,t={clone:!0}){const n=t.clone?yr({},e):e;return br(e)&&br(r)&&Object.keys(r).forEach(o=>{"__proto__"!==o&&(n[o]=br(r[o])&&o in e&&br(e[o])?vr(e[o],r[o],t):t.clone&&br(r[o])?xr(r[o]):r[o])}),n}function Cr(e){var r={exports:{}};return e(r,r.exports),r.exports}var wr="function"==typeof Symbol&&Symbol.for,kr=wr?Symbol.for("react.element"):60103,Er=wr?Symbol.for("react.portal"):60106,Sr=wr?Symbol.for("react.fragment"):60107,Dr=wr?Symbol.for("react.strict_mode"):60108,Yr=wr?Symbol.for("react.profiler"):60114,Mr=wr?Symbol.for("react.provider"):60109,Or=wr?Symbol.for("react.context"):60110,Ir=wr?Symbol.for("react.async_mode"):60111,Vr=wr?Symbol.for("react.concurrent_mode"):60111,Tr=wr?Symbol.for("react.forward_ref"):60112,Ar=wr?Symbol.for("react.suspense"):60113,Fr=wr?Symbol.for("react.suspense_list"):60120,Rr=wr?Symbol.for("react.memo"):60115,jr=wr?Symbol.for("react.lazy"):60116,Nr=wr?Symbol.for("react.block"):60121,$r=wr?Symbol.for("react.fundamental"):60117,Pr=wr?Symbol.for("react.responder"):60118,zr=wr?Symbol.for("react.scope"):60119;function Br(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case kr:switch(e=e.type){case Ir:case Vr:case Sr:case Yr:case Dr:case Ar:return e;default:switch(e=e&&e.$$typeof){case Or:case Tr:case jr:case Rr:case Mr:return e;default:return r}}case Er:return r}}}function Wr(e){return Br(e)===Vr}var Lr={AsyncMode:Ir,ConcurrentMode:Vr,ContextConsumer:Or,ContextProvider:Mr,Element:kr,ForwardRef:Tr,Fragment:Sr,Lazy:jr,Memo:Rr,Portal:Er,Profiler:Yr,StrictMode:Dr,Suspense:Ar,isAsyncMode:function(e){return Wr(e)||Br(e)===Ir},isConcurrentMode:Wr,isContextConsumer:function(e){return Br(e)===Or},isContextProvider:function(e){return Br(e)===Mr},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===kr},isForwardRef:function(e){return Br(e)===Tr},isFragment:function(e){return Br(e)===Sr},isLazy:function(e){return Br(e)===jr},isMemo:function(e){return Br(e)===Rr},isPortal:function(e){return Br(e)===Er},isProfiler:function(e){return Br(e)===Yr},isStrictMode:function(e){return Br(e)===Dr},isSuspense:function(e){return Br(e)===Ar},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Sr||e===Vr||e===Yr||e===Dr||e===Ar||e===Fr||"object"==typeof e&&null!==e&&(e.$$typeof===jr||e.$$typeof===Rr||e.$$typeof===Mr||e.$$typeof===Or||e.$$typeof===Tr||e.$$typeof===$r||e.$$typeof===Pr||e.$$typeof===zr||e.$$typeof===Nr)},typeOf:Br},_r=Cr(function(e,r){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:var m=e.type;switch(m){case c:case d:case o:case a:case i:case p:return m;default:var g=m&&m.$$typeof;switch(g){case s:case u:case h:case f:case l:return g;default:return r}}case n:return r}}}var C=d,w=s,k=l,E=t,S=u,D=o,Y=h,M=f,O=n,I=a,V=i,T=p,A=!1;function F(e){return v(e)===d}r.AsyncMode=c,r.ConcurrentMode=C,r.ContextConsumer=w,r.ContextProvider=k,r.Element=E,r.ForwardRef=S,r.Fragment=D,r.Lazy=Y,r.Memo=M,r.Portal=O,r.Profiler=I,r.StrictMode=V,r.Suspense=T,r.isAsyncMode=function(e){return A||(A=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),F(e)||v(e)===c},r.isConcurrentMode=F,r.isContextConsumer=function(e){return v(e)===s},r.isContextProvider=function(e){return v(e)===l},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.isForwardRef=function(e){return v(e)===u},r.isFragment=function(e){return v(e)===o},r.isLazy=function(e){return v(e)===h},r.isMemo=function(e){return v(e)===f},r.isPortal=function(e){return v(e)===n},r.isProfiler=function(e){return v(e)===a},r.isStrictMode=function(e){return v(e)===i},r.isSuspense=function(e){return v(e)===p},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===a||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===f||e.$$typeof===l||e.$$typeof===s||e.$$typeof===u||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===g)},r.typeOf=v}()}),qr=Cr(function(e){e.exports="production"===process.env.NODE_ENV?Lr:_r}),Ur=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable,Hr=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(r).map(function(e){return r[e]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var t,n,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var a in t=Object(arguments[i]))Kr.call(t,a)&&(o[a]=t[a]);if(Ur){n=Ur(t);for(var l=0;l<n.length;l++)Xr.call(t,n[l])&&(o[n[l]]=t[n[l]])}}return o},Gr=Function.call.bind(Object.prototype.hasOwnProperty),Jr="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zr=Gr,Qr=function(){};if("production"!==process.env.NODE_ENV){var et=Jr,rt={},tt=Zr;Qr=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function nt(e,r,t,n,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(tt(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](r,i,n,t,null,et)}catch(e){a=e}if(!a||a instanceof Error||Qr((n||"React class")+": type specification of "+t+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in rt)){rt[a.message]=!0;var s=o?o():"";Qr("Failed "+t+" type: "+a.message+(null!=s?s:""))}}}nt.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(rt={})};var ot=nt,it=function(){};function at(){return null}function lt(){}function st(){}"production"!==process.env.NODE_ENV&&(it=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}),st.resetWarningCache=lt;var ct,dt=Cr(function(e){e.exports="production"!==process.env.NODE_ENV?function(e){var r="function"==typeof Symbol&&Symbol.iterator,t="<<anonymous>>",n={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(at),arrayOf:function(e){return a(function(r,t,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var l=r[t];if(!Array.isArray(l))return new i("Invalid "+o+" `"+a+"` of type `"+d(l)+"` supplied to `"+n+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,n,o,a+"["+s+"]",Jr);if(c instanceof Error)return c}return null})},element:a(function(r,t,n,o,a){var l=r[t];return e(l)?null:new i("Invalid "+o+" `"+a+"` of type `"+d(l)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:a(function(e,r,t,n,o){var a=e[r];return qr.isValidElementType(a)?null:new i("Invalid "+n+" `"+o+"` of type `"+d(a)+"` supplied to `"+t+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(r,n,o,a,l){return r[n]instanceof e?null:new i("Invalid "+a+" `"+l+"` of type `"+((s=r[n]).constructor&&s.constructor.name?s.constructor.name:t)+"` supplied to `"+o+"`, expected instance of `"+(e.name||t)+"`.");var s})},node:a(function(e,r,t,n,o){return c(e[r])?null:new i("Invalid "+n+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(r,t,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var l=r[t],s=d(l);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+n+"`, expected an object.");for(var c in l)if(Zr(l,c)){var u=e(l,c,n,o,a+"."+c,Jr);if(u instanceof Error)return u}return null})},oneOf:function(e){return Array.isArray(e)?a(function(r,t,n,a,l){for(var s=r[t],c=0;c<e.length;c++)if(o(s,e[c]))return null;var d=JSON.stringify(e,function(e,r){return"symbol"===u(r)?String(r):r});return new i("Invalid "+a+" `"+l+"` of value `"+String(s)+"` supplied to `"+n+"`, expected one of "+d+".")}):("production"!==process.env.NODE_ENV&&it(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),at)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&it("Invalid argument supplied to oneOfType, expected an instance of array."),at;for(var r=0;r<e.length;r++){var t=e[r];if("function"!=typeof t)return it("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(t)+" at index "+r+"."),at}return a(function(r,t,n,o,a){for(var l=[],s=0;s<e.length;s++){var c=(0,e[s])(r,t,n,o,a,Jr);if(null==c)return null;c.data&&Zr(c.data,"expectedType")&&l.push(c.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+n+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(r,t,n,o,a){var l=r[t],c=d(l);if("object"!==c)return new i("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");for(var p in e){var m=e[p];if("function"!=typeof m)return s(n,o,a,p,u(m));var f=m(l,p,n,o,a+"."+p,Jr);if(f)return f}return null})},exact:function(e){return a(function(r,t,n,o,a){var l=r[t],c=d(l);if("object"!==c)return new i("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");var p=Hr({},r[t],e);for(var m in p){var f=e[m];if(Zr(e,m)&&"function"!=typeof f)return s(n,o,a,m,u(f));if(!f)return new i("Invalid "+o+" `"+a+"` key `"+m+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(r[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(l,m,n,o,a+"."+m,Jr);if(h)return h}return null})}};function o(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function i(e,r){this.message=e,this.data=r&&"object"==typeof r?r:{},this.stack=""}function a(e){function r(r,n,o,a,l,s,c){if(a=a||t,s=s||o,c!==Jr){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}return null==n[o]?r?new i(null===n[o]?"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(n,o,a,l,s)}process;var n=r.bind(null,!1);return n.isRequired=r.bind(null,!0),n}function l(e){return a(function(r,t,n,o,a,l){var s=r[t];return d(s)!==e?new i("Invalid "+o+" `"+a+"` of type `"+u(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,r,t,n,o){return new i((e||"React class")+": "+r+" type `"+t+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var n=function(e){var t=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!n)return!1;var o,i=n.call(t);if(n!==t.entries){for(;!(o=i.next()).done;)if(!c(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function d(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function u(e){if(null==e)return""+e;var r=d(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function p(e){var r=u(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return i.prototype=Error.prototype,n.checkPropTypes=ot,n.resetWarningCache=ot.resetWarningCache,n.PropTypes=n,n}(qr.isElement):function(){function e(e,r,t,n,o,i){if(i!==Jr){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:st,resetWarningCache:lt};return t.PropTypes=t,t}()}),ut=Symbol.for("react.element"),pt=Symbol.for("react.portal"),mt=Symbol.for("react.fragment"),ft=Symbol.for("react.strict_mode"),ht=Symbol.for("react.profiler"),gt=Symbol.for("react.provider"),yt=Symbol.for("react.context"),bt=Symbol.for("react.server_context"),xt=Symbol.for("react.forward_ref"),vt=Symbol.for("react.suspense"),Ct=Symbol.for("react.suspense_list"),wt=Symbol.for("react.memo"),kt=Symbol.for("react.lazy"),Et=Symbol.for("react.offscreen");function St(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case ut:switch(e=e.type){case mt:case ht:case ft:case vt:case Ct:return e;default:switch(e=e&&e.$$typeof){case bt:case yt:case xt:case kt:case wt:case gt:return e;default:return r}}case pt:return r}}}ct=Symbol.for("react.module.reference");var Dt={ContextConsumer:yt,ContextProvider:gt,Element:ut,ForwardRef:xt,Fragment:mt,Lazy:kt,Memo:wt,Portal:pt,Profiler:ht,StrictMode:ft,Suspense:vt,SuspenseList:Ct,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return St(e)===yt},isContextProvider:function(e){return St(e)===gt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ut},isForwardRef:function(e){return St(e)===xt},isFragment:function(e){return St(e)===mt},isLazy:function(e){return St(e)===kt},isMemo:function(e){return St(e)===wt},isPortal:function(e){return St(e)===pt},isProfiler:function(e){return St(e)===ht},isStrictMode:function(e){return St(e)===ft},isSuspense:function(e){return St(e)===vt},isSuspenseList:function(e){return St(e)===Ct},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===mt||e===ht||e===ft||e===vt||e===Ct||e===Et||"object"==typeof e&&null!==e&&(e.$$typeof===kt||e.$$typeof===wt||e.$$typeof===gt||e.$$typeof===yt||e.$$typeof===xt||e.$$typeof===ct||void 0!==e.getModuleId)},typeOf:St},Yt=Cr(function(e,r){"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:var h=e.type;switch(h){case o:case a:case i:case u:case p:return h;default:var g=h&&h.$$typeof;switch(g){case c:case s:case d:case f:case m:case l:return g;default:return r}}case n:return r}}}e=Symbol.for("react.module.reference");var y=l,b=t,x=d,v=o,C=f,w=m,k=n,E=a,S=i,D=u,Y=p,M=!1,O=!1;r.ContextConsumer=s,r.ContextProvider=y,r.Element=b,r.ForwardRef=x,r.Fragment=v,r.Lazy=C,r.Memo=w,r.Portal=k,r.Profiler=E,r.StrictMode=S,r.Suspense=D,r.SuspenseList=Y,r.isAsyncMode=function(e){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},r.isConcurrentMode=function(e){return O||(O=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},r.isContextConsumer=function(e){return g(e)===s},r.isContextProvider=function(e){return g(e)===l},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.isForwardRef=function(e){return g(e)===d},r.isFragment=function(e){return g(e)===o},r.isLazy=function(e){return g(e)===f},r.isMemo=function(e){return g(e)===m},r.isPortal=function(e){return g(e)===n},r.isProfiler=function(e){return g(e)===a},r.isStrictMode=function(e){return g(e)===i},r.isSuspense=function(e){return g(e)===u},r.isSuspenseList=function(e){return g(e)===p},r.isValidElementType=function(r){return"string"==typeof r||"function"==typeof r||r===o||r===a||r===i||r===u||r===p||r===h||"object"==typeof r&&null!==r&&(r.$$typeof===f||r.$$typeof===m||r.$$typeof===l||r.$$typeof===s||r.$$typeof===d||r.$$typeof===e||void 0!==r.getModuleId)},r.typeOf=g}()}),Mt=Cr(function(e){e.exports="production"===process.env.NODE_ENV?Dt:Yt});const Ot=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function It(e,r=""){return e.displayName||e.name||function(e){const r=`${e}`.match(Ot);return r&&r[1]||""}(e)||r}function Vt(e,r,t){const n=It(r);return e.displayName||(""!==n?`${t}(${n})`:t)}function Tt(e){if("string"!=typeof e)throw new Error("production"!==process.env.NODE_ENV?"MUI: `capitalize(string)` expects a string argument.":function(e){let r="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)r+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+r+" for the full message."}(7));return e.charAt(0).toUpperCase()+e.slice(1)}function At(e,r){const t=yr({},r);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))t[n]=yr({},e[n],t[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=r[n];t[n]={},i&&Object.keys(i)?o&&Object.keys(o)?(t[n]=yr({},i),Object.keys(o).forEach(e=>{t[n][e]=At(o[e],i[e])})):t[n]=i:t[n]=o}else void 0===t[n]&&(t[n]=e[n])}),t}const Ft=e=>e;var Rt=(()=>{let e=Ft;return{configure(r){e=r},generate:r=>e(r),reset(){e=Ft}}})();const jt={active:"active",checked:"checked",completed:"completed",disabled:"disabled",readOnly:"readOnly",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function Nt(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}const $t=["values","unit","step"];var Pt={borderRadius:4},zt="production"!==process.env.NODE_ENV?dt.oneOfType([dt.number,dt.string,dt.object,dt.array]):{};function Bt(e,r){return r?vr(e,r,{clone:!1}):e}const Wt={xs:0,sm:600,md:900,lg:1200,xl:1536},Lt={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Wt[e]}px)`};function _t(e,r,t){const n=e.theme||{};if(Array.isArray(r)){const e=n.breakpoints||Lt;return r.reduce((n,o,i)=>(n[e.up(e.keys[i])]=t(r[i]),n),{})}if("object"==typeof r){const e=n.breakpoints||Lt;return Object.keys(r).reduce((n,o)=>(-1!==Object.keys(e.values||Wt).indexOf(o)?n[e.up(o)]=t(r[o],o):n[o]=r[o],n),{})}return t(r)}function qt(e={}){var r;return(null==(r=e.keys)?void 0:r.reduce((r,t)=>(r[e.up(t)]={},r),{}))||{}}function Ut(e,r){return e.reduce((e,r)=>{const t=e[r];return(!t||0===Object.keys(t).length)&&delete e[r],e},r)}function Kt({values:e,breakpoints:r,base:t}){const n=t||function(e,r){if("object"!=typeof e)return{};const t={},n=Object.keys(r);return Array.isArray(e)?n.forEach((r,n)=>{n<e.length&&(t[r]=!0)}):n.forEach(r=>{null!=e[r]&&(t[r]=!0)}),t}(e,r),o=Object.keys(n);if(0===o.length)return e;let i;return o.reduce((r,t,n)=>(Array.isArray(e)?(r[t]=null!=e[n]?e[n]:e[i],i=n):"object"==typeof e?(r[t]=null!=e[t]?e[t]:e[i],i=t):r[t]=e,r),{})}function Xt(e,r,t=!0){if(!r||"string"!=typeof r)return null;if(e&&e.vars&&t){const t=`vars.${r}`.split(".").reduce((e,r)=>e&&e[r]?e[r]:null,e);if(null!=t)return t}return r.split(".").reduce((e,r)=>e&&null!=e[r]?e[r]:null,e)}function Ht(e,r,t,n=t){let o;return o="function"==typeof e?e(t):Array.isArray(e)?e[t]||n:Xt(e,t)||n,r&&(o=r(o,n,e)),o}function Gt(e){const{prop:r,cssProperty:t=e.prop,themeKey:n,transform:o}=e,i=e=>{if(null==e[r])return null;const i=e[r],a=Xt(e.theme,n)||{};return _t(e,i,e=>{let n=Ht(a,o,e);return e===n&&"string"==typeof e&&(n=Ht(a,o,`${r}${"default"===e?"":Tt(e)}`,e)),!1===t?n:{[t]:n}})};return i.propTypes="production"!==process.env.NODE_ENV?{[r]:zt}:{},i.filterProps=[r],i}const Jt={m:"margin",p:"padding"},Zt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Qt={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},en=function(){const e={};return r=>(void 0===e[r]&&(e[r]=(e=>{if(e.length>2){if(!Qt[e])return[e];e=Qt[e]}const[r,t]=e.split(""),n=Jt[r],o=Zt[t]||"";return Array.isArray(o)?o.map(e=>n+e):[n+o]})(r)),e[r])}(),rn=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],tn=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],nn=[...rn,...tn];function on(e,r,t,n){var o;const i=null!=(o=Xt(e,r,!1))?o:t;return"number"==typeof i?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${e}.`),i*e):Array.isArray(i)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>i.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${e} > ${i.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${r}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${r}\` as a number.`].join("\n"))),i[e]):"function"==typeof i?i:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${r}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}function an(e){return on(e,"spacing",8,"spacing")}function ln(e,r){if("string"==typeof r||null==r)return r;const t=e(Math.abs(r));return r>=0?t:"number"==typeof t?-t:`-${t}`}function sn(e,r){const t=an(e.theme);return Object.keys(e).map(n=>function(e,r,t,n){if(-1===r.indexOf(t))return null;const o=function(e,r){return t=>e.reduce((e,n)=>(e[n]=ln(r,t),e),{})}(en(t),n);return _t(e,e[t],o)}(e,r,n,t)).reduce(Bt,{})}function cn(e){return sn(e,rn)}function dn(e){return sn(e,tn)}function un(...e){const r=e.reduce((e,r)=>(r.filterProps.forEach(t=>{e[t]=r}),e),{}),t=e=>Object.keys(e).reduce((t,n)=>r[n]?Bt(t,r[n](e)):t,{});return t.propTypes="production"!==process.env.NODE_ENV?e.reduce((e,r)=>Object.assign(e,r.propTypes),{}):{},t.filterProps=e.reduce((e,r)=>e.concat(r.filterProps),[]),t}function pn(e){return"number"!=typeof e?e:`${e}px solid`}cn.propTypes="production"!==process.env.NODE_ENV?rn.reduce((e,r)=>(e[r]=zt,e),{}):{},cn.filterProps=rn,dn.propTypes="production"!==process.env.NODE_ENV?tn.reduce((e,r)=>(e[r]=zt,e),{}):{},dn.filterProps=tn,"production"===process.env.NODE_ENV||nn.reduce((e,r)=>(e[r]=zt,e),{});const mn=Gt({prop:"border",themeKey:"borders",transform:pn}),fn=Gt({prop:"borderTop",themeKey:"borders",transform:pn}),hn=Gt({prop:"borderRight",themeKey:"borders",transform:pn}),gn=Gt({prop:"borderBottom",themeKey:"borders",transform:pn}),yn=Gt({prop:"borderLeft",themeKey:"borders",transform:pn}),bn=Gt({prop:"borderColor",themeKey:"palette"}),xn=Gt({prop:"borderTopColor",themeKey:"palette"}),vn=Gt({prop:"borderRightColor",themeKey:"palette"}),Cn=Gt({prop:"borderBottomColor",themeKey:"palette"}),wn=Gt({prop:"borderLeftColor",themeKey:"palette"}),kn=e=>{if(null!=e.borderRadius){const r=on(e.theme,"shape.borderRadius",4,"borderRadius");return _t(e,e.borderRadius,e=>({borderRadius:ln(r,e)}))}return null};kn.propTypes="production"!==process.env.NODE_ENV?{borderRadius:zt}:{},kn.filterProps=["borderRadius"],un(mn,fn,hn,gn,yn,bn,xn,vn,Cn,wn,kn);const En=e=>{if(null!=e.gap){const r=on(e.theme,"spacing",8,"gap");return _t(e,e.gap,e=>({gap:ln(r,e)}))}return null};En.propTypes="production"!==process.env.NODE_ENV?{gap:zt}:{},En.filterProps=["gap"];const Sn=e=>{if(null!=e.columnGap){const r=on(e.theme,"spacing",8,"columnGap");return _t(e,e.columnGap,e=>({columnGap:ln(r,e)}))}return null};Sn.propTypes="production"!==process.env.NODE_ENV?{columnGap:zt}:{},Sn.filterProps=["columnGap"];const Dn=e=>{if(null!=e.rowGap){const r=on(e.theme,"spacing",8,"rowGap");return _t(e,e.rowGap,e=>({rowGap:ln(r,e)}))}return null};function Yn(e,r){return"grey"===r?r:e}function Mn(e){return e<=1&&0!==e?100*e+"%":e}Dn.propTypes="production"!==process.env.NODE_ENV?{rowGap:zt}:{},Dn.filterProps=["rowGap"],un(En,Sn,Dn,Gt({prop:"gridColumn"}),Gt({prop:"gridRow"}),Gt({prop:"gridAutoFlow"}),Gt({prop:"gridAutoColumns"}),Gt({prop:"gridAutoRows"}),Gt({prop:"gridTemplateColumns"}),Gt({prop:"gridTemplateRows"}),Gt({prop:"gridTemplateAreas"}),Gt({prop:"gridArea"})),un(Gt({prop:"color",themeKey:"palette",transform:Yn}),Gt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Yn}),Gt({prop:"backgroundColor",themeKey:"palette",transform:Yn}));const On=Gt({prop:"width",transform:Mn}),In=e=>null!=e.maxWidth?_t(e,e.maxWidth,r=>{var t,n,o;return{maxWidth:(null==(t=e.theme)||null==(n=t.breakpoints)||null==(o=n.values)?void 0:o[r])||Wt[r]||Mn(r)}}):null;In.filterProps=["maxWidth"];const Vn=Gt({prop:"minWidth",transform:Mn}),Tn=Gt({prop:"height",transform:Mn}),An=Gt({prop:"maxHeight",transform:Mn}),Fn=Gt({prop:"minHeight",transform:Mn});Gt({prop:"size",cssProperty:"width",transform:Mn}),Gt({prop:"size",cssProperty:"height",transform:Mn}),un(On,In,Vn,Tn,An,Fn,Gt({prop:"boxSizing"}));var Rn={border:{themeKey:"borders",transform:pn},borderTop:{themeKey:"borders",transform:pn},borderRight:{themeKey:"borders",transform:pn},borderBottom:{themeKey:"borders",transform:pn},borderLeft:{themeKey:"borders",transform:pn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:kn},color:{themeKey:"palette",transform:Yn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Yn},backgroundColor:{themeKey:"palette",transform:Yn},p:{style:dn},pt:{style:dn},pr:{style:dn},pb:{style:dn},pl:{style:dn},px:{style:dn},py:{style:dn},padding:{style:dn},paddingTop:{style:dn},paddingRight:{style:dn},paddingBottom:{style:dn},paddingLeft:{style:dn},paddingX:{style:dn},paddingY:{style:dn},paddingInline:{style:dn},paddingInlineStart:{style:dn},paddingInlineEnd:{style:dn},paddingBlock:{style:dn},paddingBlockStart:{style:dn},paddingBlockEnd:{style:dn},m:{style:cn},mt:{style:cn},mr:{style:cn},mb:{style:cn},ml:{style:cn},mx:{style:cn},my:{style:cn},margin:{style:cn},marginTop:{style:cn},marginRight:{style:cn},marginBottom:{style:cn},marginLeft:{style:cn},marginX:{style:cn},marginY:{style:cn},marginInline:{style:cn},marginInlineStart:{style:cn},marginInlineEnd:{style:cn},marginBlock:{style:cn},marginBlockStart:{style:cn},marginBlockEnd:{style:cn},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:En},rowGap:{style:Dn},columnGap:{style:Sn},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Mn},maxWidth:{style:In},minWidth:{transform:Mn},height:{transform:Mn},maxHeight:{transform:Mn},minHeight:{transform:Mn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const jn=function(){function e(e,r,t,n){const o={[e]:r,theme:t},i=n[e];if(!i)return{[e]:r};const{cssProperty:a=e,themeKey:l,transform:s,style:c}=i;if(null==r)return null;if("typography"===l&&"inherit"===r)return{[e]:r};const d=Xt(t,l)||{};return c?c(o):_t(o,r,r=>{let t=Ht(d,s,r);return r===t&&"string"==typeof r&&(t=Ht(d,s,`${e}${"default"===r?"":Tt(r)}`,r)),!1===a?t:{[a]:t}})}return function r(t){var n;const{sx:o,theme:i={}}=t||{};if(!o)return null;const a=null!=(n=i.unstable_sxConfig)?n:Rn;function l(t){let n=t;if("function"==typeof t)n=t(i);else if("object"!=typeof t)return t;if(!n)return null;const o=qt(i.breakpoints),l=Object.keys(o);let s=o;return Object.keys(n).forEach(t=>{const o="function"==typeof(l=n[t])?l(i):l;var l;if(null!=o)if("object"==typeof o)if(a[t])s=Bt(s,e(t,o,i,a));else{const e=_t({theme:i},o,e=>({[t]:e}));!function(...e){const r=e.reduce((e,r)=>e.concat(Object.keys(r)),[]),t=new Set(r);return e.every(e=>t.size===Object.keys(e).length)}(e,o)?s=Bt(s,e):s[t]=r({sx:o,theme:i})}else s=Bt(s,e(t,o,i,a))}),Ut(l,s)}return Array.isArray(o)?o.map(l):l(o)}}();jn.filterProps=["sx"];var Nn=jn;const $n=["breakpoints","palette","spacing","shape"];function Pn(e={},...r){const{breakpoints:t={},palette:n={},spacing:o,shape:i={}}=e,a=Nt(e,$n),l=function(e){const{values:r={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:t="px",step:n=5}=e,o=Nt(e,$t),i=(e=>{const r=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return r.sort((e,r)=>e.val-r.val),r.reduce((e,r)=>yr({},e,{[r.key]:r.val}),{})})(r),a=Object.keys(i);function l(e){return`@media (min-width:${"number"==typeof r[e]?r[e]:e}${t})`}function s(e){return`@media (max-width:${("number"==typeof r[e]?r[e]:e)-n/100}${t})`}function c(e,o){const i=a.indexOf(o);return`@media (min-width:${"number"==typeof r[e]?r[e]:e}${t}) and (max-width:${(-1!==i&&"number"==typeof r[a[i]]?r[a[i]]:o)-n/100}${t})`}return yr({keys:a,values:i,up:l,down:s,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):l(e)},not:function(e){const r=a.indexOf(e);return 0===r?l(a[1]):r===a.length-1?s(a[r]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:t},o)}(t),s=function(e=8){if(e.mui)return e;const r=an({spacing:e}),t=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map(e=>{const t=r(e);return"number"==typeof t?`${t}px`:t}).join(" "));return t.mui=!0,t}(o);let c=vr({breakpoints:l,direction:"ltr",components:{},palette:yr({mode:"light"},n),spacing:s,shape:yr({},Pt,i)},a);return c=r.reduce((e,r)=>vr(e,r),c),c.unstable_sxConfig=yr({},Rn,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return Nn({sx:e,theme:this})},c}const zn=Pn(),Bn=["sx"];function Wn(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=Wn(e[r]))&&(n&&(n+=" "),n+=t);else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ln(){for(var e,r,t=0,n="";t<arguments.length;)(e=arguments[t++])&&(r=Wn(e))&&(n&&(n+=" "),n+=r);return n}const _n=["variant"];function qn(e){return 0===e.length}function Un(e){const{variant:r}=e,t=Nt(e,_n);let n=r||"";return Object.keys(t).sort().forEach(r=>{n+="color"===r?qn(n)?e[r]:Tt(e[r]):`${qn(n)?r:Tt(r)}${Tt(e[r].toString())}`}),n}const Kn=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Xn(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const Hn=Pn();function Gn({defaultTheme:e,theme:r,themeId:t}){return 0===Object.keys(r).length?e:r[t]||r}const Jn=function(e={}){const{themeId:r,defaultTheme:t=Hn,rootShouldForwardProp:n=Xn,slotShouldForwardProp:o=Xn}=e,i=e=>Nn(yr({},e,{theme:Gn(yr({},e,{defaultTheme:t,themeId:r}))}));return i.__mui_systemSx=!0,(e,a={})=>{(e=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=e.__emotion_styles.filter(e=>!(null!=e&&e.__mui_systemSx)))})(e);const{name:l,slot:s,skipVariantsResolver:c,skipSx:d,overridesResolver:u}=a,p=Nt(a,Kn),m=void 0!==c?c:s&&"Root"!==s||!1,f=d||!1;let h;var g;"production"!==process.env.NODE_ENV&&l&&(h=`${l}-${g=s||"Root",g.charAt(0).toLowerCase()+g.slice(1)}`);let y=Xn;"Root"===s?y=n:s?y=o:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(y=void 0);const b=function(e,r){const t=me(e,r);return"production"!==process.env.NODE_ENV?(...r)=>{const n="string"==typeof e?`"${e}"`:"component";return 0===r.length?console.error([`MUI: Seems like you called \`styled(${n})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n")):r.some(e=>void 0===e)&&console.error(`MUI: the styled(${n})(...args) API requires all its args to be defined.`),t(...r)}:t}(e,yr({shouldForwardProp:y,label:h},p)),x=(n,...o)=>{const a=o?o.map(e=>"function"==typeof e&&e.__emotion_real!==e?n=>e(yr({},n,{theme:Gn(yr({},n,{defaultTheme:t,themeId:r}))})):e):[];let c=n;l&&u&&a.push(e=>{const n=Gn(yr({},e,{defaultTheme:t,themeId:r})),o=((e,r)=>r.components&&r.components[e]&&r.components[e].styleOverrides?r.components[e].styleOverrides:null)(l,n);if(o){const r={};return Object.entries(o).forEach(([t,o])=>{r[t]="function"==typeof o?o(yr({},e,{theme:n})):o}),u(e,r)}return null}),l&&!m&&a.push(e=>{const n=Gn(yr({},e,{defaultTheme:t,themeId:r}));return((e,r,t,n)=>{var o,i;const{ownerState:a={}}=e,l=[],s=null==t||null==(o=t.components)||null==(i=o[n])?void 0:i.variants;return s&&s.forEach(t=>{let n=!0;Object.keys(t.props).forEach(r=>{a[r]!==t.props[r]&&e[r]!==t.props[r]&&(n=!1)}),n&&l.push(r[Un(t.props)])}),l})(e,((e,r)=>{let t=[];r&&r.components&&r.components[e]&&r.components[e].variants&&(t=r.components[e].variants);const n={};return t.forEach(e=>{const r=Un(e.props);n[r]=e.style}),n})(l,n),n,l)}),f||a.push(i);const d=a.length-o.length;if(Array.isArray(n)&&d>0){const e=new Array(d).fill("");c=[...n,...e],c.raw=[...n.raw,...e]}else"function"==typeof n&&n.__emotion_real!==n&&(c=e=>n(yr({},e,{theme:Gn(yr({},e,{defaultTheme:t,themeId:r}))})));const p=b(c,...a);if("production"!==process.env.NODE_ENV){let r;l&&(r=`${l}${s||""}`),void 0===r&&(r=`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return It(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Mt.ForwardRef:return Vt(e,e.render,"ForwardRef");case Mt.Memo:return Vt(e,e.type,"memo");default:return}}}(e)})`),p.displayName=r}return e.muiName&&(p.muiName=e.muiName),p};return b.withConfig&&(x.withConfig=b.withConfig),x}}();var Zn=Jn;function Qn(e){const{theme:r,name:t,props:n}=e;return r&&r.components&&r.components[t]&&r.components[t].defaultProps?At(r.components[t].defaultProps,n):n}const eo=["component","direction","spacing","divider","children","className","useFlexGap"],ro=Pn(),to=Zn("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,r)=>r.root});function no(e){return function({props:e,name:r,defaultTheme:t,themeId:n}){let o=function(e=zn){return function(e=null){const r=U.useContext(fe);return r&&0!==Object.keys(r).length?r:e}(e)}(t);return n&&(o=o[n]||o),Qn({theme:o,name:r,props:e})}({props:e,name:"MuiStack",defaultTheme:ro})}function oo(e,r){const t=U.Children.toArray(e).filter(Boolean);return t.reduce((e,n,o)=>(e.push(n),o<t.length-1&&e.push(/*#__PURE__*/U.cloneElement(r,{key:`separator-${o}`})),e),[])}const io=({ownerState:e,theme:r})=>{let t=yr({display:"flex",flexDirection:"column"},_t({theme:r},Kt({values:e.direction,breakpoints:r.breakpoints.values}),e=>({flexDirection:e})));if(e.spacing){const n=an(r),o=Object.keys(r.breakpoints.values).reduce((r,t)=>(("object"==typeof e.spacing&&null!=e.spacing[t]||"object"==typeof e.direction&&null!=e.direction[t])&&(r[t]=!0),r),{}),i=Kt({values:e.direction,base:o}),a=Kt({values:e.spacing,base:o});"object"==typeof i&&Object.keys(i).forEach((e,r,t)=>{i[e]||(i[e]=r>0?i[t[r-1]]:"column")}),t=vr(t,_t({theme:r},a,(r,t)=>{return e.useFlexGap?{gap:ln(n,r)}:{"& > :not(style) + :not(style)":{margin:0,[`margin${o=t?i[t]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[o]}`]:ln(n,r)}};var o}))}return t=function(e,...r){const t=qt(e),n=[t,...r].reduce((e,r)=>vr(e,r),{});return Ut(Object.keys(t),n)}(r.breakpoints,t),t},ao=function(e={}){const{createStyledComponent:t=to,useThemeProps:n=no,componentName:o="MuiStack"}=e,i=t(io),a=/*#__PURE__*/U.forwardRef(function(e,t){const a=function(e){const{sx:r}=e,t=Nt(e,Bn),{systemProps:n,otherProps:o}=(e=>{var r,t;const n={systemProps:{},otherProps:{}},o=null!=(r=null==e||null==(t=e.theme)?void 0:t.unstable_sxConfig)?r:Rn;return Object.keys(e).forEach(r=>{o[r]?n.systemProps[r]=e[r]:n.otherProps[r]=e[r]}),n})(t);let i;return i=Array.isArray(r)?[n,...r]:"function"==typeof r?(...e)=>{const t=r(...e);return br(t)?yr({},n,t):n}:yr({},n,r),yr({},o,{sx:i})}(n(e)),{component:l="div",direction:s="column",spacing:c=0,divider:d,children:u,className:p,useFlexGap:m=!1}=a,f=Nt(a,eo),h={direction:s,spacing:c,useFlexGap:m},g=function(e,r,t){const n={};return Object.keys(e).forEach(r=>{n[r]=e[r].reduce((e,r)=>{if(r){const n=(e=>function(e,r,t="Mui"){const n=jt[r];return n?`${t}-${n}`:`${Rt.generate(e)}-${r}`}(o,e))(r);""!==n&&e.push(n),t&&t[r]&&e.push(t[r])}return e},[]).join(" ")}),n}({root:["root"]},0,{});/*#__PURE__*/
|
|
2
|
+
return r(i,yr({as:l,ownerState:h,ref:t,className:Ln(g.root,p)},f,{children:d?oo(u,d):u}))});return"production"!==process.env.NODE_ENV&&(a.propTypes={children:dt.node,direction:dt.oneOfType([dt.oneOf(["column-reverse","column","row-reverse","row"]),dt.arrayOf(dt.oneOf(["column-reverse","column","row-reverse","row"])),dt.object]),divider:dt.node,spacing:dt.oneOfType([dt.arrayOf(dt.oneOfType([dt.number,dt.string])),dt.number,dt.object,dt.string]),sx:dt.oneOfType([dt.arrayOf(dt.oneOfType([dt.func,dt.object,dt.bool])),dt.func,dt.object])}),a}();"production"!==process.env.NODE_ENV&&(ao.propTypes={children:dt.node,component:dt.elementType,direction:dt.oneOfType([dt.oneOf(["column-reverse","column","row-reverse","row"]),dt.arrayOf(dt.oneOf(["column-reverse","column","row-reverse","row"])),dt.object]),divider:dt.node,spacing:dt.oneOfType([dt.arrayOf(dt.oneOfType([dt.number,dt.string])),dt.number,dt.object,dt.string]),sx:dt.oneOfType([dt.arrayOf(dt.oneOfType([dt.func,dt.object,dt.bool])),dt.func,dt.object]),useFlexGap:dt.bool});var lo=ao;function so(t){return r(m,{...t,children:e("svg",{width:"26",height:"34",viewBox:"0 0 26 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r("path",{d:"M24.9717 11.5L14.8333 1.36165C14.5757 1.10371 14.2262 0.958634 13.8617 0.958313H5.66667C4.32953 0.958313 3.04717 1.48949 2.10167 2.43498C1.15617 3.38048 0.625 4.66285 0.625 5.99998V28C0.625 29.3371 1.15617 30.6195 2.10167 31.565C3.04717 32.5105 4.32953 33.0416 5.66667 33.0416H20.3333C21.6705 33.0416 22.9528 32.5105 23.8983 31.565C24.8438 30.6195 25.375 29.3371 25.375 28V12.4166C25.3606 12.0713 25.2166 11.744 24.9717 11.5ZM15.2917 5.65165L20.6817 11.0416H15.2917V5.65165ZM20.3333 30.2916H5.66667C5.05888 30.2916 4.47598 30.0502 4.04621 29.6204C3.61644 29.1907 3.375 28.6078 3.375 28V5.99998C3.375 5.39219 3.61644 4.8093 4.04621 4.37953C4.47598 3.94976 5.05888 3.70831 5.66667 3.70831H12.5417V12.4166C12.5464 12.7798 12.6928 13.1268 12.9496 13.3837C13.2065 13.6405 13.5535 13.7869 13.9167 13.7916H22.625V28C22.625 28.6078 22.3836 29.1907 21.9538 29.6204C21.524 30.0502 20.9411 30.2916 20.3333 30.2916Z",fill:"#fff"}),r("path",{d:"M15.7317 22.225C14.6044 21.5176 13.756 20.4425 13.33 19.1817C13.7248 18.0021 13.8439 16.7478 13.6784 15.515C13.6255 15.2044 13.474 14.9191 13.2464 14.7013C13.0187 14.4835 12.727 14.3448 12.4144 14.3058C12.1018 14.2667 11.7849 14.3293 11.5107 14.4844C11.2364 14.6394 11.0194 14.8786 10.8917 15.1667C10.683 16.6487 10.8403 18.1594 11.35 19.5667C10.6537 21.1933 9.87664 22.7842 9.02169 24.3333C7.72002 25.0667 5.94169 26.1667 5.66669 27.4317C5.44669 28.4583 7.37169 31.0983 10.6534 25.3783C12.1126 24.8366 13.6072 24.3956 15.1267 24.0583C16.2499 24.7005 17.5029 25.0827 18.7934 25.1767C19.0897 25.1843 19.3816 25.1043 19.6325 24.9465C19.8835 24.7887 20.0822 24.5603 20.2036 24.2899C20.3251 24.0195 20.3639 23.7193 20.3152 23.4269C20.2666 23.1345 20.1325 22.8631 19.93 22.6467C19.16 21.8583 16.8684 22.0783 15.7317 22.225ZM6.96836 27.725C7.48213 26.8458 8.16063 26.0739 8.96669 25.4517C7.72002 27.4317 6.96836 27.78 6.96836 27.7433V27.725ZM12.3217 15.24C12.7984 15.24 12.7617 17.3483 12.4317 17.9167C12.1831 17.0521 12.1454 16.1405 12.3217 15.2583V15.24ZM10.7267 24.1867C11.3478 23.0533 11.887 21.877 12.34 20.6667C12.8257 21.5704 13.5012 22.3585 14.32 22.9767C13.09 23.2848 11.888 23.6956 10.7267 24.205V24.1867ZM19.3434 23.8567C19.3434 23.8567 19.0134 24.26 16.905 23.3433C19.1967 23.1967 19.5817 23.7283 19.3434 23.875V23.8567Z",fill:"#fff"})]})})}function co(t){return r(m,{...t,children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r("path",{d:"M20 8.70001H4C3.90151 8.70001 3.80398 8.68061 3.71299 8.64292C3.62199 8.60523 3.53931 8.54999 3.46967 8.48034C3.40003 8.4107 3.34478 8.32802 3.30709 8.23703C3.2694 8.14603 3.25 8.0485 3.25 7.95001C3.25 7.85152 3.2694 7.75399 3.30709 7.663C3.34478 7.57201 3.40003 7.48933 3.46967 7.41968C3.53931 7.35004 3.62199 7.29479 3.71299 7.2571C3.80398 7.21941 3.90151 7.20001 4 7.20001H20C20.1989 7.20001 20.3897 7.27903 20.5303 7.41968C20.671 7.56033 20.75 7.7511 20.75 7.95001C20.75 8.14892 20.671 8.33969 20.5303 8.48034C20.3897 8.621 20.1989 8.70001 20 8.70001Z",fill:"white"}),r("path",{d:"M16.44 20.75H7.56C7.24309 20.7717 6.92503 20.7302 6.62427 20.628C6.3235 20.5259 6.04601 20.365 5.80788 20.1548C5.56975 19.9446 5.37572 19.6891 5.23704 19.4034C5.09836 19.1176 5.01779 18.8071 5 18.49V7.99998C5 7.80107 5.07902 7.61031 5.21967 7.46965C5.36032 7.329 5.55109 7.24998 5.75 7.24998C5.94891 7.24998 6.13968 7.329 6.28033 7.46965C6.42098 7.61031 6.5 7.80107 6.5 7.99998V18.49C6.5 18.9 6.97 19.25 7.5 19.25H16.38C16.94 19.25 17.38 18.9 17.38 18.49V7.99998C17.38 7.78516 17.4653 7.57913 17.6172 7.42723C17.7691 7.27532 17.9752 7.18998 18.19 7.18998C18.4048 7.18998 18.6109 7.27532 18.7628 7.42723C18.9147 7.57913 19 7.78516 19 7.99998V18.49C18.9822 18.8071 18.9016 19.1176 18.763 19.4034C18.6243 19.6891 18.4303 19.9446 18.1921 20.1548C17.954 20.365 17.6765 20.5259 17.3757 20.628C17.075 20.7302 16.7569 20.7717 16.44 20.75ZM16.56 7.74998C16.4611 7.75133 16.363 7.73285 16.2714 7.69563C16.1798 7.65842 16.0966 7.60323 16.0267 7.53331C15.9568 7.4634 15.9016 7.38018 15.8644 7.28858C15.8271 7.19698 15.8087 7.09885 15.81 6.99998V5.50998C15.81 5.09999 15.33 4.74998 14.81 4.74998H9.22C8.67 4.74998 8.22 5.09999 8.22 5.50998V6.99998C8.22 7.1989 8.14098 7.38966 8.00033 7.53031C7.85968 7.67097 7.66891 7.74998 7.47 7.74998C7.27109 7.74998 7.08032 7.67097 6.93967 7.53031C6.79902 7.38966 6.72 7.1989 6.72 6.99998V5.50998C6.75872 4.8813 7.04203 4.29275 7.50929 3.87035C7.97655 3.44795 8.5906 3.22527 9.22 3.24998H14.78C15.4145 3.21717 16.0362 3.4362 16.51 3.85944C16.9838 4.28267 17.2713 4.87586 17.31 5.50998V6.99998C17.3113 7.09931 17.2929 7.19792 17.2558 7.29007C17.2187 7.38222 17.1637 7.46608 17.0939 7.53679C17.0241 7.6075 16.941 7.66364 16.8493 7.70195C16.7577 7.74027 16.6593 7.75999 16.56 7.75998V7.74998Z",fill:"white"}),r("path",{d:"M10.22 17C10.0219 16.9974 9.8326 16.9175 9.6925 16.7774C9.55241 16.6373 9.47256 16.4481 9.46997 16.25V11.72C9.46997 11.5211 9.54899 11.3303 9.68964 11.1896C9.83029 11.049 10.0211 10.97 10.22 10.97C10.4189 10.97 10.6096 11.049 10.7503 11.1896C10.891 11.3303 10.97 11.5211 10.97 11.72V16.24C10.9713 16.3393 10.9529 16.4379 10.9158 16.5301C10.8787 16.6222 10.8236 16.7061 10.7539 16.7768C10.6841 16.8475 10.601 16.9036 10.5093 16.9419C10.4177 16.9803 10.3193 17 10.22 17Z",fill:"white"}),r("path",{d:"M13.78 17C13.5811 17 13.3904 16.921 13.2497 16.7803C13.109 16.6396 13.03 16.4489 13.03 16.25V11.72C13.03 11.5211 13.109 11.3303 13.2497 11.1896C13.3904 11.049 13.5811 10.97 13.78 10.97C13.9789 10.97 14.1697 11.049 14.3104 11.1896C14.451 11.3303 14.53 11.5211 14.53 11.72V16.24C14.53 16.4398 14.4513 16.6316 14.311 16.7739C14.1706 16.9161 13.9799 16.9973 13.78 17Z",fill:"white"})]})})}function uo(e){const r=1048576;return e<r?`${(e/1024).toFixed(1)}KB`:`${(e/r).toFixed(1)}MB`}function po({name:t,tipoArquivo:a,title:s,required:c=!1,multiple:d=!1,apiURL:p,sizeLimit:m=4,xs:y=12,sm:b,md:x,route:v="",tstToken:C="",dropZoneOptions:w}){const{getRootProps:k,getInputProps:E}=pe({multiple:d,useFsAccessApi:!0,onDrop:e=>{O(-1),e.filter(e=>!(e.size/1048576>m&&($(`Por favor, escolha um arquivo com tamanho inferior a ${m} MB`),setTimeout(()=>{$("")},3e3),1))).forEach((e,r)=>{let t=Date.now()+r;const n=new FormData;n.append("files",e),n.append("tipoArquivo",a),ue.post(p,n,{onUploadProgress:r=>{const n=Math.round(100*r.loaded/r.total);O(n),n>=100&&V(r=>[...r,{id:t,name:e.name,loading:!0,error:!1,file:e,size:e.size}])},headers:{Authorization:`Bearer ${""===C?D?D.token:"":C}`}}).then(e=>{if(e.status>200){const r=te(e.data,v,e.data)[0].coSeqArquivo;S.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:r,CO_TIPO_ARQUIVO:parseInt(a)}]),A(e=>[...e,t]);const n={};n[t]=r,R(e=>({...e,...n}))}else O(-1),P(t)}).catch(e=>{console.log(e),O(-1),P(t)})})},...w||{}}),S=H(lr),{user:D}=H(ir),Y=f();h(Y.breakpoints.only("xs"));const[M,O]=J(-1),[I,V]=J([]),[T,A]=J([]),[F,R]=J({}),[j,$]=J(""),P=(e,r,t)=>{V(I.filter(r=>r.id!==e)),t&&S.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==t)),r||($("Erro ao enviar arquivo. Verifique o formato e tente mais tarde."),setTimeout(()=>{$("")},3e3))};return Z(()=>{const e=new DataTransfer;I.forEach(r=>{e.items.add(r.file)}),S?.formSetValue(t,e.files)},[I,S,t]),Z(()=>()=>{S.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(a)))},[]),r(n,{item:!0,xs:y,sm:b,md:x,sx:{width:"100%"},children:e(i,{bgcolor:"white",p:2,borderRadius:"8px",color:"#1E293B",children:[r(u,{required:c,sx:{marginBottom:2,textTransform:"capitalize"},children:s}),e(lo,{...k({className:"dropzone"}),bgcolor:"#EFEFEF",justifyContent:"center",alignItems:"center",textAlign:"center",borderRadius:"6px",py:8,border:"solid 1.5px #989898",sx:{borderStyle:"dashed",cursor:"pointer"},children:[r("input",{...E(),...S.formRegister(t,{validate:(e,r)=>{if((e.length&&T.length)<=0&&c)return"O campo de arquivo é obrigatório"}})}),e(lo,{spacing:2,alignItems:"center",children:[e(i,{children:[r(o,{fontWeight:600,fontSize:18,children:"Arraste seus arquivos até aqui"}),r(o,{children:"ou selecione arquivos que estão no seu computador"})]}),r(l,{variant:"contained",sx:{backgroundColor:"#64748B",pointerEvents:"none",borderRadius:"8px",width:"fit-content"},children:"Selecionar"}),e(o,{fontWeight:300,children:["Tamanho máximo por arquivo ",m,"MB"]})]})]}),e(o,{pt:2,fontSize:16,fontWeight:600,children:["Você selecionou ",I.length," arquivo",I.length>1?"s":"","."]}),e(lo,{width:"100%",marginTop:1,spacing:1,children:[I.map(t=>e(lo,{direction:"row",justifyContent:"space-between",border:"solid 1px #E2E8F0",borderRadius:2,p:1,children:[e(lo,{direction:"row",children:[r(lo,{direction:"row",justifyContent:"center",alignItems:"center",minWidth:30,pr:1.5,children:r(so,{sx:{filter:"invert(42%) sepia(86%) saturate(2412%) hue-rotate(326deg) brightness(86%) contrast(102%)",transform:"scale(1.5)",width:30}})}),e(lo,{children:[r(o,{fontWeight:600,children:t.name}),r(o,{fontSize:14,children:uo(t.size)})]})]}),r(l,{size:"small",startIcon:r(co,{}),variant:"contained",onClick:e=>{return r=t.id,void(Object.keys(F).includes(r.toString())&&fetch(`${p}/${F[r]}`,{method:"DELETE",headers:{Authorization:`Bearer ${""===C?D?D.token:"":C}`}}).then(e=>{e.ok||P(r,!0,F[r]),200===e.status&&P(r,!0,F[r])}).catch(e=>console.log(e)));var r},sx:{height:40,backgroundColor:"#DE3F50",borderRadius:"8px"},children:"Remover"})]})),M>0&&M<100&&r(g,{value:M,sx:{backgroundColor:"#103D6A",".MuiLinearProgress-bar":{backgroundColor:"#BDDDFA"}}})]}),j&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"16px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:j})]}),te(S?.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:"O campo de arquivo é obrigatório"})]})]})})}function mo({name:t,tipoArquivo:a,title:s,required:c=!1,multiple:d=!1,apiURL:p,route:m="",sizeLimit:g=4,xs:v=12,sm:C,md:w}){const k=H(lr),{user:E}=H(ir),S=f(),D=h(S.breakpoints.only("xs")),[Y,M]=J([]),[O,I]=J([]),[V,T]=J({}),[A,F]=J(""),R=G(e=>{const r=e.target.files,t=Object.keys(r).map(e=>r[e]);M([...Y,...t.filter(e=>!(e.size/1048576>g&&(F(`Por favor, escolha um arquivo com tamanho inferior a ${g} MB`),setTimeout(()=>{F("")},3e3),1))).map((e,r)=>{let t=Date.now()+r;const n=new FormData;return n.append("files",e),n.append("tipoArquivo",a),fetch(p,{method:"POST",body:n,headers:{Authorization:`Bearer ${E?E.token:""}`}}).then(e=>{e.ok?e.json().then(e=>{if(e.status&&200===e.status.status){const r=te(e,m,e)[0].coSeqArquivo;k.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:r,CO_TIPO_ARQUIVO:parseInt(a)}]),I(e=>[...e,t]);const n={};n[t]=r,T(e=>({...e,...n}))}else j(t)}):j(t)}).catch(e=>{j(t)}),{id:t,name:e.name,loading:!0,error:!1,file:e}})])},[Y,k]),j=(e,r,t)=>{M(Y.filter(r=>r.id!==e)),t&&k.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==t)),r||(F("Erro ao enviar arquivo. Tente novamente mais tarde"),setTimeout(()=>{F("")},3e3))};return Z(()=>{const e=new DataTransfer;Y.forEach(r=>{e.items.add(r.file)}),k?.formSetValue(t,e.files)},[Y,k,t]),Z(()=>()=>{k.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(a)))},[]),e(n,{item:!0,xs:v,sm:C,md:w,sx:{width:"100%"},children:[r(u,{required:c,sx:{marginBottom:2,textTransform:"capitalize"},children:s}),e(i,{sx:{backgroundColor:"#e2eafc",padding:1,borderRadius:1,marginTop:1},children:[r("input",{id:t,type:"file",multiple:d,...k?.formRegister(t,{validate:(e,r)=>{if((e.length&&O.length)<=0&&c)return"O campo de arquivo é obrigatório"}}),onChange:R,accept:".pdf",style:{display:"none"}}),r("input",{id:t+"foto",type:"file",capture:"environment",multiple:d,...k?.formRegister(t,{validate:(e,r)=>{if((e.length&&O.length)<=0&&c)return"O campo de arquivo é obrigatório"}}),onChange:R,accept:".jpg, .png, .jpeg",style:{display:"none"}}),e(i,{sx:{display:{sx:"block",md:"flex"}},children:[r(i,{sx:{width:"100%",marginRight:{xs:0,md:1},marginBottom:{xs:1,md:0}},children:!d&&Y.length>=1?r(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:r(be,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"}):r("label",{htmlFor:t,children:r(l,{variant:"contained",disableElevation:!0,startIcon:r(be,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"})})}),r(i,{sx:{width:"100%"},children:!d&&Y.length>=1?r(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:r(he,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:D?"Tirar Foto":"Escolher Imagem"}):r("label",{htmlFor:t+"foto",children:r(l,{variant:"contained",disableElevation:!0,startIcon:r(he,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:D?"Tirar Foto":"Escolher Imagem"})})})]}),e(o,{fontWeight:600,paddingY:1,color:"black",children:["Você selecionou ",Y.length," arquivo",Y.length>1&&"s"]}),Y.length>0&&r(y,{component:b,children:r(lo,{direction:"column",children:Y.map(t=>e(lo,{direction:"row",justifyContent:"space-between",padding:.5,children:[r(i,{children:e(lo,{direction:"row",spacing:2,children:[O.includes(t.id)?r(ye,{sx:{fill:"#06d6a0"}}):r(x,{size:22,sx:{color:"black"}}),r(xe,{color:"error"}),r(o,{fontWeight:600,children:t.name})]})}),r(i,{children:O.includes(t.id)&&r(l,{variant:"contained",size:"small",sx:{textTransform:"none",backgroundColor:"#d1495b","&:hover":{backgroundColor:"#c1121f"}},onClick:e=>{return r=t.id,void(Object.keys(V).includes(r.toString())&&fetch(`${p}/${V[r]}`,{method:"DELETE",headers:{Authorization:`Bearer ${E?.token}`}}).then(e=>{e.ok||j(r,!0,V[r]),200===e.status&&j(r,!0,V[r])}).catch(e=>console.log(e)));var r},startIcon:r(ge,{}),children:"Remover"})})]},t.name))})}),A&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"16px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:A})]}),te(k?.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})]})]})}function fo({defaultChecked:t=!1,...n}){const i=H(lr);Z(()=>{i?.formSetValue(n.name,t)},[]);const l=Q(()=>n.overrideYes||"Sim",[n.overrideYes]),c=Q(()=>n.overrideNo||"Não",[n.overrideNo]);return e(a,{sx:{alignItems:"center",justifyContent:"center"},children:[n.title&&r(u,{children:n.title}),r(s,{control:r(v,{defaultChecked:t,...i?.formRegister(n.name)}),label:r(o,{width:25,sx:{userSelect:"none",fontWeight:600},children:i?.formWatch(n.name)?l:c}),sx:{paddingLeft:1}})]})}var ho=/*#__PURE__*/K.memo(fo);function go({invert:e=!1,hasCheckValue:n=!1,...o}){const i=H(lr);return Z(()=>()=>{(n?e:i.formWatch(o.switchId)===e)&&o.unregisterNameList.forEach(e=>i.formUnregister(e))},[o.unregisterNameList]),r(t,{})}function yo({invert:n=!1,checkValue:o,...i}){const a=H(lr);return r(t,{children:(o?a?.formWatch(i.switchId)===o!==n:a?.formWatch(i.switchId)!==n)&&e(t,{children:[r(go,{switchId:i.switchId,unregisterNameList:i.unregisterNameList,hasCheckValue:!!o,invert:o?a?.formWatch(i.switchId)===o!==n:n}),i.children]})})}const bo=/*#__PURE__*/K.forwardRef(function(e,t){const{onChange:n,onMask:o,maskValue:i,setMaskValue:a,watchValue:l,imaskConfig:s,...c}=e,[d,u]=J(s.mask);delete c.value;const p=ee(null),[m,f]=J(""),h=H(lr);return Z(()=>{l&&f(l)},[l]),Z(()=>{h.formSetValue(c.name,p.current.element.value)},[m]),delete c.watchValue,r(Ce,{...c,mask:d,value:m,ref:p,inputRef:t,onChange:e=>{},onAccept:(e,r)=>{f(e),r.updateValue(),o&&o(e,u)},...s})});function xo(e){const n=H(lr),[o,i]=J("");return r(t,{children:r(p,{...e.formConfig,onInput:r=>{n.formSetValue(e.formConfig.name,r.target.value)},InputProps:{inputComponent:bo,inputProps:{onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue,imaskConfig:e.imaskConfig}},disabled:e.disabled,fullWidth:!0})})}function vo({type:t="input",numberMask:o="000000000000000",xs:a=12,sm:l,inputMinLength:s=1,inputMaxLength:c=255,defaultValue:d="",md:m,disabled:f=!1,watchValue:h,...g}){const y=H(lr);return Z(()=>{void 0!==h&&y.formSetValue(g.name,h)},[h]),e(n,{item:!0,xs:a,sm:l,md:m,children:[g.title&&r(u,{htmlFor:"campo",required:g.required,sx:{mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:g.title}),(()=>{const n={fullWidth:!0,size:"small",placeholder:g.customPlaceholder?g.customPlaceholder:g.title},a=g.name,l=te(y?.errors,g.name);let u=l?.message;const m=!!l;m&&(u=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),u]}));const b={...y?.formRegister(a,{validate:(e,r)=>{const n=e??"";if(n.length<=0&&g.required)return"Este campo é obrigatório";if(g.customValidate){const e=g.customValidate(n,r);if(e)return e}if("cnpj"===t){if(n.length<18&&g.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===t){if(n.length<14&&g.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===t){if(n.length<22&&g.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===t){if(n.length<9&&g.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===t||"password"===t||"number"===t){if(n.length>c)return`Limite máximo de ${c} caracteres`;if(n.length<s&&g.required)return`Limite mínimo de ${s} caracteres`}else if("email"===t){if(n.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&g.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===t){if((n.length<14||n.length>14&&n.length<18)&&g.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===t&&n.length<14&&g.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:m,helperText:u,...n,FormHelperTextProps:{sx:{backgroundColor:m?"#FFEBEE":"transparent",borderRadius:"8px",padding:m?"8px 12px":0,marginBottom:m?"4px":0,marginTop:m?"8px":0,border:m?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}},sx:{backgroundColor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}}};switch(t){case"input":case"email":return r(p,{...b,defaultValue:d,disabled:f});case"password":return r(p,{...b,type:"password",disabled:f});case"number":return r(xo,{formConfig:b,defaultValue:d,imaskConfig:{mask:o},watchValue:h,disabled:f});case"cep":return r(xo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000-000"},watchValue:h,disabled:f});case"phone":return r(xo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"(00) [9]0000-0000"},watchValue:h,disabled:f});case"sei":return r(xo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000-00000000/0000-00"},watchValue:h,disabled:f});case"cpf_cnpj":return r(xo,{formConfig:b,defaultValue:d,imaskConfig:{mask:[{mask:"000.000.000-00"},{mask:"00.000.000/0000-00"}],dispatch:(e,r)=>(r.value+e).replace(/\D/g,"").length>11?r.compiledMasks[1]:r.compiledMasks[0]},watchValue:h,disabled:f});case"cpf":return r(xo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"000.000.000-00"},watchValue:h,disabled:f});case"cnpj":return r(xo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00.000.000/0000-00"},watchValue:h,disabled:f});case"rg":return r(xo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000[000000]"},watchValue:h,disabled:f})}})()]})}var Co=/*#__PURE__*/K.memo(vo);function wo({name:t,required:o=!1,title:i,defaultChecked:l=!1,xs:s=12,unregisterNameList:c,sm:d,md:u,...p}){const m=`${t}-switch`;return e(n,{item:!0,xs:s,sm:d,md:u,children:[i&&r(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),e(a,{direction:"row",children:[r(ho,{name:m,defaultChecked:l}),r(yo,{switchId:m,unregisterNameList:c,children:r(vo,{name:"ddd",type:"input"})})]})]})}function ko({name:t,required:o=!1,title:i,customPlaceholder:a,url:l,xs:s=12,sm:c,md:d,dataPath:u=""}){const m=H(lr),{user:f}=H(ir),[h,g]=J([]);we(`autocomplete-${t}`,()=>fetch(l,{headers:{Authorization:`Bearer ${f?f.token:""}`}}).then(e=>e.json().then(e=>g(y(e)))));const y=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]),b=G((e,r)=>{m?.formSetValue(t,r?r.id:""),m?.formTrigger(t)},[m,t]);return e(n,{item:!0,xs:s,sm:c,md:d,children:[i&&r(ve,{required:o,children:i}),r("input",{type:"text",...m?.formRegister(t,{validate:(e,r)=>{if(e.length<=0&&o)return"Este campo é obrigatório"}}),hidden:!0}),r(C,{options:h,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:b,renderInput:e=>r(p,{...e,placeholder:a,size:"small",error:!!te(m?.errors,t),helperText:te(m?.errors,t)?.message})})]})}let Eo=!0;function So({name:t,url:o,title:a,customLoadingText:l,shouldRefetch:s=!0,required:c=!1,defaultValue:d,route:m="",onChange:f=()=>{},xs:h=12,sm:g,watchValue:y,md:b,disabled:x=!1}){const v=H(lr),[w,k]=J(!0),[E,S]=J([]),[D,Y]=J("Carregando..."),[M,O]=J(null),[I,V]=J(null),[T,A]=J(null),{user:F}=H(ir),R=function(e,r,n=!1){try{return Promise.resolve(function(o,i){try{var a=(A(null),Promise.resolve(fetch(e,{method:"GET",headers:{Authorization:`Bearer ${F?.token}`}})).then(function(e){if(!e.ok){const r=401===e.status?"Sessão expirada. Faça login novamente.":403===e.status?"Acesso negado. Verifique suas permissões.":e.status>=500?"Erro interno do servidor. Tente novamente mais tarde.":"Erro ao carregar dados";return A(r),Y(r),void k(!1)}return Promise.resolve(e.json()).then(function(e){const o=te(e,r,e);if(n){const e=o.filter(e=>e.id===d);e.length>0?(S(o),k(!1),v.formSetValue(t,d),O(e[0])):(A("Valor padrão inválido"),Y("Erro ao carregar dados. Valor inválido"),k(!1))}else S(o),k(!1)})}))}catch(e){return i(e)}return a&&a.then?a.then(void 0,i):a}(0,function(e){console.error("Network error:",e),A("Erro de conexão. Verifique sua internet e tente novamente."),Y("Erro de conexão. Verifique sua internet e tente novamente."),k(!1)}))}catch(e){return Promise.reject(e)}};function j(){(d||!s)&&E.length>0||(k(!0),S([]),l&&Y(l),R(o,m,!1))}return Z(()=>{d&&R(o,m,!0)},[]),Z(()=>{y&&Eo&&(V(y),v.formSetValue(t,y.id),f(y.id))},[y]),d&&E.length<=0&&!M?r(n,{item:!0,xs:h,sm:g,md:b,children:r(p,{size:"small",fullWidth:!0,placeholder:D,disabled:!0})}):e(n,{item:!0,xs:h,sm:g,md:b,children:[a&&r(u,{required:c,children:a}),r("input",{type:"text",...v?.formRegister(t,{validate:(e,r)=>e?e.length<=0&&c?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),r(C,{value:I,loading:w,loadingText:D,options:E,defaultValue:M,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(Eo=!1,e)return V(e),v.formSetValue(t,e.id),void f(e.id);V(null),v.formSetValue(t,""),f(void 0)}(r),renderInput:n=>{const o=te(v?.errors,t),l=!!o||!!T;let s=o?.message||T;return l&&(s=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),s]})),r(p,{...n,size:"small",fullWidth:!0,placeholder:a,onFocus:j,error:l,helperText:s,FormHelperTextProps:{sx:{backgroundColor:l?"#FFEBEE":"transparent",borderRadius:"8px",padding:l?"8px 12px":0,marginBottom:l?"4px":0,marginTop:l?"8px":0,border:l?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}}})},sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},size:"small",fullWidth:!0,disabled:x})]})}let Do=!0;function Yo({name:t,title:o,required:a=!1,list:l,defaultValue:s,onChange:c=()=>{},xs:d=12,sm:m,watchValue:f,forceUpdate:h=!1,md:g}){const y=H(lr),[b,x]=J(null);return Z(()=>{s&&y?.formSetValue(t,s.id)},[]),Z(()=>{f&&(Do||h)?(x(f),y.formSetValue(t,f.id),c(f.id)):void 0===f&&(Do||h)&&(x(null),y.formSetValue(t,void 0),c(void 0))},[f]),e(n,{item:!0,xs:d,sm:m,md:g,children:[o&&r(u,{required:a,children:o}),r("input",{type:"text",...y?.formRegister(t,{validate:(e,r)=>e?e?.length<=0&&a?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),r(C,{value:b,options:l,defaultValue:s,getOptionLabel:e=>e.label?e.label.toString():"Não Encontrado",isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(Do=!1,e)return x(e),y.formSetValue(t,e.id),void c(e.id);x(null),y.formSetValue(t,""),c(void 0)}(r),renderInput:n=>{const a=te(y?.errors,t),l=!!a;let s=a?.message;return l&&(s=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),s]})),r(p,{...n,size:"small",fullWidth:!0,placeholder:o,error:l,helperText:s,FormHelperTextProps:{sx:{backgroundColor:l?"#FFEBEE":"transparent",borderRadius:"8px",padding:l?"8px 12px":0,marginBottom:l?"4px":0,marginTop:l?"8px":0,border:l?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}}})},size:"small",sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},fullWidth:!0})]})}let Mo=!0;function Oo({name:t,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:m=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const x=ce(),[v,w]=J(!0),[k,E]=J([]),[S,D]=J("Carregando..."),[Y,M]=J(null),[O,I]=J(null),{user:V}=H(ir);function T(){(c||!l)&&k.length>0||(w(!0),E([]),a&&D(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?e.json().then(e=>{E(te(e,d,e)),w(!1)}):D("Erro ao carregar dados")}))}return Z(()=>{c&&fetch(o,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?(console.log("llll"),e.json().then(e=>{let r=te(e,d,e).filter(e=>e.id===c);r.length>0?(E(te(e,d,e)),w(!1),x.setValue(t,c),M(r[0])):D("Erro ao carregar dados. Valor inválido")})):D("Erro ao carregar dados")})},[]),Z(()=>{g&&Mo&&(I(g),x.setValue(t,g.id),m(g.id))},[g]),c&&k.length<=0&&!Y?r(n,{item:!0,xs:f,sm:h,md:y,children:r(p,{size:"small",fullWidth:!0,placeholder:S,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,md:y,children:[i&&r(u,{required:s,children:i}),r("input",{type:"text",...x?.register(t,{validate:(e,r)=>{if(e.length<=0&&s)return"Este campo é obrigatório"}}),hidden:!0}),r(C,{value:O,loading:v,loadingText:S,options:k,defaultValue:Y,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(Mo=!1,e)return I(e),x.setValue(t,e.id),void m(e.id);I(null),x.setValue(t,""),m(void 0)}(r),renderInput:e=>r(p,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:T,error:!!te(x.formState.errors,t),helperText:te(x.formState.errors,t)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}const Io=/*#__PURE__*/K.forwardRef(function(e,t){const{onChange:n,maskProps:o,onMask:i,maskValue:a,setMaskValue:l,watchValue:s,...c}=e,[d,u]=J(o.mask);delete c.value;const p=ee(null),[m,f]=J(""),h=ce();return Z(()=>{s&&f(s)},[s]),Z(()=>{h.setValue(c.name,p.current.element.value)},[m]),delete c.watchValue,r(Ce,{...c,...o,mask:d,value:m,ref:p,inputRef:t,onChange:e=>{},onAccept:(e,r)=>{f(e),r.updateValue(),i&&i(e,u)}})});function Vo(e){const n=H(lr),[o,i]=J("");return r(t,{children:r(p,{...e.formConfig,onInput:r=>{n.formSetValue(e.formConfig.name,r.target.value)},InputProps:{inputComponent:Io,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function To({type:t="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:m=!1,watchValue:f,...h}){const g=ce();return Z(()=>{void 0!==f&&g.setValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&r(u,{htmlFor:"campo",required:h.required,sx:{mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.formState.errors,h.name),a=i?.message,d=!!i,u={...g?.register(n,{validate:(e,r)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if("cnpj"===t){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===t){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===t){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===t){if(n.length<9&&h.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===t||"password"===t||"number"===t){if(n.length>s)return`Limite máximo de ${s} caracteres`;if(n.length<l&&h.required)return`Limite mínimo de ${l} caracteres`}else if("email"===t){if(n.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===t){if((n.length<14||n.length>14&&n.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===t&&n.length<14&&h.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"1px"}}}};switch(t){case"input":case"email":return r(p,{...u,defaultValue:c,disabled:m});case"password":return r(p,{...u,type:"password",disabled:m});case"number":return r(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:f,disabled:m});case"cep":return r(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:f,disabled:m});case"phone":return r(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:f,disabled:m});case"sei":return r(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:m});case"cpf_cnpj":return r(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00[0]"},onMask:(e,r)=>{r(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:f,disabled:m});case"cpf":return r(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:f,disabled:m});case"cnpj":return r(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:f,disabled:m});case"rg":return r(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:f,disabled:m})}})()]})}var Ao=/*#__PURE__*/K.memo(To);function Fo({name:t,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:m=255,md:f,...h}){const g=ce();return Z(()=>{g.setValue(t,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&r(ve,{required:o,sx:{textTransform:"capitalize",mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:i}),r(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.register(t,{validate:(e,r)=>o&&e.length<=0?"Este campo é obrigatório":e.length>m?`Limite máximo de ${m} caracteres`:e.length<u&&o?`Limite mínimo de ${u} caracteres`:void 0}),error:!!te(g.formState.errors,t),helperText:te(g.formState.errors,t)?.message,sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"1px"}}},placeholder:a||i})]})}function Ro({name:t,required:o=!1,title:a,customPlaceholder:l,defaultValue:s="",xs:c=12,sm:d,watchValue:u="",inputMinLength:m=3,inputMaxLength:f=255,md:h,...g}){const y=H(lr);Z(()=>{y.formSetValue(t,u)},[u]);const b=te(y.errors,t);let x=b?.message;const v=!!b;return v&&(x=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),x]})),e(n,{item:!0,xs:c,sm:d,md:h,children:[a&&r(ve,{required:o,sx:{textTransform:"capitalize",mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:a}),r(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:s,...y.formRegister(t,{validate:(e,r)=>o&&e.length<=0?"Este campo é obrigatório":e.length>f?`Limite máximo de ${f} caracteres`:e.length<m&&o?`Limite mínimo de ${m} caracteres`:void 0}),error:v,helperText:x,FormHelperTextProps:{sx:{backgroundColor:v?"#FFEBEE":"transparent",borderRadius:"8px",padding:v?"8px 12px":0,marginBottom:v?"4px":0,marginTop:v?"8px":0,border:v?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}},sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},placeholder:l||a})]})}function jo({name:t,required:o=!1,xs:l=12,sm:s,md:d}){const u=H(lr),m=`switch-${t}`;return Z(()=>{u.formWatch(m)||u.formSetValue(t,void 0)},[u]),r(n,{item:!0,xs:l,sm:s,md:d,children:e(a,{direction:"row",children:[r(i,{children:r(c,{size:"small",...u.formRegister(m),sx:{paddingLeft:0,margin:0}})}),u.formWatch(m)?r(p,{size:"small",...u.formRegister(t,{validate:(e,r)=>{if(!0===u.formWatch(m)&&(!e||e.length<=0&&o))return"Este campo não pode ser vazio"}}),required:!0,error:!!te(u.errors,t),helperText:te(u.errors,t)?.message,placeholder:"Outro"}):r(p,{size:"small",disabled:!0,placeholder:"Outro"})]})})}const No=(e,r)=>{if(!e||Object.keys(e).length<=0)return[];if(!e[r])return[];let t=Object.keys(e[r]).map(e=>`${r}.${e}`);return e.files&&(t=[...t,...Object.keys(e.files).map(e=>`files.${e}`)]),t};function $o({debugLog:t=!1,test:n=!1,testConfig:o={},customMarginBottom:s=10,...c}){c.children=Array.isArray(c.children)?c.children.filter((e,r)=>e):c.children;const d=Array.isArray(c.children)?c.children.length:1,u=H(lr),p=ee(null),m=f(),[g,y]=J(0),b=(Array.isArray(c.children)?c.children:[c.children]).map((e,r)=>/*#__PURE__*/K.cloneElement(e,{...e.props,prefix:r})),x=d;return e(i,{children:[n&&r(a,{direction:"row",justifyContent:"end",children:r(l,{variant:"contained",color:"error",onClick:()=>{Object.keys(o).forEach((e,r)=>{const t=o[Number(e)];Object.keys(t).forEach(r=>{u.formUnregister(`${e}.${r}`),u.formSetValue(`${e}.${r}`,t[r])}),r<Object.keys(o).length-1&&new Promise(e=>setTimeout(e,100)).then(()=>{p.current?.click()})})},children:"EXCLUIR BANCO PRODUÇÃO"})}),e(a,{sx:{padding:2,marginBottom:s},children:[r(i,{children:b.map((e,t)=>r(i,{hidden:!(g===t),children:b[t]},"formsB"+t))}),r(w,{variant:"text",steps:x,position:h(m.breakpoints.only("xs"))?"bottom":"static",activeStep:g,sx:{paddingTop:2,paddingBottom:4,paddingX:0},backButton:r(l,{variant:"contained",startIcon:r(ke,{}),onClick:()=>{y(e=>e-1)},disabled:0===g,sx:{textTransform:"none"},children:"Voltar"}),nextButton:g<x-1?r(l,{variant:"contained",endIcon:r(Ee,{}),onClick:function(){try{return t&&console.log(u.formGetValues()),Promise.resolve(u.formTrigger(No(u.formGetValues(),g))).then(function(e){e?y(e=>e+1):Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"})})}catch(e){return Promise.reject(e)}},sx:{textTransform:"none"},ref:p,children:"Próximo"}):r(i,{children:r(De,{variant:"contained",type:"submit",loading:u.submiting,loadingPosition:"start",startIcon:r(Se,{}),onClick:e=>function(e){try{return Promise.resolve(u.formTrigger(No(u.formGetValues(),g))).then(function(r){r||(e.preventDefault(),Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"}))})}catch(e){return Promise.reject(e)}}(e),sx:{textTransform:"none",backgroundColor:"#22C55E","&:hover":{backgroundColor:"#48cf7a"}},children:r("span",{children:"Salvar"})})})})]})]})}var Po=/*#__PURE__*/K.memo($o);function zo(e,r,t){if(!e.props)return e;const n=e.props.children;if(!n)/*#__PURE__*/return K.cloneElement(e,{...e.props,name:`${r}.${e.props.name}`,key:e.props.name?`${r}.${e.props.name}`:`noListing-${t}-${r}-${e.props.name}`});let o;if(Array.isArray(n)){let e=[];n.forEach((n,o)=>{e.push(zo(n,r,t+(o+1)))}),o=e}else o=zo(n,r,t+1);/*#__PURE__*/return K.cloneElement(e,{...e.props,children:o,name:`${r}.${e.props.name}`,key:e.props.name?`${r}.${e.props.name}`:`noListing-${t}-${r}-${e.props.name}`})}function Bo({optional:o=!1,title:l,prefix:s=0,optionalMessage:c,defaultChecked:d,...u}){const p=H(lr),m=`switch-${s}`,f=(Array.isArray(u.children)?u.children:[u.children]).map((e,r)=>e&&zo(e,s,r));return e(i,{children:[r(n,{item:!0,xs:12,children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",spacing:2,children:[r(i,{sx:{marginTop:.6},children:r(a,{sx:{backgroundColor:"#E6F8EB",borderRadius:"100%",height:"35px",width:"35px"},justifyContent:"center",alignItems:"center",children:r(Oe,{sx:{height:"18px",fill:"#01BA35"}})})}),r(re,{variant:"h6",fontWeight:600,fontSize:28,fontFamily:"Inter",sx:{color:"#1E293B",paddingBottom:4},children:l})]}),r(i,{hidden:!o,children:r(ho,{name:m,defaultChecked:!o||d,overrideNo:u.overrideSwitchNo,overrideYes:u.overrideSwitchYes})})]})}),r(a,{spacing:2,children:o?p.formWatch(m)?r(n,{container:!0,spacing:1,children:f}):r(a,{justifyContent:"center",alignItems:"center",children:r(re,{fontFamily:"Inter",fontSize:22,paddingY:8,textAlign:"center",children:c||e(t,{children:[r("b",{children:l})," é opcional. ",r("br",{}),"Marque a opção acima caso haja necessidade."]})})}):r(n,{container:!0,spacing:1,children:f})})]})}var Wo=/*#__PURE__*/K.memo(Bo);let Lo={open:()=>{},close:()=>{},openReparented:()=>{},reparent:()=>r(t,{})};function _o(){const[n,l]=J(!1),[s,c]=J(null),d=()=>l(!1);ee(null);const u=f(),p=h(u.breakpoints.up("sm")),[m,g]=J({}),[y,b]=J(-1321465654);return Z(()=>{Lo.open=e=>{e&&c(e),b(-1321465654),l(!0)},Lo.reparent=(e,n)=>(g(o=>({...o,[n]:r(t,{children:e})})),r(t,{})),Lo.openReparented=e=>{b(e),c(null),l(!0)},Lo.close=d},[l]),r(t,{children:p?r(E,{open:n,onClose:d,children:e(i,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",borderRadius:2,bgcolor:"white",border:"1px solid #454545",boxShadow:24},children:[r(i,{onClick:d,width:"fit-content",height:"fit-content",position:"absolute",right:0,top:0,margin:.6,sx:{":hover":{transform:"scale(1.03)",transition:"all 500ms",cursor:"pointer"}},children:r($e,{sx:{transform:"scale(.9)"}})}),e(i,{overflow:"auto",maxHeight:"90vh",p:2,marginTop:4,borderTop:"solid 1px gray",bgcolor:"#F9F9F9",borderRadius:2,children:[s,m[y]]})]})}):e(k,{anchor:"bottom",open:n,onClose:d,onOpen:()=>{},PaperProps:{sx:{bgcolor:"transparent"}},children:[r(a,{direction:"row",onClick:d,maxHeight:"8vh",height:"8vh",justifyContent:"center",alignItems:"center",children:r(o,{fontWeight:600,color:"white",children:"Clique fora para fechar"})}),e(i,{p:2,maxHeight:"92vh",bgcolor:"white",overflow:"auto",children:[s,m[y]]})]})})}function qo({customColor:e="#383838",customFontColor:t="white",...n}){const o=Pe(e);return r(l,{...n,sx:{bgcolor:o.toHexString(),color:Pe(t).toHexString(),":hover":{bgcolor:o.darken(10).toHexString()},boxShadow:"none",borderRadius:3,textTransform:"capitalize",paddingX:2},size:"small",children:n.children})}function Uo({data:n=[],...o}){const[i,a]=K.useState(null),l=Boolean(i),s=()=>{a(null)};return e(t,{children:[r(qo,{...o.btProps,onClick:e=>{a(e.currentTarget)},children:o.children}),r(S,{id:"basic-menu",anchorEl:i,open:l,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:n.map(e=>r(D,{onClick:r=>{e.onClick&&e.onClick(),s()},children:e.name}))})]})}function Ko(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function Xo(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}let Ho=[],Go=!1,Jo="",Zo=!1,Qo={},ei="";function ri({mediaQueryLG:n,columns:o,emptyMsg:s={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:c="",tableName:d="Dados",csv:u,columnSize:p,action:m,useKC:y=!0,statusKeyName:x="",csvExcludeKeys:v=[],csvExcludeKeysCSV:C=[],csvExcludeKeysAll:w=[],csvCustomKeyNames:k={},csvExcludeValidate:E=(e,r)=>!1,csvButtonTitle:S="Salvar .CSV",csvNoZipText:D="Salvar .CSV",csvAllButtonTitle:V="Salvar todos em CSV",removeQuotes:T=!1,normalize:A=!1,csvShowAllButton:F=!1,csvWithoutZip:R=!1,itemCount:j=10,csvUpper:N=!1,csvZipFileNamesKey:_="",generateCsvZip:U=!1,hideTitleCSV:K=!1,csvExcludeUpper:X=[],multipleDataPath:Q="",expandTextMaxLength:ne=50,collapsedSize:oe=53,customMargin:ie=4,customMarginMobile:ae=0,filtersFunc:se,filters:ce=[],orderBy:de=[],customErrorMsg:ue,customTableStyle:pe={},id:me,initialData:fe=null,isLoading:he,alwaysExpanded:ge=!1}){const[ye,be]=J(null),[xe,ve]=J(fe),{user:Ce,userLoaded:we}=H(ir),[ke,Ee]=J([]),[Se,De]=J([]),[Ye,Me]=J(j),[Oe,$e]=J(0),[Pe,ze]=J(1),[Be,We]=J(1);J("");const[Le,_e]=J({}),[qe,Ue]=J({}),[Ke,Xe]=J({}),[He,Ge]=J("filterKey"),Je=f(),Ze=h(Je.breakpoints.only("xs")),Qe=ee(null),er=h(Je.breakpoints.up(2e3));Jo=`tableFilter_${me}`,ei=`tableFilterCache_${me}`,Qo=se??{},localStorage.getItem(ei)||localStorage.setItem(ei,JSON.stringify(ce)),localStorage.getItem(ei)!==JSON.stringify(ce)&&(localStorage.setItem(ei,JSON.stringify(ce)),localStorage.removeItem(Jo));const rr=G(e=>{if(e.length<=0)return 1;let r=e.length/Ye;return r=r<1?1:r,Math.ceil(r)},[Ye]),tr=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,c):void 0,[]);Z(()=>{if(ye||!tr(xe))return;const e=tr(xe);Ee(e),De(e),ze(rr(e)),localStorage.getItem(Jo)&&dr(JSON.parse(localStorage.getItem(Jo)))},[Ye,xe,rr,ye]),Z(()=>{$e(Be-1)},[Be]);const nr=G((e,r)=>{We(r)},[]),or=G(()=>{const e=Oe*Ye;return ke.slice(e,e+Ye)},[ke,Ye,Oe]),ar=G((e,r=!1)=>{if(e.preventDefault(),ke.length<=0)return;const t=Object.keys(ke[0]);if(U&&r){const e=t.filter(e=>!v.includes(e)),r=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=new Ne,i={};ke.forEach(e=>{i[e[_]]||(i[e[_]]=[]),i[e[_]].push(e)}),Object.keys(i).forEach(n=>{const a=[];i[n].forEach(r=>{let n=!0;if(t.forEach(e=>{E(e,r[e])&&(n=!1)}),n){const t=e.map(e=>{if("string"==typeof r[e]){let t=N?r[e].toUpperCase():r[e];return t=A?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,T?`${t}`:`"${t}"`}if("object"==typeof r[e]&&!Array.isArray(r[e])&&null!==r[e]){let t=lr(r[e]).slice(1,-1),n=N&&!X.includes(e)?t.toUpperCase():t;return n=A?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,T?`${n}`:`"${n}"`}return r[e]}).join(",");a.push(t)}});const l=K?a.join("\n"):"\ufeff"+r+a.join("\n");a.length>0&&o.file(`${n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}.csv`,l)});var n=window.document.createElement("a");o.generateAsync({type:"base64"}).then(e=>{n.setAttribute("href","data:application/zip;base64,"+e),n.setAttribute("download",`${u?.fileName}.zip`),n.click()})}else{let e=t.filter(e=>!C.includes(e)).map(e=>e===Q?"hrTermino":e);""!==Q&&(e=["dtInicio","hrInicio",...e]);const r=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=[];ke.forEach(r=>{let n=!0;if(t.forEach(e=>{E(e,r[e])&&(n=!1)}),n){const t=e.map(e=>{if("dtInicio"===e)return"{dtInicio}";if("hrInicio"===e)return"{hrInicio}";if("hrTermino"===e)return"{hrTermino}";if("string"==typeof r[e]){let t=N&&!X.includes(e)?r[e].toUpperCase():r[e];return t=A?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,T?`${t}`:`"${t}"`}if("object"==typeof r[e]&&!Array.isArray(r[e])&&null!==r[e]){let t=lr(r[e]).slice(1,-1),n=N&&!X.includes(e)?t.toUpperCase():t;return n=A?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,T?`${n}`:`"${n}"`}return r[e]}).join(",");if(""!==Q){const e=r[Q];e&&e.forEach(e=>{o.push(t.replace("{dtInicio}",e.dtInicio).replace("{hrInicio}",e.hrInicio).replace("{hrTermino}",e.hrTermino))})}else o.push(t)}});const i=r+o.join("\n");(n=window.document.createElement("a")).setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(i)),n.setAttribute("download",`${u?.fileName}.csv`),n.click()}},[ke]);function lr(e){let r=[];if("object"==typeof e&&!Array.isArray(e)&&null!==e)for(let[t,n]of Object.entries(e))"object"!=typeof n||Array.isArray(n)||null===n?n&&r.push(t):r.push(t+": "+lr(n));return"["+r.join(" - ")+"]"}const sr=G(e=>{if(e.preventDefault(),ke.length<=0)return;const r=Object.keys(ke[0]).filter(e=>!w.includes(e)),t=r.join(",")+"\n",n=ke.map(e=>r.map(r=>{if("tbRa"===r)return e[r].NO_CIDADE;if("rlEventoData"===r)return`${e[r][0].DT_INICIO} - ${e[r][0].HR_INICIO}`;if("string"==typeof e[r]){let t=N&&!X.includes(r)?e[r].toUpperCase():e[r];return t=A?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,T?`${t}`:`"${t}"`}if("object"==typeof e[r]&&!Array.isArray(e[r])&&null!==e[r]){let t=lr(e[r]).slice(1,-1),n=N&&!X.includes(r)?t.toUpperCase():t;return n=A?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,T?`${n}`:`"${n}"`}return e[r]}).join(",")).join("\n"),o=t+n;var i=window.document.createElement("a");i.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(o)),i.setAttribute("download",`${u?.fileName}.csv`),i.click()},[ke]);function cr(){Ee(Ho),De(Ho),ze(rr(Ho)),$e(0),We(1),localStorage.removeItem(Jo),Ge((new Date).getTime().toString())}function dr(e){if(!Ho)return;let r=JSON.parse(JSON.stringify(Ho));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let t=[];switch(e.type){case"number":switch(e.operator){case"igual":r.forEach(r=>{Number(te(r,e.keyName,""))===Number(e.value)&&t.push(r)});break;case"maior que":r.forEach(r=>{Number(te(r,e.keyName,""))>Number(e.value)&&t.push(r)});break;case"menor que":r.forEach(r=>{Number(te(r,e.keyName,""))<Number(e.value)&&t.push(r)})}break;case"string":switch(console.log("ata: ",e.operator),e.operator){case"igual":r.forEach(r=>{const n=te(r,e.keyName,"");e.useList?Xo(n)===Xo(e.value.id)&&t.push(r):Xo(n)===Xo(e.value)&&t.push(r)});break;case"contem":r.forEach(r=>{const n=te(r,e.keyName,"");n&&(e.useList?Xo(n).includes(Xo(e.value.id))&&t.push(r):Xo(n).includes(Xo(e.value))&&t.push(r))});break;case"tem um dos":r.forEach(r=>{const n=te(r,e.keyName,"");n&&e.value.map(e=>Xo(e.id)).includes(Xo(n))&&t.push(r)})}break;case"date":switch(e.operator){case"data exata":r.forEach(r=>{const n=le(te(r,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(le(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"entre":const n=le(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=le(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");r.forEach(r=>{const i=le(te(r,e.keyName,""),"DD/MM/YYYY");(i.isAfter(n)||i.isSame(n))&&(i.isBefore(o)||i.isSame(o))&&t.push(r)})}break;case"dates":switch(e.operator){case"data inicio":r.forEach(r=>{const n=Qo[e.customFunc](te(r,e.keyName,""))??[];n.length<=0||le(n[0],"DD/MM/YYYY").isSame(le(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"data fim":r.forEach(r=>{const n=Qo[e.customFunc](te(r,e.keyName,""))??[];n.length<=0||le(n[n.length-1],"DD/MM/YYYY").isSame(le(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"tem a data":r.forEach(r=>{(Qo[e.customFunc](te(r,e.keyName,""))??[]).includes(e.value)&&t.push(r)});break;case"entre":const n=le(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=le(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");r.forEach(r=>{const i=Qo[e.customFunc](te(r,e.keyName,""))??[];let a=!1;i.forEach(e=>{if(a)return;const r=le(e,"DD/MM/YYYY");r.isValid()&&(r.isAfter(n)||r.isSame(n))&&(r.isBefore(o)||r.isSame(o))&&(a=!0)}),a&&t.push(r)})}}r=t}),Ee(r),ze(rr(r)),$e(0),We(1),localStorage.setItem(Jo,JSON.stringify(e)),De(r)}return Z(()=>{const e=Oe*Ye,r=ke.slice(e,e+Ye);let t={};r.forEach((e,r)=>{o.forEach(n=>{t[r]=!0===t[r]||(te(e,n?.keyName,"")??"Não Informado").toString().length>=ne})}),Ue(t)},[ke,Ye,Oe]),Z(()=>{console.log(Qe.current)},[Qe.current]),ye?r(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(re,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===ye.status&&"Acesso negado",500===ye.status&&e(i,{fontWeight:500,textAlign:"center",children:[r($,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),r(i,{children:ue||e(t,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",r("br",{}),r("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",r("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})}):he?r(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[r(P,{sx:{fill:"#5e5e5e"}}),e(re,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",d]})]}),r(g,{color:"inherit"}),Array(10).fill("").map(t=>r(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(t=>e(i,{children:[r(Y,{width:60}),r(Y,{width:120})]}))}))]})}):!we&&y?r(g,{}):e(t,{children:[e(i,{marginX:Ze?ae:ie,bgcolor:"white",p:2,borderRadius:6,...pe,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[r(je,{InputProps:{startAdornment:r(Ae,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){console.log(Se);const r=e.target.value;if(""===r)return Ee(Se),void ze(rr(tr(ke)));const t=tr(ke),n=[];t.forEach(e=>{const t=[];if(Object.keys(e).map(r=>{let n=te(e,r,"")??"";"number"==typeof n&&(n=n.toString()),"string"==typeof n&&t.push(n)}),t.length<=0)return;let o=!1;t.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(r.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(r.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(r.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(r.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(r.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(r.toLowerCase())||"pre aprovado".includes(r.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(r.toLowerCase())&&(o=!0))}Ko(e.toLowerCase()).includes(Ko(r.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),Ee(n),ze(rr(n)),$e(0),We(1)},fullWidth:!0,placeholder:`Pesquisar ${d}`}),ce.length>0&&r(l,{startIcon:r(z,{}),variant:"contained",onClick:e=>Lo.open(r(ti,{reset:cr,filtrar:dr,baseFilters:[...ce],filters:localStorage.getItem(Jo)?JSON.parse(localStorage.getItem(Jo)):[...ce]},He)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:r(a,{direction:"row",borderRadius:5,padding:0,children:r("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[r(Uo,{data:de.map(e=>({name:e.label,onClick:()=>function(e){let r=[...ke];r.sort((r,t)=>{const n="string"===e.type?te(r,e.key,""):Number(te(r,e.key,0)),o="string"===e.type?te(t,e.key,""):Number(te(t,e.key,0));if(Zo){if(n<o)return-1;if(n>o)return 1}else{if(n>o)return-1;if(n<o)return 1}return 0}),Zo=!Zo,Ee(r)}(e)})),btProps:{startIcon:r(B,{}),fullWidth:!0},children:"Ordenar"}),r(l,{variant:"contained",fullWidth:!0,startIcon:r(Go?q:B,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let r=0;r<j;r++)e[r]=!Go;Xe(e),_e(e),Go=!Go},children:Go?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(re,{fontWeight:600,textAlign:"end",children:["Registro de ",d,"s"]}),r(a,{justifyContent:"center",children:e(re,{children:["Exibindo ",Oe*Ye+1,"-",Oe*Ye+1+or().length-1," de ",ke.length]})})]})]}),localStorage.getItem(Jo)&&r(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(Jo)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(t=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[r(re,{fontWeight:700,children:t.label}),r(re,{fontStyle:"italic",children:t.operator}),r(re,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(t.value)?t.value.map(e=>e.label).join(" - "):"object"==typeof t.value?t.value.label:"entre"===t.operator?`${t.value?t.value:"Antes"} e ${t.value2?t.value2:"Depois"}`:t.value.toString()}),r(M,{onClick:e=>{let r=JSON.parse(localStorage.getItem(Jo)??"[]");r=r.map(e=>e.label===t.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),dr(r)},size:"small",sx:{padding:0},children:r(Ie,{sx:{fill:"white"}})})]}))}),r(a,{spacing:.2,children:or().length<=0?r(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:r(re,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:Ce?s.user:s.public})}):or().map((s,c)=>r(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:ge?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Fe,{container:!0,spacing:Ze?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Fe,{item:!0,xs:12,md:er?12/p*(o.size?o.size:1):n?n.all:12/p*(o.size?o.size:1),sx:{overflow:"hidden"},children:[r(i,{sx:{width:"max-content",paddingX:1},children:r(re,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),r(i,{paddingLeft:1,position:"relative",children:r(O,{in:ge||!0===Le[c],collapsedSize:ge?"auto":oe,onExited:e=>Xe(e=>({...e,[c]:!1})),children:r(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(te(s,o.keyName),s):e(t,{children:[r(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")}),r(i,{position:"absolute",top:0,children:ge||Ke[c]?te(s,o?.keyName,""):(te(s,o?.keyName,"")??"").toString().length>=ne?r(t,{children:(te(s,o?.keyName,"")??"").toString().substring(0,ne)+"..."}):te(s,o?.keyName,"")})]})})})})]},String(o?.keyName)+c)),r(Fe,{item:!0,xs:12,md:er?12/p:n?n.action:12/p,children:r(a,{direction:"row",alignItems:"center",justifyContent:Ze?"start":"flex-end",sx:{height:"100%",paddingBottom:Ze?2:0},children:m(s)})}),qe[c]&&!ge&&r(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:r(l,{onClick:e=>{_e(e=>({...e,[c]:!e[c]})),Xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:r(Le[c]?W:L,{}),children:Le[c]?"Ver Menos":"Ver Mais"})})]})},c))}),or().length>0&&r(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:u&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[R&&r(l,{startIcon:r(Ve,{}),variant:"contained",size:"small",onClick:ar,sx:{backgroundColor:"#5a88b0",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:D}),F&&r(l,{startIcon:r(Ve,{}),variant:"contained",size:"small",onClick:sr,sx:{backgroundColor:"#64748B",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:V}),r(l,{startIcon:r(Ve,{}),variant:"contained",size:"small",onClick:e=>ar(e,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:S})]})})]}),r(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[r(l,{onClick:e=>We(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Te,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),r(Re,{renderItem:e=>"page"===e.type?r(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:r(I,{...e}),count:Pe,siblingCount:Ze?0:6,size:"large",onChange:nr,page:Be,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),r(l,{onClick:e=>We(e=>e<Pe?e+1:Pe),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Te,{sx:{transform:"scale(1.5)"}})})]})})]})}function ti({filters:t,baseFilters:n,filtrar:o,reset:s}){const[c,d]=J(t),[u,p]=J(!1),[m,f]=K.useState(null),h=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[r(S,{open:h,onClose:()=>{f(null)},anchorEl:m,children:n.map(e=>r(D,{onClick:r=>{var t;t=e,d(e=>[...e,t]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[r(re,{fontWeight:700,fontSize:18,children:"Filtrar"}),r(l,{startIcon:r(_,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Lo.close()},children:"Limpar"})]}),r(i,{marginBottom:1,children:r(V,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),r(a,{children:u?c.map((e,t)=>r(ni,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let n=[...r];return n[t]=e,n})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}})):r(i,{children:c.map((e,t)=>r(ni,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let n=[...r];return n[t]=e,n})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}}))})}),r(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:r(l,{variant:"contained",color:"success",startIcon:r(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Lo.close()},children:"Filtrar"})})]})}function ni({filterValue:t,setDt:n,idx:o}){const[i,l]=J(t.operator),[s,c]=J(t),d=f(),u=h(d.breakpoints.only("xs"));return Z(()=>{n(s)},[s]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!u&&r(re,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:t.label}),e(T,{sx:{width:"100%"},children:[u&&r(re,{children:t.label}),r(A,{onChange:e=>{const r=e.target.value;c(e=>({...e,operator:r,value:""})),l(r)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:t.operators.map(e=>r(D,{value:e,children:e}))})]}),r(oi,{filterValue:t,operator:s.operator,onChange:(e,r="value")=>{c(t=>({...t,[r]:e}))}})]})}function oi({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return r(je,{type:"number",size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(n.useList)switch(o){case"tem um dos":return r(C,{multiple:!0,id:"tags-standard",onChange:(e,r)=>{a(r.length<=0?"":r)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>r(je,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return r(i,{width:"100%",children:r(C,{options:n.useList,onChange:(e,r)=>{a(r)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,r)=>e.label===r.label,renderInput:e=>r(je,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return r(je,{size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(o){case"data exata":case"data fim":case"data inicio":case"tem a data":return r(ne,{adapterLocale:"pt-br",dateAdapter:ae,children:r(oe,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?le(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(je,{...e,size:"small",fullWidth:!0})})});case"entre":return e(ne,{adapterLocale:"pt-br",dateAdapter:ae,children:[r(oe,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?le(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(je,{...e,size:"small",fullWidth:!0})}),r(oe,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?le(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(je,{...e,size:"small",fullWidth:!0})})]})}}return r(t,{})}var ii=/*#__PURE__*/K.memo(ri);function ai({customErrorMsg:n,error:a}){return r(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(o,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===a.status&&"Acesso negado",500===a.status&&e(i,{fontWeight:500,textAlign:"center",children:[r($,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),r(i,{children:n||e(t,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",r("br",{}),r("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",r("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})})}function li({tableName:t}){return r(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[r(P,{sx:{fill:"#5e5e5e"}}),e(re,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",t]})]}),r(g,{color:"inherit"}),Array(10).fill("").map(t=>r(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(t=>e(i,{children:[r(Y,{width:60}),r(Y,{width:120})]}))}))]})})}const si=(e,r)=>{if(e.length<=0)return 1;let t=e.length/r;return t=t<1?1:t,Math.ceil(t)};function ci(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function di(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function ui({filterData:e,startData:r,filtersFuncData:t={},localTableName:n="",setCurrentPage:o,setList:i,setListClone:a,setListPage:l,setPagCount:s,itemsCount:c}){if(!r)return;let d=JSON.parse(JSON.stringify(r));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let r=[];switch(e.type){case"number":switch(e.operator){case"igual":d.forEach(t=>{Number(te(t,e.keyName,""))===Number(e.value)&&r.push(t)});break;case"maior que":d.forEach(t=>{Number(te(t,e.keyName,""))>Number(e.value)&&r.push(t)});break;case"menor que":d.forEach(t=>{Number(te(t,e.keyName,""))<Number(e.value)&&r.push(t)})}break;case"string":switch(e.operator){case"igual":d.forEach(t=>{const n=te(t,e.keyName,"");e.useList?di(n)===di(e.value.id)&&r.push(t):di(n)===di(e.value)&&r.push(t)});break;case"contem":d.forEach(t=>{const n=te(t,e.keyName,"");n&&(e.useList?di(n).includes(di(e.value.id))&&r.push(t):di(n).includes(di(e.value))&&r.push(t))});break;case"tem um dos":d.forEach(t=>{const n=te(t,e.keyName,"");n&&e.value.map(e=>di(e.id)).includes(di(n))&&r.push(t)})}break;case"date":switch(e.operator){case"data exata":d.forEach(t=>{const n=le(te(t,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(le(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"entre":const t=le(e.value?e.value:"01/01/2000","DD/MM/YYYY"),n=le(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(o=>{const i=le(te(o,e.keyName,""),"DD/MM/YYYY");(i.isAfter(t)||i.isSame(t))&&(i.isBefore(n)||i.isSame(n))&&r.push(o)})}break;case"dates":switch(e.operator){case"data inicio":d.forEach(n=>{const o=(t[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||le(o[0],"DD/MM/YYYY").isSame(le(e.value,"DD/MM/YYYY"))&&r.push(n)});break;case"data fim":d.forEach(n=>{const o=(t[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||(console.log(o),le(o[o.length-1],"DD/MM/YYYY").isSame(le(e.value,"DD/MM/YYYY"))&&r.push(n))});break;case"tem a data":d.forEach(n=>{const o=(t[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.includes(e.value)&&r.push(n)});break;case"entre":const n=le(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=le(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(i=>{const a=(t[e.customFunc](te(i,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);let l=!1;a.forEach(e=>{if(l)return;const r=le(e,"DD/MM/YYYY");r.isValid()&&(r.isAfter(n)||r.isSame(n))&&(r.isBefore(o)||r.isSame(o))&&(l=!0)}),l&&r.push(i)})}}d=r}),i(d),s(si(d,c)),o(0),l(1),localStorage.setItem(n,JSON.stringify(e)),a(d)}function pi({order:e,list:r,orderAsc:t=!1}){const n=ze(r).sort((r,n)=>{const o="string"===e.type?te(r,e.key,""):Number(te(r,e.key,0)),i="string"===e.type?te(n,e.key,""):Number(te(n,e.key,0));if(t){if(o<i)return-1;if(o>i)return 1}else{if(o>i)return-1;if(o<i)return 1}return 0});return n}function mi({filters:t,baseFilters:n,filtrar:o,reset:s}){const[c,d]=J(t),[u,p]=J(!1),[m,f]=K.useState(null),h=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[r(S,{open:h,onClose:()=>{f(null)},anchorEl:m,children:n.map(e=>r(D,{onClick:r=>{var t;t=e,d(e=>[...e,t]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[r(re,{fontWeight:700,fontSize:18,children:"Filtrar"}),r(l,{startIcon:r(_,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Lo.close()},children:"Limpar"})]}),r(i,{marginBottom:1,children:r(V,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),r(a,{children:u?c.map((e,t)=>r(fi,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let n=[...r];return n[t]=e,n})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}})):r(i,{children:c.map((e,t)=>r(fi,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let n=[...r];return n[t]=e,n})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}}))})}),r(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:r(l,{variant:"contained",color:"success",startIcon:r(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Lo.close()},children:"Filtrar"})})]})}function fi({filterValue:t,setDt:n,idx:o}){const[i,l]=J(t.operator),[s,c]=J(t),d=f(),u=h(d.breakpoints.only("xs"));return Z(()=>{n(s)},[s]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!u&&r(re,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:t.label}),e(T,{sx:{width:"100%"},children:[u&&r(re,{children:t.label}),r(A,{onChange:e=>{const r=e.target.value;c(e=>({...e,operator:r,value:""})),l(r)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:t.operators.map(e=>r(D,{value:e,children:e}))})]}),r(hi,{filterValue:t,operator:s.operator,onChange:(e,r="value")=>{c(t=>({...t,[r]:e}))}})]})}function hi({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return r(je,{type:"number",size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(n.useList)switch(o){case"tem um dos":return r(C,{multiple:!0,id:"tags-standard",onChange:(e,r)=>{a(r.length<=0?"":r)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>r(je,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return r(i,{width:"100%",children:r(C,{options:n.useList,onChange:(e,r)=>{a(r)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,r)=>e.label===r.label,renderInput:e=>r(je,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return r(je,{size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(o){case"data exata":case"data fim":case"data inicio":case"tem a data":return r(ne,{adapterLocale:"pt-br",dateAdapter:ae,children:r(oe,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?le(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(je,{...e,size:"small",fullWidth:!0})})});case"entre":return e(ne,{adapterLocale:"pt-br",dateAdapter:ae,children:[r(oe,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?le(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(je,{...e,size:"small",fullWidth:!0})}),r(oe,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?le(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(je,{...e,size:"small",fullWidth:!0})})]})}}return r(t,{})}let gi=!1,yi="",bi={},xi="";function vi({mediaQueryLG:n,columns:o,csvConfig:s,fetchFunc:c,emptyMsg:d={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:u="",tableName:p="Dado",columnSize:m,action:y,useKC:x=!0,itemCount:v=10,expandTextMaxLength:C=50,collapsedSize:w=53,customMargin:k=4,customMarginMobile:E=0,filtersFunc:S,filters:D=[],orderBy:Y=[],customErrorMsg:V,customTableStyle:T={},id:A,initialData:F=null,isExpandable:R=!0,alwaysExpanded:j=!1}){const[N,$]=J(!1),[P,_]=J(null),[U,K]=J(F),{user:X,userLoaded:Q}=H(ir),[ne,oe]=J([]),[ie,ae]=J([]),[le,se]=J(v),[ce,de]=J(0),[ue,pe]=J(1),[me,fe]=J(1),[he,ge]=J({}),[ye,be]=J({}),[xe,ve]=J({}),[Ce,we]=J("filterKey"),ke=f(),Ee=h(ke.breakpoints.only("xs")),Se=ee(U),De=ee("true"===localStorage.getItem(`order-${A}`)||!1),Ye=h(ke.breakpoints.up(2e3));yi=`tableFilter_${A}`,xi=`tableFilterCache_${A}`,bi=S??{},localStorage.getItem(xi)||localStorage.setItem(xi,JSON.stringify(D)),localStorage.getItem(xi)!==JSON.stringify(D)&&(localStorage.setItem(xi,JSON.stringify(D)),localStorage.removeItem(yi)),Z(()=>{_(null),c&&(!Q&&x||($(!0),c().then(e=>e.ok?e.json().then(e=>{if(204===e.statusCode)K({body:{data:[]}}),Se.current=[];else if(403===e.statusCode)_({status:e.statusCode});else{let r=u?te(e,u):e;if(r&&Array.isArray(r)){let e=r;if(localStorage.getItem(`order-data-${A}`))try{e=pi({order:JSON.parse(localStorage.getItem(`order-data-${A}`)),list:r,orderAsc:De.current})}catch(e){console.log(e)}else Y.length>0&&(e=pi({order:Y[0],list:r,orderAsc:De.current}));K(e),Se.current=JSON.parse(JSON.stringify(e))}else K({body:{data:[]}}),Se.current=[]}$(!1)}):(_({status:500}),void $(!1))).catch(e=>{_({status:500})})))},[Q,c]);const Me=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]);Z(()=>{if(N||P||!Me(U))return;let e=Me(U);oe(e),ae(e),pe(si(e,le)),localStorage.getItem(yi)&&ui({filterData:JSON.parse(localStorage.getItem(yi)),filtersFuncData:bi,localTableName:yi,setCurrentPage:de,setList:oe,setListClone:ae,setListPage:fe,setPagCount:pe,startData:Se.current,itemsCount:le})},[le,N,U,P]),Z(()=>{de(me-1)},[me]);const Oe=G((e,r)=>{fe(r)},[]),Ne=G(()=>{const e=ce*le;return ne.slice(e,e+le)},[ne,le,ce]);function $e(){oe(Se.current),ae(Se.current),pe(si(Se.current,le)),de(0),fe(1),localStorage.removeItem(yi),we((new Date).getTime().toString())}Z(()=>{const e=ce*le,r=ne.slice(e,e+le);let t={};r.forEach((e,r)=>{o.forEach(n=>{t[r]=!0===t[r]||(te(e,n.keyName,"")??"Não Informado").toString().length>=C})}),be(t)},[ne,le,ce]);const Pe=(e,r=!1)=>{s&&function(e,r,t){try{if(e.length<=0)return Promise.resolve();let n=[];r.downloadAll&&r.customAll?n=r.customAll(e,t):!r.downloadAll&&r.customFiltered?n=r.customFiltered(e,t):e.forEach(e=>{const o={};r.map.forEach(n=>{if(n.useFilterValue&&!r.downloadAll&&!n.onlyAll){const r=t.filter(e=>e.label==n.useFilterValue.label&&n.useFilterValue.operators.includes(e.operator)),i=r.length>0&&r.reduce(e=>e.value).value||void 0;return void(o[n.name]=i||te(e,n.key))}n.onlyFilter||(o[n.name]=te(e,n.key))}),n.push(o)});const o=Be.utils.json_to_sheet(n),i=Be.utils.book_new();return Be.utils.book_append_sheet(i,o,r.fileName),Be.writeFile(i,`${r.fileName}.xlsx`),Promise.resolve()}catch(e){return Promise.reject(e)}}(e,{...s,...r?{downloadAll:!0}:{}},JSON.parse(localStorage.getItem(yi)??"[]")||[])},ze=e=>{ui({filterData:e,filtersFuncData:bi,localTableName:yi,setCurrentPage:de,setList:oe,setListClone:ae,setListPage:fe,setPagCount:pe,startData:Se.current,itemsCount:le})};return P?r(ai,{customErrorMsg:V,error:P}):N?r(li,{tableName:p}):!Q&&x?r(g,{}):e(t,{children:[e(i,{marginX:Ee?E:k,bgcolor:"white",p:2,borderRadius:6,...T,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[r(je,{InputProps:{startAdornment:r(Ae,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){const r=e.target.value;if(""===r)return oe(ie),void pe(si(Me(ne),le));const t=[];ie.forEach(e=>{const n=[];if(Object.keys(e).map(r=>{let t=te(e,r,"")??"";"number"==typeof t&&(t=t.toString()),"string"==typeof t&&n.push(t)}),n.length<=0)return;let o=!1;n.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(r.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(r.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(r.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(r.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(r.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(r.toLowerCase())||"pre aprovado".includes(r.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(r.toLowerCase())&&(o=!0))}ci(e.toLowerCase()).includes(ci(r.toLowerCase()))&&(o=!0)}),o&&t.push(e)}),oe(t),pe(si(t,le)),de(0),fe(1)},fullWidth:!0,placeholder:`Pesquisar ${p}`}),r(l,{startIcon:r(z,{}),variant:"contained",onClick:e=>Lo.open(r(mi,{reset:$e,filtrar:e=>ze(e),baseFilters:[...D],filters:localStorage.getItem(yi)?JSON.parse(localStorage.getItem(yi)):[...D]},Ce)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:r(a,{direction:"row",borderRadius:5,padding:0,children:r("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[Y.length>0&&r(Uo,{data:Y.map(e=>({name:e.label,onClick:()=>(e=>{De.current=!De.current;const r=pi({order:e,list:ne,orderAsc:De.current});localStorage.setItem(`order-${A}`,De.current.toString()),localStorage.setItem(`order-data-${A}`,JSON.stringify(e)),oe(r)})(e)})),btProps:{startIcon:r(B,{}),fullWidth:!0},children:"Ordenar"}),R&&!j&&r(l,{variant:"contained",fullWidth:!0,startIcon:r(gi?q:B,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let r=0;r<v;r++)e[r]=!gi;ve(e),ge(e),gi=!gi},children:gi?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(re,{fontWeight:600,textAlign:"end",children:["Registro de ",p,"s"]}),r(a,{justifyContent:"center",children:e(re,{children:["Exibindo ",ce*le+1,"-",ce*le+1+Ne().length-1," de ",ne.length]})})]})]}),localStorage.getItem(yi)&&r(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(yi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(t=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[r(re,{fontWeight:700,children:t.label}),r(re,{fontStyle:"italic",children:t.operator}),r(re,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(t.value)?t.value.map(e=>e.label).join(" - "):"object"==typeof t.value?t.value.label:"entre"===t.operator?`${t.value?t.value:"Antes"} e ${t.value2?t.value2:"Depois"}`:t.value.toString()}),r(M,{onClick:e=>{let r=JSON.parse(localStorage.getItem(yi)??"[]");r=r.map(e=>e.label===t.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),ze(r)},size:"small",sx:{padding:0},children:r(Ie,{sx:{fill:"white"}})})]}))}),r(a,{spacing:.2,children:Ne().length<=0?r(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:r(re,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:X?d.user:d.public})}):Ne().map((s,c)=>r(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:j?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Fe,{container:!0,spacing:Ee?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Fe,{item:!0,xs:12,md:Ye?12/m*(o.size?o.size:1):n?n.all:12/m*(o.size?o.size:1),sx:{overflow:"hidden"},children:[r(i,{sx:{width:"max-content",paddingX:1},children:r(re,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),r(i,{paddingLeft:1,position:"relative",children:r(O,{in:j||!0===he[c],collapsedSize:j?"auto":w,onExited:e=>ve(e=>({...e,[c]:!1})),children:r(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(te(s,o.keyName),s):e(t,{children:[r(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")}),r(i,{position:"absolute",top:0,children:j||xe[c]?te(s,o.keyName,""):(te(s,o.keyName,"")??"").toString().length>=C?r(t,{children:(te(s,o.keyName,"")??"").toString().substring(0,C)+"..."}):te(s,o.keyName,"")})]})})})})]},o.keyName+c)),r(Fe,{item:!0,xs:12,md:Ye?12/m:n?n.action:12/m,children:r(a,{direction:"row",alignItems:"center",justifyContent:Ee?"start":"flex-end",sx:{height:"100%",paddingBottom:Ee?2:0},children:y(s)})}),ye[c]&&!j&&r(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:r(l,{onClick:e=>{ge(e=>({...e,[c]:!e[c]})),ve(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:r(he[c]?W:L,{}),children:he[c]?"Ver Menos":"Ver Mais"})})]})},c))}),Ne().length>0&&r(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:s&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[JSON.parse(localStorage.getItem(yi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).length>0&&r(l,{startIcon:r(Ve,{}),variant:"contained",size:"small",onClick:e=>Pe(ne),sx:{backgroundColor:"#a5a5a5",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Filtrados"}),r(l,{startIcon:r(Ve,{}),variant:"contained",size:"small",onClick:e=>Pe(Se.current,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Tabela"})]})})]}),r(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[r(l,{onClick:e=>fe(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Te,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),r(Re,{renderItem:e=>"page"===e.type?r(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:r(I,{...e}),count:ue,siblingCount:Ee?0:6,size:"large",onChange:Oe,page:me,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),r(l,{onClick:e=>fe(e=>e<ue?e+1:ue),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Te,{sx:{transform:"scale(1.5)"}})})]})})]})}var Ci=/*#__PURE__*/K.memo(vi);const wi=We(()=>import("./Map-31d95a26.js").then(e=>e.Map),{ssr:!1});function ki({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:p,menuItems:m,paddingBottom:f=0,logoutMsg:h="Sair",logoutFunc:g,...y}){let b;u&&(b=Ge());const{user:x,login:v,logout:C,type:w}=H(ir),[k,E]=J(null),[Y,O]=J(null),I=Boolean(k),V=Boolean(Y),[T,A]=J(!1),j=G(e=>{E(e.currentTarget)},[]),N=G(()=>{E(null)},[]),$=G((e,r)=>{A(!0),E(null),b?b.push({pathname:r}).finally(()=>A(!1)):A(!1)},[b]);return e(t,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[r(F,{position:"relative",elevation:0,sx:{backgroundColor:"#F1F5F9",color:"black",paddingY:1,paddingX:{xs:1,md:4}},children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",md:"flex"},width:"100%"},children:[r(He,{href:"/",children:u?r(Xe,{src:c,alt:s,width:40,height:40}):r("img",{src:c,height:35})}),r(i,{children:r(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),r(i,{sx:{display:{xs:"flex",md:"none"}},children:n.length>0&&e(t,{children:[r(M,{onClick:j,children:r(qe,{})}),r(S,{open:I,onClose:N,anchorEl:k,children:n.map(e=>r(D,{onClick:r=>$(r,e.path),children:r(o,{textTransform:"capitalize",children:e.name})},`navmenu${e}`))})]})}),e(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{md:"100%"}},children:[r(a,{direction:"row",spacing:2,sx:{display:{xs:"none",md:"flex"}},children:n.map(e=>r(i,{sx:{a:{color:"#2c7da0",textDecoration:"none",textTransform:"capitalize","&:hover":{color:"#90e0ef"}}},children:r(l,{onClick:r=>{return t=e.path,A(!0),void(b?b.push({pathname:t}).finally(()=>A(!1)):A(!1));var t},sx:{textTransform:"capitalize"},children:e.name})},`navigation${e.path}`))}),e(a,{direction:"row",spacing:2,children:[r(i,{children:p}),x?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[r(R,{sx:{width:30,height:30},src:x.image}),e(S,{open:V,onClose:e=>O(null),anchorEl:Y,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[m,r(D,{onClick:function(e){try{function r(){C()}O(null);const t=function(){if(g){const e=function(e,r){try{var t=Promise.resolve(g()).then(function(){})}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(r):r())}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[r(_e,{sx:{fill:"#545454"}}),r(o,{textTransform:"capitalize",children:h})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>O(e.currentTarget),sx:{userSelect:"none"},children:[r(o,{children:"Olá,"}),r(o,{fontWeight:600,children:x?.given_name}),r(Le,{})]})]}):r(l,"govbr"===w?{variant:"contained",size:"small",startIcon:r(Ue,{}),onClick:v,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:r(Ue,{}),onClick:v,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})]})]})}),T&&r(Ke,{})]}),r(i,{paddingBottom:f})]})}function Ei({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:p,menuItems:m,color:h="blue",route:g="/teste/89",paddingBottom:y=0,logoutMsg:b="Sair",customBgColor:x="#FFFFFF",logoutFunc:v,...C}){const w=f(),k=n.length<=3?"md":"lg";let E;u&&(E=Ge());const{user:Y,login:O,logout:I,type:V}=H(ir),[T,A]=J(null),[j,N]=J(null),$=Boolean(T),P=Boolean(j),[z,B]=J(!1),W=G(e=>{A(e.currentTarget)},[]),L=G(()=>{A(null)},[]),_=G((e,r)=>{B(!0),A(null),E?E.push({pathname:r}).finally(()=>B(!1)):B(!1)},[E]);return e(t,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[r(F,{position:"relative",elevation:0,sx:{color:w.palette.getContrastText(x),paddingX:{xs:1,[k]:4},bgcolor:x},children:e(a,{direction:"row",justifyContent:"space-between",bgcolor:x,children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",[k]:"flex"},width:"100%"},children:[r(He,{href:"/",children:u?r(Xe,{src:c,alt:s,width:40,height:40}):r("img",{src:c,height:35})}),r(i,{children:r(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),r(a,{direction:"row",width:"100%",justifyContent:"center",alignItems:"center",spacing:2,sx:{display:{xs:"none",[k]:"flex"}},children:n.map((e,t)=>{const n=function(e,r){return"/"===r?e===r:e.startsWith(r)}(u?E?.pathname??"":g,e.path);return r(i,{paddingX:3,paddingY:.8,borderRadius:50,bgcolor:n?h:"transparent",color:n?"#fff":"inherit",sx:{transition:"all 0.2s ease-in-out",":hover":{backgroundColor:n?h:"rgba(0,0,0,0.05)",cursor:"pointer",userSelect:"none",filter:n?"brightness(1.1)":"none"}},onClick:r=>{var t;u&&console.log("pathname:",E?.pathname,":=",e.path),t=e.path,B(!0),E?E.push({pathname:t}).finally(()=>B(!1)):B(!1)},children:r(a,{justifyContent:"center",children:r(o,{fontWeight:n?600:500,whiteSpace:"nowrap",children:e.name})})},JSON.stringify({x:e,index:t}))})}),r(i,{sx:{display:{xs:"flex",[k]:"none"}},children:n.length>0&&e(t,{children:[r(M,{onClick:W,children:r(qe,{})}),r(S,{open:$,onClose:L,anchorEl:T,children:n.map((e,t)=>r(D,{onClick:r=>_(r,e.path),children:r(o,{textTransform:"capitalize",children:e.name})},JSON.stringify({x:e,index:t})))})]})}),r(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{[k]:"100%"}},paddingY:1,children:e(a,{direction:"row",spacing:2,children:[r(i,{children:p}),Y?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[r(R,{sx:{width:30,height:30},src:Y.image}),e(S,{open:P,onClose:e=>N(null),anchorEl:j,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[m,r(D,{onClick:function(e){try{function r(){I()}N(null);const t=function(){if(v){const e=function(e,r){try{var t=Promise.resolve(v()).then(function(){})}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(r):r())}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[r(_e,{sx:{fill:"#545454"}}),r(o,{textTransform:"capitalize",children:b})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>N(e.currentTarget),sx:{userSelect:"none"},children:[r(o,{children:"Olá,"}),r(o,{fontWeight:600,children:Y.given_name}),r(Le,{})]})]}):r(l,"govbr"===V?{variant:"contained",size:"small",startIcon:r(Ue,{}),onClick:O,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:r(Ue,{}),onClick:O,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})})]})}),z&&r(Ke,{})]}),r(i,{paddingBottom:y})]})}function Si({children:e,onSubmit:t,formMethod:n="GET",submiting:o=!1}){const{register:i,handleSubmit:a,control:l,formState:s,reset:c,watch:d,trigger:u,setValue:p,unregister:m,getValues:f}=de(),[h,g]=J([]);return r(lr.Provider,{value:{formRegister:i,formWatch:d,formReset:c,formControl:l,formSetValue:p,formTrigger:u,formUnregister:m,formGetValues:f,formHandleSubmit:a,setFilesUid:g,formState:s,errors:s?.errors,submiting:o},children:r("form",{method:n,onSubmit:a(e=>t(e,h),()=>Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",position:"top-right",theme:"colored"})),children:e})})}function Di({url:e,realm:t,clientId:n,children:o,type:i="ad",resource_name:a="eventos-front",redirectUri:l=""}){const[s,c]=J(),[d,u]=J(!1),[p,m]=J(null),f=Ge(),h=!!s;return Z(()=>{const r=new Je({url:e,realm:t,clientId:n});m(r),r.onTokenExpired=function(){try{console.log("token expired");const e=function(e,t){try{var n=Promise.resolve(r.updateToken(5)).then(function(e){e&&c(e=>({...e,token:r.token})),console.log(e?"Token was refreshed":"Token is still valid")})}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}(0,function(e){console.log("Failed to refresh token",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},r.init({onLoad:"check-sso",pkceMethod:"S256"}).then(e=>{if(u(!0),e){const e=r.tokenParsed;console.log("TOKEN-> ",e);const t={...e,token:r.token,roles:((e?.resource_access??{})[a]??[]).roles};c(t),console.info("Authenticated!!!")}else console.log("NAO AUTENTICADO")},()=>{console.error("Authenticated Failed")}).catch(e=>console.log(e));const o=f.query.status;o&&"success"===o&&window.history.replaceState(null,"","/")},[]),r(ir.Provider,{value:{user:s,isAuth:h,userLoaded:d,login:function(){console.log("Tentando logar..."),console.log("KC: ",{instancia:p,logado:p?.authenticated,client_id:p?.clientId}),p?.login({redirectUri:l})},logout:function(){u(!1),p?.logout(),c(null),localStorage.removeItem("user-data.img")},saveUserData:()=>{},type:i},children:o})}const Yi="nextauth.token",Mi="user-data.img";function Oi({children:e,AUTH_URL:t,oidcConfig:n,redirectURL:o,validateTokenRoute:i,testToken:a,testIP:l,logoutURL:s=o}){const c=n.authority+"/authorize?response_type=code&client_id="+n.client_id+"&scope="+n.scope+"&redirect_uri="+n.redirect_uri,[d,u]=J(),[p,m]=J(!1),f=Ge(),h=!!d;function g(){m(!1),f.replace(s).finally(()=>{u(null),Qe(Yi),localStorage.removeItem(Mi),m(!0)})}return Z(()=>{const e=Ze(Yi);e?fetch(`${t}${i}`,{method:"POST",headers:{Authorization:`Bearer ${e}`}}).then(r=>{if(r.ok){const r=rr(e),t=localStorage.getItem(Mi);u({name:r.given_name,image:t??"",roles:r.roles.map(e=>e.code),token:e}),m(!0)}else g()}):m(!0)},[]),r(ir.Provider,{value:{user:d,isAuth:h,userLoaded:p,login:function(){if(!location||"localhost"!==location.hostname&&location.hostname!==l)m(!1),f.replace(c);else{const e=a;er(Yi,e),u({name:"Teste",image:"",roles:[1],token:e}),f.replace(o).finally(()=>m(!0))}},logout:g,saveUserData:function(e){try{const r=e.ssp_token;er(Yi,r);const t=rr(r),n=rr(e.id_token);return Promise.resolve(fetch(n.picture,{headers:{Authorization:`Bearer ${e.access_token}`}}).then(e=>{200===e.status&&e.blob().then(e=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{const e=n.result;localStorage.setItem(Mi,e),u({name:t.name,image:e,roles:t.roles.map(e=>e.code),token:r}),f.replace(o).finally(()=>m(!0))}}),u({name:t.name,image:"",roles:t.roles.map(e=>e.code),token:r}),f.replace(o).finally(()=>m(!0))})).then(function(){f.replace(o).finally(()=>m(!0))})}catch(e){return Promise.reject(e)}},type:"govbr"},children:e})}function Ii(n){return e(t,{children:[r(_o,{}),n.children,r(Me,{position:"bottom-right",theme:"colored"})]})}export{Yi as AUTH_COOKIE_NAME,wo as ActiveInput,ir as AuthContext,ko as AutoComplete,qo as Button,tr as Category,sr as CheckBox,dr as CheckBoxAdditional,ur as CheckBoxWarning,fr as DatePicker,po as DropFileUpload,So as FetchAutoComplete,nr as Field,or as FieldLabel,ar as File,mo as FileUpload,Yo as FixedAutoComplete,lr as FormContext,Si as FormProvider,hr as GenericDatePicker,Oo as GenericFetchAutoComplete,Ao as GenericInput,Vo as GenericMaskInput,Fo as GenericMultInput,ii as GenericTable,Co as Input,Di as KeycloakAuthProvider,Lo as MODAL,wi as Map,xo as MaskInput,Uo as Menu,Ro as MultInput,ki as NavBar,Oi as OAuthProvider,jo as OtherCheckBox,mr as RequiredCheckBoxGroup,Ii as SspComponentsProvider,Po as Stepper,Wo as StepperBlock,ho as Switch,yo as SwitchWatch,Ei as TabNavBar,Ci as Table,gr as TimePicker,go as ToggleVisibility};
|
|
3
3
|
//# sourceMappingURL=index.esm.js.map
|