@zydon/common 1.4.14 → 1.4.15

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
1
  import { MaskedInputProps } from './props';
2
- declare const MaskedInput: ({ name, helperText, rules, ...other }: MaskedInputProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const MaskedInput: ({ name, helperText, rules, onChange: onChangeValue, ...other }: MaskedInputProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MaskedInput;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/MaskedInput/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,QAAA,MAAM,WAAW,0CAKd,gBAAgB,4CAwBlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/MaskedInput/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,QAAA,MAAM,WAAW,mEAMd,gBAAgB,4CA2BlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -7,8 +7,9 @@ type IProps = {
7
7
  mask: string;
8
8
  }[];
9
9
  rules?: RegisterOptions;
10
+ onChange?(value: string): void;
10
11
  };
11
- type Props = IProps & TextFieldProps;
12
+ type Props = IProps & Omit<TextFieldProps, 'onChange'>;
12
13
  export type MaskedInputProps = BaseField<Props>;
13
14
  export {};
14
15
  //# sourceMappingURL=props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/MaskedInput/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,KAAK,KAAK,GAAG,MAAM,GAAG,cAAc,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/MaskedInput/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,KAAK,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { p as rt, f as C, n as B, r as mn, c as gn, i as tt, d as Ts, a as yn, v as Vs, w as ie, b as yt, e as K, g as R, t as Pt, h as et, j as Ss, k as bs, l as k, m as nt, o as vn, q as xt, s as vt, u as As, x as Ds, y as Cs, z as at, A as Ms, B as Pn, C as Kt, D as xn, E as Tn, F as w, G as zt, H as dt, P as ws, I as Ls, L as Rs, S as Bs, J as Vn, K as Sn, M as bn, N as Et, O as jt, Q as ye, R as Ht, T as Fs, U as An, V as Dn, W as Es, X as js, Y as Cn, Z as Mn, _ as ks, $ as Is, a0 as Os, a1 as Us, a2 as Ns, a3 as Gs, a4 as $s, a5 as Ks, a6 as zs, a7 as Hs } from "./index-5f14e3b0.js";
1
+ import { p as rt, f as C, n as B, r as mn, c as gn, i as tt, d as Ts, a as yn, v as Vs, w as ie, b as yt, e as K, g as R, t as Pt, h as et, j as Ss, k as bs, l as k, m as nt, o as vn, q as xt, s as vt, u as As, x as Ds, y as Cs, z as at, A as Ms, B as Pn, C as Kt, D as xn, E as Tn, F as w, G as zt, H as dt, P as ws, I as Ls, L as Rs, S as Bs, J as Vn, K as Sn, M as bn, N as Et, O as jt, Q as ye, R as Ht, T as Fs, U as An, V as Dn, W as Es, X as js, Y as Cn, Z as Mn, _ as ks, $ as Is, a0 as Os, a1 as Us, a2 as Ns, a3 as Gs, a4 as $s, a5 as Ks, a6 as zs, a7 as Hs } from "./index-d7f826fe.js";
2
2
  import wn, { useContext as _t, useId as _s, useEffect as Ws } from "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -7751,7 +7751,7 @@ const Nlu = ({
7751
7751
  ...a,
7752
7752
  children: n
7753
7753
  }
7754
- ), Yr1 = () => import("./features-04ef70f3.js").then((e) => e.default), iAn = ({ children: e }) => /* @__PURE__ */ d.jsx(fr1, { strict: !0, features: Yr1, children: /* @__PURE__ */ d.jsxs(Rn.div, { style: { height: "100%" }, children: [
7754
+ ), Yr1 = () => import("./features-cd15ad74.js").then((e) => e.default), iAn = ({ children: e }) => /* @__PURE__ */ d.jsx(fr1, { strict: !0, features: Yr1, children: /* @__PURE__ */ d.jsxs(Rn.div, { style: { height: "100%" }, children: [
7755
7755
  " ",
7756
7756
  e,
7757
7757
  " "
@@ -279169,28 +279169,31 @@ const rlu = Oe(PXr)(() => ({
279169
279169
  name: e,
279170
279170
  helperText: t,
279171
279171
  rules: n,
279172
- ...a
279172
+ onChange: a,
279173
+ ...r
279173
279174
  }) => {
279174
- const { control: r } = At();
279175
+ const { control: u } = At();
279175
279176
  return /* @__PURE__ */ d.jsx(
279176
279177
  Yt,
279177
279178
  {
279178
279179
  name: e,
279179
- control: r,
279180
+ control: u,
279180
279181
  rules: n,
279181
279182
  render: ({
279182
- field: { name: u, onChange: c, value: l, ref: f },
279183
- fieldState: { error: s }
279183
+ field: { name: c, onChange: l, value: f, ref: s },
279184
+ fieldState: { error: g }
279184
279185
  }) => /* @__PURE__ */ d.jsx(
279185
279186
  CTn,
279186
279187
  {
279187
- ref: f,
279188
- ...a,
279189
- name: u,
279190
- value: l,
279191
- error: !!s,
279192
- helperText: (s == null ? void 0 : s.message) || t,
279193
- onChange: ({ target: { value: g } }) => c(g)
279188
+ ref: s,
279189
+ ...r,
279190
+ name: c,
279191
+ value: f,
279192
+ error: !!g,
279193
+ helperText: (g == null ? void 0 : g.message) || t,
279194
+ onChange: ({ target: { value: _ } }) => {
279195
+ a && a(_), l(_);
279196
+ }
279194
279197
  }
279195
279198
  )
279196
279199
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ad as u, b4 as p, ae as m, af as d, b6 as C, b5 as v, ag as S, ah as T, bW as g, b_ as k, bZ as A, bY as P, b7 as I, b9 as h, ba as F, ai as y, aj as B, ak as x, al as D, am as M, an as f, ao as w, bb as E, bc as L, bd as R, ap as N, br as U, aq as G, ar as W, as as H, at as O, b1 as q, bt as z, be as V, au as j, bf as K, a$ as Z, av as J, aw as Q, bu as X, ax as Y, a9 as _, ay as $, az as aa, bg as sa, aA as ea, ab as oa, aB as ta, aC as ra, bh as ia, bP as ba, aD as na, aE as la, aF as ca, bw as ua, bx as pa, bv as ma, b8 as da, bi as Ca, aa as va, aG as Sa, bj as Ta, bk as ga, aH as ka, aZ as Aa, aI as Pa, bl as Ia, aJ as ha, aK as Fa, aL as ya, aM as Ba, b0 as xa, bQ as Da, bR as Ma, aN as fa, aO as wa, aP as Ea, aQ as La, a_ as Ra, bq as Na, bm as Ua, by as Ga, aR as Wa, c2 as Ha, c3 as Oa, c0 as qa, c5 as za, c4 as Va, c1 as ja, bs as Ka, aS as Za, aT as Ja, bn as Qa, b2 as Xa, bS as Ya, aU as _a, aV as $a, bo as as, aW as ss, a8 as es, aX as os, bp as ts, b3 as rs, aY as is, bT as bs, cy as ns, cz as ls, cs, c6 as us, bU as ps, cp as ms, cq as ds, cr as Cs, c7 as vs, cB as Ss, cx as Ts, cw as gs, ct as ks, cu as As, c8 as Ps, cl as Is, bX as hs, c9 as Fs, ca as ys, cb as Bs, cm as xs, cc as Ds, cd as Ms, cn as fs, ac as ws, co as Es, cj as Ls, ci as Rs, ch as Ns, ck as Us, ce as Gs, bV as Ws, b$ as Hs, cf as Os, cg as qs, cA as zs, cv as Vs, bM as js, bN as Ks, bO as Zs, bF as Js, bI as Qs, bA as Xs, bC as Ys, bH as _s, bz as $s, bG as ae, bE as se, bD as ee, bK as oe, bL as te, bJ as re, bB as ie } from "./index-5f14e3b0.js";
1
+ import { ad as u, b4 as p, ae as m, af as d, b6 as C, b5 as v, ag as S, ah as T, bW as g, b_ as k, bZ as A, bY as P, b7 as I, b9 as h, ba as F, ai as y, aj as B, ak as x, al as D, am as M, an as f, ao as w, bb as E, bc as L, bd as R, ap as N, br as U, aq as G, ar as W, as as H, at as O, b1 as q, bt as z, be as V, au as j, bf as K, a$ as Z, av as J, aw as Q, bu as X, ax as Y, a9 as _, ay as $, az as aa, bg as sa, aA as ea, ab as oa, aB as ta, aC as ra, bh as ia, bP as ba, aD as na, aE as la, aF as ca, bw as ua, bx as pa, bv as ma, b8 as da, bi as Ca, aa as va, aG as Sa, bj as Ta, bk as ga, aH as ka, aZ as Aa, aI as Pa, bl as Ia, aJ as ha, aK as Fa, aL as ya, aM as Ba, b0 as xa, bQ as Da, bR as Ma, aN as fa, aO as wa, aP as Ea, aQ as La, a_ as Ra, bq as Na, bm as Ua, by as Ga, aR as Wa, c2 as Ha, c3 as Oa, c0 as qa, c5 as za, c4 as Va, c1 as ja, bs as Ka, aS as Za, aT as Ja, bn as Qa, b2 as Xa, bS as Ya, aU as _a, aV as $a, bo as as, aW as ss, a8 as es, aX as os, bp as ts, b3 as rs, aY as is, bT as bs, cy as ns, cz as ls, cs, c6 as us, bU as ps, cp as ms, cq as ds, cr as Cs, c7 as vs, cB as Ss, cx as Ts, cw as gs, ct as ks, cu as As, c8 as Ps, cl as Is, bX as hs, c9 as Fs, ca as ys, cb as Bs, cm as xs, cc as Ds, cd as Ms, cn as fs, ac as ws, co as Es, cj as Ls, ci as Rs, ch as Ns, ck as Us, ce as Gs, bV as Ws, b$ as Hs, cf as Os, cg as qs, cA as zs, cv as Vs, bM as js, bN as Ks, bO as Zs, bF as Js, bI as Qs, bA as Xs, bC as Ys, bH as _s, bz as $s, bG as ae, bE as se, bD as ee, bK as oe, bL as te, bJ as re, bB as ie } from "./index-d7f826fe.js";
2
2
  import "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -35406,4 +35406,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
35406
35406
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n22(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r22(e){if(Array.isArray(e))return XBn(e)}function TUn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function ZUn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TUn(Object(n),!0).forEach(function(a){UUn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TUn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function UUn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Omt(e,t){return o22(e)||i22(e,t)||GUn(e,t)||a22()}function a22(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35407
35407
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GUn(e,t){if(e){if(typeof e=="string")return XBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XBn(e,t)}}function XBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function i22(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function o22(e){if(Array.isArray(e))return e}var u22="file-invalid-type",c22="file-too-large",l22="file-too-small",f22="too-many-files",s22=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:u22,message:"File type must be ".concat(n)}},YUn=function(t){return{code:c22,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},KUn=function(t){return{code:l22,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},d22={code:f22,message:"Too many files"};function XUn(e,t){var n=e.type==="application/x-moz-file"||e22(e,t);return[n,n?null:s22(t)]}function QUn(e,t,n){if(CT(e.size))if(CT(t)&&CT(n)){if(e.size>n)return[!1,YUn(n)];if(e.size<t)return[!1,KUn(t)]}else{if(CT(t)&&e.size<t)return[!1,KUn(t)];if(CT(n)&&e.size>n)return[!1,YUn(n)]}return[!0,null]}function CT(e){return e!=null}function g22(e){var t=e.files,n=e.accept,a=e.minSize,r=e.maxSize,u=e.multiple,c=e.maxFiles,l=e.validator;return!u&&t.length>1||u&&c>=1&&t.length>c?!1:t.every(function(f){var s=XUn(f,n),d=Omt(s,1),_=d[0],m=QUn(f,a,r),v=Omt(m,1),C=v[0],h=l?l(f):null;return _&&C&&!h})}function xCt(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function zCt(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function JUn(e){e.preventDefault()}function _22(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function m22(e){return e.indexOf("Edge/")!==-1}function v22(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return _22(e)||m22(e)}function Sc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(a){for(var r=arguments.length,u=new Array(r>1?r-1:0),c=1;c<r;c++)u[c-1]=arguments[c];return t.some(function(l){return!xCt(a)&&l&&l.apply(void 0,[a].concat(u)),xCt(a)})}}function h22(){return"showOpenFilePicker"in window}function C22(e){if(CT(e)){var t=Object.entries(e).filter(function(n){var a=Omt(n,2),r=a[0],u=a[1],c=!0;return qUn(r)||(console.warn('Skipped "'.concat(r,'" 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.')),c=!1),(!Array.isArray(u)||!u.every(eGn))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,a){var r=Omt(a,2),u=r[0],c=r[1];return ZUn(ZUn({},n),{},UUn({},u,c))},{});return[{description:"Files",accept:t}]}return e}function b22(e){if(CT(e))return Object.entries(e).reduce(function(t,n){var a=Omt(n,2),r=a[0],u=a[1];return[].concat(NUn(t),[r],NUn(u))},[]).filter(function(t){return qUn(t)||eGn(t)}).join(",")}function y22(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function p22(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function qUn(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function eGn(e){return/^.*\.[\w]+$/.test(e)}var O22=["children"],j22=["open"],w22=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],M22=["refKey","onChange","onClick"];function L22(e){return k22(e)||E22(e)||tGn(e)||P22()}function P22(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
35408
35408
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E22(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function k22(e){if(Array.isArray(e))return JBn(e)}function QBn(e,t){return B22(e)||D22(e,t)||tGn(e,t)||S22()}function S22(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35409
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tGn(e,t){if(e){if(typeof e=="string")return JBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JBn(e,t)}}function JBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function D22(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function B22(e){if(Array.isArray(e))return e}function nGn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nGn(Object(n),!0).forEach(function(a){qBn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nGn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function qBn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HCt(e,t){if(e==null)return{};var n=W22(e,t),a,r;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)a=u[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function W22(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,u;for(u=0;u<a.length;u++)r=a[u],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var eWn=o.forwardRef(function(e,t){var n=e.children,a=HCt(e,O22),r=ACt(a),u=r.open,c=HCt(r,j22);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(Pt(Pt({},c),{},{open:u})))});eWn.displayName="Dropzone";var rGn={disabled:!1,getFilesFromEvent:Zo2,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};eWn.defaultProps=rGn,eWn.propTypes={children:P.func,accept:P.objectOf(P.arrayOf(P.string)),multiple:P.bool,preventDropOnDocument:P.bool,noClick:P.bool,noKeyboard:P.bool,noDrag:P.bool,noDragEventsBubbling:P.bool,minSize:P.number,maxSize:P.number,maxFiles:P.number,disabled:P.bool,getFilesFromEvent:P.func,onFileDialogCancel:P.func,onFileDialogOpen:P.func,useFsAccessApi:P.bool,autoFocus:P.bool,onDragEnter:P.func,onDragLeave:P.func,onDragOver:P.func,onDrop:P.func,onDropAccepted:P.func,onDropRejected:P.func,onError:P.func,validator:P.func};var tWn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function ACt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Pt(Pt({},rGn),e),n=t.accept,a=t.disabled,r=t.getFilesFromEvent,u=t.maxSize,c=t.minSize,l=t.multiple,f=t.maxFiles,s=t.onDragEnter,d=t.onDragLeave,_=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,C=t.onDropRejected,h=t.onFileDialogCancel,b=t.onFileDialogOpen,p=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,E=t.noClick,M=t.noKeyboard,j=t.noDrag,k=t.noDragEventsBubbling,D=t.onError,S=t.validator,B=o.useMemo(function(){return b22(n)},[n]),H=o.useMemo(function(){return C22(n)},[n]),F=o.useMemo(function(){return typeof b=="function"?b:aGn},[b]),W=o.useMemo(function(){return typeof h=="function"?h:aGn},[h]),z=o.useRef(null),T=o.useRef(null),A=o.useReducer(I22,tWn),Z=QBn(A,2),X=Z[0],J=Z[1],V=X.isFocused,N=X.isFileDialogActive,Y=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&h22()),ie=function(){!Y.current&&N&&setTimeout(function(){if(T.current){var he=T.current.files;he.length||(J({type:"closeDialog"}),W())}},300)};o.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[T,N,W,Y]);var ee=o.useRef([]),fe=function(he){z.current&&z.current.contains(he.target)||(he.preventDefault(),ee.current=[])};o.useEffect(function(){return w&&(document.addEventListener("dragover",JUn,!1),document.addEventListener("drop",fe,!1)),function(){w&&(document.removeEventListener("dragover",JUn),document.removeEventListener("drop",fe))}},[z,w]),o.useEffect(function(){return!a&&y&&z.current&&z.current.focus(),function(){}},[z,y,a]);var ce=o.useCallback(function(q){D?D(q):console.error(q)},[D]),Ce=o.useCallback(function(q){q.preventDefault(),q.persist(),Pe(q),ee.current=[].concat(L22(ee.current),[q.target]),zCt(q)&&Promise.resolve(r(q)).then(function(he){if(!(xCt(q)&&!k)){var at=he.length,He=at>0&&g22({files:he,accept:B,minSize:c,maxSize:u,multiple:l,maxFiles:f,validator:S}),Et=at>0&&!He;J({isDragAccept:He,isDragReject:Et,isDragActive:!0,type:"setDraggedFiles"}),s&&s(q)}}).catch(function(he){return ce(he)})},[r,s,ce,k,B,c,u,l,f,S]),le=o.useCallback(function(q){q.preventDefault(),q.persist(),Pe(q);var he=zCt(q);if(he&&q.dataTransfer)try{q.dataTransfer.dropEffect="copy"}catch{}return he&&_&&_(q),!1},[_,k]),te=o.useCallback(function(q){q.preventDefault(),q.persist(),Pe(q);var he=ee.current.filter(function(He){return z.current&&z.current.contains(He)}),at=he.indexOf(q.target);at!==-1&&he.splice(at,1),ee.current=he,!(he.length>0)&&(J({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),zCt(q)&&d&&d(q))},[z,d,k]),ge=o.useCallback(function(q,he){var at=[],He=[];q.forEach(function(Et){var we=XUn(Et,B),qt=QBn(we,2),_n=qt[0],Dc=qt[1],XO=QUn(Et,c,u),QO=QBn(XO,2),bT=QO[0],yT=QO[1],pT=S?S(Et):null;if(_n&&bT&&!pT)at.push(Et);else{var OT=[Dc,yT];pT&&(OT=OT.concat(pT)),He.push({file:Et,errors:OT.filter(function(jT){return jT})})}}),(!l&&at.length>1||l&&f>=1&&at.length>f)&&(at.forEach(function(Et){He.push({file:Et,errors:[d22]})}),at.splice(0)),J({acceptedFiles:at,fileRejections:He,type:"setFiles"}),m&&m(at,He,he),He.length>0&&C&&C(He,he),at.length>0&&v&&v(at,he)},[J,l,B,c,u,f,m,v,C,S]),We=o.useCallback(function(q){q.preventDefault(),q.persist(),Pe(q),ee.current=[],zCt(q)&&Promise.resolve(r(q)).then(function(he){xCt(q)&&!k||ge(he,q)}).catch(function(he){return ce(he)}),J({type:"reset"})},[r,ge,ce,k]),U=o.useCallback(function(){if(Y.current){J({type:"openDialog"}),F();var q={multiple:l,types:H};window.showOpenFilePicker(q).then(function(he){return r(he)}).then(function(he){ge(he,null),J({type:"closeDialog"})}).catch(function(he){y22(he)?(W(he),J({type:"closeDialog"})):p22(he)?(Y.current=!1,T.current?(T.current.value=null,T.current.click()):ce(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."))):ce(he)});return}T.current&&(J({type:"openDialog"}),F(),T.current.value=null,T.current.click())},[J,F,W,p,ge,ce,H,l]),qe=o.useCallback(function(q){!z.current||!z.current.isEqualNode(q.target)||(q.key===" "||q.key==="Enter"||q.keyCode===32||q.keyCode===13)&&(q.preventDefault(),U())},[z,U]),se=o.useCallback(function(){J({type:"focus"})},[]),ne=o.useCallback(function(){J({type:"blur"})},[]),_e=o.useCallback(function(){E||(v22()?setTimeout(U,0):U())},[E,U]),je=function(he){return a?null:he},K=function(he){return M?null:je(he)},Oe=function(he){return j?null:je(he)},Pe=function(he){k&&he.stopPropagation()},xe=o.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=q.refKey,at=he===void 0?"ref":he,He=q.role,Et=q.onKeyDown,we=q.onFocus,qt=q.onBlur,_n=q.onClick,Dc=q.onDragEnter,XO=q.onDragOver,QO=q.onDragLeave,bT=q.onDrop,yT=HCt(q,w22);return Pt(Pt(qBn({onKeyDown:K(Sc(Et,qe)),onFocus:K(Sc(we,se)),onBlur:K(Sc(qt,ne)),onClick:je(Sc(_n,_e)),onDragEnter:Oe(Sc(Dc,Ce)),onDragOver:Oe(Sc(XO,le)),onDragLeave:Oe(Sc(QO,te)),onDrop:Oe(Sc(bT,We)),role:typeof He=="string"&&He!==""?He:"presentation"},at,z),!a&&!M?{tabIndex:0}:{}),yT)}},[z,qe,se,ne,_e,Ce,le,te,We,M,j,a]),ze=o.useCallback(function(q){q.stopPropagation()},[]),Zt=o.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=q.refKey,at=he===void 0?"ref":he,He=q.onChange,Et=q.onClick,we=HCt(q,M22),qt=qBn({accept:B,multiple:l,type:"file",style:{display:"none"},onChange:je(Sc(He,We)),onClick:je(Sc(Et,ze)),tabIndex:-1},at,T);return Pt(Pt({},qt),we)}},[T,n,l,We,a]);return Pt(Pt({},X),{},{isFocused:V&&!a,getRootProps:xe,getInputProps:Zt,rootRef:z,inputRef:T,open:je(U)})}function I22(e,t){switch(t.type){case"focus":return Pt(Pt({},e),{},{isFocused:!0});case"blur":return Pt(Pt({},e),{},{isFocused:!1});case"openDialog":return Pt(Pt({},tWn),{},{isFileDialogActive:!0});case"closeDialog":return Pt(Pt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Pt(Pt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Pt(Pt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Pt({},tWn);default:return e}}function aGn(){}const iGn=({fileRejections:e})=>e.length?g.jsx(O.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>Q(t.palette.error.main,.08),borderColor:t=>Q(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=YBn(t);return g.jsxs(O.Box,{sx:{my:1},children:[g.jsxs(O.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?$Bn(r):""]}),n.map(u=>g.jsxs(O.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,$22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return g.jsx(O.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:g.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},x22=Bt("div")(({theme:e})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`1px dashed ${Q(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),z22=({header:e,description:t,sx:n,...a})=>g.jsxs(O.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...a,children:[g.jsx(MIn,{sx:{width:220}}),g.jsxs("div",{children:[g.jsx(O.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),g.jsx(O.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||g.jsxs(g.Fragment,{children:["Solte os arquivos aqui ou clique",g.jsx(O.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),oGn=({id:e,disabled:t,multiple:n=!1,error:a,helperText:r,file:u,onDelete:c,files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:_,sx:m,dropZoneProps:v,placeholderProps:C,placeholderAlt:h,image:b,tabIndex:p,...y})=>{const{getRootProps:w,getInputProps:E,isDragActive:M,isDragReject:j,fileRejections:k}=ACt({multiple:n,disabled:t,...y}),D=!!u&&!n||b,S=l&&n&&l.length>0,B=j||!!a;return g.jsxs(O.Box,{sx:{width:1,position:"relative",...m},children:[g.jsxs(x22,{...w(),sx:{...M&&{opacity:.72},...B&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...v},children:[g.jsx("input",{...E(),id:e,tabIndex:p}),h?g.jsx(O.Stack,{sx:{...D&&{opacity:0}},children:h}):g.jsx(z22,{sx:{...D&&{opacity:0}},header:C==null?void 0:C.title,description:C==null?void 0:C.description}),D&&g.jsx($22,{file:u||b||""})]}),r&&g.jsx(O.FormHelperText,{error:!!a,sx:H=>({mx:"14px",color:t?H.palette.grey[500]:void 0}),children:r}),g.jsx(iGn,{fileRejections:k}),D&&c&&g.jsx(O.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:H=>Q(H.palette.common.white,.8),bgcolor:H=>Q(H.palette.grey[900],.72),"&:hover":{bgcolor:H=>Q(H.palette.grey[900],.48)}},children:g.jsx(be,{icon:"CLOSE_MARK_BUTTON",width:18})}),S&&g.jsx(g.Fragment,{children:g.jsx(O.Box,{sx:{my:3},children:g.jsx(Vo2,{files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:_})})})]})},H22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return g.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},A22=Bt("div")(({theme:e})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${Q(e.palette.grey[500],.32)}`})),R22=Bt("div")(({theme:e})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:e.palette.text.disabled,backgroundColor:e.palette.background.neutral,transition:e.transitions.create("opacity",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.shorter})})),uGn=({error:e,file:t,image:n,disabled:a,helperText:r,sx:u,tabIndex:c,...l})=>{const{getRootProps:f,getInputProps:s,isDragActive:d,isDragReject:_,fileRejections:m}=ACt({multiple:!1,disabled:a,...l}),v=!!t||n,C=_||!!e;return g.jsxs(g.Fragment,{children:[g.jsxs(A22,{...f(),sx:{...d&&{opacity:.72},...C&&{borderColor:"error.light",...v&&{bgcolor:"error.lighter"}},...a&&{opacity:.48,pointerEvents:"none"},...v&&{"&:hover":{"& .placeholder":{opacity:1}}},...u},children:[g.jsx("input",{...s(),tabIndex:c}),v&&g.jsx(H22,{file:t||n||""}),g.jsxs(R22,{className:"placeholder",sx:{"&:hover":{opacity:.72},...v&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>Q(h.palette.grey[900],.64)},...C&&{color:"error.main",bgcolor:"error.lighter"}},children:[g.jsx(be,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),g.jsx(O.Typography,{variant:"caption",children:t?"Atualizar foto":"Carregar foto"})]})]}),r&&r,g.jsx(iGn,{fileRejections:m})]})},V22=Bt("div")(({theme:e})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:e.spacing(.5),color:e.palette.text.disabled,borderRadius:e.shape.borderRadius,border:`dashed 1px ${e.palette.divider}`,backgroundColor:Q(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),F22=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:l,isDragActive:f,isDragReject:s}=ACt({disabled:n,...u}),d=s||t;return g.jsxs(V22,{...c(),sx:{...f&&{opacity:.72},...d&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...a},children:[g.jsx("input",{...l(),tabIndex:r}),e||g.jsx(be,{icon:"CLOUD_UPLOAD",width:28})]})},cGn=({onFileCropped:e,onImageUploaded:t,onCancel:n})=>{const a=o.useId(),[r,u]=o.useState(),[c,l,f]=kht(),[s,d]=o.useState();return{id:a,setCropModalOpen:f,handleRemove:()=>{e(void 0),t(void 0),f(!1)},toggleCropModalOpen:l,cropModalOpen:c,cancelChanges:()=>{n&&n(),f(!1)},saveChanges:()=>{r!==void 0&&r.getCroppedCanvas().toBlob(b=>{if(!b)return;const p=new File([b],"imagem");e(p),l()},"image/png",1)},previewImage:()=>{r!==void 0&&d(r.getCroppedCanvas().toDataURL())},setCropper:u,preview:s,closePreviewImage:()=>d(void 0)}},lGn=({id:e,open:t,onClose:n,label:a,onSave:r,onRemove:u,onPreview:c,imageSrc:l,aspectRatio:f,onInitialized:s})=>{const[d,_]=o.useState(.5);return g.jsx(kUn,{open:t,onClose:n,dialogTitle:a,actions:g.jsxs(g.Fragment,{children:[g.jsx(O.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),g.jsx(O.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),fullWidth:!0,maxWidth:"sm",keepMounted:!0,children:g.jsxs(O.Stack,{gap:2,children:[g.jsx(aUn,{imageSrc:l,aspectRatio:f,onInitialized:s,zoom:d,onZoomChange:_}),g.jsxs(O.Stack,{gap:1.5,children:[g.jsxs(O.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",children:[g.jsx(O.Typography,{variant:"body1",children:"Zoom"}),g.jsx(O.Slider,{value:d,onChange:(m,v)=>_(Array.isArray(v)?v[0]:v),min:.1,max:2,size:"medium",step:.0125})]}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(O.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(be,{icon:"DELETE_MARK_BUTTON_02"}),onClick:u,children:"Remover"}),g.jsx(O.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(be,{icon:"PLAY_SIMPLE"}),onClick:c,children:"Pré-visualizar"}),g.jsx(O.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(be,{icon:"SEARCH_IMAGE"}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})})},N22=O.styled(O.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),T22=O.styled(O.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:O.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),Z22=O.styled(O.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),fGn=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:l,tabIndex:f,...s})=>{const{id:d,setCropModalOpen:_,handleRemove:m,toggleCropModalOpen:v,cropModalOpen:C,cancelChanges:h,saveChanges:b,previewImage:p,setCropper:y,preview:w,closePreviewImage:E}=cGn({onFileCropped:e,onImageUploaded:t,onCancel:n});return g.jsxs(g.Fragment,{children:[g.jsxs(N22,{children:[c&&g.jsx(gCt,{}),g.jsx(oGn,{...s,id:d,file:l,onDrop:M=>{if(M.length>0){_(!0);const j=new FileReader;j.addEventListener("load",()=>{var D;const k=((D=j.result)==null?void 0:D.toString())||"";t(k),e(void 0)}),j.readAsDataURL(M[0])}},image:u,tabIndex:f}),(l||u)&&g.jsxs(T22,{className:"actions",children:[g.jsx(O.Button,{color:"inherit",startIcon:g.jsx(be,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:m,children:"Remover"}),g.jsx(O.Button,{color:"inherit",startIcon:g.jsx(be,{icon:"SEARCH_IMAGE",color:"primary.maon"}),onClick:v,children:"Editar"})]})]}),g.jsx(lGn,{id:d,open:C,onClose:h,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:b,onPreview:p,onInitialized:y}),g.jsx(O.Dialog,{open:!!w,onClose:E,scroll:"body",PaperProps:{sx:{p:2}},children:w&&g.jsx("img",{src:w,alt:"Preview"})})]})},U22=O.styled(O.Stack)(({theme:e})=>({backgroundColor:"#fff",border:`1px solid ${e.palette.grey[300]}`})),sGn=({children:e,...t})=>g.jsx(U22,{borderRadius:1,gap:3,padding:3,...t,children:e}),G22=O.styled(O.Box)(()=>({marginLeft:"4px",fontWeight:"fontWeightBold"})),Y22=O.styled(O.Button)(()=>({fontWeight:"fontWeightSemiBold"})),K22=O.styled(be)(({theme:e})=>({color:e.palette.primary.main})),X22=({selectedTitle:e,onSelect:t,options:n})=>{const a=zSn();return g.jsxs(g.Fragment,{children:[g.jsx(Y22,{disableRipple:!0,color:"inherit",onClick:a.onOpen,endIcon:g.jsx(K22,{icon:a.open?"CHEVRON_UP":"ARROW_DOWN_SIMPLE"}),children:g.jsx(G22,{component:"span",children:e.label})}),g.jsx(EUn,{open:a.open,onClose:a.onClose,children:n.map(r=>g.jsx(O.MenuItem,{selected:r.value===e.value,onClick:()=>{a.onClose(),t(r.value)},children:r.label},r.value))})]})},Q22=O.styled(O.Stack)({display:"grid",gridTemplateColumns:"auto auto"}),J22=O.styled(O.Typography)(({theme:e})=>({color:e.palette.grey[600]})),q22=O.styled(O.Typography)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]})),eu2=({data:e,...t})=>e.length===0?null:g.jsx(Q22,{gap:1,...t,children:e.map(n=>[g.jsx(J22,{variant:"body2",children:n.label},`label:${n.id}`),g.jsx(q22,{variant:"body2",children:n.value},`value:${n.id}`)])}),tu2=O.styled(O.Stack)(({theme:e})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${e.palette.grey[300]}`})),nu2=O.styled(O.Stack)(({theme:e})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${e.palette.grey[300]}`})),ru2=O.styled(O.Stack)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),au2=O.styled(O.Stack)(({theme:e})=>({height:"100%",width:"50%",flex:1,[e.breakpoints.down(1680)]:{width:"70%"}})),iu2=O.styled(O.Typography)(({theme:e})=>({color:e.palette.grey[800],fontSize:18,fontWeight:700})),ou2=O.styled(O.Typography)(({theme:e})=>({color:e.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),uu2=O.styled(O.Button)(({theme:e})=>({paddingTop:6,paddingBottom:6,paddingLeft:0,margin:0,marginBottom:4,marginTop:4,width:"100%",display:"block",cursor:"pointer",color:e.palette.grey[600],textAlign:"left",fontWeight:400,fontSize:14,"> span":{color:e.palette.error.main}})),cu2=O.styled(tmt)(()=>({height:1,"& .simplebar-content":{height:1}})),lu2=O.styled(O.Stack)(()=>({position:"fixed",width:"202px"})),fu2=({title:e,sections:t,headerLeftContent:n,headerRightContent:a,onClickBack:r})=>g.jsx(O.Stack,{children:g.jsxs(O.Stack,{direction:"row",children:[g.jsx(tu2,{children:g.jsx(cu2,{children:g.jsxs(lu2,{children:[g.jsx(O.Typography,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO RÁPIDO"}),t.map((u,c)=>g.jsxs(O.Stack,{children:[g.jsxs(uu2,{onClick:()=>{u.ref.current&&u.ref.current.scrollIntoView({block:"start",behavior:"smooth"})},children:[u.title,u.isRequired&&g.jsx("span",{children:"*"})]}),c<t.length-1&&g.jsx(O.Divider,{})]},c))]})})}),g.jsxs(O.Stack,{width:"100%",alignItems:"center",mb:8,children:[g.jsx(nu2,{children:g.jsxs(ru2,{children:[g.jsxs(O.Stack,{flexDirection:"row",gap:2,children:[g.jsx(O.IconButton,{color:"primary",onClick:()=>r(),children:g.jsx(be,{icon:"CHEVRON_LEFT"})}),g.jsx(O.Typography,{variant:"h4",children:e}),n]}),g.jsxs(O.Stack,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[g.jsx(hSn,{disabled:!0}),a]})]})}),g.jsx(au2,{children:t.map(u=>g.jsxs(O.Stack,{paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",children:[g.jsx(iu2,{ref:u.ref,children:u.title}),g.jsx(ou2,{children:u.subTitle}),g.jsx(sGn,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:u.child})]},u.title))})]})]})}),su2=O.styled(O.Box)(({theme:e})=>({padding:24,borderRadius:8,height:"auto",maxWidth:800,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.grey[300]}`})),du2=O.styled(O.Stack)(({theme:e})=>({minHeight:180,maxWidth:700,border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff",padding:24})),gu2=O.styled(O.Box)(()=>({maxWidth:70,maxHeight:40,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),_u2=O.styled(O.Box)(({theme:e})=>({backgroundColor:e.palette.background.default,maxWidth:90,maxHeight:80,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),dGn=O.styled(O.Stack)(({theme:e})=>({border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff"})),mu2=O.styled(O.Box)(({theme:e})=>({width:"auto",height:120,overflow:"hidden",padding:2,borderBottom:`4px dotted ${e.palette.grey[300]}`})),vu2=({titlePreview:e,logoImage:t,brandingName:n,url:a,title:r,description:u,keyWords:c,customTitles:l,productImage:f,child:s,previewLinkImage:d,hasPreviewLink:_})=>g.jsx(su2,{children:g.jsxs(O.Stack,{gap:3,display:"flex",flex:1,children:[g.jsx(O.Typography,{variant:"overline",color:"text.disabled",children:e??"PRÉ-VISUALIZAÇÃO"}),g.jsxs(du2,{children:[g.jsxs(O.Stack,{direction:"row",pb:3,gap:.5,children:[g.jsx(O.Box,{height:0,width:10,children:g.jsx(be,{icon:"CIRCLE",width:30,color:"error.main"})}),g.jsx(O.Box,{height:0,width:10,children:g.jsx(be,{icon:"CIRCLE",width:30,color:"warning.main"})}),g.jsx(O.Box,{height:0,width:10,children:g.jsx(be,{icon:"CIRCLE",width:30,color:"success.main"})})]}),g.jsxs(O.Stack,{flexDirection:"row",gap:2,justifyContent:"space-between",children:[g.jsxs(O.Stack,{gap:1,width:"100%",children:[g.jsxs(O.Stack,{direction:"row",gap:1.5,pb:.5,children:[t&&g.jsx(gu2,{children:g.jsx("img",{alt:"Logo",src:t})}),g.jsxs(O.Stack,{children:[g.jsx(O.Typography,{variant:"overline",color:"grey.600",pb:.5,children:n??"SUAEMPRESA"}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(O.Typography,{variant:"caption",color:"grey.600",children:a??"https://www.exemplo.com"}),g.jsx(be,{icon:"MORE_OPTIONS_VERTICAL",width:15,color:"grey.500"})]})]})]}),g.jsx(KO,{variant:"subtitle1",color:"#4E5BEC",overflow:"hidden",textOverflow:"ellipsis",line:5,children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),g.jsx(KO,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:5,children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),c&&g.jsx(O.Stack,{direction:"row",gap:1,alignItems:"center",children:c.map((m,v)=>g.jsxs(g.Fragment,{children:[g.jsx(O.Typography,{variant:"caption",color:"text.disabled",children:m}),v<c.length-1&&g.jsx(O.Box,{width:4,height:16,children:g.jsx(be,{icon:"CIRCLE",color:"text.disabled",width:10})})]}))}),l&&g.jsx(O.Stack,{pt:2,children:l.map((m,v)=>g.jsxs(O.Stack,{gap:1,children:[g.jsx(O.Typography,{variant:"subtitle1",color:"#4E5BEC",children:m.title}),g.jsx(KO,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:1,children:m.description??"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys stansince the 1500"})]},v))}),s]}),f&&g.jsx(_u2,{children:g.jsx("img",{alt:"ProductImage",src:f})})]})]}),_&&g.jsxs(O.Stack,{gap:3,display:"flex",flex:1,width:"100%",children:[g.jsx(O.Typography,{variant:"overline",color:"text.disabled",children:"pré-visualização link de compartilhamento".toUpperCase()}),g.jsxs(dGn,{children:[d&&g.jsx(mu2,{children:g.jsx("img",{alt:"PreviewLinkImage",src:d,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:8}})}),g.jsxs(O.Stack,{gap:.2,p:2,width:"100%",children:[g.jsx(O.Typography,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),g.jsx(O.Typography,{variant:"caption",color:"grey.600",children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),g.jsx(O.Typography,{variant:"caption",color:"grey.500",children:a??"https://www.exemplo.com"})]})]}),g.jsx(dGn,{children:g.jsxs(O.Stack,{direction:"row",gap:1,alignItems:"center",children:[g.jsx(O.Box,{width:100,height:95,bgcolor:"grey.100",p:.5,alignItems:"center",children:g.jsx("img",{alt:"Logo",src:t,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:8}})}),g.jsxs(O.Stack,{padding:1,gap:.2,width:"80%",children:[g.jsx(KO,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),g.jsx(KO,{variant:"caption",color:"grey.600",children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),g.jsx(KO,{variant:"caption",color:"grey.500",line:1,children:a??"https://www.exemplo.com"})]})]})})]})]})}),hu2=O.styled(O.Stack)(({theme:e})=>({border:`1px solid ${O.alpha(e.palette.grey[500],.32)}`,borderRadius:8,alignItems:"center",overflow:"hidden"})),Cu2=O.styled(O.Stack)(()=>({backgroundColor:"#F5F5F5",padding:8,width:"100%",justifyContent:"space-between",alignItems:"center",gap:12,"& .MuiInputBase-root":{backgroundColor:"#fff"}}));O.styled(O.Stack)(({theme:e})=>({border:`1px solid ${O.alpha(e.palette.grey[500],.32)}`,borderRadius:8,alignItems:"center"}));const bu2=O.styled(O.Collapse)(()=>({width:"100%",padding:"12px 16px"})),yu2=({description:e,name:t,children:n,header:a,onDelete:r})=>{const[u,c]=kht(!0);return g.jsxs(hu2,{children:[g.jsxs(Cu2,{direction:"row",children:[g.jsxs(O.Stack,{direction:"row",alignItems:"center",gap:1.5,flex:1,children:[g.jsx(O.IconButton,{edge:"end",onClick:c,children:g.jsx(be,{icon:u?"CHEVRON_UP":"CHEVRON_RIGHT"})}),g.jsx(O.Typography,{variant:"overline",color:"text.primary",children:t}),g.jsx(O.Typography,{variant:"overline",color:"text.secondary",children:e}),g.jsx(O.Stack,{flex:1,children:a})]}),g.jsx(O.IconButton,{color:"error",onClick:r,children:g.jsx(be,{icon:"DELETE_MARK_BUTTON_02"})})]}),g.jsx(bu2,{in:u,timeout:"auto",unmountOnExit:!0,children:n})]})},pu2=O.styled(O.ToggleButtonGroup)(({theme:e})=>({button:{textTransform:"none"},"& .MuiToggleButton-primary:hover":{backgroundColor:`${e.palette.primary.dark}`,color:e.palette.primary.contrastText},"& button:not(.Mui-selected):hover":{backgroundColor:e.palette.primary.lighter,color:e.palette.primary.main},"& .Mui-selected":{backgroundColor:`${e.palette.primary.main} !important`,color:`${e.palette.primary.contrastText} !important`}})),Ou2=e=>g.jsx(pu2,{...e}),un=({name:e,helperText:t,rules:n,onChange:a,tabIndex:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:{ref:l,...f},fieldState:{error:s}})=>g.jsx(O.TextField,{...f,onChange:d=>{f.onChange(d),a&&a(d)},inputRef:l,fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...u,inputProps:{...u.inputProps,tabIndex:r}})})},gGn=({name:e,helperText:t,onChange:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,render:({field:c,fieldState:{error:l}})=>g.jsxs("div",{children:[g.jsx(O.FormControlLabel,{control:g.jsx(O.Switch,{...c,checked:c.value,onChange:(f,s)=>{c.onChange(f),n&&n(f,s)},inputProps:{tabIndex:a}}),...r}),(!!l||t)&&g.jsx(O.FormHelperText,{error:!!l,sx:f=>({mx:"14px",color:r.disabled?f.palette.grey[500]:void 0}),children:l?l==null?void 0:l.message:t})]})})},ju2=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],wu2=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],Mu2=O.styled(O.Stack)(({theme:e})=>({border:`1px solid ${O.alpha(e.palette.primary.main,.3)}`,backgroundColor:O.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),Lu2=O.styled(O.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),Pu2=O.styled(O.IconButton)(()=>({height:"38px",alignSelf:"center"})),Eu2=({webhookData:e,isEditing:t=!1,haveTip:n=!1})=>{const{control:a}=Ie.useFormContext(),{fields:r,append:u,remove:c}=Ie.useFieldArray({name:"headers",control:a}),l=()=>{u({value:"",name:""})};return g.jsxs(g.Fragment,{children:[n&&g.jsxs(Mu2,{children:[g.jsx(be,{icon:"INFO_CIRCLE"}),g.jsx(O.Typography,{variant:"caption",color:"text.secondary",children:"Webhooks permitem que serviços externos sejam notificados quando determinados eventos acontecem. Saiba mais acessando a documentação do Webhook"})]}),t&&g.jsx(un,{name:"name",label:"Nome do webhook"}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(un,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),g.jsx(un,{name:"filter",label:"Filtro"})]}),t&&e&&g.jsxs(g.Fragment,{children:[g.jsx(un,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(un,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),g.jsx(un,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:g.jsx(O.InputAdornment,{position:"end",children:g.jsx(Lu2,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:g.jsx(be,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),g.jsx(un,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsxs(O.Stack,{width:"35%",gap:2,children:[g.jsx(O.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),g.jsx(nWn,{name:"content_type",options:ju2,row:!0,decorated:!0})]}),g.jsxs(O.Stack,{gap:2,children:[g.jsx(O.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),g.jsx(nWn,{name:"http_method",options:wu2,row:!0,decorated:!0})]})]}),g.jsx(O.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),g.jsx(gGn,{name:"active",label:"Ativo"}),g.jsx(O.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((f,s)=>g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(un,{name:`headers.${s}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),g.jsx(un,{name:`headers.${s}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),g.jsx(Pu2,{onClick:()=>c(s),color:"error",children:g.jsx(be,{icon:"DELETE_MARK_BUTTON_02"})})]},f.id)),g.jsx(ORn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>l(),children:"Adicionar novo cabeçalho"}),g.jsx(O.Divider,{})]})},_Gn=({name:e,helperText:t,rules:n,onSelectOption:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>g.jsx(_Sn,{...c,...r,onChange:f=>{a&&a(f,c.value),c.onChange(f)},error:!!l,helperText:(l==null?void 0:l.message)||t})})},mGn=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{name:u,onChange:c,value:l,ref:f},fieldState:{error:s}})=>g.jsx(NBn,{ref:f,...a,name:u,value:l,error:!!s,helperText:(s==null?void 0:s.message)||t,onChange:({target:{value:d}})=>c(d)})})},ku2=({name:e,containerProps:t,required:n,rules:a,tabIndex:r})=>{const u=`${e}.zipCode`,c=`${e}.publicPlace`,l=`${e}.number`,f=`${e}.district`,s=`${e}.complement`,d=`${e}.state`,_=`${e}.city`,m=v=>{v.key==="Enter"&&v.preventDefault()};return g.jsxs(O.Stack,{gap:1.5,...t,children:[g.jsxs(O.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[g.jsx(mGn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:g.jsx(O.InputAdornment,{position:"end",children:g.jsx(O.CircularProgress,{size:24})})},rules:a,onKeyDown:m,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),g.jsxs(O.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[g.jsx(un,{name:c,label:"Logradouro",onKeyDown:m,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),g.jsx(un,{name:l,label:"Número",onKeyDown:m,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),g.jsxs(O.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[g.jsx(un,{name:f,label:"Bairro",onKeyDown:m,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),g.jsx(un,{name:s,label:"Complemento",onKeyDown:m,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:r})]}),g.jsxs(O.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[g.jsx(_Gn,{name:d,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),g.jsx(un,{name:_,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},Su2=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:r,rules:t,render:({field:u,fieldState:{error:c}})=>g.jsx(vSn,{...u,...a,onChange:l=>{u.onChange(l)},error:!!c,helperText:(c==null?void 0:c.message)||n})})},Du2=({name:e,rules:t,helperText:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,rules:t,render:({field:c,fieldState:{error:l}})=>g.jsxs("div",{children:[g.jsx(O.FormControlLabel,{control:g.jsx(O.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!l||n)&&g.jsx(O.FormHelperText,{error:!!l,children:l?l==null?void 0:l.message:n})]})})},Bu2=({row:e,name:t,rules:n,label:a,options:r,spacing:u,helperText:c,required:l,...f})=>{const{control:s}=Ie.useFormContext(),d=(_,m)=>_.includes(m)?_.filter(v=>v!==m):[..._,m];return g.jsx(Ie.Controller,{name:t,control:s,rules:n,render:({field:{value:_=[],...m},fieldState:{error:v}})=>g.jsxs(O.FormControl,{component:"fieldset",children:[a&&g.jsx(O.FormLabel,{component:"legend",sx:{typography:"body2"},required:l,children:a}),g.jsx(O.FormGroup,{sx:{...e&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:u||0},...e&&{mr:0,"&:not(:last-of-type)":{mr:u||2}}}},children:r.map(C=>g.jsx(O.FormControlLabel,{control:g.jsx(O.Checkbox,{checked:_.includes(C.value),onChange:()=>m.onChange(d(_,C.value))}),label:C.label,...f},C.value))}),(!!v||c)&&g.jsx(O.FormHelperText,{error:!!v,sx:C=>({color:f.disabled?C.palette.grey[500]:void 0}),children:v?v==null?void 0:v.message:c})]})})},Wu2=({keyName:e,inputs:t=[],rules:n,tabIndex:a,...r})=>{const u=o.useRef(null),{control:c,setValue:l,formState:{errors:f}}=Ie.useFormContext(),s=m=>{const v=m.clipboardData.getData("text").split("");t.map((C,h)=>l(C,v[h])),m.preventDefault()},d=(m,v)=>{const{maxLength:C,value:h,name:b}=m.target,p=b.replace(e,""),y=Number(p),w=document.querySelector(`input[name=${e}${y+1}]`);h.length>C&&(m.target.value=h[0]),h.length>=C&&y<6&&w!==null&&w.focus(),v(m)};D_t("paste",s,u);const _=t.some(m=>f[m]);return g.jsxs(O.Stack,{children:[g.jsx(O.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:u,children:t.map((m,v)=>g.jsx(Ie.Controller,{name:`${e}${v+1}`,control:c,rules:n,render:({field:C,fieldState:{error:h}})=>g.jsx(O.TextField,{...r,...C,autoComplete:"none",error:!!h,autoFocus:v===0,placeholder:"-",onChange:b=>{d(b,C.onChange)},onFocus:b=>b.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:a}})},m))}),_&&g.jsx(O.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},Iu2=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:r,rules:{...t,validate:{...t==null?void 0:t.validate,validation:u=>{const c="#"+u.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(c)?!0:"Cor inválida"}}},render:({field:{ref:u,onChange:c,...l},fieldState:{error:f}})=>g.jsx(HNn,{...l,onChangeColor:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||n,...a})})},$u2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return g.jsx(wT.DatePicker,{inputRef:l,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},xu2=({name:e,label:t,rules:n,tabIndex:a,helperText:r,required:u,...c})=>{const{control:l,setError:f}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:l,rules:n,render:({field:{value:s,onChange:d},fieldState:{error:_}})=>g.jsx(wT.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...c.localeText},value:[(s==null?void 0:s.startDate)||null,(s==null?void 0:s.endDate)||null],onChange:m=>d({startDate:m[0],endDate:m[1]}),onError:m=>{f(e,{message:m[0]||m[1]||void 0})},...c,slotProps:{textField:({position:m})=>{var v;return{...(v=c.slotProps)==null?void 0:v.textField,required:u,error:!!_,helperText:(_==null?void 0:_.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:m==="start"?`${t} (Dt. Início)`:`${t} (Dt. Fim)`,inputProps:{tabIndex:a}}}},sx:{width:1}})})},zu2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return g.jsx(wT.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:l,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Hu2=({id:e,children:t,onSubmit:n,methods:a,...r})=>g.jsx(Ie.FormProvider,{...a,children:g.jsx(O.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),Au2=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{ref:u,value:c,...l},fieldState:{error:f}})=>g.jsx(ABn,{value:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||t,...a,...l,name:e})})},Ru2=({name:e,label:t="",rules:n,helperText:a,changed:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:l,fieldState:{error:f}})=>g.jsx(O.Autocomplete,{...l,onChange:(s,d)=>{r&&r(d),l.onChange(d)},renderInput:s=>g.jsx(O.TextField,{label:t,error:!!f,helperText:f?f==null?void 0:f.message:a,...s}),...u})})},Vu2=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>g.jsx(ECt,{...c,onChange:f=>{c.onChange(f),a&&a(f)},fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...r})})},Fu2=({name:e,sx:t,rules:n,passwordSize:a,specialCharacter:r,upperCaseChar:u,numberChar:c,showErrorMessage:l,match:f,...s})=>{const{watch:d}=Ie.useFormContext(),_=d(e),[m,v]=o.useState(!1),{hasNumberChar:C,hasSpecialCharacter:h,hasUpperCaseChar:b,isLengthValid:p}=WCt(_,a,c,r,u);return g.jsx(un,{...s,name:e,type:m?"text":"password",InputProps:{endAdornment:g.jsx(O.InputAdornment,{position:"end",children:g.jsx(O.IconButton,{onClick:()=>v(!m),edge:"end","aria-label":"Mostrar/Ocultar senha",children:g.jsx(be,{icon:m?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const w=WCt(y,a,c,r,u);return!w.hasNumberChar||!w.hasSpecialCharacter||!w.hasUpperCaseChar||!w.isLengthValid?"Senha inválida":f&&f.fieldPassword&&d(f.fieldPassword)!==y?"As senhas devem ser iguais":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:(!h||!b||!p||!C)&&!l?"none":void 0}}})},nWn=({name:e,rules:t,row:n,label:a,options:r,spacing:u,helperText:c,decorated:l,onChange:f,tabIndex:s,required:d,disabled:_,...m})=>{const{control:v}=Ie.useFormContext(),C=a?`${e}-${a}`:"";return g.jsx(Ie.Controller,{name:e,control:v,rules:t,render:({field:h,fieldState:{error:b}})=>g.jsxs(O.FormControl,{component:"fieldset",sx:{...l&&{paddingLeft:1.5}},children:[a&&g.jsx(O.FormLabel,{component:"legend",id:C,sx:{typography:"body2"},required:d,children:a}),g.jsx(O.RadioGroup,{...m,...h,onChange:(p,y)=>{h.onChange(p),f&&f(p,y)},"aria-labelledby":C,row:n,children:r.map(p=>g.jsx(O.FormControlLabel,{value:p.value,control:g.jsx(O.Radio,{inputProps:{tabIndex:s},disabled:_,checked:p.value===h.value}),label:p.label,sx:({palette:y})=>({"&:not(:last-of-type)":{mb:u||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:u||2}},...l&&{border:`1px solid ${O.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:O.alpha(y.primary.main,.05)}}})},p.value))}),(!!b||c)&&g.jsx(O.FormHelperText,{error:!!b,sx:p=>({color:_?p.palette.grey[500]:void 0}),children:b?b==null?void 0:b.message:c})]})})},Nu2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return g.jsx(wT.TimePicker,{ampm:!1,format:"HH:mm",inputRef:l,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,error:!!s,required:r,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Tu2=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:l,tabIndex:f,...s})=>{const{id:d,setCropModalOpen:_,handleRemove:m,cropModalOpen:v,cancelChanges:C,saveChanges:h,previewImage:b,setCropper:p,preview:y,closePreviewImage:w}=cGn({onFileCropped:e,onImageUploaded:t,onCancel:n});return g.jsxs(g.Fragment,{children:[g.jsxs(O.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[c&&g.jsx(Z22,{}),g.jsx(uGn,{...s,id:d,file:l,onDrop:E=>{if(E.length>0){_(!0);const M=new FileReader;M.addEventListener("load",()=>{var k;const j=((k=M.result)==null?void 0:k.toString())||"";t(j),e(void 0)}),M.readAsDataURL(E[0])}},image:u,tabIndex:f})]}),g.jsx(lGn,{id:d,open:v,onClose:C,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:h,onPreview:b,onInitialized:p}),g.jsx(O.Dialog,{open:!!y,onClose:w,scroll:"body",PaperProps:{sx:{p:2}},children:y&&g.jsx("img",{src:y,alt:"Preview"})})]})};function vGn(e,t){const{watch:n,setValue:a}=Ie.useFormContext(),[r,u]=o.useState(t),c=n(e)||[];return{uploadFile:async m=>{if(!m){a(e,void 0),u(void 0);return}a(e,m),u(Object.assign(m,{preview:URL.createObjectURL(m)}))},uploadFiles:async m=>{a(e,[...c,...m.map(v=>Object.assign(v,{preview:URL.createObjectURL(v)}))])},handleDeleteFile:()=>{a(e,void 0),u(void 0)},handleRemoveAll:()=>{a(e,void 0)},handleRemove:m=>{const v=c.filter(C=>C!==m);a(e,v)},file:r,setFileValue:u}}const Zu2=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:l,onCancel:f,...s})=>{const{control:d}=Ie.useFormContext(),{uploadFile:_,file:m,setFileValue:v}=vGn(e);return g.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>g.jsx(Tu2,{accept:{"image/*":[]},file:C?m:void 0,onFileCropped:b=>{_(b),c&&c(b)},onImageUploaded:l,onCancel:()=>{v(void 0),f&&f()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&g.jsx(O.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},Uu2=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:l,onCancel:f,...s})=>{const{control:d}=Ie.useFormContext(),{uploadFile:_,file:m,setFileValue:v}=vGn(e);return g.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>g.jsx(fGn,{accept:{"image/*":[]},file:C?m:void 0,onFileCropped:b=>{_(b),c&&c(b)},onImageUploaded:l,onCancel:()=>{v(void 0),f&&f()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&g.jsx(O.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},hGn=O.styled(O.Button)(({theme:e})=>({borderColor:e.palette.grey[300]})),CGn=O.styled(O.Box)(({theme:e})=>({border:"1.5px solid",borderColor:e.palette.grey[300],height:450,width:"40%",borderRadius:8})),Gu2=({selectedItems:e,items:t,loading:n,searchText:a,onAdd:r,onRemove:u,search:c,itemsTitle:l,selectedItemsTitle:f,additionalContent:s,enableSearchInSelectedItems:d,onSearch:_})=>{const[m,v]=o.useState(""),C=O.debounce(_,400),h=t.filter(W=>!e.some(z=>z.id===W.id)),b=e.filter(W=>{var z;return(z=W.name)==null?void 0:z.toLowerCase().includes(m.toLowerCase())}),p=d?b:t.filter(W=>e.some(z=>z.id===W.id)),[y,w]=o.useState([]),[E,M]=o.useState([]),j=()=>{r(y),w([])},k=()=>{u(E),M([])},D=W=>{M(W?p:[])},S=W=>{w(W?h:[])},B=(W,z)=>{M(z?T=>[...T,W]:T=>T.filter(A=>A.id!==W.id))},H=(W,z)=>{w(z?T=>[...T,W]:T=>T.filter(A=>A.id!==W.id))},F=W=>{W.key==="Enter"&&W.preventDefault()};return g.jsx(O.Stack,{children:g.jsxs(O.Stack,{direction:"row",alignItems:"center",gap:3,children:[g.jsx(CGn,{display:"flex",flex:1,children:g.jsxs(O.Stack,{flex:1,children:[g.jsxs(O.Stack,{direction:"row",gap:1,padding:2,children:[g.jsx(O.Checkbox,{size:"small",indeterminate:y.length>0&&y.length!==h.length,checked:y.length>0&&y.length===h.length,onChange:W=>S(W.target.checked)}),g.jsxs(O.Stack,{children:[g.jsx(O.Typography,{variant:"subtitle2",color:"text.primary",children:`${l} cadastrados(as)`}),g.jsx(O.Typography,{variant:"caption",color:"text.disabled",children:`${y.length}/${h.length} selecionados`})]})]}),g.jsx(O.Divider,{}),g.jsxs(O.Stack,{p:2,flex:1,children:[g.jsxs(O.Stack,{direction:"row",gap:1,children:[g.jsx(GBn,{iconPosition:"start",placeholder:"Buscar",onKeyDown:F,size:"small",fullWidth:!0,trigger:"change",onSearch:W=>C(W)}),s]}),g.jsx(TBn,{isLoading:n,loading:g.jsx(O.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:g.jsx(O.CircularProgress,{})}),isEmpty:h.length===0,empty:g.jsx(_Ct,{text:c?`Nenhum ${a} encontrado`:`Nenhum ${a} disponível`,sx:{svg:{height:140}}}),children:g.jsx(tmt,{sx:{maxHeight:280},children:h.map(W=>g.jsxs(O.Stack,{gap:1,marginTop:"8px",children:[g.jsxs(O.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[g.jsx(O.Checkbox,{size:"small",checked:y.includes(W),onChange:z=>H(W,z.target.checked)}),W.label]}),g.jsx(O.Divider,{})]},W.id))})})]})]})}),g.jsxs(O.Stack,{gap:3,children:[g.jsx(hGn,{variant:"outlined",onClick:j,children:g.jsx(be,{icon:"ARROW_RIGHT_SIMPLE"})}),g.jsx(hGn,{variant:"outlined",onClick:k,children:g.jsx(be,{icon:"ARROW_LEFT_SIMPLE"})})]}),g.jsx(CGn,{display:"flex",flex:1,children:g.jsxs(O.Stack,{flex:1,children:[g.jsxs(O.Stack,{direction:"row",gap:1,padding:2,children:[g.jsx(O.Checkbox,{size:"small",indeterminate:E.length>0&&E.length!==p.length,checked:E.length>0&&E.length===p.length,onChange:W=>D(W.target.checked)}),g.jsxs(O.Stack,{children:[g.jsx(O.Typography,{variant:"subtitle2",color:"text.primary",children:`${f} selecionados(as)`}),g.jsx(O.Typography,{variant:"caption",color:"text.disabled",children:`${E.length}/${p.length} selecionados`})]})]}),g.jsx(O.Divider,{}),g.jsxs(O.Stack,{p:2,gap:1,children:[d&&g.jsx(GBn,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:W=>v(W??""),onKeyDown:F}),g.jsx(TBn,{isLoading:n,loading:g.jsx(O.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:g.jsx(O.CircularProgress,{})}),isEmpty:p.length===0,empty:g.jsx(_Ct,{text:m?`Nenhum ${a} encontrado`:`Nenhum ${a} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:g.jsx(tmt,{sx:{maxHeight:280},children:p.map(W=>g.jsxs(O.Stack,{gap:1,children:[g.jsxs(O.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[g.jsx(O.Checkbox,{size:"small",checked:E.includes(W),onChange:z=>B(W,z.target.checked)}),W.label]}),g.jsx(O.Divider,{})]},W.id))})})]})]})})]})})},Yu2=Object.freeze(Object.defineProperty({__proto__:null,default:qer},Symbol.toStringTag,{value:"Module"}));R.ActionButton=ORn,R.Address=ku2,R.Autocomplete=_Sn,R.AutocompleteDetailed=vSn,R.AutocompleteDetailedField=Su2,R.AutocompleteField=_Gn,R.BuilderLayout=BDo,R.BuilderSidebar=cHo,R.Carousel=HEo,R.CarouselArrowIndex=tko,R.CarouselArrows=NEo,R.CarouselDots=FEo,R.Checkbox=Du2,R.Codes=Wu2,R.ColorPickerField=Iu2,R.ColorPickerInput=HNn,R.Common=pr2,R.CommonSSR=jr2,R.Confirm=wr2,R.CustomAvatar=mSn,R.CustomAvatarGroup=$Rn,R.DataGrid=Pr2,R.DatePicker=$u2,R.DateRangePicker=xu2,R.DateTimePicker=zu2,R.Delayed=Er2,R.DialogAnimate=Mtr,R.Drawer=Ar2,R.EmptyContent=tAn,R.EmptyView=_Ct,R.Error=Vr2,R.ExpandableGroup=yu2,R.FabButtonAnimate=izn,R.Field=un,R.FixedProgressBar=gCt,R.Form=Hu2,R.FrameSkeleton=fu2,R.HelpButton=hSn,R.Icon=be,R.IconButtonAnimate=ozn,R.Iconify=MZn,R.IllustrationEmptyContent=LIn,R.ImageCrop=aUn,R.Incrementer=ABn,R.IncrementerField=Au2,R.Label=CUn,R.Lightbox=rDo,R.LoadingScreen=mi2,R.MaskedInput=NBn,R.MaskedInputField=mGn,R.MaterialDesignContent=$yt,R.MenuPopover=EUn,R.Modal=kUn,R.ModalActions=xi2,R.MotionContainer=Atr,R.MotionLazyContainer=Lyt,R.MotionViewport=Htr,R.MultiCheckbox=Bu2,R.MultipleChipField=Ru2,R.NoData=PIn,R.NumberInput=ECt,R.NumberInputField=Vu2,R.PasswordField=Fu2,R.PasswordRules=Fi2,R.PopoverSelect=X22,R.Portal=SUn,R.RadioGroupField=nWn,R.Result=TBn,R.SavedChanges=fo2,R.Scrollbar=tmt,R.SearchInput=GBn,R.SeoPreview=vu2,R.SnackbarContent=Iyt,R.SnackbarProvider=Wzn,R.SplashScreen=so2,R.Steps=_o2,R.StyledTab=mo2,R.StyledTabs=vo2,R.Summary=eu2,R.SwapList=Gu2,R.Switch=gGn,R.TRANSITION=EIn,R.TabPanel=ho2,R.TableEmptyRows=cko,R.TableHeadCustom=fko,R.TableNoData=oko,R.TablePaginationCustom=dko,R.TableSelectedAction=sko,R.TableSkeleton=uko,R.TextAnimate=Ltr,R.TextMaxLine=KO,R.ThemeProvider=zTn,R.TimePicker=Nu2,R.ToggleButtonGroup=Ou2,R.Transition=Wvt,R.Upload=oGn,R.UploadAvatar=uGn,R.UploadAvatarWithCropField=Zu2,R.UploadBox=F22,R.UploadIllustration=MIn,R.UploadWithCrop=fGn,R.UploadWithCropField=Uu2,R.Webhook=Eu2,R.WhiteBox=sGn,R.color=en2,R.compare=Uzo,R.cssStyles=qEo,R.emptyRows=nko,R.file=Ni2,R.formatNumber=Na2,R.formatTime=to2,R.getComparator=rko,R.loadable=lo2,R.mask=uo2,R.number=za2,R.routes=ro2,R.sort=oo2,R.useActiveElement=WDo,R.useApiMessage=tHo,R.useCarousel=AEo,R.useCopyToClipboard=IDo,R.useDatagrid=$Do,R.useDeepCompareEffect=Yzo,R.useEventCallback=HSn,R.useEventListener=D_t,R.useIsMounting=Xzo,R.useIsomorphicLayoutEffect=WVn,R.useLightBox=oDo,R.useLocalStorage=aHo,R.useOffSetTop=eHo,R.useOnClickOutside=qzo,R.usePagination=Jzo,R.usePopover=zSn,R.useResponsive=Myt,R.useSnackbar=Izn,R.useTable=ako,R.useTabs=Qzo,R.useToggle=kht,R.uuidv4=co2,R.validators=Ai2,R.varBgColor=FXn,R.varBgKenburns=NXn,R.varBgPan=TXn,R.varBounce=AXn,R.varContainer=avt,R.varFade=fle,R.varFlip=xXn,R.varHover=VXn,R.varPath=WXn,R.varRotate=RXn,R.varScale=HXn,R.varSlide=zXn,R.varTranEnter=$e,R.varTranExit=Ne,R.varTranHover=IXn,R.varZoom=$Xn,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
35409
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tGn(e,t){if(e){if(typeof e=="string")return JBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JBn(e,t)}}function JBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function D22(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function B22(e){if(Array.isArray(e))return e}function nGn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nGn(Object(n),!0).forEach(function(a){qBn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nGn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function qBn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HCt(e,t){if(e==null)return{};var n=W22(e,t),a,r;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)a=u[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function W22(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,u;for(u=0;u<a.length;u++)r=a[u],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var eWn=o.forwardRef(function(e,t){var n=e.children,a=HCt(e,O22),r=ACt(a),u=r.open,c=HCt(r,j22);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(Pt(Pt({},c),{},{open:u})))});eWn.displayName="Dropzone";var rGn={disabled:!1,getFilesFromEvent:Zo2,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};eWn.defaultProps=rGn,eWn.propTypes={children:P.func,accept:P.objectOf(P.arrayOf(P.string)),multiple:P.bool,preventDropOnDocument:P.bool,noClick:P.bool,noKeyboard:P.bool,noDrag:P.bool,noDragEventsBubbling:P.bool,minSize:P.number,maxSize:P.number,maxFiles:P.number,disabled:P.bool,getFilesFromEvent:P.func,onFileDialogCancel:P.func,onFileDialogOpen:P.func,useFsAccessApi:P.bool,autoFocus:P.bool,onDragEnter:P.func,onDragLeave:P.func,onDragOver:P.func,onDrop:P.func,onDropAccepted:P.func,onDropRejected:P.func,onError:P.func,validator:P.func};var tWn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function ACt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Pt(Pt({},rGn),e),n=t.accept,a=t.disabled,r=t.getFilesFromEvent,u=t.maxSize,c=t.minSize,l=t.multiple,f=t.maxFiles,s=t.onDragEnter,d=t.onDragLeave,_=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,C=t.onDropRejected,h=t.onFileDialogCancel,b=t.onFileDialogOpen,p=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,E=t.noClick,M=t.noKeyboard,j=t.noDrag,k=t.noDragEventsBubbling,D=t.onError,S=t.validator,B=o.useMemo(function(){return b22(n)},[n]),H=o.useMemo(function(){return C22(n)},[n]),F=o.useMemo(function(){return typeof b=="function"?b:aGn},[b]),W=o.useMemo(function(){return typeof h=="function"?h:aGn},[h]),z=o.useRef(null),T=o.useRef(null),A=o.useReducer(I22,tWn),Z=QBn(A,2),X=Z[0],J=Z[1],V=X.isFocused,N=X.isFileDialogActive,Y=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&h22()),ie=function(){!Y.current&&N&&setTimeout(function(){if(T.current){var he=T.current.files;he.length||(J({type:"closeDialog"}),W())}},300)};o.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[T,N,W,Y]);var ee=o.useRef([]),fe=function(he){z.current&&z.current.contains(he.target)||(he.preventDefault(),ee.current=[])};o.useEffect(function(){return w&&(document.addEventListener("dragover",JUn,!1),document.addEventListener("drop",fe,!1)),function(){w&&(document.removeEventListener("dragover",JUn),document.removeEventListener("drop",fe))}},[z,w]),o.useEffect(function(){return!a&&y&&z.current&&z.current.focus(),function(){}},[z,y,a]);var ce=o.useCallback(function(q){D?D(q):console.error(q)},[D]),Ce=o.useCallback(function(q){q.preventDefault(),q.persist(),Pe(q),ee.current=[].concat(L22(ee.current),[q.target]),zCt(q)&&Promise.resolve(r(q)).then(function(he){if(!(xCt(q)&&!k)){var at=he.length,He=at>0&&g22({files:he,accept:B,minSize:c,maxSize:u,multiple:l,maxFiles:f,validator:S}),Et=at>0&&!He;J({isDragAccept:He,isDragReject:Et,isDragActive:!0,type:"setDraggedFiles"}),s&&s(q)}}).catch(function(he){return ce(he)})},[r,s,ce,k,B,c,u,l,f,S]),le=o.useCallback(function(q){q.preventDefault(),q.persist(),Pe(q);var he=zCt(q);if(he&&q.dataTransfer)try{q.dataTransfer.dropEffect="copy"}catch{}return he&&_&&_(q),!1},[_,k]),te=o.useCallback(function(q){q.preventDefault(),q.persist(),Pe(q);var he=ee.current.filter(function(He){return z.current&&z.current.contains(He)}),at=he.indexOf(q.target);at!==-1&&he.splice(at,1),ee.current=he,!(he.length>0)&&(J({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),zCt(q)&&d&&d(q))},[z,d,k]),ge=o.useCallback(function(q,he){var at=[],He=[];q.forEach(function(Et){var we=XUn(Et,B),qt=QBn(we,2),_n=qt[0],Dc=qt[1],XO=QUn(Et,c,u),QO=QBn(XO,2),bT=QO[0],yT=QO[1],pT=S?S(Et):null;if(_n&&bT&&!pT)at.push(Et);else{var OT=[Dc,yT];pT&&(OT=OT.concat(pT)),He.push({file:Et,errors:OT.filter(function(jT){return jT})})}}),(!l&&at.length>1||l&&f>=1&&at.length>f)&&(at.forEach(function(Et){He.push({file:Et,errors:[d22]})}),at.splice(0)),J({acceptedFiles:at,fileRejections:He,type:"setFiles"}),m&&m(at,He,he),He.length>0&&C&&C(He,he),at.length>0&&v&&v(at,he)},[J,l,B,c,u,f,m,v,C,S]),We=o.useCallback(function(q){q.preventDefault(),q.persist(),Pe(q),ee.current=[],zCt(q)&&Promise.resolve(r(q)).then(function(he){xCt(q)&&!k||ge(he,q)}).catch(function(he){return ce(he)}),J({type:"reset"})},[r,ge,ce,k]),U=o.useCallback(function(){if(Y.current){J({type:"openDialog"}),F();var q={multiple:l,types:H};window.showOpenFilePicker(q).then(function(he){return r(he)}).then(function(he){ge(he,null),J({type:"closeDialog"})}).catch(function(he){y22(he)?(W(he),J({type:"closeDialog"})):p22(he)?(Y.current=!1,T.current?(T.current.value=null,T.current.click()):ce(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."))):ce(he)});return}T.current&&(J({type:"openDialog"}),F(),T.current.value=null,T.current.click())},[J,F,W,p,ge,ce,H,l]),qe=o.useCallback(function(q){!z.current||!z.current.isEqualNode(q.target)||(q.key===" "||q.key==="Enter"||q.keyCode===32||q.keyCode===13)&&(q.preventDefault(),U())},[z,U]),se=o.useCallback(function(){J({type:"focus"})},[]),ne=o.useCallback(function(){J({type:"blur"})},[]),_e=o.useCallback(function(){E||(v22()?setTimeout(U,0):U())},[E,U]),je=function(he){return a?null:he},K=function(he){return M?null:je(he)},Oe=function(he){return j?null:je(he)},Pe=function(he){k&&he.stopPropagation()},xe=o.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=q.refKey,at=he===void 0?"ref":he,He=q.role,Et=q.onKeyDown,we=q.onFocus,qt=q.onBlur,_n=q.onClick,Dc=q.onDragEnter,XO=q.onDragOver,QO=q.onDragLeave,bT=q.onDrop,yT=HCt(q,w22);return Pt(Pt(qBn({onKeyDown:K(Sc(Et,qe)),onFocus:K(Sc(we,se)),onBlur:K(Sc(qt,ne)),onClick:je(Sc(_n,_e)),onDragEnter:Oe(Sc(Dc,Ce)),onDragOver:Oe(Sc(XO,le)),onDragLeave:Oe(Sc(QO,te)),onDrop:Oe(Sc(bT,We)),role:typeof He=="string"&&He!==""?He:"presentation"},at,z),!a&&!M?{tabIndex:0}:{}),yT)}},[z,qe,se,ne,_e,Ce,le,te,We,M,j,a]),ze=o.useCallback(function(q){q.stopPropagation()},[]),Zt=o.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=q.refKey,at=he===void 0?"ref":he,He=q.onChange,Et=q.onClick,we=HCt(q,M22),qt=qBn({accept:B,multiple:l,type:"file",style:{display:"none"},onChange:je(Sc(He,We)),onClick:je(Sc(Et,ze)),tabIndex:-1},at,T);return Pt(Pt({},qt),we)}},[T,n,l,We,a]);return Pt(Pt({},X),{},{isFocused:V&&!a,getRootProps:xe,getInputProps:Zt,rootRef:z,inputRef:T,open:je(U)})}function I22(e,t){switch(t.type){case"focus":return Pt(Pt({},e),{},{isFocused:!0});case"blur":return Pt(Pt({},e),{},{isFocused:!1});case"openDialog":return Pt(Pt({},tWn),{},{isFileDialogActive:!0});case"closeDialog":return Pt(Pt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Pt(Pt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Pt(Pt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Pt({},tWn);default:return e}}function aGn(){}const iGn=({fileRejections:e})=>e.length?g.jsx(O.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>Q(t.palette.error.main,.08),borderColor:t=>Q(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=YBn(t);return g.jsxs(O.Box,{sx:{my:1},children:[g.jsxs(O.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?$Bn(r):""]}),n.map(u=>g.jsxs(O.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,$22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return g.jsx(O.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:g.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},x22=Bt("div")(({theme:e})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`1px dashed ${Q(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),z22=({header:e,description:t,sx:n,...a})=>g.jsxs(O.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...a,children:[g.jsx(MIn,{sx:{width:220}}),g.jsxs("div",{children:[g.jsx(O.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),g.jsx(O.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||g.jsxs(g.Fragment,{children:["Solte os arquivos aqui ou clique",g.jsx(O.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),oGn=({id:e,disabled:t,multiple:n=!1,error:a,helperText:r,file:u,onDelete:c,files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:_,sx:m,dropZoneProps:v,placeholderProps:C,placeholderAlt:h,image:b,tabIndex:p,...y})=>{const{getRootProps:w,getInputProps:E,isDragActive:M,isDragReject:j,fileRejections:k}=ACt({multiple:n,disabled:t,...y}),D=!!u&&!n||b,S=l&&n&&l.length>0,B=j||!!a;return g.jsxs(O.Box,{sx:{width:1,position:"relative",...m},children:[g.jsxs(x22,{...w(),sx:{...M&&{opacity:.72},...B&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...v},children:[g.jsx("input",{...E(),id:e,tabIndex:p}),h?g.jsx(O.Stack,{sx:{...D&&{opacity:0}},children:h}):g.jsx(z22,{sx:{...D&&{opacity:0}},header:C==null?void 0:C.title,description:C==null?void 0:C.description}),D&&g.jsx($22,{file:u||b||""})]}),r&&g.jsx(O.FormHelperText,{error:!!a,sx:H=>({mx:"14px",color:t?H.palette.grey[500]:void 0}),children:r}),g.jsx(iGn,{fileRejections:k}),D&&c&&g.jsx(O.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:H=>Q(H.palette.common.white,.8),bgcolor:H=>Q(H.palette.grey[900],.72),"&:hover":{bgcolor:H=>Q(H.palette.grey[900],.48)}},children:g.jsx(be,{icon:"CLOSE_MARK_BUTTON",width:18})}),S&&g.jsx(g.Fragment,{children:g.jsx(O.Box,{sx:{my:3},children:g.jsx(Vo2,{files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:_})})})]})},H22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return g.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},A22=Bt("div")(({theme:e})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${Q(e.palette.grey[500],.32)}`})),R22=Bt("div")(({theme:e})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:e.palette.text.disabled,backgroundColor:e.palette.background.neutral,transition:e.transitions.create("opacity",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.shorter})})),uGn=({error:e,file:t,image:n,disabled:a,helperText:r,sx:u,tabIndex:c,...l})=>{const{getRootProps:f,getInputProps:s,isDragActive:d,isDragReject:_,fileRejections:m}=ACt({multiple:!1,disabled:a,...l}),v=!!t||n,C=_||!!e;return g.jsxs(g.Fragment,{children:[g.jsxs(A22,{...f(),sx:{...d&&{opacity:.72},...C&&{borderColor:"error.light",...v&&{bgcolor:"error.lighter"}},...a&&{opacity:.48,pointerEvents:"none"},...v&&{"&:hover":{"& .placeholder":{opacity:1}}},...u},children:[g.jsx("input",{...s(),tabIndex:c}),v&&g.jsx(H22,{file:t||n||""}),g.jsxs(R22,{className:"placeholder",sx:{"&:hover":{opacity:.72},...v&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>Q(h.palette.grey[900],.64)},...C&&{color:"error.main",bgcolor:"error.lighter"}},children:[g.jsx(be,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),g.jsx(O.Typography,{variant:"caption",children:t?"Atualizar foto":"Carregar foto"})]})]}),r&&r,g.jsx(iGn,{fileRejections:m})]})},V22=Bt("div")(({theme:e})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:e.spacing(.5),color:e.palette.text.disabled,borderRadius:e.shape.borderRadius,border:`dashed 1px ${e.palette.divider}`,backgroundColor:Q(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),F22=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:l,isDragActive:f,isDragReject:s}=ACt({disabled:n,...u}),d=s||t;return g.jsxs(V22,{...c(),sx:{...f&&{opacity:.72},...d&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...a},children:[g.jsx("input",{...l(),tabIndex:r}),e||g.jsx(be,{icon:"CLOUD_UPLOAD",width:28})]})},cGn=({onFileCropped:e,onImageUploaded:t,onCancel:n})=>{const a=o.useId(),[r,u]=o.useState(),[c,l,f]=kht(),[s,d]=o.useState();return{id:a,setCropModalOpen:f,handleRemove:()=>{e(void 0),t(void 0),f(!1)},toggleCropModalOpen:l,cropModalOpen:c,cancelChanges:()=>{n&&n(),f(!1)},saveChanges:()=>{r!==void 0&&r.getCroppedCanvas().toBlob(b=>{if(!b)return;const p=new File([b],"imagem");e(p),l()},"image/png",1)},previewImage:()=>{r!==void 0&&d(r.getCroppedCanvas().toDataURL())},setCropper:u,preview:s,closePreviewImage:()=>d(void 0)}},lGn=({id:e,open:t,onClose:n,label:a,onSave:r,onRemove:u,onPreview:c,imageSrc:l,aspectRatio:f,onInitialized:s})=>{const[d,_]=o.useState(.5);return g.jsx(kUn,{open:t,onClose:n,dialogTitle:a,actions:g.jsxs(g.Fragment,{children:[g.jsx(O.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),g.jsx(O.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),fullWidth:!0,maxWidth:"sm",keepMounted:!0,children:g.jsxs(O.Stack,{gap:2,children:[g.jsx(aUn,{imageSrc:l,aspectRatio:f,onInitialized:s,zoom:d,onZoomChange:_}),g.jsxs(O.Stack,{gap:1.5,children:[g.jsxs(O.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",children:[g.jsx(O.Typography,{variant:"body1",children:"Zoom"}),g.jsx(O.Slider,{value:d,onChange:(m,v)=>_(Array.isArray(v)?v[0]:v),min:.1,max:2,size:"medium",step:.0125})]}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(O.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(be,{icon:"DELETE_MARK_BUTTON_02"}),onClick:u,children:"Remover"}),g.jsx(O.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(be,{icon:"PLAY_SIMPLE"}),onClick:c,children:"Pré-visualizar"}),g.jsx(O.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(be,{icon:"SEARCH_IMAGE"}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})})},N22=O.styled(O.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),T22=O.styled(O.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:O.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),Z22=O.styled(O.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),fGn=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:l,tabIndex:f,...s})=>{const{id:d,setCropModalOpen:_,handleRemove:m,toggleCropModalOpen:v,cropModalOpen:C,cancelChanges:h,saveChanges:b,previewImage:p,setCropper:y,preview:w,closePreviewImage:E}=cGn({onFileCropped:e,onImageUploaded:t,onCancel:n});return g.jsxs(g.Fragment,{children:[g.jsxs(N22,{children:[c&&g.jsx(gCt,{}),g.jsx(oGn,{...s,id:d,file:l,onDrop:M=>{if(M.length>0){_(!0);const j=new FileReader;j.addEventListener("load",()=>{var D;const k=((D=j.result)==null?void 0:D.toString())||"";t(k),e(void 0)}),j.readAsDataURL(M[0])}},image:u,tabIndex:f}),(l||u)&&g.jsxs(T22,{className:"actions",children:[g.jsx(O.Button,{color:"inherit",startIcon:g.jsx(be,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:m,children:"Remover"}),g.jsx(O.Button,{color:"inherit",startIcon:g.jsx(be,{icon:"SEARCH_IMAGE",color:"primary.maon"}),onClick:v,children:"Editar"})]})]}),g.jsx(lGn,{id:d,open:C,onClose:h,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:b,onPreview:p,onInitialized:y}),g.jsx(O.Dialog,{open:!!w,onClose:E,scroll:"body",PaperProps:{sx:{p:2}},children:w&&g.jsx("img",{src:w,alt:"Preview"})})]})},U22=O.styled(O.Stack)(({theme:e})=>({backgroundColor:"#fff",border:`1px solid ${e.palette.grey[300]}`})),sGn=({children:e,...t})=>g.jsx(U22,{borderRadius:1,gap:3,padding:3,...t,children:e}),G22=O.styled(O.Box)(()=>({marginLeft:"4px",fontWeight:"fontWeightBold"})),Y22=O.styled(O.Button)(()=>({fontWeight:"fontWeightSemiBold"})),K22=O.styled(be)(({theme:e})=>({color:e.palette.primary.main})),X22=({selectedTitle:e,onSelect:t,options:n})=>{const a=zSn();return g.jsxs(g.Fragment,{children:[g.jsx(Y22,{disableRipple:!0,color:"inherit",onClick:a.onOpen,endIcon:g.jsx(K22,{icon:a.open?"CHEVRON_UP":"ARROW_DOWN_SIMPLE"}),children:g.jsx(G22,{component:"span",children:e.label})}),g.jsx(EUn,{open:a.open,onClose:a.onClose,children:n.map(r=>g.jsx(O.MenuItem,{selected:r.value===e.value,onClick:()=>{a.onClose(),t(r.value)},children:r.label},r.value))})]})},Q22=O.styled(O.Stack)({display:"grid",gridTemplateColumns:"auto auto"}),J22=O.styled(O.Typography)(({theme:e})=>({color:e.palette.grey[600]})),q22=O.styled(O.Typography)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]})),eu2=({data:e,...t})=>e.length===0?null:g.jsx(Q22,{gap:1,...t,children:e.map(n=>[g.jsx(J22,{variant:"body2",children:n.label},`label:${n.id}`),g.jsx(q22,{variant:"body2",children:n.value},`value:${n.id}`)])}),tu2=O.styled(O.Stack)(({theme:e})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${e.palette.grey[300]}`})),nu2=O.styled(O.Stack)(({theme:e})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${e.palette.grey[300]}`})),ru2=O.styled(O.Stack)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),au2=O.styled(O.Stack)(({theme:e})=>({height:"100%",width:"50%",flex:1,[e.breakpoints.down(1680)]:{width:"70%"}})),iu2=O.styled(O.Typography)(({theme:e})=>({color:e.palette.grey[800],fontSize:18,fontWeight:700})),ou2=O.styled(O.Typography)(({theme:e})=>({color:e.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),uu2=O.styled(O.Button)(({theme:e})=>({paddingTop:6,paddingBottom:6,paddingLeft:0,margin:0,marginBottom:4,marginTop:4,width:"100%",display:"block",cursor:"pointer",color:e.palette.grey[600],textAlign:"left",fontWeight:400,fontSize:14,"> span":{color:e.palette.error.main}})),cu2=O.styled(tmt)(()=>({height:1,"& .simplebar-content":{height:1}})),lu2=O.styled(O.Stack)(()=>({position:"fixed",width:"202px"})),fu2=({title:e,sections:t,headerLeftContent:n,headerRightContent:a,onClickBack:r})=>g.jsx(O.Stack,{children:g.jsxs(O.Stack,{direction:"row",children:[g.jsx(tu2,{children:g.jsx(cu2,{children:g.jsxs(lu2,{children:[g.jsx(O.Typography,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO RÁPIDO"}),t.map((u,c)=>g.jsxs(O.Stack,{children:[g.jsxs(uu2,{onClick:()=>{u.ref.current&&u.ref.current.scrollIntoView({block:"start",behavior:"smooth"})},children:[u.title,u.isRequired&&g.jsx("span",{children:"*"})]}),c<t.length-1&&g.jsx(O.Divider,{})]},c))]})})}),g.jsxs(O.Stack,{width:"100%",alignItems:"center",mb:8,children:[g.jsx(nu2,{children:g.jsxs(ru2,{children:[g.jsxs(O.Stack,{flexDirection:"row",gap:2,children:[g.jsx(O.IconButton,{color:"primary",onClick:()=>r(),children:g.jsx(be,{icon:"CHEVRON_LEFT"})}),g.jsx(O.Typography,{variant:"h4",children:e}),n]}),g.jsxs(O.Stack,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[g.jsx(hSn,{disabled:!0}),a]})]})}),g.jsx(au2,{children:t.map(u=>g.jsxs(O.Stack,{paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",children:[g.jsx(iu2,{ref:u.ref,children:u.title}),g.jsx(ou2,{children:u.subTitle}),g.jsx(sGn,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:u.child})]},u.title))})]})]})}),su2=O.styled(O.Box)(({theme:e})=>({padding:24,borderRadius:8,height:"auto",maxWidth:800,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.grey[300]}`})),du2=O.styled(O.Stack)(({theme:e})=>({minHeight:180,maxWidth:700,border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff",padding:24})),gu2=O.styled(O.Box)(()=>({maxWidth:70,maxHeight:40,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),_u2=O.styled(O.Box)(({theme:e})=>({backgroundColor:e.palette.background.default,maxWidth:90,maxHeight:80,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),dGn=O.styled(O.Stack)(({theme:e})=>({border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff"})),mu2=O.styled(O.Box)(({theme:e})=>({width:"auto",height:120,overflow:"hidden",padding:2,borderBottom:`4px dotted ${e.palette.grey[300]}`})),vu2=({titlePreview:e,logoImage:t,brandingName:n,url:a,title:r,description:u,keyWords:c,customTitles:l,productImage:f,child:s,previewLinkImage:d,hasPreviewLink:_})=>g.jsx(su2,{children:g.jsxs(O.Stack,{gap:3,display:"flex",flex:1,children:[g.jsx(O.Typography,{variant:"overline",color:"text.disabled",children:e??"PRÉ-VISUALIZAÇÃO"}),g.jsxs(du2,{children:[g.jsxs(O.Stack,{direction:"row",pb:3,gap:.5,children:[g.jsx(O.Box,{height:0,width:10,children:g.jsx(be,{icon:"CIRCLE",width:30,color:"error.main"})}),g.jsx(O.Box,{height:0,width:10,children:g.jsx(be,{icon:"CIRCLE",width:30,color:"warning.main"})}),g.jsx(O.Box,{height:0,width:10,children:g.jsx(be,{icon:"CIRCLE",width:30,color:"success.main"})})]}),g.jsxs(O.Stack,{flexDirection:"row",gap:2,justifyContent:"space-between",children:[g.jsxs(O.Stack,{gap:1,width:"100%",children:[g.jsxs(O.Stack,{direction:"row",gap:1.5,pb:.5,children:[t&&g.jsx(gu2,{children:g.jsx("img",{alt:"Logo",src:t})}),g.jsxs(O.Stack,{children:[g.jsx(O.Typography,{variant:"overline",color:"grey.600",pb:.5,children:n??"SUAEMPRESA"}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(O.Typography,{variant:"caption",color:"grey.600",children:a??"https://www.exemplo.com"}),g.jsx(be,{icon:"MORE_OPTIONS_VERTICAL",width:15,color:"grey.500"})]})]})]}),g.jsx(KO,{variant:"subtitle1",color:"#4E5BEC",overflow:"hidden",textOverflow:"ellipsis",line:5,children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),g.jsx(KO,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:5,children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),c&&g.jsx(O.Stack,{direction:"row",gap:1,alignItems:"center",children:c.map((m,v)=>g.jsxs(g.Fragment,{children:[g.jsx(O.Typography,{variant:"caption",color:"text.disabled",children:m}),v<c.length-1&&g.jsx(O.Box,{width:4,height:16,children:g.jsx(be,{icon:"CIRCLE",color:"text.disabled",width:10})})]}))}),l&&g.jsx(O.Stack,{pt:2,children:l.map((m,v)=>g.jsxs(O.Stack,{gap:1,children:[g.jsx(O.Typography,{variant:"subtitle1",color:"#4E5BEC",children:m.title}),g.jsx(KO,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:1,children:m.description??"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys stansince the 1500"})]},v))}),s]}),f&&g.jsx(_u2,{children:g.jsx("img",{alt:"ProductImage",src:f})})]})]}),_&&g.jsxs(O.Stack,{gap:3,display:"flex",flex:1,width:"100%",children:[g.jsx(O.Typography,{variant:"overline",color:"text.disabled",children:"pré-visualização link de compartilhamento".toUpperCase()}),g.jsxs(dGn,{children:[d&&g.jsx(mu2,{children:g.jsx("img",{alt:"PreviewLinkImage",src:d,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:8}})}),g.jsxs(O.Stack,{gap:.2,p:2,width:"100%",children:[g.jsx(O.Typography,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),g.jsx(O.Typography,{variant:"caption",color:"grey.600",children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),g.jsx(O.Typography,{variant:"caption",color:"grey.500",children:a??"https://www.exemplo.com"})]})]}),g.jsx(dGn,{children:g.jsxs(O.Stack,{direction:"row",gap:1,alignItems:"center",children:[g.jsx(O.Box,{width:100,height:95,bgcolor:"grey.100",p:.5,alignItems:"center",children:g.jsx("img",{alt:"Logo",src:t,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:8}})}),g.jsxs(O.Stack,{padding:1,gap:.2,width:"80%",children:[g.jsx(KO,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),g.jsx(KO,{variant:"caption",color:"grey.600",children:u??"A Páscoa chegou e a Sua Empresa está com ofertas chocantes em tecnologia! Descontos de até 50% em notebooks, smartphones, tablets e muito mais!"}),g.jsx(KO,{variant:"caption",color:"grey.500",line:1,children:a??"https://www.exemplo.com"})]})]})})]})]})}),hu2=O.styled(O.Stack)(({theme:e})=>({border:`1px solid ${O.alpha(e.palette.grey[500],.32)}`,borderRadius:8,alignItems:"center",overflow:"hidden"})),Cu2=O.styled(O.Stack)(()=>({backgroundColor:"#F5F5F5",padding:8,width:"100%",justifyContent:"space-between",alignItems:"center",gap:12,"& .MuiInputBase-root":{backgroundColor:"#fff"}}));O.styled(O.Stack)(({theme:e})=>({border:`1px solid ${O.alpha(e.palette.grey[500],.32)}`,borderRadius:8,alignItems:"center"}));const bu2=O.styled(O.Collapse)(()=>({width:"100%",padding:"12px 16px"})),yu2=({description:e,name:t,children:n,header:a,onDelete:r})=>{const[u,c]=kht(!0);return g.jsxs(hu2,{children:[g.jsxs(Cu2,{direction:"row",children:[g.jsxs(O.Stack,{direction:"row",alignItems:"center",gap:1.5,flex:1,children:[g.jsx(O.IconButton,{edge:"end",onClick:c,children:g.jsx(be,{icon:u?"CHEVRON_UP":"CHEVRON_RIGHT"})}),g.jsx(O.Typography,{variant:"overline",color:"text.primary",children:t}),g.jsx(O.Typography,{variant:"overline",color:"text.secondary",children:e}),g.jsx(O.Stack,{flex:1,children:a})]}),g.jsx(O.IconButton,{color:"error",onClick:r,children:g.jsx(be,{icon:"DELETE_MARK_BUTTON_02"})})]}),g.jsx(bu2,{in:u,timeout:"auto",unmountOnExit:!0,children:n})]})},pu2=O.styled(O.ToggleButtonGroup)(({theme:e})=>({button:{textTransform:"none"},"& .MuiToggleButton-primary:hover":{backgroundColor:`${e.palette.primary.dark}`,color:e.palette.primary.contrastText},"& button:not(.Mui-selected):hover":{backgroundColor:e.palette.primary.lighter,color:e.palette.primary.main},"& .Mui-selected":{backgroundColor:`${e.palette.primary.main} !important`,color:`${e.palette.primary.contrastText} !important`}})),Ou2=e=>g.jsx(pu2,{...e}),un=({name:e,helperText:t,rules:n,onChange:a,tabIndex:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:{ref:l,...f},fieldState:{error:s}})=>g.jsx(O.TextField,{...f,onChange:d=>{f.onChange(d),a&&a(d)},inputRef:l,fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...u,inputProps:{...u.inputProps,tabIndex:r}})})},gGn=({name:e,helperText:t,onChange:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,render:({field:c,fieldState:{error:l}})=>g.jsxs("div",{children:[g.jsx(O.FormControlLabel,{control:g.jsx(O.Switch,{...c,checked:c.value,onChange:(f,s)=>{c.onChange(f),n&&n(f,s)},inputProps:{tabIndex:a}}),...r}),(!!l||t)&&g.jsx(O.FormHelperText,{error:!!l,sx:f=>({mx:"14px",color:r.disabled?f.palette.grey[500]:void 0}),children:l?l==null?void 0:l.message:t})]})})},ju2=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],wu2=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],Mu2=O.styled(O.Stack)(({theme:e})=>({border:`1px solid ${O.alpha(e.palette.primary.main,.3)}`,backgroundColor:O.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),Lu2=O.styled(O.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),Pu2=O.styled(O.IconButton)(()=>({height:"38px",alignSelf:"center"})),Eu2=({webhookData:e,isEditing:t=!1,haveTip:n=!1})=>{const{control:a}=Ie.useFormContext(),{fields:r,append:u,remove:c}=Ie.useFieldArray({name:"headers",control:a}),l=()=>{u({value:"",name:""})};return g.jsxs(g.Fragment,{children:[n&&g.jsxs(Mu2,{children:[g.jsx(be,{icon:"INFO_CIRCLE"}),g.jsx(O.Typography,{variant:"caption",color:"text.secondary",children:"Webhooks permitem que serviços externos sejam notificados quando determinados eventos acontecem. Saiba mais acessando a documentação do Webhook"})]}),t&&g.jsx(un,{name:"name",label:"Nome do webhook"}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(un,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),g.jsx(un,{name:"filter",label:"Filtro"})]}),t&&e&&g.jsxs(g.Fragment,{children:[g.jsx(un,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(un,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),g.jsx(un,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:g.jsx(O.InputAdornment,{position:"end",children:g.jsx(Lu2,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:g.jsx(be,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),g.jsx(un,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsxs(O.Stack,{width:"35%",gap:2,children:[g.jsx(O.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),g.jsx(nWn,{name:"content_type",options:ju2,row:!0,decorated:!0})]}),g.jsxs(O.Stack,{gap:2,children:[g.jsx(O.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),g.jsx(nWn,{name:"http_method",options:wu2,row:!0,decorated:!0})]})]}),g.jsx(O.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),g.jsx(gGn,{name:"active",label:"Ativo"}),g.jsx(O.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((f,s)=>g.jsxs(O.Stack,{direction:"row",gap:2,children:[g.jsx(un,{name:`headers.${s}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),g.jsx(un,{name:`headers.${s}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),g.jsx(Pu2,{onClick:()=>c(s),color:"error",children:g.jsx(be,{icon:"DELETE_MARK_BUTTON_02"})})]},f.id)),g.jsx(ORn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>l(),children:"Adicionar novo cabeçalho"}),g.jsx(O.Divider,{})]})},_Gn=({name:e,helperText:t,rules:n,onSelectOption:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>g.jsx(_Sn,{...c,...r,onChange:f=>{a&&a(f,c.value),c.onChange(f)},error:!!l,helperText:(l==null?void 0:l.message)||t})})},mGn=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:{name:c,onChange:l,value:f,ref:s},fieldState:{error:d}})=>g.jsx(NBn,{ref:s,...r,name:c,value:f,error:!!d,helperText:(d==null?void 0:d.message)||t,onChange:({target:{value:_}})=>{a&&a(_),l(_)}})})},ku2=({name:e,containerProps:t,required:n,rules:a,tabIndex:r})=>{const u=`${e}.zipCode`,c=`${e}.publicPlace`,l=`${e}.number`,f=`${e}.district`,s=`${e}.complement`,d=`${e}.state`,_=`${e}.city`,m=v=>{v.key==="Enter"&&v.preventDefault()};return g.jsxs(O.Stack,{gap:1.5,...t,children:[g.jsxs(O.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[g.jsx(mGn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:g.jsx(O.InputAdornment,{position:"end",children:g.jsx(O.CircularProgress,{size:24})})},rules:a,onKeyDown:m,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),g.jsxs(O.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[g.jsx(un,{name:c,label:"Logradouro",onKeyDown:m,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),g.jsx(un,{name:l,label:"Número",onKeyDown:m,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),g.jsxs(O.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[g.jsx(un,{name:f,label:"Bairro",onKeyDown:m,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),g.jsx(un,{name:s,label:"Complemento",onKeyDown:m,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:r})]}),g.jsxs(O.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[g.jsx(_Gn,{name:d,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),g.jsx(un,{name:_,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},Su2=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:r,rules:t,render:({field:u,fieldState:{error:c}})=>g.jsx(vSn,{...u,...a,onChange:l=>{u.onChange(l)},error:!!c,helperText:(c==null?void 0:c.message)||n})})},Du2=({name:e,rules:t,helperText:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,rules:t,render:({field:c,fieldState:{error:l}})=>g.jsxs("div",{children:[g.jsx(O.FormControlLabel,{control:g.jsx(O.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!l||n)&&g.jsx(O.FormHelperText,{error:!!l,children:l?l==null?void 0:l.message:n})]})})},Bu2=({row:e,name:t,rules:n,label:a,options:r,spacing:u,helperText:c,required:l,...f})=>{const{control:s}=Ie.useFormContext(),d=(_,m)=>_.includes(m)?_.filter(v=>v!==m):[..._,m];return g.jsx(Ie.Controller,{name:t,control:s,rules:n,render:({field:{value:_=[],...m},fieldState:{error:v}})=>g.jsxs(O.FormControl,{component:"fieldset",children:[a&&g.jsx(O.FormLabel,{component:"legend",sx:{typography:"body2"},required:l,children:a}),g.jsx(O.FormGroup,{sx:{...e&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:u||0},...e&&{mr:0,"&:not(:last-of-type)":{mr:u||2}}}},children:r.map(C=>g.jsx(O.FormControlLabel,{control:g.jsx(O.Checkbox,{checked:_.includes(C.value),onChange:()=>m.onChange(d(_,C.value))}),label:C.label,...f},C.value))}),(!!v||c)&&g.jsx(O.FormHelperText,{error:!!v,sx:C=>({color:f.disabled?C.palette.grey[500]:void 0}),children:v?v==null?void 0:v.message:c})]})})},Wu2=({keyName:e,inputs:t=[],rules:n,tabIndex:a,...r})=>{const u=o.useRef(null),{control:c,setValue:l,formState:{errors:f}}=Ie.useFormContext(),s=m=>{const v=m.clipboardData.getData("text").split("");t.map((C,h)=>l(C,v[h])),m.preventDefault()},d=(m,v)=>{const{maxLength:C,value:h,name:b}=m.target,p=b.replace(e,""),y=Number(p),w=document.querySelector(`input[name=${e}${y+1}]`);h.length>C&&(m.target.value=h[0]),h.length>=C&&y<6&&w!==null&&w.focus(),v(m)};D_t("paste",s,u);const _=t.some(m=>f[m]);return g.jsxs(O.Stack,{children:[g.jsx(O.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:u,children:t.map((m,v)=>g.jsx(Ie.Controller,{name:`${e}${v+1}`,control:c,rules:n,render:({field:C,fieldState:{error:h}})=>g.jsx(O.TextField,{...r,...C,autoComplete:"none",error:!!h,autoFocus:v===0,placeholder:"-",onChange:b=>{d(b,C.onChange)},onFocus:b=>b.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:a}})},m))}),_&&g.jsx(O.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},Iu2=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:r,rules:{...t,validate:{...t==null?void 0:t.validate,validation:u=>{const c="#"+u.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(c)?!0:"Cor inválida"}}},render:({field:{ref:u,onChange:c,...l},fieldState:{error:f}})=>g.jsx(HNn,{...l,onChangeColor:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||n,...a})})},$u2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return g.jsx(wT.DatePicker,{inputRef:l,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},xu2=({name:e,label:t,rules:n,tabIndex:a,helperText:r,required:u,...c})=>{const{control:l,setError:f}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:l,rules:n,render:({field:{value:s,onChange:d},fieldState:{error:_}})=>g.jsx(wT.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...c.localeText},value:[(s==null?void 0:s.startDate)||null,(s==null?void 0:s.endDate)||null],onChange:m=>d({startDate:m[0],endDate:m[1]}),onError:m=>{f(e,{message:m[0]||m[1]||void 0})},...c,slotProps:{textField:({position:m})=>{var v;return{...(v=c.slotProps)==null?void 0:v.textField,required:u,error:!!_,helperText:(_==null?void 0:_.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:m==="start"?`${t} (Dt. Início)`:`${t} (Dt. Fim)`,inputProps:{tabIndex:a}}}},sx:{width:1}})})},zu2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return g.jsx(wT.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:l,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Hu2=({id:e,children:t,onSubmit:n,methods:a,...r})=>g.jsx(Ie.FormProvider,{...a,children:g.jsx(O.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),Au2=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{ref:u,value:c,...l},fieldState:{error:f}})=>g.jsx(ABn,{value:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||t,...a,...l,name:e})})},Ru2=({name:e,label:t="",rules:n,helperText:a,changed:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:l,fieldState:{error:f}})=>g.jsx(O.Autocomplete,{...l,onChange:(s,d)=>{r&&r(d),l.onChange(d)},renderInput:s=>g.jsx(O.TextField,{label:t,error:!!f,helperText:f?f==null?void 0:f.message:a,...s}),...u})})},Vu2=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>g.jsx(ECt,{...c,onChange:f=>{c.onChange(f),a&&a(f)},fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...r})})},Fu2=({name:e,sx:t,rules:n,passwordSize:a,specialCharacter:r,upperCaseChar:u,numberChar:c,showErrorMessage:l,match:f,...s})=>{const{watch:d}=Ie.useFormContext(),_=d(e),[m,v]=o.useState(!1),{hasNumberChar:C,hasSpecialCharacter:h,hasUpperCaseChar:b,isLengthValid:p}=WCt(_,a,c,r,u);return g.jsx(un,{...s,name:e,type:m?"text":"password",InputProps:{endAdornment:g.jsx(O.InputAdornment,{position:"end",children:g.jsx(O.IconButton,{onClick:()=>v(!m),edge:"end","aria-label":"Mostrar/Ocultar senha",children:g.jsx(be,{icon:m?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const w=WCt(y,a,c,r,u);return!w.hasNumberChar||!w.hasSpecialCharacter||!w.hasUpperCaseChar||!w.isLengthValid?"Senha inválida":f&&f.fieldPassword&&d(f.fieldPassword)!==y?"As senhas devem ser iguais":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:(!h||!b||!p||!C)&&!l?"none":void 0}}})},nWn=({name:e,rules:t,row:n,label:a,options:r,spacing:u,helperText:c,decorated:l,onChange:f,tabIndex:s,required:d,disabled:_,...m})=>{const{control:v}=Ie.useFormContext(),C=a?`${e}-${a}`:"";return g.jsx(Ie.Controller,{name:e,control:v,rules:t,render:({field:h,fieldState:{error:b}})=>g.jsxs(O.FormControl,{component:"fieldset",sx:{...l&&{paddingLeft:1.5}},children:[a&&g.jsx(O.FormLabel,{component:"legend",id:C,sx:{typography:"body2"},required:d,children:a}),g.jsx(O.RadioGroup,{...m,...h,onChange:(p,y)=>{h.onChange(p),f&&f(p,y)},"aria-labelledby":C,row:n,children:r.map(p=>g.jsx(O.FormControlLabel,{value:p.value,control:g.jsx(O.Radio,{inputProps:{tabIndex:s},disabled:_,checked:p.value===h.value}),label:p.label,sx:({palette:y})=>({"&:not(:last-of-type)":{mb:u||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:u||2}},...l&&{border:`1px solid ${O.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:O.alpha(y.primary.main,.05)}}})},p.value))}),(!!b||c)&&g.jsx(O.FormHelperText,{error:!!b,sx:p=>({color:_?p.palette.grey[500]:void 0}),children:b?b==null?void 0:b.message:c})]})})},Nu2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return g.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return g.jsx(wT.TimePicker,{ampm:!1,format:"HH:mm",inputRef:l,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,error:!!s,required:r,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Tu2=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,label:r,image:u="",uploading:c,file:l,tabIndex:f,...s})=>{const{id:d,setCropModalOpen:_,handleRemove:m,cropModalOpen:v,cancelChanges:C,saveChanges:h,previewImage:b,setCropper:p,preview:y,closePreviewImage:w}=cGn({onFileCropped:e,onImageUploaded:t,onCancel:n});return g.jsxs(g.Fragment,{children:[g.jsxs(O.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[c&&g.jsx(Z22,{}),g.jsx(uGn,{...s,id:d,file:l,onDrop:E=>{if(E.length>0){_(!0);const M=new FileReader;M.addEventListener("load",()=>{var k;const j=((k=M.result)==null?void 0:k.toString())||"";t(j),e(void 0)}),M.readAsDataURL(E[0])}},image:u,tabIndex:f})]}),g.jsx(lGn,{id:d,open:v,onClose:C,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:h,onPreview:b,onInitialized:p}),g.jsx(O.Dialog,{open:!!y,onClose:w,scroll:"body",PaperProps:{sx:{p:2}},children:y&&g.jsx("img",{src:y,alt:"Preview"})})]})};function vGn(e,t){const{watch:n,setValue:a}=Ie.useFormContext(),[r,u]=o.useState(t),c=n(e)||[];return{uploadFile:async m=>{if(!m){a(e,void 0),u(void 0);return}a(e,m),u(Object.assign(m,{preview:URL.createObjectURL(m)}))},uploadFiles:async m=>{a(e,[...c,...m.map(v=>Object.assign(v,{preview:URL.createObjectURL(v)}))])},handleDeleteFile:()=>{a(e,void 0),u(void 0)},handleRemoveAll:()=>{a(e,void 0)},handleRemove:m=>{const v=c.filter(C=>C!==m);a(e,v)},file:r,setFileValue:u}}const Zu2=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:l,onCancel:f,...s})=>{const{control:d}=Ie.useFormContext(),{uploadFile:_,file:m,setFileValue:v}=vGn(e);return g.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>g.jsx(Tu2,{accept:{"image/*":[]},file:C?m:void 0,onFileCropped:b=>{_(b),c&&c(b)},onImageUploaded:l,onCancel:()=>{v(void 0),f&&f()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&g.jsx(O.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},Uu2=({name:e,rules:t,helperText:n,aspect:a,label:r,image:u,onFileCropped:c,onImageUploaded:l,onCancel:f,...s})=>{const{control:d}=Ie.useFormContext(),{uploadFile:_,file:m,setFileValue:v}=vGn(e);return g.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>g.jsx(fGn,{accept:{"image/*":[]},file:C?m:void 0,onFileCropped:b=>{_(b),c&&c(b)},onImageUploaded:l,onCancel:()=>{v(void 0),f&&f()},error:!!h,disableMultiple:!0,helperText:(!!h||n)&&g.jsx(O.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},hGn=O.styled(O.Button)(({theme:e})=>({borderColor:e.palette.grey[300]})),CGn=O.styled(O.Box)(({theme:e})=>({border:"1.5px solid",borderColor:e.palette.grey[300],height:450,width:"40%",borderRadius:8})),Gu2=({selectedItems:e,items:t,loading:n,searchText:a,onAdd:r,onRemove:u,search:c,itemsTitle:l,selectedItemsTitle:f,additionalContent:s,enableSearchInSelectedItems:d,onSearch:_})=>{const[m,v]=o.useState(""),C=O.debounce(_,400),h=t.filter(W=>!e.some(z=>z.id===W.id)),b=e.filter(W=>{var z;return(z=W.name)==null?void 0:z.toLowerCase().includes(m.toLowerCase())}),p=d?b:t.filter(W=>e.some(z=>z.id===W.id)),[y,w]=o.useState([]),[E,M]=o.useState([]),j=()=>{r(y),w([])},k=()=>{u(E),M([])},D=W=>{M(W?p:[])},S=W=>{w(W?h:[])},B=(W,z)=>{M(z?T=>[...T,W]:T=>T.filter(A=>A.id!==W.id))},H=(W,z)=>{w(z?T=>[...T,W]:T=>T.filter(A=>A.id!==W.id))},F=W=>{W.key==="Enter"&&W.preventDefault()};return g.jsx(O.Stack,{children:g.jsxs(O.Stack,{direction:"row",alignItems:"center",gap:3,children:[g.jsx(CGn,{display:"flex",flex:1,children:g.jsxs(O.Stack,{flex:1,children:[g.jsxs(O.Stack,{direction:"row",gap:1,padding:2,children:[g.jsx(O.Checkbox,{size:"small",indeterminate:y.length>0&&y.length!==h.length,checked:y.length>0&&y.length===h.length,onChange:W=>S(W.target.checked)}),g.jsxs(O.Stack,{children:[g.jsx(O.Typography,{variant:"subtitle2",color:"text.primary",children:`${l} cadastrados(as)`}),g.jsx(O.Typography,{variant:"caption",color:"text.disabled",children:`${y.length}/${h.length} selecionados`})]})]}),g.jsx(O.Divider,{}),g.jsxs(O.Stack,{p:2,flex:1,children:[g.jsxs(O.Stack,{direction:"row",gap:1,children:[g.jsx(GBn,{iconPosition:"start",placeholder:"Buscar",onKeyDown:F,size:"small",fullWidth:!0,trigger:"change",onSearch:W=>C(W)}),s]}),g.jsx(TBn,{isLoading:n,loading:g.jsx(O.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:g.jsx(O.CircularProgress,{})}),isEmpty:h.length===0,empty:g.jsx(_Ct,{text:c?`Nenhum ${a} encontrado`:`Nenhum ${a} disponível`,sx:{svg:{height:140}}}),children:g.jsx(tmt,{sx:{maxHeight:280},children:h.map(W=>g.jsxs(O.Stack,{gap:1,marginTop:"8px",children:[g.jsxs(O.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[g.jsx(O.Checkbox,{size:"small",checked:y.includes(W),onChange:z=>H(W,z.target.checked)}),W.label]}),g.jsx(O.Divider,{})]},W.id))})})]})]})}),g.jsxs(O.Stack,{gap:3,children:[g.jsx(hGn,{variant:"outlined",onClick:j,children:g.jsx(be,{icon:"ARROW_RIGHT_SIMPLE"})}),g.jsx(hGn,{variant:"outlined",onClick:k,children:g.jsx(be,{icon:"ARROW_LEFT_SIMPLE"})})]}),g.jsx(CGn,{display:"flex",flex:1,children:g.jsxs(O.Stack,{flex:1,children:[g.jsxs(O.Stack,{direction:"row",gap:1,padding:2,children:[g.jsx(O.Checkbox,{size:"small",indeterminate:E.length>0&&E.length!==p.length,checked:E.length>0&&E.length===p.length,onChange:W=>D(W.target.checked)}),g.jsxs(O.Stack,{children:[g.jsx(O.Typography,{variant:"subtitle2",color:"text.primary",children:`${f} selecionados(as)`}),g.jsx(O.Typography,{variant:"caption",color:"text.disabled",children:`${E.length}/${p.length} selecionados`})]})]}),g.jsx(O.Divider,{}),g.jsxs(O.Stack,{p:2,gap:1,children:[d&&g.jsx(GBn,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:W=>v(W??""),onKeyDown:F}),g.jsx(TBn,{isLoading:n,loading:g.jsx(O.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:g.jsx(O.CircularProgress,{})}),isEmpty:p.length===0,empty:g.jsx(_Ct,{text:m?`Nenhum ${a} encontrado`:`Nenhum ${a} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:g.jsx(tmt,{sx:{maxHeight:280},children:p.map(W=>g.jsxs(O.Stack,{gap:1,children:[g.jsxs(O.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[g.jsx(O.Checkbox,{size:"small",checked:E.includes(W),onChange:z=>B(W,z.target.checked)}),W.label]}),g.jsx(O.Divider,{})]},W.id))})})]})]})})]})})},Yu2=Object.freeze(Object.defineProperty({__proto__:null,default:qer},Symbol.toStringTag,{value:"Module"}));R.ActionButton=ORn,R.Address=ku2,R.Autocomplete=_Sn,R.AutocompleteDetailed=vSn,R.AutocompleteDetailedField=Su2,R.AutocompleteField=_Gn,R.BuilderLayout=BDo,R.BuilderSidebar=cHo,R.Carousel=HEo,R.CarouselArrowIndex=tko,R.CarouselArrows=NEo,R.CarouselDots=FEo,R.Checkbox=Du2,R.Codes=Wu2,R.ColorPickerField=Iu2,R.ColorPickerInput=HNn,R.Common=pr2,R.CommonSSR=jr2,R.Confirm=wr2,R.CustomAvatar=mSn,R.CustomAvatarGroup=$Rn,R.DataGrid=Pr2,R.DatePicker=$u2,R.DateRangePicker=xu2,R.DateTimePicker=zu2,R.Delayed=Er2,R.DialogAnimate=Mtr,R.Drawer=Ar2,R.EmptyContent=tAn,R.EmptyView=_Ct,R.Error=Vr2,R.ExpandableGroup=yu2,R.FabButtonAnimate=izn,R.Field=un,R.FixedProgressBar=gCt,R.Form=Hu2,R.FrameSkeleton=fu2,R.HelpButton=hSn,R.Icon=be,R.IconButtonAnimate=ozn,R.Iconify=MZn,R.IllustrationEmptyContent=LIn,R.ImageCrop=aUn,R.Incrementer=ABn,R.IncrementerField=Au2,R.Label=CUn,R.Lightbox=rDo,R.LoadingScreen=mi2,R.MaskedInput=NBn,R.MaskedInputField=mGn,R.MaterialDesignContent=$yt,R.MenuPopover=EUn,R.Modal=kUn,R.ModalActions=xi2,R.MotionContainer=Atr,R.MotionLazyContainer=Lyt,R.MotionViewport=Htr,R.MultiCheckbox=Bu2,R.MultipleChipField=Ru2,R.NoData=PIn,R.NumberInput=ECt,R.NumberInputField=Vu2,R.PasswordField=Fu2,R.PasswordRules=Fi2,R.PopoverSelect=X22,R.Portal=SUn,R.RadioGroupField=nWn,R.Result=TBn,R.SavedChanges=fo2,R.Scrollbar=tmt,R.SearchInput=GBn,R.SeoPreview=vu2,R.SnackbarContent=Iyt,R.SnackbarProvider=Wzn,R.SplashScreen=so2,R.Steps=_o2,R.StyledTab=mo2,R.StyledTabs=vo2,R.Summary=eu2,R.SwapList=Gu2,R.Switch=gGn,R.TRANSITION=EIn,R.TabPanel=ho2,R.TableEmptyRows=cko,R.TableHeadCustom=fko,R.TableNoData=oko,R.TablePaginationCustom=dko,R.TableSelectedAction=sko,R.TableSkeleton=uko,R.TextAnimate=Ltr,R.TextMaxLine=KO,R.ThemeProvider=zTn,R.TimePicker=Nu2,R.ToggleButtonGroup=Ou2,R.Transition=Wvt,R.Upload=oGn,R.UploadAvatar=uGn,R.UploadAvatarWithCropField=Zu2,R.UploadBox=F22,R.UploadIllustration=MIn,R.UploadWithCrop=fGn,R.UploadWithCropField=Uu2,R.Webhook=Eu2,R.WhiteBox=sGn,R.color=en2,R.compare=Uzo,R.cssStyles=qEo,R.emptyRows=nko,R.file=Ni2,R.formatNumber=Na2,R.formatTime=to2,R.getComparator=rko,R.loadable=lo2,R.mask=uo2,R.number=za2,R.routes=ro2,R.sort=oo2,R.useActiveElement=WDo,R.useApiMessage=tHo,R.useCarousel=AEo,R.useCopyToClipboard=IDo,R.useDatagrid=$Do,R.useDeepCompareEffect=Yzo,R.useEventCallback=HSn,R.useEventListener=D_t,R.useIsMounting=Xzo,R.useIsomorphicLayoutEffect=WVn,R.useLightBox=oDo,R.useLocalStorage=aHo,R.useOffSetTop=eHo,R.useOnClickOutside=qzo,R.usePagination=Jzo,R.usePopover=zSn,R.useResponsive=Myt,R.useSnackbar=Izn,R.useTable=ako,R.useTabs=Qzo,R.useToggle=kht,R.uuidv4=co2,R.validators=Ai2,R.varBgColor=FXn,R.varBgKenburns=NXn,R.varBgPan=TXn,R.varBounce=AXn,R.varContainer=avt,R.varFade=fle,R.varFlip=xXn,R.varHover=VXn,R.varPath=WXn,R.varRotate=RXn,R.varScale=HXn,R.varSlide=zXn,R.varTranEnter=$e,R.varTranExit=Ne,R.varTranHover=IXn,R.varZoom=$Xn,Object.defineProperty(R,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.4.14",
4
+ "version": "1.4.15",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",