@zydon/common 1.1.57 → 1.1.59

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.
@@ -1,4 +1,4 @@
1
- import { f as D, n as L, r as En, c as jn, i as K, a as jt, s as Xs, b as It, d as xt, e as In, g as Ot, h as it, p as ot, j as On, k as Zs, w as Nt, l as z, m as B, t as Vt, o as Js, q as rt, u as St, v as Qs, x as ti, y as ei, z as ni, A as Nn, B as ne, C as Un, D as Gn, E as yt, P as si, F as ii, L as oi, S as ri, G as Kt, H as zt, I as ke, J as se, K as ai, M as $n, N as li, O as ci, Q as Kn, R as zn, T as ui, U as hi, V as fi, W as di, X as pi, Y as mi, Z as gi, _ as yi, $ as vi, a0 as xi } from "./index-01567dce.js";
1
+ import { f as D, n as L, r as En, c as jn, i as K, a as jt, s as Xs, b as It, d as xt, e as In, g as Ot, h as it, p as ot, j as On, k as Zs, w as Nt, l as z, m as B, t as Vt, o as Js, q as rt, u as St, v as Qs, x as ti, y as ei, z as ni, A as Nn, B as ne, C as Un, D as Gn, E as yt, P as si, F as ii, L as oi, S as ri, G as Kt, H as zt, I as ke, J as se, K as ai, M as $n, N as li, O as ci, Q as Kn, R as zn, T as ui, U as hi, V as fi, W as di, X as pi, Y as mi, Z as gi, _ as yi, $ as vi, a0 as xi } from "./index-1eda1b5d.js";
2
2
  import Hn, { useContext as ie, useId as Pi, useEffect as Ti } from "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -5612,7 +5612,7 @@ const N6 = (t, e, n) => {
5612
5612
  ...r,
5613
5613
  children: n
5614
5614
  }
5615
- ), w6 = () => import("./features-caa6fbaa.js").then((t) => t.default), I6 = ({ children: t }) => /* @__PURE__ */ O.jsx(h5, { strict: !0, features: w6, children: /* @__PURE__ */ O.jsxs(Dr.div, { style: { height: "100%" }, children: [
5615
+ ), w6 = () => import("./features-9ee683b8.js").then((t) => t.default), I6 = ({ children: t }) => /* @__PURE__ */ O.jsx(h5, { strict: !0, features: w6, children: /* @__PURE__ */ O.jsxs(Dr.div, { style: { height: "100%" }, children: [
5616
5616
  " ",
5617
5617
  t,
5618
5618
  " "
@@ -107401,7 +107401,7 @@ const G1e = (t = !1) => {
107401
107401
  name: e,
107402
107402
  control: c,
107403
107403
  rules: n,
107404
- render: ({ field: d, fieldState: { error: f } }) => /* @__PURE__ */ O.jsxs(Xw, { component: "fieldset", children: [
107404
+ render: ({ field: { value: d = [], ...f }, fieldState: { error: p } }) => /* @__PURE__ */ O.jsxs(Xw, { component: "fieldset", children: [
107405
107405
  r && /* @__PURE__ */ O.jsx(
107406
107406
  Zw,
107407
107407
  {
@@ -107430,31 +107430,31 @@ const G1e = (t = !1) => {
107430
107430
  }
107431
107431
  }
107432
107432
  },
107433
- children: i.map((p) => /* @__PURE__ */ O.jsx(
107433
+ children: i.map((m) => /* @__PURE__ */ O.jsx(
107434
107434
  Ef,
107435
107435
  {
107436
107436
  control: /* @__PURE__ */ O.jsx(
107437
107437
  Qw,
107438
107438
  {
107439
- checked: d.value.includes(p.value),
107440
- onChange: () => d.onChange(u(d.value, p.value))
107439
+ checked: d.includes(m.value),
107440
+ onChange: () => f.onChange(u(d, m.value))
107441
107441
  }
107442
107442
  ),
107443
- label: p.label,
107443
+ label: m.label,
107444
107444
  ...l
107445
107445
  },
107446
- p.value
107446
+ m.value
107447
107447
  ))
107448
107448
  }
107449
107449
  ),
107450
- (!!f || o) && /* @__PURE__ */ O.jsx(
107450
+ (!!p || o) && /* @__PURE__ */ O.jsx(
107451
107451
  ai,
107452
107452
  {
107453
- error: !!f,
107454
- sx: (p) => ({
107455
- color: l.disabled ? p.palette.grey[500] : void 0
107453
+ error: !!p,
107454
+ sx: (m) => ({
107455
+ color: l.disabled ? m.palette.grey[500] : void 0
107456
107456
  }),
107457
- children: f ? f == null ? void 0 : f.message : o
107457
+ children: p ? p == null ? void 0 : p.message : o
107458
107458
  }
107459
107459
  )
107460
107460
  ] })
@@ -107964,13 +107964,13 @@ const wRe = ({
107964
107964
  /* @__PURE__ */ O.jsx(
107965
107965
  qB,
107966
107966
  {
107967
+ ...f,
107967
107968
  ...h,
107968
107969
  onChange: (_, b) => {
107969
107970
  h.onChange(_), l && l(_, b);
107970
107971
  },
107971
107972
  "aria-labelledby": m,
107972
107973
  row: n,
107973
- ...f,
107974
107974
  children: i.map((_) => /* @__PURE__ */ O.jsx(
107975
107975
  Ef,
107976
107976
  {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aD as m, a1 as p, aE as c, aF as v, aH as C, aI as k, a2 as S, a3 as F, a4 as P, a5 as A, a6 as I, a7 as g, aJ as T, aK as M, aL as E, a8 as h, aZ as D, a9 as B, aa as N, aM as f, ab as x, a$ as w, aN as y, ac as L, aO as R, b0 as U, ad as G, ae as H, af as O, ag as V, aP as W, ah as z, ai as q, aQ as K, bl as Q, aj as j, ak as J, al as Z, b2 as X, b3 as Y, b1 as _, aG as $, av as aa, aw as sa, ax as ea, ay as ra, am as oa, aR as ta, aS as ia, ao as na, an as ba, aT as la, ap as da, aU as ua, aq as ma, ar as pa, bm as ca, bn as va, as as Ca, aV as ka, b4 as Sa, at as Fa, a_ as Pa, au as Aa, aW as Ia, bo as ga, az as Ta, aA as Ma, aY as Ea, aB as ha, aC as Da, aX as Ba, bp as Na, bH as fa, bq as xa, bE as wa, bF as ya, bG as La, bO as Ra, bM as Ua, bL as Ga, bI as Ha, bJ as Oa, bs as Va, bt as Wa, bu as za, bv as qa, bw as Ka, bx as Qa, by as ja, bD as Ja, bC as Za, bz as Xa, br as Ya, bA as _a, bB as $a, bN as as, bK as ss, bi as es, bj as rs, bk as os, bb as ts, be as is, b6 as ns, b8 as bs, bd as ls, b5 as ds, bc as us, ba as ms, b9 as ps, bg as cs, bh as vs, bf as Cs, b7 as ks } from "./index-01567dce.js";
1
+ import { aD as m, a1 as p, aE as c, aF as v, aH as C, aI as k, a2 as S, a3 as F, a4 as P, a5 as A, a6 as I, a7 as g, aJ as T, aK as M, aL as E, a8 as h, aZ as D, a9 as B, aa as N, aM as f, ab as x, a$ as w, aN as y, ac as L, aO as R, b0 as U, ad as G, ae as H, af as O, ag as V, aP as W, ah as z, ai as q, aQ as K, bl as Q, aj as j, ak as J, al as Z, b2 as X, b3 as Y, b1 as _, aG as $, av as aa, aw as sa, ax as ea, ay as ra, am as oa, aR as ta, aS as ia, ao as na, an as ba, aT as la, ap as da, aU as ua, aq as ma, ar as pa, bm as ca, bn as va, as as Ca, aV as ka, b4 as Sa, at as Fa, a_ as Pa, au as Aa, aW as Ia, bo as ga, az as Ta, aA as Ma, aY as Ea, aB as ha, aC as Da, aX as Ba, bp as Na, bH as fa, bq as xa, bE as wa, bF as ya, bG as La, bO as Ra, bM as Ua, bL as Ga, bI as Ha, bJ as Oa, bs as Va, bt as Wa, bu as za, bv as qa, bw as Ka, bx as Qa, by as ja, bD as Ja, bC as Za, bz as Xa, br as Ya, bA as _a, bB as $a, bN as as, bK as ss, bi as es, bj as rs, bk as os, bb as ts, be as is, b6 as ns, b8 as bs, bd as ls, b5 as ds, bc as us, ba as ms, b9 as ps, bg as cs, bh as vs, bf as Cs, b7 as ks } from "./index-1eda1b5d.js";
2
2
  import "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -316,4 +316,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),I=F,M=j),$===void 0&&(
316
316
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function OAe(t){if(Array.isArray(t))return tT(t)}function C5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function O5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?C5(Object(n),!0).forEach(function(r){x5(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function x5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lu(t,e){return AAe(t)||RAe(t,e)||R5(t,e)||xAe()}function xAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
317
317
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R5(t,e){if(t){if(typeof t=="string")return tT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tT(t,e)}}function tT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function RAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function AAe(t){if(Array.isArray(t))return t}var NAe="file-invalid-type",wAe="file-too-large",IAe="file-too-small",DAe="too-many-files",MAe=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var n=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:NAe,message:"File type must be ".concat(n)}},A5=function(e){return{code:wAe,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},N5=function(e){return{code:IAe,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},kAe={code:DAe,message:"Too many files"};function w5(t,e){var n=t.type==="application/x-moz-file"||yAe(t,e);return[n,n?null:MAe(e)]}function I5(t,e,n){if(po(t.size))if(po(e)&&po(n)){if(t.size>n)return[!1,A5(n)];if(t.size<e)return[!1,N5(e)]}else{if(po(e)&&t.size<e)return[!1,N5(e)];if(po(n)&&t.size>n)return[!1,A5(n)]}return[!0,null]}function po(t){return t!=null}function PAe(t){var e=t.files,n=t.accept,r=t.minSize,i=t.maxSize,a=t.multiple,o=t.maxFiles,s=t.validator;return!a&&e.length>1||a&&o>=1&&e.length>o?!1:e.every(function(l){var c=w5(l,n),u=lu(c,1),d=u[0],f=I5(l,r,i),p=lu(f,1),h=p[0],m=s?s(l):null;return d&&h&&!m})}function ch(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function uh(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function D5(t){t.preventDefault()}function LAe(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function FAe(t){return t.indexOf("Edge/")!==-1}function BAe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return LAe(t)||FAe(t)}function ci(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return e.some(function(s){return!ch(r)&&s&&s.apply(void 0,[r].concat(a)),ch(r)})}}function UAe(){return"showOpenFilePicker"in window}function GAe(t){if(po(t)){var e=Object.entries(t).filter(function(n){var r=lu(n,2),i=r[0],a=r[1],o=!0;return M5(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(a)||!a.every(k5))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=lu(r,2),a=i[0],o=i[1];return O5(O5({},n),{},x5({},a,o))},{});return[{description:"Files",accept:e}]}return t}function $Ae(t){if(po(t))return Object.entries(t).reduce(function(e,n){var r=lu(n,2),i=r[0],a=r[1];return[].concat(T5(e),[i],T5(a))},[]).filter(function(e){return M5(e)||k5(e)}).join(",")}function qAe(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function VAe(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function M5(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}function k5(t){return/^.*\.[\w]+$/.test(t)}var YAe=["children"],HAe=["open"],zAe=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],WAe=["refKey","onChange","onClick"];function jAe(t){return XAe(t)||QAe(t)||P5(t)||KAe()}function KAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
318
318
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function XAe(t){if(Array.isArray(t))return rT(t)}function nT(t,e){return eNe(t)||JAe(t,e)||P5(t,e)||ZAe()}function ZAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
319
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P5(t,e){if(t){if(typeof t=="string")return rT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rT(t,e)}}function rT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function JAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function eNe(t){if(Array.isArray(t))return t}function L5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function jt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?L5(Object(n),!0).forEach(function(r){iT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dh(t,e){if(t==null)return{};var n=tNe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tNe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var aT=A.forwardRef(function(t,e){var n=t.children,r=dh(t,YAe),i=fh(r),a=i.open,o=dh(i,HAe);return A.useImperativeHandle(e,function(){return{open:a}},[a]),A.createElement(A.Fragment,null,n(jt(jt({},o),{},{open:a})))});aT.displayName="Dropzone";var F5={disabled:!1,getFilesFromEvent:pAe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};aT.defaultProps=F5,aT.propTypes={children:te.func,accept:te.objectOf(te.arrayOf(te.string)),multiple:te.bool,preventDropOnDocument:te.bool,noClick:te.bool,noKeyboard:te.bool,noDrag:te.bool,noDragEventsBubbling:te.bool,minSize:te.number,maxSize:te.number,maxFiles:te.number,disabled:te.bool,getFilesFromEvent:te.func,onFileDialogCancel:te.func,onFileDialogOpen:te.func,useFsAccessApi:te.bool,autoFocus:te.bool,onDragEnter:te.func,onDragLeave:te.func,onDragOver:te.func,onDrop:te.func,onDropAccepted:te.func,onDropRejected:te.func,onError:te.func,validator:te.func};var oT={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fh(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=jt(jt({},F5),t),n=e.accept,r=e.disabled,i=e.getFilesFromEvent,a=e.maxSize,o=e.minSize,s=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,f=e.onDrop,p=e.onDropAccepted,h=e.onDropRejected,m=e.onFileDialogCancel,g=e.onFileDialogOpen,_=e.useFsAccessApi,b=e.autoFocus,S=e.preventDropOnDocument,v=e.noClick,E=e.noKeyboard,T=e.noDrag,y=e.noDragEventsBubbling,C=e.onError,N=e.validator,R=A.useMemo(function(){return $Ae(n)},[n]),x=A.useMemo(function(){return GAe(n)},[n]),w=A.useMemo(function(){return typeof g=="function"?g:B5},[g]),D=A.useMemo(function(){return typeof m=="function"?m:B5},[m]),k=A.useRef(null),P=A.useRef(null),G=A.useReducer(nNe,oT),F=nT(G,2),j=F[0],$=F[1],M=j.isFocused,I=j.isFileDialogActive,L=A.useRef(typeof window<"u"&&window.isSecureContext&&_&&UAe()),U=function(){!L.current&&I&&setTimeout(function(){if(P.current){var be=P.current.files;be.length||($({type:"closeDialog"}),D())}},300)};A.useEffect(function(){return window.addEventListener("focus",U,!1),function(){window.removeEventListener("focus",U,!1)}},[P,I,D,L]);var Y=A.useRef([]),V=function(be){k.current&&k.current.contains(be.target)||(be.preventDefault(),Y.current=[])};A.useEffect(function(){return S&&(document.addEventListener("dragover",D5,!1),document.addEventListener("drop",V,!1)),function(){S&&(document.removeEventListener("dragover",D5),document.removeEventListener("drop",V))}},[k,S]),A.useEffect(function(){return!r&&b&&k.current&&k.current.focus(),function(){}},[k,b,r]);var B=A.useCallback(function(de){C?C(de):console.error(de)},[C]),q=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de),Y.current=[].concat(jAe(Y.current),[de.target]),uh(de)&&Promise.resolve(i(de)).then(function(be){if(!(ch(de)&&!y)){var We=be.length,X=We>0&&PAe({files:be,accept:R,minSize:o,maxSize:a,multiple:s,maxFiles:l,validator:N}),z=We>0&&!X;$({isDragAccept:X,isDragReject:z,isDragActive:!0,type:"setDraggedFiles"}),c&&c(de)}}).catch(function(be){return B(be)})},[i,c,B,y,R,o,a,s,l,N]),W=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de);var be=uh(de);if(be&&de.dataTransfer)try{de.dataTransfer.dropEffect="copy"}catch{}return be&&d&&d(de),!1},[d,y]),K=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de);var be=Y.current.filter(function(X){return k.current&&k.current.contains(X)}),We=be.indexOf(de.target);We!==-1&&be.splice(We,1),Y.current=be,!(be.length>0)&&($({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(de)&&u&&u(de))},[k,u,y]),Z=A.useCallback(function(de,be){var We=[],X=[];de.forEach(function(z){var oe=w5(z,R),ae=nT(oe,2),Re=ae[0],$e=ae[1],Le=I5(z,o,a),ue=nT(Le,2),pe=ue[0],De=ue[1],Ie=N?N(z):null;if(Re&&pe&&!Ie)We.push(z);else{var Ne=[$e,De];Ie&&(Ne=Ne.concat(Ie)),X.push({file:z,errors:Ne.filter(function(Ke){return Ke})})}}),(!s&&We.length>1||s&&l>=1&&We.length>l)&&(We.forEach(function(z){X.push({file:z,errors:[kAe]})}),We.splice(0)),$({acceptedFiles:We,fileRejections:X,type:"setFiles"}),f&&f(We,X,be),X.length>0&&h&&h(X,be),We.length>0&&p&&p(We,be)},[$,s,R,o,a,l,f,p,h,N]),le=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de),Y.current=[],uh(de)&&Promise.resolve(i(de)).then(function(be){ch(de)&&!y||Z(be,de)}).catch(function(be){return B(be)}),$({type:"reset"})},[i,Z,B,y]),ne=A.useCallback(function(){if(L.current){$({type:"openDialog"}),w();var de={multiple:s,types:x};window.showOpenFilePicker(de).then(function(be){return i(be)}).then(function(be){Z(be,null),$({type:"closeDialog"})}).catch(function(be){qAe(be)?(D(be),$({type:"closeDialog"})):VAe(be)?(L.current=!1,P.current?(P.current.value=null,P.current.click()):B(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):B(be)});return}P.current&&($({type:"openDialog"}),w(),P.current.value=null,P.current.click())},[$,w,D,_,Z,B,x,s]),Ee=A.useCallback(function(de){!k.current||!k.current.isEqualNode(de.target)||(de.key===" "||de.key==="Enter"||de.keyCode===32||de.keyCode===13)&&(de.preventDefault(),ne())},[k,ne]),_e=A.useCallback(function(){$({type:"focus"})},[]),fe=A.useCallback(function(){$({type:"blur"})},[]),Se=A.useCallback(function(){v||(BAe()?setTimeout(ne,0):ne())},[v,ne]),Te=function(be){return r?null:be},re=function(be){return E?null:Te(be)},ee=function(be){return T?null:Te(be)},me=function(be){y&&be.stopPropagation()},he=A.useMemo(function(){return function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},be=de.refKey,We=be===void 0?"ref":be,X=de.role,z=de.onKeyDown,oe=de.onFocus,ae=de.onBlur,Re=de.onClick,$e=de.onDragEnter,Le=de.onDragOver,ue=de.onDragLeave,pe=de.onDrop,De=dh(de,zAe);return jt(jt(iT({onKeyDown:re(ci(z,Ee)),onFocus:re(ci(oe,_e)),onBlur:re(ci(ae,fe)),onClick:Te(ci(Re,Se)),onDragEnter:ee(ci($e,q)),onDragOver:ee(ci(Le,W)),onDragLeave:ee(ci(ue,K)),onDrop:ee(ci(pe,le)),role:typeof X=="string"&&X!==""?X:"presentation"},We,k),!r&&!E?{tabIndex:0}:{}),De)}},[k,Ee,_e,fe,Se,q,W,K,le,E,T,r]),ie=A.useCallback(function(de){de.stopPropagation()},[]),Ue=A.useMemo(function(){return function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},be=de.refKey,We=be===void 0?"ref":be,X=de.onChange,z=de.onClick,oe=dh(de,WAe),ae=iT({accept:R,multiple:s,type:"file",style:{display:"none"},onChange:Te(ci(X,le)),onClick:Te(ci(z,ie)),tabIndex:-1},We,P);return jt(jt({},ae),oe)}},[P,n,s,le,r]);return jt(jt({},j),{},{isFocused:M&&!r,getRootProps:he,getInputProps:Ue,rootRef:k,inputRef:P,open:Te(ne)})}function nNe(t,e){switch(e.type){case"focus":return jt(jt({},t),{},{isFocused:!0});case"blur":return jt(jt({},t),{},{isFocused:!1});case"openDialog":return jt(jt({},oT),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return jt(jt({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return jt({},oT);default:return t}}function B5(){}const rNe=["pdf"],iNe=["txt"],aNe=["psd"],oNe=["doc","docx"],sNe=["xls","xlsx"],lNe=["zip","rar","iso"],cNe=["ai","esp"],uNe=["ppt","pptx"],dNe=["wav","aif","mp3","aac"],fNe=["jpg","jpeg","gif","bmp","png","svg"],pNe=["m4v","avi","mpg","mp4","webm"],fr=t=>`/assets/icons/files/${t}.svg`;function U5(t){let e;switch(t==null?void 0:t.includes(jn(t))){case iNe.includes(jn(t)):e="txt";break;case lNe.includes(jn(t)):e="zip";break;case dNe.includes(jn(t)):e="audio";break;case fNe.includes(jn(t)):e="image";break;case pNe.includes(jn(t)):e="video";break;case oNe.includes(jn(t)):e="word";break;case sNe.includes(jn(t)):e="excel";break;case uNe.includes(jn(t)):e="powerpoint";break;case rNe.includes(jn(t)):e="pdf";break;case aNe.includes(jn(t)):e="photoshop";break;case cNe.includes(jn(t)):e="illustrator";break;default:e=jn(t)}return e}function hNe(t){let e;switch(U5(t)){case"folder":e=fr("ic_folder");break;case"txt":e=fr("ic_txt");break;case"zip":e=fr("ic_zip");break;case"audio":e=fr("ic_audio");break;case"video":e=fr("ic_video");break;case"word":e=fr("ic_word");break;case"excel":e=fr("ic_excel");break;case"powerpoint":e=fr("ic_power_point");break;case"pdf":e=fr("ic_pdf");break;case"photoshop":e=fr("ic_pts");break;case"illustrator":e=fr("ic_ai");break;case"image":e=fr("ic_img");break;default:e=fr("ic_file")}return e}function jn(t=""){return t&&t.split(".").pop()||""}function mNe(t){return t.split("/").pop()}function sT(t){return typeof t=="string"?{key:t,preview:t,name:mNe(t),type:jn(t)}:{key:t.preview,name:t.name,size:t.size,path:t.path,type:t.type,preview:t.preview,lastModified:t.lastModified,lastModifiedDate:t.lastModifiedDate}}const G5=({onDownload:t})=>{const e=Ra();return O.jsx(H.IconButton,{onClick:t,sx:{p:0,top:0,right:0,width:1,height:1,zIndex:9,opacity:0,position:"absolute",borderRadius:"unset",justifyContent:"center",bgcolor:"grey.800",color:"common.white",transition:e.transitions.create("opacity"),"&:hover":{opacity:1,...sh({opacity:.64,color:e.palette.grey[900]})}},children:O.jsx(Ct,{icon:"eva:arrow-circle-down-fill",width:24})})},$5=({file:t,tooltip:e,imageView:n,onDownload:r,sx:i,imgSx:a})=>{const{name:o="",path:s="",preview:l=""}=sT(t),c=U5(s||l),u=c==="image"&&n?O.jsx(H.Box,{component:"img",src:l,sx:{width:1,height:1,flexShrink:0,objectFit:"cover",...a}}):O.jsx(H.Box,{component:"img",src:hNe(c),sx:{width:32,height:32,flexShrink:0,...i}});return e?O.jsx(H.Tooltip,{title:o,children:O.jsxs(H.Stack,{flexShrink:0,component:"span",alignItems:"center",justifyContent:"center",sx:{width:"fit-content",height:"inherit"},children:[u,r&&O.jsx(G5,{onDownload:r})]})}):O.jsxs(O.Fragment,{children:[u,r&&O.jsx(G5,{onDownload:r})]})},q5=({fileRejections:t})=>t.length?O.jsx(H.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:e=>ye(e.palette.error.main,.08),borderColor:e=>ye(e.palette.error.main,.24)},children:t.map(({file:e,errors:n})=>{const{path:r,size:i}=sT(e);return O.jsxs(H.Box,{sx:{my:1},children:[O.jsxs(H.Typography,{variant:"subtitle2",noWrap:!0,children:[r," - ",i?VS(i):""]}),n.map(a=>O.jsxs(H.Box,{component:"span",sx:{typography:"caption"},children:["- ",a.message]},a.code))]},r)})}):null,gNe=({thumbnail:t,files:e,onRemove:n,sx:r})=>e!=null&&e.length?O.jsx(H1,{initial:!1,children:e.map(i=>{const{key:a,name:o="",size:s=0}=sT(i),l=typeof i=="string";return t?O.jsxs(H.Stack,{component:Cr.div,...il().inUp,alignItems:"center",display:"inline-flex",justifyContent:"center",sx:{m:.5,width:80,height:80,borderRadius:1.25,overflow:"hidden",position:"relative",border:c=>`solid 1px ${c.palette.divider}`,...r},children:[O.jsx($5,{tooltip:!0,imageView:!0,file:i,sx:{position:"absolute"},imgSx:{position:"absolute"}}),n&&O.jsx(H.IconButton,{size:"small",onClick:()=>n(i),sx:{top:4,right:4,p:"1px",position:"absolute",color:c=>ye(c.palette.common.white,.72),bgcolor:c=>ye(c.palette.grey[900],.48),"&:hover":{bgcolor:c=>ye(c.palette.grey[900],.72)}},children:O.jsx(Ct,{icon:"eva:close-fill",width:16})})]},a):O.jsxs(H.Stack,{component:Cr.div,...il().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:c=>`solid 1px ${c.palette.divider}`,...r},children:[O.jsx($5,{file:i}),O.jsxs(H.Stack,{flexGrow:1,sx:{minWidth:0},children:[O.jsx(H.Typography,{variant:"subtitle2",noWrap:!0,children:l?i:o}),O.jsx(H.Typography,{variant:"caption",sx:{color:"text.secondary"},children:l?"":VS(s)})]}),n&&O.jsx(H.IconButton,{edge:"end",size:"small",onClick:()=>n(i),children:O.jsx(Ct,{icon:"eva:close-fill"})})]},a)})}):null,_Ne=({file:t})=>{if(!t)return null;const e=typeof t=="string"?t:t.preview;return O.jsx(H.Stack,{position:"absolute",width:1,height:1,maxHeight:"100%",alignItems:"center",justifyContent:"center",top:0,right:0,bottom:0,left:0,padding:2,margin:"auto",children:O.jsx(yf,{alt:"file preview",src:e,sx:{borderRadius:1,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},bNe=qt("div")(({theme:t})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:t.spacing(5),borderRadius:t.shape.borderRadius,transition:t.transitions.create("padding"),backgroundColor:t.palette.background.neutral,border:`1px dashed ${ye(t.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),vNe=({header:t,description:e,sx:n,...r})=>O.jsxs(H.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...r,children:[O.jsx(ame,{sx:{width:220}}),O.jsxs("div",{children:[O.jsx(H.Typography,{gutterBottom:!0,variant:"h5",children:t||"Soltar ou selecionar arquivos"}),O.jsx(H.Typography,{variant:"body2",sx:{color:"text.secondary"},children:e||O.jsxs(O.Fragment,{children:["Solte os arquivos aqui ou clique",O.jsx(H.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),V5=({id:t,disabled:e,multiple:n=!1,error:r,helperText:i,file:a,onDelete:o,files:s,thumbnail:l,onUpload:c,onRemove:u,onRemoveAll:d,sx:f,dropZoneProps:p,placeholderProps:h,placeholderAlt:m,image:g,tabIndex:_,...b})=>{const{getRootProps:S,getInputProps:v,isDragActive:E,isDragReject:T,fileRejections:y}=fh({multiple:n,disabled:e,...b}),C=!!a&&!n||g,N=s&&n&&s.length>0,R=T||!!r;return O.jsxs(H.Box,{sx:{width:1,position:"relative",...f},children:[O.jsxs(bNe,{...S(),sx:{...E&&{opacity:.72},...R&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...e&&{opacity:.48,pointerEvents:"none"},...p},children:[O.jsx("input",{...v(),id:t,tabIndex:_}),m?O.jsx(H.Stack,{sx:{...C&&{opacity:0}},children:m}):O.jsx(vNe,{sx:{...C&&{opacity:0}},header:h==null?void 0:h.title,description:h==null?void 0:h.description}),C&&O.jsx(_Ne,{file:a||g||""})]}),i&&O.jsx(H.FormHelperText,{error:!!r,sx:x=>({mx:"14px",color:e?x.palette.grey[500]:void 0}),children:i}),O.jsx(q5,{fileRejections:y}),C&&o&&O.jsx(H.IconButton,{size:"small",onClick:o,sx:{top:16,right:16,zIndex:9,position:"absolute",color:x=>ye(x.palette.common.white,.8),bgcolor:x=>ye(x.palette.grey[900],.72),"&:hover":{bgcolor:x=>ye(x.palette.grey[900],.48)}},children:O.jsx(Ct,{icon:"eva:close-fill",width:18})}),N&&O.jsxs(O.Fragment,{children:[O.jsx(H.Box,{sx:{my:3},children:O.jsx(gNe,{files:s,thumbnail:l,onRemove:u})}),O.jsxs(H.Stack,{direction:"row",justifyContent:"flex-end",spacing:1.5,children:[d&&O.jsx(H.Button,{color:"inherit",variant:"outlined",size:"small",onClick:d,children:"Remove all"}),c&&O.jsx(H.Button,{size:"small",variant:"contained",onClick:c,children:"Upload files"})]})]})]})},ENe=({file:t})=>{if(!t)return null;const e=typeof t=="string"?t:t.preview;return O.jsx(yf,{alt:"avatar",src:e,sx:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},SNe=qt("div")(({theme:t})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${ye(t.palette.grey[500],.32)}`})),yNe=qt("div")(({theme:t})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:t.palette.text.disabled,backgroundColor:t.palette.background.neutral,transition:t.transitions.create("opacity",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.shorter})})),Y5=({error:t,file:e,image:n,disabled:r,helperText:i,sx:a,tabIndex:o,...s})=>{const{getRootProps:l,getInputProps:c,isDragActive:u,isDragReject:d,fileRejections:f}=fh({multiple:!1,disabled:r,...s}),p=!!e||n,h=d||!!t;return O.jsxs(O.Fragment,{children:[O.jsxs(SNe,{...l(),sx:{...u&&{opacity:.72},...h&&{borderColor:"error.light",...p&&{bgcolor:"error.lighter"}},...r&&{opacity:.48,pointerEvents:"none"},...p&&{"&:hover":{"& .placeholder":{opacity:1}}},...a},children:[O.jsx("input",{...c(),tabIndex:o}),p&&O.jsx(ENe,{file:e||n||""}),O.jsxs(yNe,{className:"placeholder",sx:{"&:hover":{opacity:.72},...p&&{zIndex:9,opacity:0,color:"common.white",bgcolor:m=>ye(m.palette.grey[900],.64)},...h&&{color:"error.main",bgcolor:"error.lighter"}},children:[O.jsx(Ct,{icon:"ic:round-add-a-photo",width:24,sx:{mb:1}}),O.jsx(H.Typography,{variant:"caption",children:e?"Update photo":"Upload photo"})]})]}),i&&i,O.jsx(q5,{fileRejections:f})]})},TNe=qt("div")(({theme:t})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:t.spacing(.5),color:t.palette.text.disabled,borderRadius:t.shape.borderRadius,border:`dashed 1px ${t.palette.divider}`,backgroundColor:ye(t.palette.grey[500],.08),"&:hover":{opacity:.72}})),CNe=({placeholderAlt:t,error:e,disabled:n,sx:r,tabIndex:i,...a})=>{const{getRootProps:o,getInputProps:s,isDragActive:l,isDragReject:c}=fh({disabled:n,...a}),u=c||e;return O.jsxs(TNe,{...o(),sx:{...l&&{opacity:.72},...u&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...r},children:[O.jsx("input",{...s(),tabIndex:i}),t||O.jsx(Ct,{icon:"eva:cloud-upload-fill",width:28})]})},ONe=t=>new Promise((e,n)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",i=>n(i)),r.setAttribute("crossOrigin","anonymous"),r.src=t});function H5(t){return t*Math.PI/180}function xNe(t,e,n){const r=H5(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}async function RNe(t,e,n=0,r={horizontal:!1,vertical:!1}){const i=await ONe(t),a=document.createElement("canvas"),o=a.getContext("2d");if(!o)return null;const s=H5(n),{width:l,height:c}=xNe(i.width,i.height,n);a.width=l,a.height=c,o.translate(l/2,c/2),o.rotate(s),o.scale(r.horizontal?-1:1,r.vertical?-1:1),o.translate(-i.width/2,-i.height/2),o.drawImage(i,0,0);const u=o.getImageData(e.x,e.y,e.width,e.height);return a.width=e.width,a.height=e.height,o.putImageData(u,0,0),new Promise((d,f)=>{a.toBlob(p=>{d(p)},"image/png")})}const z5=(t=!1)=>{const[e,n]=A.useState(t),r=A.useCallback(()=>n(i=>!i),[]);return[e,r,n]},W5=({onFileCropped:t,onImageUploaded:e,onCancel:n,image:r})=>{const i=A.useId(),[a,o,s]=z5(),[l,c]=A.useState({x:0,y:0}),[u,d]=A.useState(1),f=A.useRef();return{id:i,crop:l,setCrop:c,zoom:u,setZoom:d,fileRef:f,onCropComplete:async(_,b)=>{try{const S=await RNe(r,b,0);f.current=new File([S],"image.png",{type:S.type})}catch{t(void 0)}},saveChanges:()=>{t(f.current),o()},cancelChanges:()=>{n&&n(),s(!1)},handleRemove:()=>{t(void 0),e(void 0),c({x:0,y:0}),d(1),s(!1)},cropModalOpen:a,toggleCropModalOpen:o,setCropModalOpen:s}},j5=({id:t,open:e,onClose:n,label:r,onSave:i,onRemove:a,imgSrc:o,aspect:s,size:{height:l,width:c},crop:u,zoom:d,onCropComplete:f,onCropChange:p,onZoomChange:h})=>O.jsx(ZP,{open:e,onClose:n,dialogTitle:r,actions:O.jsxs(O.Fragment,{children:[O.jsx(H.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),O.jsx(H.Button,{variant:"contained",size:"medium",onClick:i,children:"Salvar"})]}),children:O.jsxs(H.Stack,{gap:2,children:[O.jsx(AP,{image:{width:c,height:l,aspect:s,imgSrc:o},crop:u,zoom:d,onCropComplete:f,onCropChange:p,onZoomChange:h}),O.jsxs(H.Stack,{gap:1.5,children:[O.jsxs(H.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",mr:"auto",children:[O.jsx(H.Typography,{variant:"body1",children:"Zoom"}),O.jsx(H.Slider,{value:d,onChange:(m,g)=>h(Array.isArray(g)?g[0]:g),min:1,max:5,size:"medium",step:.5})]}),O.jsxs(H.Stack,{direction:"row",gap:2,children:[O.jsx(H.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(Ct,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:a,children:"Remover"}),O.jsx(H.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(Ct,{icon:"ic:outline-image-search",color:X_.main}),component:"label",htmlFor:t,children:"Alterar"})]})]})]})}),ANe=H.styled(H.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),NNe=H.styled(H.Stack)(({theme:t})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:H.alpha(t.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),wNe=H.styled(H.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),K5=({onFileCropped:t,onImageUploaded:e,onCancel:n,aspect:r,size:i,label:a,image:o="",uploading:s,file:l,tabIndex:c,...u})=>{const{id:d,crop:f,cropModalOpen:p,zoom:h,cancelChanges:m,handleRemove:g,onCropComplete:_,saveChanges:b,setCrop:S,setCropModalOpen:v,setZoom:E,toggleCropModalOpen:T}=W5({image:o,onFileCropped:t,onImageUploaded:e,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(ANe,{children:[s&&O.jsx(mf,{}),O.jsx(V5,{...u,id:d,file:l,onDrop:y=>{if(y.length>0){v(!0),E(1),S({x:0,y:0});const C=new FileReader;C.addEventListener("load",()=>{var R;const N=((R=C.result)==null?void 0:R.toString())||"";e(N),t(void 0)}),C.readAsDataURL(y[0])}},image:o,tabIndex:c}),(l||o)&&O.jsxs(NNe,{className:"actions",children:[O.jsx(H.Button,{color:"inherit",startIcon:O.jsx(Ct,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:g,children:"Remover"}),O.jsx(H.Button,{color:"inherit",startIcon:O.jsx(Ct,{icon:"ic:outline-image",color:X_.main}),onClick:T,children:"Editar"})]})]}),O.jsx(j5,{id:d,open:p,onClose:m,label:a,aspect:r,crop:f,zoom:h,onCropComplete:_,onCropChange:S,onZoomChange:E,imgSrc:o,onRemove:g,onSave:b,size:i})]})},Q5=({name:t,helperText:e,rules:n,onSelectOption:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:o,fieldState:{error:s}})=>O.jsx(mg,{...o,...i,onChange:l=>{r&&r(l),o.onChange(l)},error:!!s,helperText:(s==null?void 0:s.message)||e})})},ho=({name:t,helperText:e,rules:n,onChange:r,tabIndex:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:n,render:({field:{ref:s,...l},fieldState:{error:c}})=>O.jsx(H.TextField,{...l,onChange:u=>{l.onChange(u),r&&r(u)},inputRef:s,fullWidth:!0,error:!!c,helperText:(c==null?void 0:c.message)||e,...a,inputProps:{...a.inputProps,tabIndex:i}})})},X5=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onChange:o,value:s,ref:l},fieldState:{error:c}})=>O.jsx(XS,{ref:l,...r,name:a,value:s,error:!!c,helperText:(c==null?void 0:c.message)||e,onChange:({target:{value:u}})=>o(u)})})},INe=({name:t,containerProps:e,required:n,rules:r,tabIndex:i})=>{const a=`${t}.zipCode`,o=`${t}.publicPlace`,s=`${t}.number`,l=`${t}.district`,c=`${t}.complement`,u=`${t}.state`,d=`${t}.city`,f=p=>{p.key==="Enter"&&p.preventDefault()};return O.jsxs(H.Stack,{gap:1.5,...e,children:[O.jsxs(H.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(X5,{name:a,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:O.jsx(H.InputAdornment,{position:"end",children:O.jsx(H.CircularProgress,{size:24})})},rules:r,onKeyDown:f,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:i}),O.jsxs(H.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[O.jsx(ho,{name:o,label:"Logradouro",onKeyDown:f,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:i}),O.jsx(ho,{name:s,label:"Número",onKeyDown:f,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:i})]})]}),O.jsxs(H.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(ho,{name:l,label:"Bairro",onKeyDown:f,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:i}),O.jsx(ho,{name:c,label:"Complemento",onKeyDown:f,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:i})]}),O.jsxs(H.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[O.jsx(Q5,{name:u,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:i}),O.jsx(ho,{name:d,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:i})]})]})},DNe=({name:t,rules:e,helperText:n,tabIndex:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:e,render:({field:o,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(H.FormControlLabel,{control:O.jsx(H.Checkbox,{...o,checked:o.value,tabIndex:r}),...i}),(!!s||n)&&O.jsx(H.FormHelperText,{error:!!s,children:s?s==null?void 0:s.message:n})]})})},MNe=({row:t,name:e,rules:n,label:r,options:i,spacing:a,helperText:o,required:s,...l})=>{const{control:c}=Xe.useFormContext(),u=(d,f)=>d.includes(f)?d.filter(p=>p!==f):[...d,f];return O.jsx(Xe.Controller,{name:e,control:c,rules:n,render:({field:d,fieldState:{error:f}})=>O.jsxs(H.FormControl,{component:"fieldset",children:[r&&O.jsx(H.FormLabel,{component:"legend",sx:{typography:"body2"},required:s,children:r}),O.jsx(H.FormGroup,{sx:{...t&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:a||0},...t&&{mr:0,"&:not(:last-of-type)":{mr:a||2}}}},children:i.map(p=>O.jsx(H.FormControlLabel,{control:O.jsx(H.Checkbox,{checked:d.value.includes(p.value),onChange:()=>d.onChange(u(d.value,p.value))}),label:p.label,...l},p.value))}),(!!f||o)&&O.jsx(H.FormHelperText,{error:!!f,sx:p=>({color:l.disabled?p.palette.grey[500]:void 0}),children:f?f==null?void 0:f.message:o})]})})},kNe=typeof window<"u"?A.useLayoutEffect:A.useEffect;function lT(t,e,n,r){const i=A.useRef(e);kNe(()=>{i.current=e},[e]),A.useEffect(()=>{const a=(n==null?void 0:n.current)||window;if(!(a&&a.addEventListener))return;const o=s=>i.current(s);return a.addEventListener(t,o,r),()=>{a.removeEventListener(t,o)}},[t,n,r])}const PNe=({keyName:t,inputs:e=[],rules:n,tabIndex:r,...i})=>{const a=A.useRef(null),{control:o,setValue:s,formState:{errors:l}}=Xe.useFormContext(),c=f=>{const p=f.clipboardData.getData("text").split("");e.map((h,m)=>s(h,p[m])),f.preventDefault()},u=(f,p)=>{const{maxLength:h,value:m,name:g}=f.target,_=g.replace(t,""),b=Number(_),S=document.querySelector(`input[name=${t}${b+1}]`);m.length>h&&(f.target.value=m[0]),m.length>=h&&b<6&&S!==null&&S.focus(),p(f)};lT("paste",c,a);const d=e.some(f=>l[f]);return O.jsxs(H.Stack,{children:[O.jsx(H.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:a,children:e.map((f,p)=>O.jsx(Xe.Controller,{name:`${t}${p+1}`,control:o,rules:n,render:({field:h,fieldState:{error:m}})=>O.jsx(H.TextField,{...i,...h,autoComplete:"none",error:!!m,autoFocus:p===0,placeholder:"-",onChange:g=>{u(g,h.onChange)},onFocus:g=>g.currentTarget.select(),InputProps:{sx:{width:{xs:36,sm:56},height:{xs:36,sm:56},"& input":{p:0,textAlign:"center"}}},inputProps:{maxLength:1,type:"number",tabIndex:r}})},f))}),d&&O.jsx(H.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},LNe=({name:t,rules:e,helperText:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:{...e,validate:{...e==null?void 0:e.validate,validation:a=>{const o="#"+a.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(o)?!0:"Cor inválida"}}},render:({field:{ref:a,onChange:o,...s},fieldState:{error:l}})=>O.jsx(iw,{...s,onChangeColor:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||n,...r})})},FNe=({name:t,rules:e,tabIndex:n,helperText:r,required:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:e,render:({field:{ref:s,...l},fieldState:{error:c}})=>{var u;return O.jsx(rl.DatePicker,{inputRef:s,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...a.localeText},...l,...a,value:l.value?new Date(l.value):null,slotProps:{textField:{...(u=a.slotProps)==null?void 0:u.textField,required:i,error:!!c,helperText:(c==null?void 0:c.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},BNe=({name:t,label:e,rules:n,tabIndex:r,helperText:i,required:a,...o})=>{const{control:s,setError:l}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:s,rules:n,render:({field:{value:c,onChange:u},fieldState:{error:d}})=>O.jsx(rl.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...o.localeText},value:[(c==null?void 0:c.startDate)||null,(c==null?void 0:c.endDate)||null],onChange:f=>u({startDate:f[0],endDate:f[1]}),onError:f=>{l(t,{message:f[0]||f[1]||void 0})},...o,slotProps:{textField:({position:f})=>{var p;return{...(p=o.slotProps)==null?void 0:p.textField,required:a,error:!!d,helperText:(d==null?void 0:d.message)||i,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:f==="start"?`${e} (Dt. Início)`:`${e} (Dt. Fim)`,inputProps:{tabIndex:r}}}},sx:{width:1}})})},UNe=({name:t,rules:e,tabIndex:n,helperText:r,required:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:e,render:({field:{ref:s,...l},fieldState:{error:c}})=>{var u;return O.jsx(rl.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:s,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...a.localeText},...l,...a,value:l.value?new Date(l.value):null,slotProps:{textField:{...(u=a.slotProps)==null?void 0:u.textField,required:i,error:!!c,helperText:(c==null?void 0:c.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},GNe=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onBlur:o,onChange:s,value:l},fieldState:{error:c}})=>O.jsx(dP,{id:`quill${a}`,onBlur:o,onChange:(u,d,f,p)=>s(p.getLength()===1?"":u),value:l,error:!!c,helperText:(c==null?void 0:c.message)||e,...r})})},$Ne=({id:t,children:e,onSubmit:n,methods:r,...i})=>O.jsx(Xe.FormProvider,{...r,children:O.jsx(H.Stack,{component:"form",id:t,onSubmit:n,flex:1,width:1,noValidate:!0,...i,children:e})}),qNe=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{ref:a,value:o,...s},fieldState:{error:l}})=>O.jsx(WS,{value:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||e,...r,...s,name:t})})},VNe=({name:t,helperText:e,rules:n,onChange:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:o,fieldState:{error:s}})=>O.jsx(Df,{...o,onChange:l=>{o.onChange(l),r&&r(l)},fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||e,...i})})},YNe=({name:t,sx:e,rules:n,passwordSize:r,specialCharacter:i,upperCaseChar:a,numberChar:o,...s})=>{const{watch:l}=Xe.useFormContext(),c=l(t),[u,d]=A.useState(!1),{hasNumberChar:f,hasSpecialCharacter:p,hasUpperCaseChar:h,isLengthValid:m}=Ff(c,r,o,i,a);return O.jsx(ho,{...s,name:t,type:u?"text":"password",InputProps:{endAdornment:O.jsx(H.InputAdornment,{position:"end",children:O.jsx(H.IconButton,{onClick:()=>d(!u),edge:"end","aria-label":"Mostrar/Ocultar senha",children:O.jsx(Ct,{icon:u?"eva:eye-off-fill":"eva:eye-fill"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:g=>{const _=Ff(g,r,o,i,a);return!_.hasNumberChar||!_.hasSpecialCharacter||!_.hasUpperCaseChar||!_.isLengthValid?"Senha inválida":!0}}},sx:{...e,"& .MuiFormHelperText-root":{display:!p||!h||!m||!f?"none":void 0}}})},HNe=({name:t,rules:e,row:n,label:r,options:i,spacing:a,helperText:o,decorated:s,onChange:l,tabIndex:c,required:u,disabled:d,...f})=>{const{control:p}=Xe.useFormContext(),h=r?`${t}-${r}`:"";return O.jsx(Xe.Controller,{name:t,control:p,rules:e,render:({field:m,fieldState:{error:g}})=>O.jsxs(H.FormControl,{component:"fieldset",sx:{...s&&{paddingLeft:1.5}},children:[r&&O.jsx(H.FormLabel,{component:"legend",id:h,sx:{typography:"body2"},required:u,children:r}),O.jsx(H.RadioGroup,{...m,onChange:(_,b)=>{m.onChange(_),l&&l(_,b)},"aria-labelledby":h,row:n,...f,children:i.map(_=>O.jsx(H.FormControlLabel,{value:_.value,control:O.jsx(H.Radio,{inputProps:{tabIndex:c},disabled:d}),label:_.label,sx:({palette:b})=>({"&:not(:last-of-type)":{mb:a||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:a||2}},...s&&{border:`1px solid ${H.alpha(b.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(a||0)/2||1,...m.value===_.value&&{borderColor:"primary.main",backgroundColor:H.alpha(b.primary.main,.05)}}})},_.value))}),(!!g||o)&&O.jsx(H.FormHelperText,{error:!!g,sx:_=>({color:d?_.palette.grey[500]:void 0}),children:g?g==null?void 0:g.message:o})]})})},zNe=({name:t,rules:e,...n})=>{const{control:r}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:r,rules:e,render:({field:{onChange:i,onBlur:a,value:o},fieldState:{error:s}})=>O.jsx(s5,{onChange:i,onBlur:a,value:o,...n,error:!!s,helperText:s==null?void 0:s.message})})},WNe=({name:t,helperText:e,onChange:n,tabIndex:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,render:({field:o,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(H.FormControlLabel,{control:O.jsx(H.Switch,{...o,checked:o.value,onChange:(l,c)=>{o.onChange(l),n&&n(l,c)},inputProps:{tabIndex:r}}),...i}),(!!s||e)&&O.jsx(H.FormHelperText,{error:!!s,sx:l=>({mx:"14px",color:i.disabled?l.palette.grey[500]:void 0}),children:s?s==null?void 0:s.message:e})]})})},jNe=({name:t,rules:e,tabIndex:n,helperText:r,required:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:e,render:({field:{ref:s,...l},fieldState:{error:c}})=>{var u;return O.jsx(rl.TimePicker,{ampm:!1,format:"HH:mm",inputRef:s,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...a.localeText},...l,...a,value:l.value?new Date(l.value):null,slotProps:{textField:{...(u=a.slotProps)==null?void 0:u.textField,error:!!c,required:i,helperText:(c==null?void 0:c.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})};function Z5(t,e){const{watch:n,setValue:r}=Xe.useFormContext(),[i,a]=A.useState(e),o=n(t)||[];return{uploadFile:async f=>{if(!f){r(t,void 0),a(void 0);return}r(t,f),a(Object.assign(f,{preview:URL.createObjectURL(f)}))},uploadFiles:async f=>{r(t,[...o,...f.map(p=>Object.assign(p,{preview:URL.createObjectURL(p)}))])},handleDeleteFile:()=>{r(t,void 0),a(void 0)},handleRemoveAll:()=>{r(t,void 0)},handleRemove:f=>{const p=o.filter(h=>h!==f);r(t,p)},file:i,setFileValue:a}}const KNe=({name:t,rules:e,helperText:n,aspect:r,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:l,onCancel:c,...u})=>{const{control:d}=Xe.useFormContext(),{uploadFile:f,file:p,setFileValue:h}=Z5(t);return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:{value:m},fieldState:{error:g}})=>O.jsx(K5,{accept:{"image/*":[]},file:m?p:void 0,onFileCropped:_=>{f(_),s&&s(_)},onImageUploaded:l,onCancel:()=>{h(void 0),c&&c()},error:!!g,disableMultiple:!0,helperText:(!!g||n)&&O.jsx(H.FormHelperText,{error:!!g,sx:{px:2},children:g?g==null?void 0:g.message:n}),aspect:r,label:i,size:a,image:o,...u})})},QNe=({onFileCropped:t,onImageUploaded:e,onCancel:n,aspect:r,size:i,label:a,image:o="",uploading:s,file:l,tabIndex:c,...u})=>{const{id:d,crop:f,cropModalOpen:p,zoom:h,cancelChanges:m,handleRemove:g,onCropComplete:_,saveChanges:b,setCrop:S,setCropModalOpen:v,setZoom:E}=W5({image:o,onFileCropped:t,onImageUploaded:e,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(H.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[s&&O.jsx(wNe,{}),O.jsx(Y5,{...u,id:d,file:l,onDrop:T=>{if(T.length>0){v(!0),E(1),S({x:0,y:0});const y=new FileReader;y.addEventListener("load",()=>{var N;const C=((N=y.result)==null?void 0:N.toString())||"";e(C),t(void 0)}),y.readAsDataURL(T[0])}},image:o,tabIndex:c})]}),O.jsx(j5,{id:d,open:p,onClose:m,label:a,aspect:r,crop:f,zoom:h,onCropComplete:_,onCropChange:S,onZoomChange:E,imgSrc:o,onRemove:g,onSave:b,size:i})]})},XNe=({name:t,rules:e,helperText:n,aspect:r,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:l,onCancel:c,...u})=>{const{control:d}=Xe.useFormContext(),{uploadFile:f,file:p,setFileValue:h}=Z5(t);return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:{value:m},fieldState:{error:g}})=>O.jsx(QNe,{accept:{"image/*":[]},file:m?p:void 0,onFileCropped:_=>{f(_),s&&s(_)},onImageUploaded:l,onCancel:()=>{h(void 0),c&&c()},error:!!g,disableMultiple:!0,helperText:(!!g||n)&&O.jsx(H.FormHelperText,{error:!!g,sx:{px:2},children:g?g==null?void 0:g.message:n}),aspect:r,label:i,size:a,image:o,...u})})},ZNe=()=>{const[t,e]=A.useState(!1),[n,r]=A.useState(document.activeElement);return A.useEffect(()=>{const i=o=>r(o.target),a=()=>r(null);return window.addEventListener("focus",i,!0),window.addEventListener("blur",a,!0),e(!0),()=>{window.removeEventListener("focus",i),window.removeEventListener("blur",a)}},[]),{activeElement:n,listenersReady:t}};function JNe(){const[t,e]=A.useState(null);return{copiedText:t,copy:async r=>{if(!(navigator!=null&&navigator.clipboard))return!1;try{return await navigator.clipboard.writeText(r),e(r),!0}catch{return e(null),!1}}}}const ewe=({page:t,perPage:e,dir:n,search:r,searchValue:i,sort:a}={page:0,perPage:25})=>{const o=Mi.useGridApiRef(),[s,l]=A.useState({page:t,perPage:e,dir:n,search:r,searchValue:i,sort:a}),c=({pageSize:m=25,page:g=0})=>{l(_=>({..._,page:g,perPage:m}))},u=m=>l(g=>({...g,page:0,search:m})),d=m=>l(g=>({...g,searchValue:m})),f=()=>l(m=>({...m,page:0,search:m.searchValue})),p=(m,g)=>l(_=>({..._,sort:m,dir:g})),h=()=>{o.current.setPage(0),c({page:0})};return{...s,apiRef:o,page:s.page||0,perPage:s.perPage||25,handlePaginationModelChange:c,handleSearch:u,handleSort:p,handleSearchValue:d,applySearchValue:f,goToPageFirstPage:h}},twe=(t,e)=>Hve(t,e),nwe=t=>{const e=A.useRef();return twe(t,e.current)||(e.current=t),e.current},rwe=(t,e)=>{A.useEffect(t,e.map(nwe))},iwe=()=>{const t=A.useRef(!0);return t.current?(t.current=!1,!0):t.current};function awe(t=""){const[e,n]=A.useState(t);return{currentTab:e,onChangeTab:(r,i)=>{n(i)},setCurrentTab:n}}function owe({items:t,itemsPerPage:e}){const[n,r]=A.useState(1),i=Math.ceil(t.length/e),a=t.slice((n-1)*e,n*e);return{currentPage:n,totalPages:i,currentItems:a,goToPage:c=>{c>0&&c<=i&&r(c)},nextPage:()=>{n<i&&r(c=>c+1)},prevPage:()=>{n>1&&r(c=>c-1)}}}const swe=(t,e,n="mousedown")=>{lT(n,r=>{const i=t==null?void 0:t.current;!i||i.contains(r.target)||e(r)})},lwe=Object.freeze(Object.defineProperty({__proto__:null,downloadFile:(t,e,n)=>{const r=`data:application/octet-stream;base64,${n}`,i=document.createElement("a"),a=`${t.replace(e,"")}.${e}`;i.href=r,i.download=a,i.click()}},Symbol.toStringTag,{value:"Module"}));function cwe(t){return q_({},t)}var J5=1440,uwe=2520,cT=43200,dwe=86400;function fwe(t,e,n){var r,i;Ce(2,arguments);var a=Nr(),o=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:a.locale)!==null&&r!==void 0?r:sf;if(!o.formatDistance)throw new RangeError("locale must contain formatDistance property");var s=ms(t,e);if(isNaN(s))throw new RangeError("Invalid time value");var l=q_(cwe(n),{addSuffix:!!(n!=null&&n.addSuffix),comparison:s}),c,u;s>0?(c=Oe(e),u=Oe(t)):(c=Oe(t),u=Oe(e));var d=cw(u,c),f=(gs(u)-gs(c))/1e3,p=Math.round((d-f)/60),h;if(p<2)return n!=null&&n.includeSeconds?d<5?o.formatDistance("lessThanXSeconds",5,l):d<10?o.formatDistance("lessThanXSeconds",10,l):d<20?o.formatDistance("lessThanXSeconds",20,l):d<40?o.formatDistance("halfAMinute",0,l):d<60?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",1,l):p===0?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",p,l);if(p<45)return o.formatDistance("xMinutes",p,l);if(p<90)return o.formatDistance("aboutXHours",1,l);if(p<J5){var m=Math.round(p/60);return o.formatDistance("aboutXHours",m,l)}else{if(p<uwe)return o.formatDistance("xDays",1,l);if(p<cT){var g=Math.round(p/J5);return o.formatDistance("xDays",g,l)}else if(p<dwe)return h=Math.round(p/cT),o.formatDistance("aboutXMonths",h,l)}if(h=k_(u,c),h<12){var _=Math.round(p/cT);return o.formatDistance("xMonths",_,l)}else{var b=h%12,S=Math.floor(h/12);return b<3?o.formatDistance("aboutXYears",S,l):b<9?o.formatDistance("overXYears",S,l):o.formatDistance("almostXYears",S+1,l)}}function pwe(t,e){return Ce(1,arguments),fwe(t,Date.now(),e)}function hwe(t){Ce(1,arguments);var e=Oe(t),n=e.getTime();return n}function mwe(t,e){const n=e||"dd/MM/yyyy";return t?G_(new Date(t),n):null}function gwe(t,e){const n=e||"dd/MM/yyyy HH:mm:ss";return t?G_(new Date(t),n):null}function _we(t){return t?hwe(new Date(t)):null}function bwe(t){return t?pwe(new Date(t),{addSuffix:!0}):null}function vwe(t,e="dd/MM/yyyy hh:mm:ss"){if(!t)return null;const n=Iw(t,e,new Date);return F_(n)?n:null}const Ewe=Object.freeze(Object.defineProperty({__proto__:null,fDate:mwe,fDateTime:gwe,fTimestamp:_we,fToNow:bwe,stringToDate:vwe},Symbol.toStringTag,{value:"Module"}));function Swe(t){const e=t.match(/\/([^/]+)/);return e?e[0]:t}const ywe=Object.freeze(Object.defineProperty({__proto__:null,getRoot:Swe},Symbol.toStringTag,{value:"Module"}));function Twe(t,e,n="asc"){return t.slice().sort((r,i)=>{const a=r[e],o=i[e];return a<o?n==="asc"?-1:1:a>o?n==="asc"?1:-1:0})}function Cwe(t,e,n){const r=[...n],i=r.splice(t,1)[0];return r.splice(e,0,i),r}const Owe=Object.freeze(Object.defineProperty({__proto__:null,sort:Twe,updatePosition:Cwe},Symbol.toStringTag,{value:"Module"})),uT=(t="",e)=>{let n="",r=0;return[...e].forEach(i=>{n+=i==="#"?t[r++]||"_":i}),n},xwe=Object.freeze(Object.defineProperty({__proto__:null,applyMask:uT,cnpjMask:t=>uT(t.replace(/\D/g,""),"##.###.###/####-##"),cpfMask:t=>uT(t.replace(/\D/g,""),"###.###.###-##")},Symbol.toStringTag,{value:"Module"}));function Rwe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const Awe=t=>function(n){return O.jsx(A.Suspense,{fallback:O.jsx(mf,{}),children:O.jsx(t,{...n})})},Nwe=Object.freeze(Object.defineProperty({__proto__:null,default:k8},Symbol.toStringTag,{value:"Module"}));se.Address=INe,se.Autocomplete=mg,se.AutocompleteField=Q5,se.Checkbox=DNe,se.Codes=PNe,se.ColorPickerField=LNe,se.ColorPickerInput=iw,se.Common=Zhe,se.Confirm=Jhe,se.CustomAvatar=Kw,se.CustomAvatarGroup=Qw,se.DataGrid=sme,se.DatePicker=FNe,se.DateRangePicker=BNe,se.DateTimePicker=UNe,se.Delayed=lme,se.DialogAnimate=P8,se.Drawer=vme,se.Editor=dP,se.EditorField=GNe,se.EmptyView=Zw,se.FabButtonAnimate=z1,se.Field=ho,se.FixedProgressBar=mf,se.Form=$Ne,se.IconButtonAnimate=W1,se.Iconify=Ct,se.Image=yf,se.ImageCrop=AP,se.Incrementer=WS,se.IncrementerField=qNe,se.Label=qP,se.MaskedInput=XS,se.MaskedInputField=X5,se.MaterialDesignContent=Sx,se.MenuPopover=xSe,se.Modal=ZP,se.ModalActions=ISe,se.MotionContainer=w$,se.MotionLazyContainer=XO,se.MotionViewport=N$,se.MultiCheckbox=MNe,se.NavSectionHorizontal=rAe,se.NavSectionMini=YRe,se.NavSectionVertical=QRe,se.NavSectionVerticalWithButtons=cAe,se.NumberInput=Df,se.NumberInputField=VNe,se.PasswordField=YNe,se.PasswordRules=FSe,se.Portal=JP,se.RadioGroupField=HNe,se.SQLEditor=s5,se.SQLEditorEditorField=zNe,se.Scrollbar=uI,se.SearchInput=NRe,se.SnackbarContent=Wm,se.SnackbarProvider=Cx,se.Steps=DRe,se.Switch=WNe,se.TRANSITION=_T,se.TabPanel=MRe,se.TextAnimate=L8,se.ThemeProvider=jw,se.TimePicker=jNe,se.Transition=od,se.Upload=V5,se.UploadAvatar=Y5,se.UploadAvatarWithCropField=XNe,se.UploadBox=CNe,se.UploadWithCrop=K5,se.UploadWithCropField=KNe,se.cssStyles=FRe,se.file=lwe,se.formatNumber=UEe,se.formatTime=Ewe,se.loadable=Awe,se.mask=xwe,se.number=MEe,se.routes=ywe,se.sort=Owe,se.useActiveElement=ZNe,se.useActiveLink=oh,se.useCopyToClipboard=JNe,se.useDatagrid=ewe,se.useDeepCompareEffect=rwe,se.useEventListener=lT,se.useIsMounting=iwe,se.useOnClickOutside=swe,se.usePagination=owe,se.useResponsive=QO,se.useSnackbar=lq,se.useTabs=awe,se.useToggle=z5,se.uuidv4=Rwe,se.validators=kSe,se.varBgColor=EU,se.varBgKenburns=SU,se.varBgPan=yU,se.varBounce=_U,se.varContainer=uu,se.varFade=il,se.varFlip=hU,se.varHover=vU,se.varPath=dU,se.varRotate=bU,se.varScale=gU,se.varSlide=mU,se.varTranEnter=Ze,se.varTranExit=rt,se.varTranHover=fU,se.varZoom=pU,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
319
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P5(t,e){if(t){if(typeof t=="string")return rT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rT(t,e)}}function rT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function JAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function eNe(t){if(Array.isArray(t))return t}function L5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function jt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?L5(Object(n),!0).forEach(function(r){iT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dh(t,e){if(t==null)return{};var n=tNe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tNe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var aT=A.forwardRef(function(t,e){var n=t.children,r=dh(t,YAe),i=fh(r),a=i.open,o=dh(i,HAe);return A.useImperativeHandle(e,function(){return{open:a}},[a]),A.createElement(A.Fragment,null,n(jt(jt({},o),{},{open:a})))});aT.displayName="Dropzone";var F5={disabled:!1,getFilesFromEvent:pAe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};aT.defaultProps=F5,aT.propTypes={children:te.func,accept:te.objectOf(te.arrayOf(te.string)),multiple:te.bool,preventDropOnDocument:te.bool,noClick:te.bool,noKeyboard:te.bool,noDrag:te.bool,noDragEventsBubbling:te.bool,minSize:te.number,maxSize:te.number,maxFiles:te.number,disabled:te.bool,getFilesFromEvent:te.func,onFileDialogCancel:te.func,onFileDialogOpen:te.func,useFsAccessApi:te.bool,autoFocus:te.bool,onDragEnter:te.func,onDragLeave:te.func,onDragOver:te.func,onDrop:te.func,onDropAccepted:te.func,onDropRejected:te.func,onError:te.func,validator:te.func};var oT={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fh(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=jt(jt({},F5),t),n=e.accept,r=e.disabled,i=e.getFilesFromEvent,a=e.maxSize,o=e.minSize,s=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,f=e.onDrop,p=e.onDropAccepted,h=e.onDropRejected,m=e.onFileDialogCancel,g=e.onFileDialogOpen,_=e.useFsAccessApi,b=e.autoFocus,S=e.preventDropOnDocument,v=e.noClick,E=e.noKeyboard,T=e.noDrag,y=e.noDragEventsBubbling,C=e.onError,N=e.validator,R=A.useMemo(function(){return $Ae(n)},[n]),x=A.useMemo(function(){return GAe(n)},[n]),w=A.useMemo(function(){return typeof g=="function"?g:B5},[g]),D=A.useMemo(function(){return typeof m=="function"?m:B5},[m]),k=A.useRef(null),P=A.useRef(null),G=A.useReducer(nNe,oT),F=nT(G,2),j=F[0],$=F[1],M=j.isFocused,I=j.isFileDialogActive,L=A.useRef(typeof window<"u"&&window.isSecureContext&&_&&UAe()),U=function(){!L.current&&I&&setTimeout(function(){if(P.current){var be=P.current.files;be.length||($({type:"closeDialog"}),D())}},300)};A.useEffect(function(){return window.addEventListener("focus",U,!1),function(){window.removeEventListener("focus",U,!1)}},[P,I,D,L]);var Y=A.useRef([]),V=function(be){k.current&&k.current.contains(be.target)||(be.preventDefault(),Y.current=[])};A.useEffect(function(){return S&&(document.addEventListener("dragover",D5,!1),document.addEventListener("drop",V,!1)),function(){S&&(document.removeEventListener("dragover",D5),document.removeEventListener("drop",V))}},[k,S]),A.useEffect(function(){return!r&&b&&k.current&&k.current.focus(),function(){}},[k,b,r]);var B=A.useCallback(function(de){C?C(de):console.error(de)},[C]),q=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de),Y.current=[].concat(jAe(Y.current),[de.target]),uh(de)&&Promise.resolve(i(de)).then(function(be){if(!(ch(de)&&!y)){var We=be.length,X=We>0&&PAe({files:be,accept:R,minSize:o,maxSize:a,multiple:s,maxFiles:l,validator:N}),z=We>0&&!X;$({isDragAccept:X,isDragReject:z,isDragActive:!0,type:"setDraggedFiles"}),c&&c(de)}}).catch(function(be){return B(be)})},[i,c,B,y,R,o,a,s,l,N]),W=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de);var be=uh(de);if(be&&de.dataTransfer)try{de.dataTransfer.dropEffect="copy"}catch{}return be&&d&&d(de),!1},[d,y]),K=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de);var be=Y.current.filter(function(X){return k.current&&k.current.contains(X)}),We=be.indexOf(de.target);We!==-1&&be.splice(We,1),Y.current=be,!(be.length>0)&&($({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(de)&&u&&u(de))},[k,u,y]),Z=A.useCallback(function(de,be){var We=[],X=[];de.forEach(function(z){var oe=w5(z,R),ae=nT(oe,2),Re=ae[0],$e=ae[1],Le=I5(z,o,a),ue=nT(Le,2),pe=ue[0],De=ue[1],Ie=N?N(z):null;if(Re&&pe&&!Ie)We.push(z);else{var Ne=[$e,De];Ie&&(Ne=Ne.concat(Ie)),X.push({file:z,errors:Ne.filter(function(Ke){return Ke})})}}),(!s&&We.length>1||s&&l>=1&&We.length>l)&&(We.forEach(function(z){X.push({file:z,errors:[kAe]})}),We.splice(0)),$({acceptedFiles:We,fileRejections:X,type:"setFiles"}),f&&f(We,X,be),X.length>0&&h&&h(X,be),We.length>0&&p&&p(We,be)},[$,s,R,o,a,l,f,p,h,N]),le=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de),Y.current=[],uh(de)&&Promise.resolve(i(de)).then(function(be){ch(de)&&!y||Z(be,de)}).catch(function(be){return B(be)}),$({type:"reset"})},[i,Z,B,y]),ne=A.useCallback(function(){if(L.current){$({type:"openDialog"}),w();var de={multiple:s,types:x};window.showOpenFilePicker(de).then(function(be){return i(be)}).then(function(be){Z(be,null),$({type:"closeDialog"})}).catch(function(be){qAe(be)?(D(be),$({type:"closeDialog"})):VAe(be)?(L.current=!1,P.current?(P.current.value=null,P.current.click()):B(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):B(be)});return}P.current&&($({type:"openDialog"}),w(),P.current.value=null,P.current.click())},[$,w,D,_,Z,B,x,s]),Ee=A.useCallback(function(de){!k.current||!k.current.isEqualNode(de.target)||(de.key===" "||de.key==="Enter"||de.keyCode===32||de.keyCode===13)&&(de.preventDefault(),ne())},[k,ne]),_e=A.useCallback(function(){$({type:"focus"})},[]),fe=A.useCallback(function(){$({type:"blur"})},[]),Se=A.useCallback(function(){v||(BAe()?setTimeout(ne,0):ne())},[v,ne]),Te=function(be){return r?null:be},re=function(be){return E?null:Te(be)},ee=function(be){return T?null:Te(be)},me=function(be){y&&be.stopPropagation()},he=A.useMemo(function(){return function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},be=de.refKey,We=be===void 0?"ref":be,X=de.role,z=de.onKeyDown,oe=de.onFocus,ae=de.onBlur,Re=de.onClick,$e=de.onDragEnter,Le=de.onDragOver,ue=de.onDragLeave,pe=de.onDrop,De=dh(de,zAe);return jt(jt(iT({onKeyDown:re(ci(z,Ee)),onFocus:re(ci(oe,_e)),onBlur:re(ci(ae,fe)),onClick:Te(ci(Re,Se)),onDragEnter:ee(ci($e,q)),onDragOver:ee(ci(Le,W)),onDragLeave:ee(ci(ue,K)),onDrop:ee(ci(pe,le)),role:typeof X=="string"&&X!==""?X:"presentation"},We,k),!r&&!E?{tabIndex:0}:{}),De)}},[k,Ee,_e,fe,Se,q,W,K,le,E,T,r]),ie=A.useCallback(function(de){de.stopPropagation()},[]),Ue=A.useMemo(function(){return function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},be=de.refKey,We=be===void 0?"ref":be,X=de.onChange,z=de.onClick,oe=dh(de,WAe),ae=iT({accept:R,multiple:s,type:"file",style:{display:"none"},onChange:Te(ci(X,le)),onClick:Te(ci(z,ie)),tabIndex:-1},We,P);return jt(jt({},ae),oe)}},[P,n,s,le,r]);return jt(jt({},j),{},{isFocused:M&&!r,getRootProps:he,getInputProps:Ue,rootRef:k,inputRef:P,open:Te(ne)})}function nNe(t,e){switch(e.type){case"focus":return jt(jt({},t),{},{isFocused:!0});case"blur":return jt(jt({},t),{},{isFocused:!1});case"openDialog":return jt(jt({},oT),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return jt(jt({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return jt({},oT);default:return t}}function B5(){}const rNe=["pdf"],iNe=["txt"],aNe=["psd"],oNe=["doc","docx"],sNe=["xls","xlsx"],lNe=["zip","rar","iso"],cNe=["ai","esp"],uNe=["ppt","pptx"],dNe=["wav","aif","mp3","aac"],fNe=["jpg","jpeg","gif","bmp","png","svg"],pNe=["m4v","avi","mpg","mp4","webm"],fr=t=>`/assets/icons/files/${t}.svg`;function U5(t){let e;switch(t==null?void 0:t.includes(jn(t))){case iNe.includes(jn(t)):e="txt";break;case lNe.includes(jn(t)):e="zip";break;case dNe.includes(jn(t)):e="audio";break;case fNe.includes(jn(t)):e="image";break;case pNe.includes(jn(t)):e="video";break;case oNe.includes(jn(t)):e="word";break;case sNe.includes(jn(t)):e="excel";break;case uNe.includes(jn(t)):e="powerpoint";break;case rNe.includes(jn(t)):e="pdf";break;case aNe.includes(jn(t)):e="photoshop";break;case cNe.includes(jn(t)):e="illustrator";break;default:e=jn(t)}return e}function hNe(t){let e;switch(U5(t)){case"folder":e=fr("ic_folder");break;case"txt":e=fr("ic_txt");break;case"zip":e=fr("ic_zip");break;case"audio":e=fr("ic_audio");break;case"video":e=fr("ic_video");break;case"word":e=fr("ic_word");break;case"excel":e=fr("ic_excel");break;case"powerpoint":e=fr("ic_power_point");break;case"pdf":e=fr("ic_pdf");break;case"photoshop":e=fr("ic_pts");break;case"illustrator":e=fr("ic_ai");break;case"image":e=fr("ic_img");break;default:e=fr("ic_file")}return e}function jn(t=""){return t&&t.split(".").pop()||""}function mNe(t){return t.split("/").pop()}function sT(t){return typeof t=="string"?{key:t,preview:t,name:mNe(t),type:jn(t)}:{key:t.preview,name:t.name,size:t.size,path:t.path,type:t.type,preview:t.preview,lastModified:t.lastModified,lastModifiedDate:t.lastModifiedDate}}const G5=({onDownload:t})=>{const e=Ra();return O.jsx(H.IconButton,{onClick:t,sx:{p:0,top:0,right:0,width:1,height:1,zIndex:9,opacity:0,position:"absolute",borderRadius:"unset",justifyContent:"center",bgcolor:"grey.800",color:"common.white",transition:e.transitions.create("opacity"),"&:hover":{opacity:1,...sh({opacity:.64,color:e.palette.grey[900]})}},children:O.jsx(Ct,{icon:"eva:arrow-circle-down-fill",width:24})})},$5=({file:t,tooltip:e,imageView:n,onDownload:r,sx:i,imgSx:a})=>{const{name:o="",path:s="",preview:l=""}=sT(t),c=U5(s||l),u=c==="image"&&n?O.jsx(H.Box,{component:"img",src:l,sx:{width:1,height:1,flexShrink:0,objectFit:"cover",...a}}):O.jsx(H.Box,{component:"img",src:hNe(c),sx:{width:32,height:32,flexShrink:0,...i}});return e?O.jsx(H.Tooltip,{title:o,children:O.jsxs(H.Stack,{flexShrink:0,component:"span",alignItems:"center",justifyContent:"center",sx:{width:"fit-content",height:"inherit"},children:[u,r&&O.jsx(G5,{onDownload:r})]})}):O.jsxs(O.Fragment,{children:[u,r&&O.jsx(G5,{onDownload:r})]})},q5=({fileRejections:t})=>t.length?O.jsx(H.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:e=>ye(e.palette.error.main,.08),borderColor:e=>ye(e.palette.error.main,.24)},children:t.map(({file:e,errors:n})=>{const{path:r,size:i}=sT(e);return O.jsxs(H.Box,{sx:{my:1},children:[O.jsxs(H.Typography,{variant:"subtitle2",noWrap:!0,children:[r," - ",i?VS(i):""]}),n.map(a=>O.jsxs(H.Box,{component:"span",sx:{typography:"caption"},children:["- ",a.message]},a.code))]},r)})}):null,gNe=({thumbnail:t,files:e,onRemove:n,sx:r})=>e!=null&&e.length?O.jsx(H1,{initial:!1,children:e.map(i=>{const{key:a,name:o="",size:s=0}=sT(i),l=typeof i=="string";return t?O.jsxs(H.Stack,{component:Cr.div,...il().inUp,alignItems:"center",display:"inline-flex",justifyContent:"center",sx:{m:.5,width:80,height:80,borderRadius:1.25,overflow:"hidden",position:"relative",border:c=>`solid 1px ${c.palette.divider}`,...r},children:[O.jsx($5,{tooltip:!0,imageView:!0,file:i,sx:{position:"absolute"},imgSx:{position:"absolute"}}),n&&O.jsx(H.IconButton,{size:"small",onClick:()=>n(i),sx:{top:4,right:4,p:"1px",position:"absolute",color:c=>ye(c.palette.common.white,.72),bgcolor:c=>ye(c.palette.grey[900],.48),"&:hover":{bgcolor:c=>ye(c.palette.grey[900],.72)}},children:O.jsx(Ct,{icon:"eva:close-fill",width:16})})]},a):O.jsxs(H.Stack,{component:Cr.div,...il().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:c=>`solid 1px ${c.palette.divider}`,...r},children:[O.jsx($5,{file:i}),O.jsxs(H.Stack,{flexGrow:1,sx:{minWidth:0},children:[O.jsx(H.Typography,{variant:"subtitle2",noWrap:!0,children:l?i:o}),O.jsx(H.Typography,{variant:"caption",sx:{color:"text.secondary"},children:l?"":VS(s)})]}),n&&O.jsx(H.IconButton,{edge:"end",size:"small",onClick:()=>n(i),children:O.jsx(Ct,{icon:"eva:close-fill"})})]},a)})}):null,_Ne=({file:t})=>{if(!t)return null;const e=typeof t=="string"?t:t.preview;return O.jsx(H.Stack,{position:"absolute",width:1,height:1,maxHeight:"100%",alignItems:"center",justifyContent:"center",top:0,right:0,bottom:0,left:0,padding:2,margin:"auto",children:O.jsx(yf,{alt:"file preview",src:e,sx:{borderRadius:1,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},bNe=qt("div")(({theme:t})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:t.spacing(5),borderRadius:t.shape.borderRadius,transition:t.transitions.create("padding"),backgroundColor:t.palette.background.neutral,border:`1px dashed ${ye(t.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),vNe=({header:t,description:e,sx:n,...r})=>O.jsxs(H.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...r,children:[O.jsx(ame,{sx:{width:220}}),O.jsxs("div",{children:[O.jsx(H.Typography,{gutterBottom:!0,variant:"h5",children:t||"Soltar ou selecionar arquivos"}),O.jsx(H.Typography,{variant:"body2",sx:{color:"text.secondary"},children:e||O.jsxs(O.Fragment,{children:["Solte os arquivos aqui ou clique",O.jsx(H.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),V5=({id:t,disabled:e,multiple:n=!1,error:r,helperText:i,file:a,onDelete:o,files:s,thumbnail:l,onUpload:c,onRemove:u,onRemoveAll:d,sx:f,dropZoneProps:p,placeholderProps:h,placeholderAlt:m,image:g,tabIndex:_,...b})=>{const{getRootProps:S,getInputProps:v,isDragActive:E,isDragReject:T,fileRejections:y}=fh({multiple:n,disabled:e,...b}),C=!!a&&!n||g,N=s&&n&&s.length>0,R=T||!!r;return O.jsxs(H.Box,{sx:{width:1,position:"relative",...f},children:[O.jsxs(bNe,{...S(),sx:{...E&&{opacity:.72},...R&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...e&&{opacity:.48,pointerEvents:"none"},...p},children:[O.jsx("input",{...v(),id:t,tabIndex:_}),m?O.jsx(H.Stack,{sx:{...C&&{opacity:0}},children:m}):O.jsx(vNe,{sx:{...C&&{opacity:0}},header:h==null?void 0:h.title,description:h==null?void 0:h.description}),C&&O.jsx(_Ne,{file:a||g||""})]}),i&&O.jsx(H.FormHelperText,{error:!!r,sx:x=>({mx:"14px",color:e?x.palette.grey[500]:void 0}),children:i}),O.jsx(q5,{fileRejections:y}),C&&o&&O.jsx(H.IconButton,{size:"small",onClick:o,sx:{top:16,right:16,zIndex:9,position:"absolute",color:x=>ye(x.palette.common.white,.8),bgcolor:x=>ye(x.palette.grey[900],.72),"&:hover":{bgcolor:x=>ye(x.palette.grey[900],.48)}},children:O.jsx(Ct,{icon:"eva:close-fill",width:18})}),N&&O.jsxs(O.Fragment,{children:[O.jsx(H.Box,{sx:{my:3},children:O.jsx(gNe,{files:s,thumbnail:l,onRemove:u})}),O.jsxs(H.Stack,{direction:"row",justifyContent:"flex-end",spacing:1.5,children:[d&&O.jsx(H.Button,{color:"inherit",variant:"outlined",size:"small",onClick:d,children:"Remove all"}),c&&O.jsx(H.Button,{size:"small",variant:"contained",onClick:c,children:"Upload files"})]})]})]})},ENe=({file:t})=>{if(!t)return null;const e=typeof t=="string"?t:t.preview;return O.jsx(yf,{alt:"avatar",src:e,sx:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},SNe=qt("div")(({theme:t})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${ye(t.palette.grey[500],.32)}`})),yNe=qt("div")(({theme:t})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:t.palette.text.disabled,backgroundColor:t.palette.background.neutral,transition:t.transitions.create("opacity",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.shorter})})),Y5=({error:t,file:e,image:n,disabled:r,helperText:i,sx:a,tabIndex:o,...s})=>{const{getRootProps:l,getInputProps:c,isDragActive:u,isDragReject:d,fileRejections:f}=fh({multiple:!1,disabled:r,...s}),p=!!e||n,h=d||!!t;return O.jsxs(O.Fragment,{children:[O.jsxs(SNe,{...l(),sx:{...u&&{opacity:.72},...h&&{borderColor:"error.light",...p&&{bgcolor:"error.lighter"}},...r&&{opacity:.48,pointerEvents:"none"},...p&&{"&:hover":{"& .placeholder":{opacity:1}}},...a},children:[O.jsx("input",{...c(),tabIndex:o}),p&&O.jsx(ENe,{file:e||n||""}),O.jsxs(yNe,{className:"placeholder",sx:{"&:hover":{opacity:.72},...p&&{zIndex:9,opacity:0,color:"common.white",bgcolor:m=>ye(m.palette.grey[900],.64)},...h&&{color:"error.main",bgcolor:"error.lighter"}},children:[O.jsx(Ct,{icon:"ic:round-add-a-photo",width:24,sx:{mb:1}}),O.jsx(H.Typography,{variant:"caption",children:e?"Update photo":"Upload photo"})]})]}),i&&i,O.jsx(q5,{fileRejections:f})]})},TNe=qt("div")(({theme:t})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:t.spacing(.5),color:t.palette.text.disabled,borderRadius:t.shape.borderRadius,border:`dashed 1px ${t.palette.divider}`,backgroundColor:ye(t.palette.grey[500],.08),"&:hover":{opacity:.72}})),CNe=({placeholderAlt:t,error:e,disabled:n,sx:r,tabIndex:i,...a})=>{const{getRootProps:o,getInputProps:s,isDragActive:l,isDragReject:c}=fh({disabled:n,...a}),u=c||e;return O.jsxs(TNe,{...o(),sx:{...l&&{opacity:.72},...u&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...r},children:[O.jsx("input",{...s(),tabIndex:i}),t||O.jsx(Ct,{icon:"eva:cloud-upload-fill",width:28})]})},ONe=t=>new Promise((e,n)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",i=>n(i)),r.setAttribute("crossOrigin","anonymous"),r.src=t});function H5(t){return t*Math.PI/180}function xNe(t,e,n){const r=H5(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}async function RNe(t,e,n=0,r={horizontal:!1,vertical:!1}){const i=await ONe(t),a=document.createElement("canvas"),o=a.getContext("2d");if(!o)return null;const s=H5(n),{width:l,height:c}=xNe(i.width,i.height,n);a.width=l,a.height=c,o.translate(l/2,c/2),o.rotate(s),o.scale(r.horizontal?-1:1,r.vertical?-1:1),o.translate(-i.width/2,-i.height/2),o.drawImage(i,0,0);const u=o.getImageData(e.x,e.y,e.width,e.height);return a.width=e.width,a.height=e.height,o.putImageData(u,0,0),new Promise((d,f)=>{a.toBlob(p=>{d(p)},"image/png")})}const z5=(t=!1)=>{const[e,n]=A.useState(t),r=A.useCallback(()=>n(i=>!i),[]);return[e,r,n]},W5=({onFileCropped:t,onImageUploaded:e,onCancel:n,image:r})=>{const i=A.useId(),[a,o,s]=z5(),[l,c]=A.useState({x:0,y:0}),[u,d]=A.useState(1),f=A.useRef();return{id:i,crop:l,setCrop:c,zoom:u,setZoom:d,fileRef:f,onCropComplete:async(_,b)=>{try{const S=await RNe(r,b,0);f.current=new File([S],"image.png",{type:S.type})}catch{t(void 0)}},saveChanges:()=>{t(f.current),o()},cancelChanges:()=>{n&&n(),s(!1)},handleRemove:()=>{t(void 0),e(void 0),c({x:0,y:0}),d(1),s(!1)},cropModalOpen:a,toggleCropModalOpen:o,setCropModalOpen:s}},j5=({id:t,open:e,onClose:n,label:r,onSave:i,onRemove:a,imgSrc:o,aspect:s,size:{height:l,width:c},crop:u,zoom:d,onCropComplete:f,onCropChange:p,onZoomChange:h})=>O.jsx(ZP,{open:e,onClose:n,dialogTitle:r,actions:O.jsxs(O.Fragment,{children:[O.jsx(H.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),O.jsx(H.Button,{variant:"contained",size:"medium",onClick:i,children:"Salvar"})]}),children:O.jsxs(H.Stack,{gap:2,children:[O.jsx(AP,{image:{width:c,height:l,aspect:s,imgSrc:o},crop:u,zoom:d,onCropComplete:f,onCropChange:p,onZoomChange:h}),O.jsxs(H.Stack,{gap:1.5,children:[O.jsxs(H.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",mr:"auto",children:[O.jsx(H.Typography,{variant:"body1",children:"Zoom"}),O.jsx(H.Slider,{value:d,onChange:(m,g)=>h(Array.isArray(g)?g[0]:g),min:1,max:5,size:"medium",step:.5})]}),O.jsxs(H.Stack,{direction:"row",gap:2,children:[O.jsx(H.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(Ct,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:a,children:"Remover"}),O.jsx(H.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(Ct,{icon:"ic:outline-image-search",color:X_.main}),component:"label",htmlFor:t,children:"Alterar"})]})]})]})}),ANe=H.styled(H.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),NNe=H.styled(H.Stack)(({theme:t})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:H.alpha(t.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),wNe=H.styled(H.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),K5=({onFileCropped:t,onImageUploaded:e,onCancel:n,aspect:r,size:i,label:a,image:o="",uploading:s,file:l,tabIndex:c,...u})=>{const{id:d,crop:f,cropModalOpen:p,zoom:h,cancelChanges:m,handleRemove:g,onCropComplete:_,saveChanges:b,setCrop:S,setCropModalOpen:v,setZoom:E,toggleCropModalOpen:T}=W5({image:o,onFileCropped:t,onImageUploaded:e,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(ANe,{children:[s&&O.jsx(mf,{}),O.jsx(V5,{...u,id:d,file:l,onDrop:y=>{if(y.length>0){v(!0),E(1),S({x:0,y:0});const C=new FileReader;C.addEventListener("load",()=>{var R;const N=((R=C.result)==null?void 0:R.toString())||"";e(N),t(void 0)}),C.readAsDataURL(y[0])}},image:o,tabIndex:c}),(l||o)&&O.jsxs(NNe,{className:"actions",children:[O.jsx(H.Button,{color:"inherit",startIcon:O.jsx(Ct,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:g,children:"Remover"}),O.jsx(H.Button,{color:"inherit",startIcon:O.jsx(Ct,{icon:"ic:outline-image",color:X_.main}),onClick:T,children:"Editar"})]})]}),O.jsx(j5,{id:d,open:p,onClose:m,label:a,aspect:r,crop:f,zoom:h,onCropComplete:_,onCropChange:S,onZoomChange:E,imgSrc:o,onRemove:g,onSave:b,size:i})]})},Q5=({name:t,helperText:e,rules:n,onSelectOption:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:o,fieldState:{error:s}})=>O.jsx(mg,{...o,...i,onChange:l=>{r&&r(l),o.onChange(l)},error:!!s,helperText:(s==null?void 0:s.message)||e})})},ho=({name:t,helperText:e,rules:n,onChange:r,tabIndex:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:n,render:({field:{ref:s,...l},fieldState:{error:c}})=>O.jsx(H.TextField,{...l,onChange:u=>{l.onChange(u),r&&r(u)},inputRef:s,fullWidth:!0,error:!!c,helperText:(c==null?void 0:c.message)||e,...a,inputProps:{...a.inputProps,tabIndex:i}})})},X5=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onChange:o,value:s,ref:l},fieldState:{error:c}})=>O.jsx(XS,{ref:l,...r,name:a,value:s,error:!!c,helperText:(c==null?void 0:c.message)||e,onChange:({target:{value:u}})=>o(u)})})},INe=({name:t,containerProps:e,required:n,rules:r,tabIndex:i})=>{const a=`${t}.zipCode`,o=`${t}.publicPlace`,s=`${t}.number`,l=`${t}.district`,c=`${t}.complement`,u=`${t}.state`,d=`${t}.city`,f=p=>{p.key==="Enter"&&p.preventDefault()};return O.jsxs(H.Stack,{gap:1.5,...e,children:[O.jsxs(H.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(X5,{name:a,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:O.jsx(H.InputAdornment,{position:"end",children:O.jsx(H.CircularProgress,{size:24})})},rules:r,onKeyDown:f,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:i}),O.jsxs(H.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[O.jsx(ho,{name:o,label:"Logradouro",onKeyDown:f,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:i}),O.jsx(ho,{name:s,label:"Número",onKeyDown:f,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:i})]})]}),O.jsxs(H.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(ho,{name:l,label:"Bairro",onKeyDown:f,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:i}),O.jsx(ho,{name:c,label:"Complemento",onKeyDown:f,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:i})]}),O.jsxs(H.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[O.jsx(Q5,{name:u,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:i}),O.jsx(ho,{name:d,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:i})]})]})},DNe=({name:t,rules:e,helperText:n,tabIndex:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:e,render:({field:o,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(H.FormControlLabel,{control:O.jsx(H.Checkbox,{...o,checked:o.value,tabIndex:r}),...i}),(!!s||n)&&O.jsx(H.FormHelperText,{error:!!s,children:s?s==null?void 0:s.message:n})]})})},MNe=({row:t,name:e,rules:n,label:r,options:i,spacing:a,helperText:o,required:s,...l})=>{const{control:c}=Xe.useFormContext(),u=(d,f)=>d.includes(f)?d.filter(p=>p!==f):[...d,f];return O.jsx(Xe.Controller,{name:e,control:c,rules:n,render:({field:{value:d=[],...f},fieldState:{error:p}})=>O.jsxs(H.FormControl,{component:"fieldset",children:[r&&O.jsx(H.FormLabel,{component:"legend",sx:{typography:"body2"},required:s,children:r}),O.jsx(H.FormGroup,{sx:{...t&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:a||0},...t&&{mr:0,"&:not(:last-of-type)":{mr:a||2}}}},children:i.map(h=>O.jsx(H.FormControlLabel,{control:O.jsx(H.Checkbox,{checked:d.includes(h.value),onChange:()=>f.onChange(u(d,h.value))}),label:h.label,...l},h.value))}),(!!p||o)&&O.jsx(H.FormHelperText,{error:!!p,sx:h=>({color:l.disabled?h.palette.grey[500]:void 0}),children:p?p==null?void 0:p.message:o})]})})},kNe=typeof window<"u"?A.useLayoutEffect:A.useEffect;function lT(t,e,n,r){const i=A.useRef(e);kNe(()=>{i.current=e},[e]),A.useEffect(()=>{const a=(n==null?void 0:n.current)||window;if(!(a&&a.addEventListener))return;const o=s=>i.current(s);return a.addEventListener(t,o,r),()=>{a.removeEventListener(t,o)}},[t,n,r])}const PNe=({keyName:t,inputs:e=[],rules:n,tabIndex:r,...i})=>{const a=A.useRef(null),{control:o,setValue:s,formState:{errors:l}}=Xe.useFormContext(),c=f=>{const p=f.clipboardData.getData("text").split("");e.map((h,m)=>s(h,p[m])),f.preventDefault()},u=(f,p)=>{const{maxLength:h,value:m,name:g}=f.target,_=g.replace(t,""),b=Number(_),S=document.querySelector(`input[name=${t}${b+1}]`);m.length>h&&(f.target.value=m[0]),m.length>=h&&b<6&&S!==null&&S.focus(),p(f)};lT("paste",c,a);const d=e.some(f=>l[f]);return O.jsxs(H.Stack,{children:[O.jsx(H.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:a,children:e.map((f,p)=>O.jsx(Xe.Controller,{name:`${t}${p+1}`,control:o,rules:n,render:({field:h,fieldState:{error:m}})=>O.jsx(H.TextField,{...i,...h,autoComplete:"none",error:!!m,autoFocus:p===0,placeholder:"-",onChange:g=>{u(g,h.onChange)},onFocus:g=>g.currentTarget.select(),InputProps:{sx:{width:{xs:36,sm:56},height:{xs:36,sm:56},"& input":{p:0,textAlign:"center"}}},inputProps:{maxLength:1,type:"number",tabIndex:r}})},f))}),d&&O.jsx(H.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},LNe=({name:t,rules:e,helperText:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:{...e,validate:{...e==null?void 0:e.validate,validation:a=>{const o="#"+a.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(o)?!0:"Cor inválida"}}},render:({field:{ref:a,onChange:o,...s},fieldState:{error:l}})=>O.jsx(iw,{...s,onChangeColor:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||n,...r})})},FNe=({name:t,rules:e,tabIndex:n,helperText:r,required:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:e,render:({field:{ref:s,...l},fieldState:{error:c}})=>{var u;return O.jsx(rl.DatePicker,{inputRef:s,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...a.localeText},...l,...a,value:l.value?new Date(l.value):null,slotProps:{textField:{...(u=a.slotProps)==null?void 0:u.textField,required:i,error:!!c,helperText:(c==null?void 0:c.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},BNe=({name:t,label:e,rules:n,tabIndex:r,helperText:i,required:a,...o})=>{const{control:s,setError:l}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:s,rules:n,render:({field:{value:c,onChange:u},fieldState:{error:d}})=>O.jsx(rl.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...o.localeText},value:[(c==null?void 0:c.startDate)||null,(c==null?void 0:c.endDate)||null],onChange:f=>u({startDate:f[0],endDate:f[1]}),onError:f=>{l(t,{message:f[0]||f[1]||void 0})},...o,slotProps:{textField:({position:f})=>{var p;return{...(p=o.slotProps)==null?void 0:p.textField,required:a,error:!!d,helperText:(d==null?void 0:d.message)||i,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:f==="start"?`${e} (Dt. Início)`:`${e} (Dt. Fim)`,inputProps:{tabIndex:r}}}},sx:{width:1}})})},UNe=({name:t,rules:e,tabIndex:n,helperText:r,required:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:e,render:({field:{ref:s,...l},fieldState:{error:c}})=>{var u;return O.jsx(rl.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:s,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...a.localeText},...l,...a,value:l.value?new Date(l.value):null,slotProps:{textField:{...(u=a.slotProps)==null?void 0:u.textField,required:i,error:!!c,helperText:(c==null?void 0:c.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},GNe=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onBlur:o,onChange:s,value:l},fieldState:{error:c}})=>O.jsx(dP,{id:`quill${a}`,onBlur:o,onChange:(u,d,f,p)=>s(p.getLength()===1?"":u),value:l,error:!!c,helperText:(c==null?void 0:c.message)||e,...r})})},$Ne=({id:t,children:e,onSubmit:n,methods:r,...i})=>O.jsx(Xe.FormProvider,{...r,children:O.jsx(H.Stack,{component:"form",id:t,onSubmit:n,flex:1,width:1,noValidate:!0,...i,children:e})}),qNe=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{ref:a,value:o,...s},fieldState:{error:l}})=>O.jsx(WS,{value:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||e,...r,...s,name:t})})},VNe=({name:t,helperText:e,rules:n,onChange:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:o,fieldState:{error:s}})=>O.jsx(Df,{...o,onChange:l=>{o.onChange(l),r&&r(l)},fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||e,...i})})},YNe=({name:t,sx:e,rules:n,passwordSize:r,specialCharacter:i,upperCaseChar:a,numberChar:o,...s})=>{const{watch:l}=Xe.useFormContext(),c=l(t),[u,d]=A.useState(!1),{hasNumberChar:f,hasSpecialCharacter:p,hasUpperCaseChar:h,isLengthValid:m}=Ff(c,r,o,i,a);return O.jsx(ho,{...s,name:t,type:u?"text":"password",InputProps:{endAdornment:O.jsx(H.InputAdornment,{position:"end",children:O.jsx(H.IconButton,{onClick:()=>d(!u),edge:"end","aria-label":"Mostrar/Ocultar senha",children:O.jsx(Ct,{icon:u?"eva:eye-off-fill":"eva:eye-fill"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:g=>{const _=Ff(g,r,o,i,a);return!_.hasNumberChar||!_.hasSpecialCharacter||!_.hasUpperCaseChar||!_.isLengthValid?"Senha inválida":!0}}},sx:{...e,"& .MuiFormHelperText-root":{display:!p||!h||!m||!f?"none":void 0}}})},HNe=({name:t,rules:e,row:n,label:r,options:i,spacing:a,helperText:o,decorated:s,onChange:l,tabIndex:c,required:u,disabled:d,...f})=>{const{control:p}=Xe.useFormContext(),h=r?`${t}-${r}`:"";return O.jsx(Xe.Controller,{name:t,control:p,rules:e,render:({field:m,fieldState:{error:g}})=>O.jsxs(H.FormControl,{component:"fieldset",sx:{...s&&{paddingLeft:1.5}},children:[r&&O.jsx(H.FormLabel,{component:"legend",id:h,sx:{typography:"body2"},required:u,children:r}),O.jsx(H.RadioGroup,{...f,...m,onChange:(_,b)=>{m.onChange(_),l&&l(_,b)},"aria-labelledby":h,row:n,children:i.map(_=>O.jsx(H.FormControlLabel,{value:_.value,control:O.jsx(H.Radio,{inputProps:{tabIndex:c},disabled:d}),label:_.label,sx:({palette:b})=>({"&:not(:last-of-type)":{mb:a||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:a||2}},...s&&{border:`1px solid ${H.alpha(b.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(a||0)/2||1,...m.value===_.value&&{borderColor:"primary.main",backgroundColor:H.alpha(b.primary.main,.05)}}})},_.value))}),(!!g||o)&&O.jsx(H.FormHelperText,{error:!!g,sx:_=>({color:d?_.palette.grey[500]:void 0}),children:g?g==null?void 0:g.message:o})]})})},zNe=({name:t,rules:e,...n})=>{const{control:r}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:r,rules:e,render:({field:{onChange:i,onBlur:a,value:o},fieldState:{error:s}})=>O.jsx(s5,{onChange:i,onBlur:a,value:o,...n,error:!!s,helperText:s==null?void 0:s.message})})},WNe=({name:t,helperText:e,onChange:n,tabIndex:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,render:({field:o,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(H.FormControlLabel,{control:O.jsx(H.Switch,{...o,checked:o.value,onChange:(l,c)=>{o.onChange(l),n&&n(l,c)},inputProps:{tabIndex:r}}),...i}),(!!s||e)&&O.jsx(H.FormHelperText,{error:!!s,sx:l=>({mx:"14px",color:i.disabled?l.palette.grey[500]:void 0}),children:s?s==null?void 0:s.message:e})]})})},jNe=({name:t,rules:e,tabIndex:n,helperText:r,required:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:e,render:({field:{ref:s,...l},fieldState:{error:c}})=>{var u;return O.jsx(rl.TimePicker,{ampm:!1,format:"HH:mm",inputRef:s,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...a.localeText},...l,...a,value:l.value?new Date(l.value):null,slotProps:{textField:{...(u=a.slotProps)==null?void 0:u.textField,error:!!c,required:i,helperText:(c==null?void 0:c.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})};function Z5(t,e){const{watch:n,setValue:r}=Xe.useFormContext(),[i,a]=A.useState(e),o=n(t)||[];return{uploadFile:async f=>{if(!f){r(t,void 0),a(void 0);return}r(t,f),a(Object.assign(f,{preview:URL.createObjectURL(f)}))},uploadFiles:async f=>{r(t,[...o,...f.map(p=>Object.assign(p,{preview:URL.createObjectURL(p)}))])},handleDeleteFile:()=>{r(t,void 0),a(void 0)},handleRemoveAll:()=>{r(t,void 0)},handleRemove:f=>{const p=o.filter(h=>h!==f);r(t,p)},file:i,setFileValue:a}}const KNe=({name:t,rules:e,helperText:n,aspect:r,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:l,onCancel:c,...u})=>{const{control:d}=Xe.useFormContext(),{uploadFile:f,file:p,setFileValue:h}=Z5(t);return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:{value:m},fieldState:{error:g}})=>O.jsx(K5,{accept:{"image/*":[]},file:m?p:void 0,onFileCropped:_=>{f(_),s&&s(_)},onImageUploaded:l,onCancel:()=>{h(void 0),c&&c()},error:!!g,disableMultiple:!0,helperText:(!!g||n)&&O.jsx(H.FormHelperText,{error:!!g,sx:{px:2},children:g?g==null?void 0:g.message:n}),aspect:r,label:i,size:a,image:o,...u})})},QNe=({onFileCropped:t,onImageUploaded:e,onCancel:n,aspect:r,size:i,label:a,image:o="",uploading:s,file:l,tabIndex:c,...u})=>{const{id:d,crop:f,cropModalOpen:p,zoom:h,cancelChanges:m,handleRemove:g,onCropComplete:_,saveChanges:b,setCrop:S,setCropModalOpen:v,setZoom:E}=W5({image:o,onFileCropped:t,onImageUploaded:e,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(H.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[s&&O.jsx(wNe,{}),O.jsx(Y5,{...u,id:d,file:l,onDrop:T=>{if(T.length>0){v(!0),E(1),S({x:0,y:0});const y=new FileReader;y.addEventListener("load",()=>{var N;const C=((N=y.result)==null?void 0:N.toString())||"";e(C),t(void 0)}),y.readAsDataURL(T[0])}},image:o,tabIndex:c})]}),O.jsx(j5,{id:d,open:p,onClose:m,label:a,aspect:r,crop:f,zoom:h,onCropComplete:_,onCropChange:S,onZoomChange:E,imgSrc:o,onRemove:g,onSave:b,size:i})]})},XNe=({name:t,rules:e,helperText:n,aspect:r,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:l,onCancel:c,...u})=>{const{control:d}=Xe.useFormContext(),{uploadFile:f,file:p,setFileValue:h}=Z5(t);return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:{value:m},fieldState:{error:g}})=>O.jsx(QNe,{accept:{"image/*":[]},file:m?p:void 0,onFileCropped:_=>{f(_),s&&s(_)},onImageUploaded:l,onCancel:()=>{h(void 0),c&&c()},error:!!g,disableMultiple:!0,helperText:(!!g||n)&&O.jsx(H.FormHelperText,{error:!!g,sx:{px:2},children:g?g==null?void 0:g.message:n}),aspect:r,label:i,size:a,image:o,...u})})},ZNe=()=>{const[t,e]=A.useState(!1),[n,r]=A.useState(document.activeElement);return A.useEffect(()=>{const i=o=>r(o.target),a=()=>r(null);return window.addEventListener("focus",i,!0),window.addEventListener("blur",a,!0),e(!0),()=>{window.removeEventListener("focus",i),window.removeEventListener("blur",a)}},[]),{activeElement:n,listenersReady:t}};function JNe(){const[t,e]=A.useState(null);return{copiedText:t,copy:async r=>{if(!(navigator!=null&&navigator.clipboard))return!1;try{return await navigator.clipboard.writeText(r),e(r),!0}catch{return e(null),!1}}}}const ewe=({page:t,perPage:e,dir:n,search:r,searchValue:i,sort:a}={page:0,perPage:25})=>{const o=Mi.useGridApiRef(),[s,l]=A.useState({page:t,perPage:e,dir:n,search:r,searchValue:i,sort:a}),c=({pageSize:m=25,page:g=0})=>{l(_=>({..._,page:g,perPage:m}))},u=m=>l(g=>({...g,page:0,search:m})),d=m=>l(g=>({...g,searchValue:m})),f=()=>l(m=>({...m,page:0,search:m.searchValue})),p=(m,g)=>l(_=>({..._,sort:m,dir:g})),h=()=>{o.current.setPage(0),c({page:0})};return{...s,apiRef:o,page:s.page||0,perPage:s.perPage||25,handlePaginationModelChange:c,handleSearch:u,handleSort:p,handleSearchValue:d,applySearchValue:f,goToPageFirstPage:h}},twe=(t,e)=>Hve(t,e),nwe=t=>{const e=A.useRef();return twe(t,e.current)||(e.current=t),e.current},rwe=(t,e)=>{A.useEffect(t,e.map(nwe))},iwe=()=>{const t=A.useRef(!0);return t.current?(t.current=!1,!0):t.current};function awe(t=""){const[e,n]=A.useState(t);return{currentTab:e,onChangeTab:(r,i)=>{n(i)},setCurrentTab:n}}function owe({items:t,itemsPerPage:e}){const[n,r]=A.useState(1),i=Math.ceil(t.length/e),a=t.slice((n-1)*e,n*e);return{currentPage:n,totalPages:i,currentItems:a,goToPage:c=>{c>0&&c<=i&&r(c)},nextPage:()=>{n<i&&r(c=>c+1)},prevPage:()=>{n>1&&r(c=>c-1)}}}const swe=(t,e,n="mousedown")=>{lT(n,r=>{const i=t==null?void 0:t.current;!i||i.contains(r.target)||e(r)})},lwe=Object.freeze(Object.defineProperty({__proto__:null,downloadFile:(t,e,n)=>{const r=`data:application/octet-stream;base64,${n}`,i=document.createElement("a"),a=`${t.replace(e,"")}.${e}`;i.href=r,i.download=a,i.click()}},Symbol.toStringTag,{value:"Module"}));function cwe(t){return q_({},t)}var J5=1440,uwe=2520,cT=43200,dwe=86400;function fwe(t,e,n){var r,i;Ce(2,arguments);var a=Nr(),o=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:a.locale)!==null&&r!==void 0?r:sf;if(!o.formatDistance)throw new RangeError("locale must contain formatDistance property");var s=ms(t,e);if(isNaN(s))throw new RangeError("Invalid time value");var l=q_(cwe(n),{addSuffix:!!(n!=null&&n.addSuffix),comparison:s}),c,u;s>0?(c=Oe(e),u=Oe(t)):(c=Oe(t),u=Oe(e));var d=cw(u,c),f=(gs(u)-gs(c))/1e3,p=Math.round((d-f)/60),h;if(p<2)return n!=null&&n.includeSeconds?d<5?o.formatDistance("lessThanXSeconds",5,l):d<10?o.formatDistance("lessThanXSeconds",10,l):d<20?o.formatDistance("lessThanXSeconds",20,l):d<40?o.formatDistance("halfAMinute",0,l):d<60?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",1,l):p===0?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",p,l);if(p<45)return o.formatDistance("xMinutes",p,l);if(p<90)return o.formatDistance("aboutXHours",1,l);if(p<J5){var m=Math.round(p/60);return o.formatDistance("aboutXHours",m,l)}else{if(p<uwe)return o.formatDistance("xDays",1,l);if(p<cT){var g=Math.round(p/J5);return o.formatDistance("xDays",g,l)}else if(p<dwe)return h=Math.round(p/cT),o.formatDistance("aboutXMonths",h,l)}if(h=k_(u,c),h<12){var _=Math.round(p/cT);return o.formatDistance("xMonths",_,l)}else{var b=h%12,S=Math.floor(h/12);return b<3?o.formatDistance("aboutXYears",S,l):b<9?o.formatDistance("overXYears",S,l):o.formatDistance("almostXYears",S+1,l)}}function pwe(t,e){return Ce(1,arguments),fwe(t,Date.now(),e)}function hwe(t){Ce(1,arguments);var e=Oe(t),n=e.getTime();return n}function mwe(t,e){const n=e||"dd/MM/yyyy";return t?G_(new Date(t),n):null}function gwe(t,e){const n=e||"dd/MM/yyyy HH:mm:ss";return t?G_(new Date(t),n):null}function _we(t){return t?hwe(new Date(t)):null}function bwe(t){return t?pwe(new Date(t),{addSuffix:!0}):null}function vwe(t,e="dd/MM/yyyy hh:mm:ss"){if(!t)return null;const n=Iw(t,e,new Date);return F_(n)?n:null}const Ewe=Object.freeze(Object.defineProperty({__proto__:null,fDate:mwe,fDateTime:gwe,fTimestamp:_we,fToNow:bwe,stringToDate:vwe},Symbol.toStringTag,{value:"Module"}));function Swe(t){const e=t.match(/\/([^/]+)/);return e?e[0]:t}const ywe=Object.freeze(Object.defineProperty({__proto__:null,getRoot:Swe},Symbol.toStringTag,{value:"Module"}));function Twe(t,e,n="asc"){return t.slice().sort((r,i)=>{const a=r[e],o=i[e];return a<o?n==="asc"?-1:1:a>o?n==="asc"?1:-1:0})}function Cwe(t,e,n){const r=[...n],i=r.splice(t,1)[0];return r.splice(e,0,i),r}const Owe=Object.freeze(Object.defineProperty({__proto__:null,sort:Twe,updatePosition:Cwe},Symbol.toStringTag,{value:"Module"})),uT=(t="",e)=>{let n="",r=0;return[...e].forEach(i=>{n+=i==="#"?t[r++]||"_":i}),n},xwe=Object.freeze(Object.defineProperty({__proto__:null,applyMask:uT,cnpjMask:t=>uT(t.replace(/\D/g,""),"##.###.###/####-##"),cpfMask:t=>uT(t.replace(/\D/g,""),"###.###.###-##")},Symbol.toStringTag,{value:"Module"}));function Rwe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const Awe=t=>function(n){return O.jsx(A.Suspense,{fallback:O.jsx(mf,{}),children:O.jsx(t,{...n})})},Nwe=Object.freeze(Object.defineProperty({__proto__:null,default:k8},Symbol.toStringTag,{value:"Module"}));se.Address=INe,se.Autocomplete=mg,se.AutocompleteField=Q5,se.Checkbox=DNe,se.Codes=PNe,se.ColorPickerField=LNe,se.ColorPickerInput=iw,se.Common=Zhe,se.Confirm=Jhe,se.CustomAvatar=Kw,se.CustomAvatarGroup=Qw,se.DataGrid=sme,se.DatePicker=FNe,se.DateRangePicker=BNe,se.DateTimePicker=UNe,se.Delayed=lme,se.DialogAnimate=P8,se.Drawer=vme,se.Editor=dP,se.EditorField=GNe,se.EmptyView=Zw,se.FabButtonAnimate=z1,se.Field=ho,se.FixedProgressBar=mf,se.Form=$Ne,se.IconButtonAnimate=W1,se.Iconify=Ct,se.Image=yf,se.ImageCrop=AP,se.Incrementer=WS,se.IncrementerField=qNe,se.Label=qP,se.MaskedInput=XS,se.MaskedInputField=X5,se.MaterialDesignContent=Sx,se.MenuPopover=xSe,se.Modal=ZP,se.ModalActions=ISe,se.MotionContainer=w$,se.MotionLazyContainer=XO,se.MotionViewport=N$,se.MultiCheckbox=MNe,se.NavSectionHorizontal=rAe,se.NavSectionMini=YRe,se.NavSectionVertical=QRe,se.NavSectionVerticalWithButtons=cAe,se.NumberInput=Df,se.NumberInputField=VNe,se.PasswordField=YNe,se.PasswordRules=FSe,se.Portal=JP,se.RadioGroupField=HNe,se.SQLEditor=s5,se.SQLEditorEditorField=zNe,se.Scrollbar=uI,se.SearchInput=NRe,se.SnackbarContent=Wm,se.SnackbarProvider=Cx,se.Steps=DRe,se.Switch=WNe,se.TRANSITION=_T,se.TabPanel=MRe,se.TextAnimate=L8,se.ThemeProvider=jw,se.TimePicker=jNe,se.Transition=od,se.Upload=V5,se.UploadAvatar=Y5,se.UploadAvatarWithCropField=XNe,se.UploadBox=CNe,se.UploadWithCrop=K5,se.UploadWithCropField=KNe,se.cssStyles=FRe,se.file=lwe,se.formatNumber=UEe,se.formatTime=Ewe,se.loadable=Awe,se.mask=xwe,se.number=MEe,se.routes=ywe,se.sort=Owe,se.useActiveElement=ZNe,se.useActiveLink=oh,se.useCopyToClipboard=JNe,se.useDatagrid=ewe,se.useDeepCompareEffect=rwe,se.useEventListener=lT,se.useIsMounting=iwe,se.useOnClickOutside=swe,se.usePagination=owe,se.useResponsive=QO,se.useSnackbar=lq,se.useTabs=awe,se.useToggle=z5,se.uuidv4=Rwe,se.validators=kSe,se.varBgColor=EU,se.varBgKenburns=SU,se.varBgPan=yU,se.varBounce=_U,se.varContainer=uu,se.varFade=il,se.varFlip=hU,se.varHover=vU,se.varPath=dU,se.varRotate=bU,se.varScale=gU,se.varSlide=mU,se.varTranEnter=Ze,se.varTranExit=rt,se.varTranHover=fU,se.varZoom=pU,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
3
  "private": false,
4
- "version": "1.1.57",
4
+ "version": "1.1.59",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",