@zydon/common 1.3.74 → 1.3.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Filters/ListingRules/index.d.ts.map +1 -1
- package/dist/components/Filters/ManualRule/index.d.ts +1 -1
- package/dist/components/Filters/ManualRule/index.d.ts.map +1 -1
- package/dist/components/Filters/ManualRule/props.d.ts +1 -0
- package/dist/components/Filters/ManualRule/props.d.ts.map +1 -1
- package/dist/{features-1d45c351.js → features-51ef2e00.js} +1 -1
- package/dist/{index-cbf51acf.js → index-356425f9.js} +25 -19
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ListingRules/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAO1E,QAAA,MAAM,YAAY,cAAe,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ListingRules/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAO1E,QAAA,MAAM,YAAY,cAAe,iBAAiB,4CAkDjD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ManualRuleProps } from '../../../components/Filters/ManualRule/props';
|
|
2
|
-
declare const ManualRule: ({ columns, rows, loading }: ManualRuleProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const ManualRule: ({ columns, rows, loading, totalRows }: ManualRuleProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default ManualRule;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ManualRule/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAK1E,QAAA,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ManualRule/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAK1E,QAAA,MAAM,UAAU,0CAA0C,eAAe,4CAqExE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ManualRule/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/Filters/ManualRule/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -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-
|
|
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-356425f9.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 klu = ({
|
|
|
7751
7751
|
...a,
|
|
7752
7752
|
children: n
|
|
7753
7753
|
}
|
|
7754
|
-
), qr1 = () => import("./features-
|
|
7754
|
+
), qr1 = () => import("./features-51ef2e00.js").then((e) => e.default), JHn = ({ children: e }) => /* @__PURE__ */ d.jsx(ur1, { strict: !0, features: qr1, children: /* @__PURE__ */ d.jsxs(Vn.div, { style: { height: "100%" }, children: [
|
|
7755
7755
|
" ",
|
|
7756
7756
|
e,
|
|
7757
7757
|
" "
|
|
@@ -278366,49 +278366,55 @@ const OTn = ({ fileRejections: e }) => e.length ? /* @__PURE__ */ d.jsx(
|
|
|
278366
278366
|
},
|
|
278367
278367
|
L
|
|
278368
278368
|
)) });
|
|
278369
|
-
}, R5u = ({ columns: e, rows: t, loading: n }) => {
|
|
278370
|
-
const { apiRef:
|
|
278369
|
+
}, R5u = ({ columns: e, rows: t, loading: n, totalRows: a }) => {
|
|
278370
|
+
const { apiRef: r, page: u, perPage: c, handlePaginationModelChange: l } = pW2(), { setValue: f, reset: s, watch: g } = Wt(), _ = g("name");
|
|
278371
278371
|
at(() => () => {
|
|
278372
|
-
|
|
278373
|
-
name:
|
|
278372
|
+
s({
|
|
278373
|
+
name: _,
|
|
278374
278374
|
config: {}
|
|
278375
278375
|
});
|
|
278376
|
-
}, [
|
|
278377
|
-
const [
|
|
278378
|
-
|
|
278379
|
-
},
|
|
278380
|
-
const
|
|
278381
|
-
return t.filter((
|
|
278376
|
+
}, [s]);
|
|
278377
|
+
const [m, v] = xe([]), [C, h] = xe(), b = (y) => {
|
|
278378
|
+
v(y), f("config.products.values", { type: "FIELD", ...y });
|
|
278379
|
+
}, p = () => {
|
|
278380
|
+
const y = C == null ? void 0 : C.toLowerCase();
|
|
278381
|
+
return t.filter((L) => Object.values(L).some((P) => typeof P == "string" || P instanceof String ? P.toLowerCase().includes(y || "") : !1));
|
|
278382
278382
|
};
|
|
278383
278383
|
return /* @__PURE__ */ d.jsxs(T, { gap: 2, children: [
|
|
278384
278384
|
/* @__PURE__ */ d.jsxs(T, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
278385
278385
|
/* @__PURE__ */ d.jsx(
|
|
278386
278386
|
aht,
|
|
278387
278387
|
{
|
|
278388
|
-
onSearch: (
|
|
278389
|
-
onChange: (
|
|
278388
|
+
onSearch: (y) => h(y),
|
|
278389
|
+
onChange: (y) => h(y.target.value),
|
|
278390
278390
|
iconPosition: "start",
|
|
278391
278391
|
size: "small",
|
|
278392
278392
|
placeholder: "Buscar"
|
|
278393
278393
|
}
|
|
278394
278394
|
),
|
|
278395
278395
|
/* @__PURE__ */ d.jsxs(we, { variant: "body1", color: "text.disabled", children: [
|
|
278396
|
-
|
|
278396
|
+
m.length,
|
|
278397
278397
|
" selecionados"
|
|
278398
278398
|
] })
|
|
278399
278399
|
] }),
|
|
278400
278400
|
/* @__PURE__ */ d.jsx(
|
|
278401
278401
|
uau,
|
|
278402
278402
|
{
|
|
278403
|
-
apiRef:
|
|
278403
|
+
apiRef: r,
|
|
278404
278404
|
columns: e,
|
|
278405
|
-
rows:
|
|
278405
|
+
rows: p(),
|
|
278406
278406
|
pagination: !0,
|
|
278407
|
-
paginationModel: { page:
|
|
278407
|
+
paginationModel: { page: u, pageSize: c },
|
|
278408
|
+
rowCount: a,
|
|
278409
|
+
paginationMode: "server",
|
|
278410
|
+
onPaginationModelChange: l,
|
|
278411
|
+
initialState: {
|
|
278412
|
+
pagination: { paginationModel: { pageSize: 5, page: u } }
|
|
278413
|
+
},
|
|
278408
278414
|
loading: n,
|
|
278409
278415
|
fetching: n,
|
|
278410
278416
|
checkboxSelection: !0,
|
|
278411
|
-
onRowSelectionModelChange:
|
|
278417
|
+
onRowSelectionModelChange: b
|
|
278412
278418
|
}
|
|
278413
278419
|
)
|
|
278414
278420
|
] });
|
|
@@ -278430,7 +278436,7 @@ const OTn = ({ fileRejections: e }) => e.length ? /* @__PURE__ */ d.jsx(
|
|
|
278430
278436
|
e && e.length > 0 && n(e[0].value);
|
|
278431
278437
|
}, []);
|
|
278432
278438
|
const a = (r, u) => {
|
|
278433
|
-
n(u);
|
|
278439
|
+
u !== null && n(u);
|
|
278434
278440
|
};
|
|
278435
278441
|
return /* @__PURE__ */ d.jsxs(T, { gap: 2, children: [
|
|
278436
278442
|
/* @__PURE__ */ d.jsx(sn, { name: "name", label: "Nome da regra" }),
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as u, b4 as p, ae as m, b5 as d, af as C, ag as v, bV as S, bZ as T, bY as g, bX as k, b6 as P, b8 as A, b9 as F, ah as I, ai as h, aj as M, ak as x, al as y, am as B, an as w, ba as D, bb as R, bc as f, ao as E, bq as L, ap as N, aq as U, ar as W, as as H, bs as O, bd as G, b0 as q, at as V, be as j, a_ as z, au as K, av as Z, bt as J, aw as Q, a9 as X, ax as Y, ay as _, bf as $, az as aa, ab as sa, b2 as ea, aA as oa, b1 as ra, aB as ta, bg as ia, bO as ba, aC as na, aD as la, aE as ca, bv as ua, bw as pa, bu as ma, b7 as da, bh as Ca, aa as va, aF as Sa, bi as Ta, bj as ga, aG as ka, aY as Pa, aH as Aa, bk as Fa, aI as Ia, aJ as ha, aK as Ma, aL as xa, a$ as ya, bP as Ba, bQ as wa, aM as Da, aN as Ra, aO as fa, aP as Ea, aZ as La, bp as Na, bl as Ua, bx as Wa, aQ as Ha, c1 as Oa, c2 as Ga, b$ as qa, c4 as Va, c3 as ja, c0 as za, br as Ka, aR as Za, aS as Ja, bm as Qa, bR as Xa, aT as Ya, aU as _a, bn as $a, aV as as, a8 as ss, aW as es, bo as os, b3 as rs, aX as ts, bS as is, cu as bs, cv as ns, co as ls, c5 as cs, bT as us, cl as ps, cm as ms, cn as ds, c6 as Cs, cx as vs, ct as Ss, cs as Ts, cp as gs, cq as ks, c7 as Ps, ck as As, bW as Fs, c8 as Is, c9 as hs, ca as Ms, cb as xs, cc as ys, ac as Bs, ci as ws, ch as Ds, cg as Rs, cj as fs, cd as Es, bU as Ls, b_ as Ns, ce as Us, cf as Ws, cw as Hs, cr as Os, bL as Gs, bM as qs, bN as Vs, bE as js, bH as zs, bz as Ks, bB as Zs, bG as Js, by as Qs, bF as Xs, bD as Ys, bC as _s, bJ as $s, bK as ae, bI as se, bA as ee } from "./index-
|
|
1
|
+
import { ad as u, b4 as p, ae as m, b5 as d, af as C, ag as v, bV as S, bZ as T, bY as g, bX as k, b6 as P, b8 as A, b9 as F, ah as I, ai as h, aj as M, ak as x, al as y, am as B, an as w, ba as D, bb as R, bc as f, ao as E, bq as L, ap as N, aq as U, ar as W, as as H, bs as O, bd as G, b0 as q, at as V, be as j, a_ as z, au as K, av as Z, bt as J, aw as Q, a9 as X, ax as Y, ay as _, bf as $, az as aa, ab as sa, b2 as ea, aA as oa, b1 as ra, aB as ta, bg as ia, bO as ba, aC as na, aD as la, aE as ca, bv as ua, bw as pa, bu as ma, b7 as da, bh as Ca, aa as va, aF as Sa, bi as Ta, bj as ga, aG as ka, aY as Pa, aH as Aa, bk as Fa, aI as Ia, aJ as ha, aK as Ma, aL as xa, a$ as ya, bP as Ba, bQ as wa, aM as Da, aN as Ra, aO as fa, aP as Ea, aZ as La, bp as Na, bl as Ua, bx as Wa, aQ as Ha, c1 as Oa, c2 as Ga, b$ as qa, c4 as Va, c3 as ja, c0 as za, br as Ka, aR as Za, aS as Ja, bm as Qa, bR as Xa, aT as Ya, aU as _a, bn as $a, aV as as, a8 as ss, aW as es, bo as os, b3 as rs, aX as ts, bS as is, cu as bs, cv as ns, co as ls, c5 as cs, bT as us, cl as ps, cm as ms, cn as ds, c6 as Cs, cx as vs, ct as Ss, cs as Ts, cp as gs, cq as ks, c7 as Ps, ck as As, bW as Fs, c8 as Is, c9 as hs, ca as Ms, cb as xs, cc as ys, ac as Bs, ci as ws, ch as Ds, cg as Rs, cj as fs, cd as Es, bU as Ls, b_ as Ns, ce as Us, cf as Ws, cw as Hs, cr as Os, bL as Gs, bM as qs, bN as Vs, bE as js, bH as zs, bz as Ks, bB as Zs, bG as Js, by as Qs, bF as Xs, bD as Ys, bC as _s, bJ as $s, bK as ae, bI as se, bA as ee } from "./index-356425f9.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "@emotion/react";
|
package/dist/index.umd.cjs
CHANGED
|
@@ -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 xo2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zo2(e){if(Array.isArray(e))return GBn(e)}function zUn(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 HUn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zUn(Object(n),!0).forEach(function(a){AUn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zUn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function AUn(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 Ro2(e)||Ao2(e,t)||RUn(e,t)||Ho2()}function Ho2(){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 RUn(e,t){if(e){if(typeof e=="string")return GBn(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 GBn(e,t)}}function GBn(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 Ao2(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 Ro2(e){if(Array.isArray(e))return e}var Vo2="file-invalid-type",Fo2="file-too-large",No2="file-too-small",To2="too-many-files",Zo2=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:Vo2,message:"File type must be ".concat(n)}},VUn=function(t){return{code:Fo2,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},FUn=function(t){return{code:No2,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Uo2={code:To2,message:"Too many files"};function NUn(e,t){var n=e.type==="application/x-moz-file"||Io2(e,t);return[n,n?null:Zo2(t)]}function TUn(e,t,n){if(CT(e.size))if(CT(t)&&CT(n)){if(e.size>n)return[!1,VUn(n)];if(e.size<t)return[!1,FUn(t)]}else{if(CT(t)&&e.size<t)return[!1,FUn(t)];if(CT(n)&&e.size>n)return[!1,VUn(n)]}return[!0,null]}function CT(e){return e!=null}function Go2(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=NUn(f,n),d=Omt(s,1),_=d[0],m=TUn(f,a,r),v=Omt(m,1),C=v[0],h=l?l(f):null;return _&&C&&!h})}function $Ct(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function xCt(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 ZUn(e){e.preventDefault()}function Yo2(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Ko2(e){return e.indexOf("Edge/")!==-1}function Xo2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Yo2(e)||Ko2(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!$Ct(a)&&l&&l.apply(void 0,[a].concat(u)),$Ct(a)})}}function Qo2(){return"showOpenFilePicker"in window}function Jo2(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 UUn(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(GUn))&&(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 HUn(HUn({},n),{},AUn({},u,c))},{});return[{description:"Files",accept:t}]}return e}function qo2(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(xUn(t),[r],xUn(u))},[]).filter(function(t){return UUn(t)||GUn(t)}).join(",")}function e22(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function t22(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function UUn(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function GUn(e){return/^.*\.[\w]+$/.test(e)}var n22=["children"],r22=["open"],a22=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],i22=["refKey","onChange","onClick"];function o22(e){return l22(e)||c22(e)||YUn(e)||u22()}function u22(){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 c22(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l22(e){if(Array.isArray(e))return KBn(e)}function YBn(e,t){return d22(e)||s22(e,t)||YUn(e,t)||f22()}function f22(){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 YUn(e,t){if(e){if(typeof e=="string")return KBn(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 KBn(e,t)}}function KBn(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 s22(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 d22(e){if(Array.isArray(e))return e}function KUn(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 Et(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KUn(Object(n),!0).forEach(function(a){XBn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KUn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function XBn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zCt(e,t){if(e==null)return{};var n=g22(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 g22(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 QBn=o.forwardRef(function(e,t){var n=e.children,a=zCt(e,n22),r=HCt(a),u=r.open,c=zCt(r,r22);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(Et(Et({},c),{},{open:u})))});QBn.displayName="Dropzone";var XUn={disabled:!1,getFilesFromEvent:Mo2,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};QBn.defaultProps=XUn,QBn.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 JBn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function HCt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Et(Et({},XUn),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,O=t.preventDropOnDocument,E=t.noClick,w=t.noKeyboard,M=t.noDrag,k=t.noDragEventsBubbling,D=t.onError,S=t.validator,B=o.useMemo(function(){return qo2(n)},[n]),H=o.useMemo(function(){return Jo2(n)},[n]),N=o.useMemo(function(){return typeof b=="function"?b:QUn},[b]),W=o.useMemo(function(){return typeof h=="function"?h:QUn},[h]),x=o.useRef(null),T=o.useRef(null),A=o.useReducer(_22,JBn),Z=YBn(A,2),Q=Z[0],ne=Z[1],V=Q.isFocused,F=Q.isFileDialogActive,Y=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&Qo2()),ie=function(){!Y.current&&F&&setTimeout(function(){if(T.current){var he=T.current.files;he.length||(ne({type:"closeDialog"}),W())}},300)};o.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[T,F,W,Y]);var q=o.useRef([]),fe=function(he){x.current&&x.current.contains(he.target)||(he.preventDefault(),q.current=[])};o.useEffect(function(){return O&&(document.addEventListener("dragover",ZUn,!1),document.addEventListener("drop",fe,!1)),function(){O&&(document.removeEventListener("dragover",ZUn),document.removeEventListener("drop",fe))}},[x,O]),o.useEffect(function(){return!a&&y&&x.current&&x.current.focus(),function(){}},[x,y,a]);var ce=o.useCallback(function(J){D?D(J):console.error(J)},[D]),Ce=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J),q.current=[].concat(o22(q.current),[J.target]),xCt(J)&&Promise.resolve(r(J)).then(function(he){if(!($Ct(J)&&!k)){var at=he.length,He=at>0&&Go2({files:he,accept:B,minSize:c,maxSize:u,multiple:l,maxFiles:f,validator:S}),kt=at>0&&!He;ne({isDragAccept:He,isDragReject:kt,isDragActive:!0,type:"setDraggedFiles"}),s&&s(J)}}).catch(function(he){return ce(he)})},[r,s,ce,k,B,c,u,l,f,S]),le=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J);var he=xCt(J);if(he&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return he&&_&&_(J),!1},[_,k]),ee=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J);var he=q.current.filter(function(He){return x.current&&x.current.contains(He)}),at=he.indexOf(J.target);at!==-1&&he.splice(at,1),q.current=he,!(he.length>0)&&(ne({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),xCt(J)&&d&&d(J))},[x,d,k]),ge=o.useCallback(function(J,he){var at=[],He=[];J.forEach(function(kt){var we=NUn(kt,B),en=YBn(we,2),_n=en[0],Dc=en[1],XO=TUn(kt,c,u),QO=YBn(XO,2),bT=QO[0],yT=QO[1],pT=S?S(kt):null;if(_n&&bT&&!pT)at.push(kt);else{var OT=[Dc,yT];pT&&(OT=OT.concat(pT)),He.push({file:kt,errors:OT.filter(function(jT){return jT})})}}),(!l&&at.length>1||l&&f>=1&&at.length>f)&&(at.forEach(function(kt){He.push({file:kt,errors:[Uo2]})}),at.splice(0)),ne({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)},[ne,l,B,c,u,f,m,v,C,S]),We=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J),q.current=[],xCt(J)&&Promise.resolve(r(J)).then(function(he){$Ct(J)&&!k||ge(he,J)}).catch(function(he){return ce(he)}),ne({type:"reset"})},[r,ge,ce,k]),U=o.useCallback(function(){if(Y.current){ne({type:"openDialog"}),N();var J={multiple:l,types:H};window.showOpenFilePicker(J).then(function(he){return r(he)}).then(function(he){ge(he,null),ne({type:"closeDialog"})}).catch(function(he){e22(he)?(W(he),ne({type:"closeDialog"})):t22(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&&(ne({type:"openDialog"}),N(),T.current.value=null,T.current.click())},[ne,N,W,p,ge,ce,H,l]),qe=o.useCallback(function(J){!x.current||!x.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),U())},[x,U]),se=o.useCallback(function(){ne({type:"focus"})},[]),te=o.useCallback(function(){ne({type:"blur"})},[]),_e=o.useCallback(function(){E||(Xo2()?setTimeout(U,0):U())},[E,U]),je=function(he){return a?null:he},K=function(he){return w?null:je(he)},pe=function(he){return M?null:je(he)},Pe=function(he){k&&he.stopPropagation()},xe=o.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=J.refKey,at=he===void 0?"ref":he,He=J.role,kt=J.onKeyDown,we=J.onFocus,en=J.onBlur,_n=J.onClick,Dc=J.onDragEnter,XO=J.onDragOver,QO=J.onDragLeave,bT=J.onDrop,yT=zCt(J,a22);return Et(Et(XBn({onKeyDown:K(Sc(kt,qe)),onFocus:K(Sc(we,se)),onBlur:K(Sc(en,te)),onClick:je(Sc(_n,_e)),onDragEnter:pe(Sc(Dc,Ce)),onDragOver:pe(Sc(XO,le)),onDragLeave:pe(Sc(QO,ee)),onDrop:pe(Sc(bT,We)),role:typeof He=="string"&&He!==""?He:"presentation"},at,x),!a&&!w?{tabIndex:0}:{}),yT)}},[x,qe,se,te,_e,Ce,le,ee,We,w,M,a]),ze=o.useCallback(function(J){J.stopPropagation()},[]),Zt=o.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=J.refKey,at=he===void 0?"ref":he,He=J.onChange,kt=J.onClick,we=zCt(J,i22),en=XBn({accept:B,multiple:l,type:"file",style:{display:"none"},onChange:je(Sc(He,We)),onClick:je(Sc(kt,ze)),tabIndex:-1},at,T);return Et(Et({},en),we)}},[T,n,l,We,a]);return Et(Et({},Q),{},{isFocused:V&&!a,getRootProps:xe,getInputProps:Zt,rootRef:x,inputRef:T,open:je(U)})}function _22(e,t){switch(t.type){case"focus":return Et(Et({},e),{},{isFocused:!0});case"blur":return Et(Et({},e),{},{isFocused:!1});case"openDialog":return Et(Et({},JBn),{},{isFileDialogActive:!0});case"closeDialog":return Et(Et({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Et(Et({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Et(Et({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Et({},JBn);default:return e}}function QUn(){}const JUn=({fileRejections:e})=>e.length?g.jsx(j.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>X(t.palette.error.main,.08),borderColor:t=>X(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=ZBn(t);return g.jsxs(j.Box,{sx:{my:1},children:[g.jsxs(j.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?BBn(r):""]}),n.map(u=>g.jsxs(j.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,m22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return g.jsx(j.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"}})})},v22=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 ${X(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),h22=({header:e,description:t,sx:n,...a})=>g.jsxs(j.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(OIn,{sx:{width:220}}),g.jsxs("div",{children:[g.jsx(j.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),g.jsx(j.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||g.jsxs(g.Fragment,{children:["Solte os arquivos aqui ou clique",g.jsx(j.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),qUn=({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:O,getInputProps:E,isDragActive:w,isDragReject:M,fileRejections:k}=HCt({multiple:n,disabled:t,...y}),D=!!u&&!n||b,S=l&&n&&l.length>0,B=M||!!a;return g.jsxs(j.Box,{sx:{width:1,position:"relative",...m},children:[g.jsxs(v22,{...O(),sx:{...w&&{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(j.Stack,{sx:{...D&&{opacity:0}},children:h}):g.jsx(h22,{sx:{...D&&{opacity:0}},header:C==null?void 0:C.title,description:C==null?void 0:C.description}),D&&g.jsx(m22,{file:u||b||""})]}),r&&g.jsx(j.FormHelperText,{error:!!a,sx:H=>({mx:"14px",color:t?H.palette.grey[500]:void 0}),children:r}),g.jsx(JUn,{fileRejections:k}),D&&c&&g.jsx(j.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:H=>X(H.palette.common.white,.8),bgcolor:H=>X(H.palette.grey[900],.72),"&:hover":{bgcolor:H=>X(H.palette.grey[900],.48)}},children:g.jsx(Oe,{icon:"CLOSE_MARK_BUTTON",width:18})}),S&&g.jsx(g.Fragment,{children:g.jsx(j.Box,{sx:{my:3},children:g.jsx(po2,{files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:_})})})]})},C22=({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)"}})},b22=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 ${X(e.palette.grey[500],.32)}`})),y22=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})})),eGn=({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}=HCt({multiple:!1,disabled:a,...l}),v=!!t||n,C=_||!!e;return g.jsxs(g.Fragment,{children:[g.jsxs(b22,{...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(C22,{file:t||n||""}),g.jsxs(y22,{className:"placeholder",sx:{"&:hover":{opacity:.72},...v&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>X(h.palette.grey[900],.64)},...C&&{color:"error.main",bgcolor:"error.lighter"}},children:[g.jsx(Oe,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),g.jsx(j.Typography,{variant:"caption",children:t?"Atualizar foto":"Carregar foto"})]})]}),r&&r,g.jsx(JUn,{fileRejections:m})]})},p22=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:X(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),O22=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:l,isDragActive:f,isDragReject:s}=HCt({disabled:n,...u}),d=s||t;return g.jsxs(p22,{...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(Oe,{icon:"CLOUD_UPLOAD",width:28})]})},tGn=({onFileCropped:e,onImageUploaded:t,onCancel:n})=>{const a=o.useId(),[r,u]=o.useState(),[c,l,f]=ISn(),[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)}},nGn=({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(OUn,{open:t,onClose:n,dialogTitle:a,actions:g.jsxs(g.Fragment,{children:[g.jsx(j.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),g.jsx(j.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),fullWidth:!0,maxWidth:"sm",keepMounted:!0,children:g.jsxs(j.Stack,{gap:2,children:[g.jsx(JZn,{imageSrc:l,aspectRatio:f,onInitialized:s,zoom:d,onZoomChange:_}),g.jsxs(j.Stack,{gap:1.5,children:[g.jsxs(j.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",children:[g.jsx(j.Typography,{variant:"body1",children:"Zoom"}),g.jsx(j.Slider,{value:d,onChange:(m,v)=>_(Array.isArray(v)?v[0]:v),min:.1,max:2,size:"medium",step:.0125})]}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(j.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(Oe,{icon:"DELETE_MARK_BUTTON_02"}),onClick:u,children:"Remover"}),g.jsx(j.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(Oe,{icon:"PLAY_SIMPLE"}),onClick:c,children:"Pré-visualizar"}),g.jsx(j.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(Oe,{icon:"SEARCH_IMAGE"}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})})},j22=j.styled(j.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),w22=j.styled(j.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:j.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),M22=j.styled(j.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),rGn=({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:O,closePreviewImage:E}=tGn({onFileCropped:e,onImageUploaded:t,onCancel:n});return g.jsxs(g.Fragment,{children:[g.jsxs(j22,{children:[c&&g.jsx(dCt,{}),g.jsx(qUn,{...s,id:d,file:l,onDrop:w=>{if(w.length>0){_(!0);const M=new FileReader;M.addEventListener("load",()=>{var D;const k=((D=M.result)==null?void 0:D.toString())||"";t(k),e(void 0)}),M.readAsDataURL(w[0])}},image:u,tabIndex:f}),(l||u)&&g.jsxs(w22,{className:"actions",children:[g.jsx(j.Button,{color:"inherit",startIcon:g.jsx(Oe,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:m,children:"Remover"}),g.jsx(j.Button,{color:"inherit",startIcon:g.jsx(Oe,{icon:"SEARCH_IMAGE",color:"primary.maon"}),onClick:v,children:"Editar"})]})]}),g.jsx(nGn,{id:d,open:C,onClose:h,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:b,onPreview:p,onInitialized:y}),g.jsx(j.Dialog,{open:!!O,onClose:E,scroll:"body",PaperProps:{sx:{p:2}},children:O&&g.jsx("img",{src:O,alt:"Preview"})})]})},L22=j.styled(j.Stack)(({theme:e})=>({backgroundColor:"#fff",border:`1px solid ${e.palette.grey[300]}`})),aGn=({children:e,...t})=>g.jsx(L22,{borderRadius:1,gap:3,padding:3,...t,children:e}),P22=j.styled(j.Box)(()=>({marginLeft:"4px",fontWeight:"fontWeightBold"})),E22=j.styled(j.Button)(()=>({fontWeight:"fontWeightSemiBold"})),k22=j.styled(Oe)(({theme:e})=>({color:e.palette.primary.main})),S22=({selectedTitle:e,onSelect:t,options:n})=>{const a=$Sn();return g.jsxs(g.Fragment,{children:[g.jsx(E22,{disableRipple:!0,color:"inherit",onClick:a.onOpen,endIcon:g.jsx(k22,{icon:a.open?"CHEVRON_UP":"ARROW_DOWN_SIMPLE"}),children:g.jsx(P22,{component:"span",children:e.label})}),g.jsx(pUn,{open:a.open,onClose:a.onClose,children:n.map(r=>g.jsx(j.MenuItem,{selected:r.value===e.value,onClick:()=>{a.onClose(),t(r.value)},children:r.label},r.value))})]})},D22=j.styled(j.Stack)({display:"grid",gridTemplateColumns:"auto auto"}),B22=j.styled(j.Typography)(({theme:e})=>({color:e.palette.grey[600]})),W22=j.styled(j.Typography)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]})),I22=({data:e,...t})=>e.length===0?null:g.jsx(D22,{gap:1,...t,children:e.map(n=>[g.jsx(B22,{variant:"body2",children:n.label},`label:${n.id}`),g.jsx(W22,{variant:"body2",children:n.value},`value:${n.id}`)])}),$22=j.styled(j.Stack)(({theme:e})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${e.palette.grey[300]}`})),x22=j.styled(j.Stack)(({theme:e})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${e.palette.grey[300]}`})),z22=j.styled(j.Stack)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),H22=j.styled(j.Stack)(({theme:e})=>({height:"100%",width:"50%",flex:1,[e.breakpoints.down(1680)]:{width:"70%"}})),A22=j.styled(j.Typography)(({theme:e})=>({color:e.palette.grey[800],fontSize:18,fontWeight:700})),R22=j.styled(j.Typography)(({theme:e})=>({color:e.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),V22=j.styled(j.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}})),F22=j.styled(Zce)(()=>({height:1,"& .simplebar-content":{height:1}})),N22=j.styled(j.Stack)(()=>({position:"fixed",width:"202px"})),T22=({title:e,sections:t,headerLeftContent:n,headerRightContent:a,onClickBack:r})=>g.jsx(j.Stack,{children:g.jsxs(j.Stack,{direction:"row",children:[g.jsx($22,{children:g.jsx(F22,{children:g.jsxs(N22,{children:[g.jsx(j.Typography,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO RÁPIDO"}),t.map((u,c)=>g.jsxs(j.Stack,{children:[g.jsxs(V22,{onClick:()=>{u.ref.current&&u.ref.current.scrollIntoView({block:"end",behavior:"smooth"})},children:[u.title,u.isRequired&&g.jsx("span",{children:"*"})]}),c<t.length-1&&g.jsx(j.Divider,{})]},c))]})})}),g.jsxs(j.Stack,{width:"100%",alignItems:"center",mb:8,children:[g.jsx(x22,{children:g.jsxs(z22,{children:[g.jsxs(j.Stack,{flexDirection:"row",gap:2,children:[g.jsx(j.IconButton,{color:"primary",onClick:()=>r(),children:g.jsx(Oe,{icon:"CHEVRON_LEFT"})}),g.jsx(j.Typography,{variant:"h4",children:e}),n]}),g.jsxs(j.Stack,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[g.jsx(gSn,{disabled:!0}),a]})]})}),g.jsx(H22,{children:t.map(u=>g.jsxs(j.Stack,{ref:u.ref,paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",children:[g.jsx(A22,{children:u.title}),g.jsx(R22,{children:u.subTitle}),g.jsx(aGn,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:u.child})]},u.title))})]})]})}),Z22=j.styled(j.Box)(({theme:e})=>({padding:24,borderRadius:8,height:"auto",maxWidth:800,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.grey[300]}`})),U22=j.styled(j.Stack)(({theme:e})=>({minHeight:180,maxWidth:700,border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff",padding:24})),G22=j.styled(j.Box)(()=>({maxWidth:70,maxHeight:40,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),Y22=j.styled(j.Box)(({theme:e})=>({backgroundColor:e.palette.background.default,maxWidth:90,maxHeight:80,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),iGn=j.styled(j.Stack)(({theme:e})=>({border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff"})),K22=j.styled(j.Box)(({theme:e})=>({width:"auto",height:120,overflow:"hidden",padding:2,borderBottom:`4px dotted ${e.palette.grey[300]}`})),X22=({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(Z22,{children:g.jsxs(j.Stack,{gap:3,display:"flex",flex:1,children:[g.jsx(j.Typography,{variant:"overline",color:"text.disabled",children:e??"PRÉ-VISUALIZAÇÃO"}),g.jsxs(U22,{children:[g.jsxs(j.Stack,{direction:"row",pb:3,gap:.5,children:[g.jsx(j.Box,{height:0,width:10,children:g.jsx(Oe,{icon:"CIRCLE",width:30,color:"error.main"})}),g.jsx(j.Box,{height:0,width:10,children:g.jsx(Oe,{icon:"CIRCLE",width:30,color:"warning.main"})}),g.jsx(j.Box,{height:0,width:10,children:g.jsx(Oe,{icon:"CIRCLE",width:30,color:"success.main"})})]}),g.jsxs(j.Stack,{flexDirection:"row",gap:2,justifyContent:"space-between",children:[g.jsxs(j.Stack,{gap:1,width:"100%",children:[g.jsxs(j.Stack,{direction:"row",gap:1.5,pb:.5,children:[t&&g.jsx(G22,{children:g.jsx("img",{alt:"Logo",src:t})}),g.jsxs(j.Stack,{children:[g.jsx(j.Typography,{variant:"overline",color:"grey.600",pb:.5,children:n??"SUAEMPRESA"}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(j.Typography,{variant:"caption",color:"grey.600",children:a??"https://www.exemplo.com"}),g.jsx(Oe,{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(j.Stack,{direction:"row",gap:1,alignItems:"center",children:c.map((m,v)=>g.jsxs(g.Fragment,{children:[g.jsx(j.Typography,{variant:"caption",color:"text.disabled",children:m}),v<c.length-1&&g.jsx(j.Box,{width:4,height:16,children:g.jsx(Oe,{icon:"CIRCLE",color:"text.disabled",width:10})})]}))}),l&&g.jsx(j.Stack,{pt:2,children:l.map((m,v)=>g.jsxs(j.Stack,{gap:1,children:[g.jsx(j.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(Y22,{children:g.jsx("img",{alt:"ProductImage",src:f})})]})]}),_&&g.jsxs(j.Stack,{gap:3,display:"flex",flex:1,width:"100%",children:[g.jsx(j.Typography,{variant:"overline",color:"text.disabled",children:"pré-visualização link de compartilhamento".toUpperCase()}),g.jsxs(iGn,{children:[d&&g.jsx(K22,{children:g.jsx("img",{alt:"PreviewLinkImage",src:d,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:8}})}),g.jsxs(j.Stack,{gap:.2,p:2,width:"100%",children:[g.jsx(j.Typography,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),g.jsx(j.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(j.Typography,{variant:"caption",color:"grey.500",children:a??"https://www.exemplo.com"})]})]}),g.jsx(iGn,{children:g.jsxs(j.Stack,{direction:"row",gap:1,alignItems:"center",children:[g.jsx(j.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(j.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"})]})]})})]})]})}),Q22=j.styled(zBn)(({theme:e})=>({backgroundColor:`${j.alpha(e.palette.grey[400],.2)}`,cursor:"pointer"})),J22=j.styled(Zce)(()=>({maxHeight:"260px"})),q22=({items:e})=>{const{setValue:t,reset:n,watch:a,getValues:r}=Ie.useFormContext(),[u,c]=o.useState(-1),[l,f]=o.useState(""),s=Object.fromEntries(e.map((y,O)=>[O,[]])),[d,_]=o.useState(s),m=a("name");o.useEffect(()=>()=>{n({name:m,config:{}})},[n]);const v=(y,O)=>{c(O?y:-1)},C=(y,O,E)=>{const w=E.target.checked?[...d[u],O]:d[u].filter(M=>M!==O);_({...d,[u]:w}),p(y,w)},h=y=>{f(y)},b=()=>{const O=e[u].list.every(E=>d[u].includes(E.value))?[]:[...e[u].list.map(E=>E.value)];_({...d,[u]:O}),p(e[u].name,O)},p=(y,O)=>{const E={},w=r("config"),M=e[u];if(M){const k=M.list.filter(D=>d[u].includes(D.value)).map(D=>D.value);E[M.name]={type:"FIELD",values:M.name===y?O:k},t("config",{...w,...E})}};return g.jsx(g.Fragment,{children:e.map((y,O)=>g.jsxs(j.Accordion,{expanded:u===O,onChange:(E,w)=>v(O,w),children:[g.jsx(j.AccordionSummary,{expandIcon:g.jsx(Oe,{icon:"CHEVRON_UP"}),id:`${O}`,children:g.jsxs(j.Stack,{alignItems:"center",direction:"row",children:[g.jsx(j.Typography,{variant:"subtitle2",color:"grey.600",children:y.label}),g.jsxs(Q22,{variant:"soft",color:"primary",marginLeft:1,children:[d[O].length," selecionados"]})]})}),g.jsxs(j.AccordionDetails,{children:[g.jsxs(j.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[g.jsx(ymt,{onSearch:h,onChange:E=>h(E.target.value),iconPosition:"start",size:"small",placeholder:"Buscar",fullWidth:!0}),g.jsx(j.Button,{onClick:()=>b(),size:"small",children:g.jsx(j.Typography,{variant:"overline",children:"TODOS"})})]}),g.jsx(J22,{children:g.jsx(j.List,{children:u>-1&&y.list.filter(E=>E.label.toLowerCase().includes(l.toLowerCase())).map((E,w)=>g.jsx(j.ListItem,{children:g.jsx(j.FormControlLabel,{control:g.jsx(j.Checkbox,{size:"small",checked:d[u].includes(E.value),onChange:M=>C(y.name,E.value,M),name:E.label}),label:g.jsx(j.Typography,{variant:"caption",color:"grey.600",children:E.label})})},w))})})]})]},O))})},eu2=({columns:e,rows:t,loading:n})=>{const{apiRef:a,page:r,perPage:u}=WRn(),{setValue:c,reset:l,watch:f}=Ie.useFormContext(),s=f("name");o.useEffect(()=>()=>{l({name:s,config:{}})},[l]);const[d,_]=o.useState([]),[m,v]=o.useState(),C=b=>{_(b),c("config.products.values",{type:"FIELD",...b})},h=()=>{const b=m==null?void 0:m.toLowerCase();return t.filter(p=>Object.values(p).some(y=>typeof y=="string"||y instanceof String?y.toLowerCase().includes(b||""):!1))};return g.jsxs(j.Stack,{gap:2,children:[g.jsxs(j.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(ymt,{onSearch:b=>v(b),onChange:b=>v(b.target.value),iconPosition:"start",size:"small",placeholder:"Buscar"}),g.jsxs(j.Typography,{variant:"body1",color:"text.disabled",children:[d.length," selecionados"]})]}),g.jsx(WTn,{apiRef:a,columns:e,rows:h(),pagination:!0,paginationModel:{page:r,pageSize:u},loading:n,fetching:n,checkboxSelection:!0,onRowSelectionModelChange:C})]})},oGn=bt(j.ToggleButton)(({theme:e})=>({width:"100%","&.Mui-selected":{backgroundColor:e.palette.primary.main,color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.primary.main}}})),tu2=bt(j.ToggleButtonGroup)(()=>({display:"flex",justifyContent:"space-between"})),nu2=({rules:e})=>{const[t,n]=o.useState();o.useEffect(()=>{e&&e.length>0&&n(e[0].value)},[]);const a=(r,u)=>{n(u)};return g.jsxs(j.Stack,{gap:2,children:[g.jsx(qt,{name:"name",label:"Nome da regra"}),g.jsx(j.Typography,{color:"grey.500",variant:"overline",children:"Selecione a regra"}),e&&g.jsxs(tu2,{color:"primary",value:t,size:"small",exclusive:!0,onChange:a,children:[e.map((r,u)=>g.jsx(oGn,{value:r.value,size:"small",color:"primary",children:g.jsx(j.Typography,{variant:"body2",children:r.toggleTitle})},u)),g.jsx(oGn,{value:"advanced",size:"small",children:g.jsx(j.Typography,{variant:"body2",children:"Avançado"})})]}),t==="advanced"||!e?g.jsx(g.Fragment,{children:"componente aqui"}):e.map((r,u)=>r.value===t?g.jsx("div",{children:r.component},u):null)]})},qt=({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(j.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}})})},uGn=({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(j.FormControlLabel,{control:g.jsx(j.Switch,{...c,checked:c.value,onChange:(f,s)=>{c.onChange(f),n&&n(f,s)},inputProps:{tabIndex:a}}),...r}),(!!l||t)&&g.jsx(j.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})]})})},ru2=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],au2=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],iu2=j.styled(j.Stack)(({theme:e})=>({border:`1px solid ${j.alpha(e.palette.primary.main,.3)}`,backgroundColor:j.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),ou2=j.styled(j.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),uu2=j.styled(j.IconButton)(()=>({height:"38px",alignSelf:"center"})),cu2=({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(iu2,{children:[g.jsx(Oe,{icon:"INFO_CIRCLE"}),g.jsx(j.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(qt,{name:"name",label:"Nome do webhook"}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(qt,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),g.jsx(qt,{name:"filter",label:"Filtro"})]}),t&&e&&g.jsxs(g.Fragment,{children:[g.jsx(qt,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(qt,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),g.jsx(qt,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:g.jsx(j.InputAdornment,{position:"end",children:g.jsx(ou2,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:g.jsx(Oe,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),g.jsx(qt,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsxs(j.Stack,{width:"35%",gap:2,children:[g.jsx(j.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),g.jsx(qBn,{name:"content_type",options:ru2,row:!0,decorated:!0})]}),g.jsxs(j.Stack,{gap:2,children:[g.jsx(j.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),g.jsx(qBn,{name:"http_method",options:au2,row:!0,decorated:!0})]})]}),g.jsx(j.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),g.jsx(uGn,{name:"active",label:"Ativo"}),g.jsx(j.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((f,s)=>g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(qt,{name:`headers.${s}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),g.jsx(qt,{name:`headers.${s}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),g.jsx(uu2,{onClick:()=>c(s),color:"error",children:g.jsx(Oe,{icon:"DELETE_MARK_BUTTON_02"})})]},f.id)),g.jsx(yRn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>l(),children:"Adicionar novo cabeçalho"}),g.jsx(j.Divider,{})]})},cGn=({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(dSn,{...c,...r,onChange:f=>{a&&a(f,c.value),c.onChange(f)},error:!!l,helperText:(l==null?void 0:l.message)||t})})},lGn=({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(VBn,{ref:f,...a,name:u,value:l,error:!!s,helperText:(s==null?void 0:s.message)||t,onChange:({target:{value:d}})=>c(d)})})},lu2=({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(j.Stack,{gap:1.5,...t,children:[g.jsxs(j.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[g.jsx(lGn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:g.jsx(j.InputAdornment,{position:"end",children:g.jsx(j.CircularProgress,{size:24})})},rules:a,onKeyDown:m,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),g.jsxs(j.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[g.jsx(qt,{name:c,label:"Logradouro",onKeyDown:m,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),g.jsx(qt,{name:l,label:"Número",onKeyDown:m,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),g.jsxs(j.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[g.jsx(qt,{name:f,label:"Bairro",onKeyDown:m,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),g.jsx(qt,{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(j.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[g.jsx(cGn,{name:d,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),g.jsx(qt,{name:_,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},fu2=({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(j.FormControlLabel,{control:g.jsx(j.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!l||n)&&g.jsx(j.FormHelperText,{error:!!l,children:l?l==null?void 0:l.message:n})]})})},su2=({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(j.FormControl,{component:"fieldset",children:[a&&g.jsx(j.FormLabel,{component:"legend",sx:{typography:"body2"},required:l,children:a}),g.jsx(j.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(j.FormControlLabel,{control:g.jsx(j.Checkbox,{checked:_.includes(C.value),onChange:()=>m.onChange(d(_,C.value))}),label:C.label,...f},C.value))}),(!!v||c)&&g.jsx(j.FormHelperText,{error:!!v,sx:C=>({color:f.disabled?C.palette.grey[500]:void 0}),children:v?v==null?void 0:v.message:c})]})})},du2=({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),O=document.querySelector(`input[name=${e}${y+1}]`);h.length>C&&(m.target.value=h[0]),h.length>=C&&y<6&&O!==null&&O.focus(),v(m)};WSn("paste",s,u);const _=t.some(m=>f[m]);return g.jsxs(j.Stack,{children:[g.jsx(j.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(j.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(j.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},gu2=({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(kNn,{...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}}})}})},mu2=({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}})})},vu2=({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(j.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),Cu2=({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(xBn,{value:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||t,...a,...l,name:e})})},bu2=({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(j.Autocomplete,{...l,onChange:(s,d)=>{r&&r(d),l.onChange(d)},renderInput:s=>g.jsx(j.TextField,{label:t,error:!!f,helperText:f?f==null?void 0:f.message:a,...s}),...u})})},yu2=({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(PCt,{...c,onChange:f=>{c.onChange(f),a&&a(f)},fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...r})})},pu2=({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}=BCt(_,a,c,r,u);return g.jsx(qt,{...s,name:e,type:m?"text":"password",InputProps:{endAdornment:g.jsx(j.InputAdornment,{position:"end",children:g.jsx(j.IconButton,{onClick:()=>v(!m),edge:"end","aria-label":"Mostrar/Ocultar senha",children:g.jsx(Oe,{icon:m?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const O=BCt(y,a,c,r,u);return!O.hasNumberChar||!O.hasSpecialCharacter||!O.hasUpperCaseChar||!O.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}}})},qBn=({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(j.FormControl,{component:"fieldset",sx:{...l&&{paddingLeft:1.5}},children:[a&&g.jsx(j.FormLabel,{component:"legend",id:C,sx:{typography:"body2"},required:d,children:a}),g.jsx(j.RadioGroup,{...m,...h,onChange:(p,y)=>{h.onChange(p),f&&f(p,y)},"aria-labelledby":C,row:n,children:r.map(p=>g.jsx(j.FormControlLabel,{value:p.value,control:g.jsx(j.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 ${j.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:j.alpha(y.primary.main,.05)}}})},p.value))}),(!!b||c)&&g.jsx(j.FormHelperText,{error:!!b,sx:p=>({color:_?p.palette.grey[500]:void 0}),children:b?b==null?void 0:b.message:c})]})})},Ou2=({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}}})}})},ju2=({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:O}=tGn({onFileCropped:e,onImageUploaded:t,onCancel:n});return g.jsxs(g.Fragment,{children:[g.jsxs(j.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[c&&g.jsx(M22,{}),g.jsx(eGn,{...s,id:d,file:l,onDrop:E=>{if(E.length>0){_(!0);const w=new FileReader;w.addEventListener("load",()=>{var k;const M=((k=w.result)==null?void 0:k.toString())||"";t(M),e(void 0)}),w.readAsDataURL(E[0])}},image:u,tabIndex:f})]}),g.jsx(nGn,{id:d,open:v,onClose:C,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:h,onPreview:b,onInitialized:p}),g.jsx(j.Dialog,{open:!!y,onClose:O,scroll:"body",PaperProps:{sx:{p:2}},children:y&&g.jsx("img",{src:y,alt:"Preview"})})]})};function fGn(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 wu2=({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}=fGn(e);return g.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>g.jsx(ju2,{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(j.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},Mu2=({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}=fGn(e);return g.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>g.jsx(rGn,{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(j.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},sGn=j.styled(j.Button)(({theme:e})=>({borderColor:e.palette.grey[300]})),dGn=j.styled(j.Box)(({theme:e})=>({border:"1.5px solid",borderColor:e.palette.grey[300],height:450,width:"40%",borderRadius:8})),Lu2=({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=j.debounce(_,400),h=t.filter(W=>!e.some(x=>x.id===W.id)),b=e.filter(W=>W.name.toLowerCase().includes(m.toLowerCase())),p=d?b:t.filter(W=>e.some(x=>x.id===W.id)),[y,O]=o.useState([]),[E,w]=o.useState([]),M=()=>{r(y),O([])},k=()=>{u(E),w([])},D=W=>{w(W?p:[])},S=W=>{O(W?h:[])},B=(W,x)=>{w(x?T=>[...T,W]:T=>T.filter(A=>A.id!==W.id))},H=(W,x)=>{O(x?T=>[...T,W]:T=>T.filter(A=>A.id!==W.id))},N=W=>{W.key==="Enter"&&W.preventDefault()};return g.jsx(j.Stack,{children:g.jsxs(j.Stack,{direction:"row",alignItems:"center",gap:3,children:[g.jsx(dGn,{display:"flex",flex:1,children:g.jsxs(j.Stack,{flex:1,children:[g.jsxs(j.Stack,{direction:"row",gap:1,padding:2,children:[g.jsx(j.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(j.Stack,{children:[g.jsx(j.Typography,{variant:"subtitle2",color:"text.primary",children:`${l} cadastrados`}),g.jsx(j.Typography,{variant:"caption",color:"text.disabled",children:`${y.length}/${h.length} selecionados`})]})]}),g.jsx(j.Divider,{}),g.jsxs(j.Stack,{p:2,flex:1,children:[g.jsxs(j.Stack,{direction:"row",gap:1,children:[g.jsx(ymt,{iconPosition:"start",placeholder:"Buscar",onKeyDown:N,size:"small",fullWidth:!0,trigger:"change",onSearch:W=>C(W)}),s]}),g.jsx(FBn,{isLoading:n,loading:g.jsx(j.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:g.jsx(j.CircularProgress,{})}),isEmpty:h.length===0,empty:g.jsx(gCt,{text:c?`Nenhum ${a} encontrado`:`Nenhum ${a} disponível`,sx:{svg:{height:140}}}),children:g.jsx(Zce,{sx:{maxHeight:280},children:h.map(W=>g.jsxs(j.Stack,{gap:1,marginTop:"8px",children:[g.jsxs(j.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[g.jsx(j.Checkbox,{size:"small",checked:y.includes(W),onChange:x=>H(W,x.target.checked)}),W.label]}),g.jsx(j.Divider,{})]},W.id))})})]})]})}),g.jsxs(j.Stack,{gap:3,children:[g.jsx(sGn,{variant:"outlined",onClick:M,children:g.jsx(Oe,{icon:"ARROW_RIGHT_SIMPLE"})}),g.jsx(sGn,{variant:"outlined",onClick:k,children:g.jsx(Oe,{icon:"ARROW_LEFT_SIMPLE"})})]}),g.jsx(dGn,{display:"flex",flex:1,children:g.jsxs(j.Stack,{flex:1,children:[g.jsxs(j.Stack,{direction:"row",gap:1,padding:2,children:[g.jsx(j.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(j.Stack,{children:[g.jsx(j.Typography,{variant:"subtitle2",color:"text.primary",children:`${f} selecionados`}),g.jsx(j.Typography,{variant:"caption",color:"text.disabled",children:`${E.length}/${p.length} selecionados`})]})]}),g.jsx(j.Divider,{}),g.jsxs(j.Stack,{p:2,gap:1,children:[d&&g.jsx(ymt,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:W=>v(W??""),onKeyDown:N}),g.jsx(FBn,{isLoading:n,loading:g.jsx(j.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:g.jsx(j.CircularProgress,{})}),isEmpty:p.length===0,empty:g.jsx(gCt,{text:m?`Nenhum ${a} encontrado`:`Nenhum ${a} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:g.jsx(Zce,{sx:{maxHeight:280},children:p.map(W=>g.jsxs(j.Stack,{gap:1,children:[g.jsxs(j.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[g.jsx(j.Checkbox,{size:"small",checked:E.includes(W),onChange:x=>B(W,x.target.checked)}),W.label]}),g.jsx(j.Divider,{})]},W.id))})})]})]})})]})})},Pu2=Object.freeze(Object.defineProperty({__proto__:null,default:Ger},Symbol.toStringTag,{value:"Module"}));R.ActionButton=yRn,R.Address=lu2,R.Autocomplete=dSn,R.AutocompleteField=cGn,R.BuilderLayout=mDo,R.BuilderSidebar=Fzo,R.Carousel=PEo,R.CarouselArrowIndex=TEo,R.CarouselArrows=BEo,R.CarouselDots=DEo,R.Checkbox=fu2,R.Codes=du2,R.ColorPickerField=gu2,R.ColorPickerInput=kNn,R.Common=tr2,R.CommonSSR=rr2,R.Confirm=ar2,R.CustomAvatar=kTn,R.CustomAvatarGroup=STn,R.DataGrid=WTn,R.DatePicker=_u2,R.DateRangePicker=mu2,R.DateTimePicker=vu2,R.Delayed=cr2,R.DialogAnimate=btr,R.Drawer=br2,R.EmptyContent=qHn,R.EmptyView=gCt,R.Error=pr2,R.FabButtonAnimate=nzn,R.Field=qt,R.FilterRule=q22,R.FixedProgressBar=dCt,R.Form=hu2,R.FrameSkeleton=T22,R.HelpButton=gSn,R.Icon=Oe,R.IconButtonAnimate=rzn,R.Iconify=bZn,R.IllustrationEmptyContent=jIn,R.ImageCrop=JZn,R.Incrementer=xBn,R.IncrementerField=Cu2,R.Label=zBn,R.Lightbox=USo,R.ListingRules=nu2,R.LoadingScreen=Ka2,R.ManualRule=eu2,R.MaskedInput=VBn,R.MaskedInputField=lGn,R.MaterialDesignContent=Wyt,R.MenuPopover=pUn,R.Modal=OUn,R.ModalActions=vi2,R.MotionContainer=Wtr,R.MotionLazyContainer=wyt,R.MotionViewport=Btr,R.MultiCheckbox=su2,R.MultipleChipField=bu2,R.NoData=wIn,R.NumberInput=PCt,R.NumberInputField=yu2,R.PasswordField=pu2,R.PasswordRules=Oi2,R.PopoverSelect=S22,R.Portal=jUn,R.RadioGroupField=qBn,R.Result=FBn,R.SavedChanges=Ti2,R.Scrollbar=Zce,R.SearchInput=ymt,R.SeoPreview=X22,R.SnackbarContent=Byt,R.SnackbarProvider=Dzn,R.SplashScreen=Zi2,R.Steps=Yi2,R.StyledTab=Ki2,R.StyledTabs=Xi2,R.Summary=I22,R.SwapList=Lu2,R.Switch=uGn,R.TRANSITION=MIn,R.TabPanel=Qi2,R.TableEmptyRows=QEo,R.TableHeadCustom=qEo,R.TableNoData=KEo,R.TablePaginationCustom=tko,R.TableSelectedAction=eko,R.TableSkeleton=XEo,R.TextAnimate=ytr,R.TextMaxLine=KO,R.ThemeProvider=ETn,R.TimePicker=Ou2,R.Transition=Wvt,R.Upload=qUn,R.UploadAvatar=eGn,R.UploadAvatarWithCropField=wu2,R.UploadBox=O22,R.UploadIllustration=OIn,R.UploadWithCrop=rGn,R.UploadWithCropField=Mu2,R.Webhook=cu2,R.WhiteBox=aGn,R.color=It2,R.compare=Ezo,R.cssStyles=FEo,R.emptyRows=ZEo,R.file=ji2,R.formatNumber=ja2,R.formatTime=$i2,R.getComparator=UEo,R.loadable=Ni2,R.mask=Vi2,R.number=ha2,R.routes=zi2,R.sort=Ri2,R.useActiveElement=vDo,R.useApiMessage=zzo,R.useCarousel=EEo,R.useCopyToClipboard=hDo,R.useDatagrid=WRn,R.useDeepCompareEffect=Szo,R.useEventListener=WSn,R.useIsMounting=Bzo,R.useLightBox=KSo,R.useOffSetTop=xzo,R.useOnClickOutside=$zo,R.usePagination=Izo,R.usePopover=$Sn,R.useResponsive=izn,R.useSnackbar=Bzn,R.useTable=GEo,R.useTabs=Wzo,R.useToggle=ISn,R.uuidv4=Fi2,R.validators=bi2,R.varBgColor=xXn,R.varBgKenburns=zXn,R.varBgPan=HXn,R.varBounce=WXn,R.varContainer=avt,R.varFade=sle,R.varFlip=SXn,R.varHover=$Xn,R.varPath=PXn,R.varRotate=IXn,R.varScale=BXn,R.varSlide=DXn,R.varTranEnter=$e,R.varTranExit=Ne,R.varTranHover=EXn,R.varZoom=kXn,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
|
35409
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YUn(e,t){if(e){if(typeof e=="string")return KBn(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 KBn(e,t)}}function KBn(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 s22(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 d22(e){if(Array.isArray(e))return e}function KUn(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 Et(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KUn(Object(n),!0).forEach(function(a){XBn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KUn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function XBn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zCt(e,t){if(e==null)return{};var n=g22(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 g22(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 QBn=o.forwardRef(function(e,t){var n=e.children,a=zCt(e,n22),r=HCt(a),u=r.open,c=zCt(r,r22);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(Et(Et({},c),{},{open:u})))});QBn.displayName="Dropzone";var XUn={disabled:!1,getFilesFromEvent:Mo2,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};QBn.defaultProps=XUn,QBn.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 JBn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function HCt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Et(Et({},XUn),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,O=t.preventDropOnDocument,E=t.noClick,w=t.noKeyboard,M=t.noDrag,k=t.noDragEventsBubbling,D=t.onError,S=t.validator,B=o.useMemo(function(){return qo2(n)},[n]),H=o.useMemo(function(){return Jo2(n)},[n]),N=o.useMemo(function(){return typeof b=="function"?b:QUn},[b]),W=o.useMemo(function(){return typeof h=="function"?h:QUn},[h]),x=o.useRef(null),T=o.useRef(null),A=o.useReducer(_22,JBn),Z=YBn(A,2),Q=Z[0],ne=Z[1],V=Q.isFocused,F=Q.isFileDialogActive,Y=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&Qo2()),ie=function(){!Y.current&&F&&setTimeout(function(){if(T.current){var he=T.current.files;he.length||(ne({type:"closeDialog"}),W())}},300)};o.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[T,F,W,Y]);var q=o.useRef([]),fe=function(he){x.current&&x.current.contains(he.target)||(he.preventDefault(),q.current=[])};o.useEffect(function(){return O&&(document.addEventListener("dragover",ZUn,!1),document.addEventListener("drop",fe,!1)),function(){O&&(document.removeEventListener("dragover",ZUn),document.removeEventListener("drop",fe))}},[x,O]),o.useEffect(function(){return!a&&y&&x.current&&x.current.focus(),function(){}},[x,y,a]);var ce=o.useCallback(function(J){D?D(J):console.error(J)},[D]),Ce=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J),q.current=[].concat(o22(q.current),[J.target]),xCt(J)&&Promise.resolve(r(J)).then(function(he){if(!($Ct(J)&&!k)){var at=he.length,He=at>0&&Go2({files:he,accept:B,minSize:c,maxSize:u,multiple:l,maxFiles:f,validator:S}),kt=at>0&&!He;ne({isDragAccept:He,isDragReject:kt,isDragActive:!0,type:"setDraggedFiles"}),s&&s(J)}}).catch(function(he){return ce(he)})},[r,s,ce,k,B,c,u,l,f,S]),le=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J);var he=xCt(J);if(he&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return he&&_&&_(J),!1},[_,k]),ee=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J);var he=q.current.filter(function(He){return x.current&&x.current.contains(He)}),at=he.indexOf(J.target);at!==-1&&he.splice(at,1),q.current=he,!(he.length>0)&&(ne({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),xCt(J)&&d&&d(J))},[x,d,k]),ge=o.useCallback(function(J,he){var at=[],He=[];J.forEach(function(kt){var we=NUn(kt,B),en=YBn(we,2),_n=en[0],Dc=en[1],XO=TUn(kt,c,u),QO=YBn(XO,2),bT=QO[0],yT=QO[1],pT=S?S(kt):null;if(_n&&bT&&!pT)at.push(kt);else{var OT=[Dc,yT];pT&&(OT=OT.concat(pT)),He.push({file:kt,errors:OT.filter(function(jT){return jT})})}}),(!l&&at.length>1||l&&f>=1&&at.length>f)&&(at.forEach(function(kt){He.push({file:kt,errors:[Uo2]})}),at.splice(0)),ne({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)},[ne,l,B,c,u,f,m,v,C,S]),We=o.useCallback(function(J){J.preventDefault(),J.persist(),Pe(J),q.current=[],xCt(J)&&Promise.resolve(r(J)).then(function(he){$Ct(J)&&!k||ge(he,J)}).catch(function(he){return ce(he)}),ne({type:"reset"})},[r,ge,ce,k]),U=o.useCallback(function(){if(Y.current){ne({type:"openDialog"}),N();var J={multiple:l,types:H};window.showOpenFilePicker(J).then(function(he){return r(he)}).then(function(he){ge(he,null),ne({type:"closeDialog"})}).catch(function(he){e22(he)?(W(he),ne({type:"closeDialog"})):t22(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&&(ne({type:"openDialog"}),N(),T.current.value=null,T.current.click())},[ne,N,W,p,ge,ce,H,l]),qe=o.useCallback(function(J){!x.current||!x.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),U())},[x,U]),se=o.useCallback(function(){ne({type:"focus"})},[]),te=o.useCallback(function(){ne({type:"blur"})},[]),_e=o.useCallback(function(){E||(Xo2()?setTimeout(U,0):U())},[E,U]),je=function(he){return a?null:he},K=function(he){return w?null:je(he)},pe=function(he){return M?null:je(he)},Pe=function(he){k&&he.stopPropagation()},xe=o.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=J.refKey,at=he===void 0?"ref":he,He=J.role,kt=J.onKeyDown,we=J.onFocus,en=J.onBlur,_n=J.onClick,Dc=J.onDragEnter,XO=J.onDragOver,QO=J.onDragLeave,bT=J.onDrop,yT=zCt(J,a22);return Et(Et(XBn({onKeyDown:K(Sc(kt,qe)),onFocus:K(Sc(we,se)),onBlur:K(Sc(en,te)),onClick:je(Sc(_n,_e)),onDragEnter:pe(Sc(Dc,Ce)),onDragOver:pe(Sc(XO,le)),onDragLeave:pe(Sc(QO,ee)),onDrop:pe(Sc(bT,We)),role:typeof He=="string"&&He!==""?He:"presentation"},at,x),!a&&!w?{tabIndex:0}:{}),yT)}},[x,qe,se,te,_e,Ce,le,ee,We,w,M,a]),ze=o.useCallback(function(J){J.stopPropagation()},[]),Zt=o.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=J.refKey,at=he===void 0?"ref":he,He=J.onChange,kt=J.onClick,we=zCt(J,i22),en=XBn({accept:B,multiple:l,type:"file",style:{display:"none"},onChange:je(Sc(He,We)),onClick:je(Sc(kt,ze)),tabIndex:-1},at,T);return Et(Et({},en),we)}},[T,n,l,We,a]);return Et(Et({},Q),{},{isFocused:V&&!a,getRootProps:xe,getInputProps:Zt,rootRef:x,inputRef:T,open:je(U)})}function _22(e,t){switch(t.type){case"focus":return Et(Et({},e),{},{isFocused:!0});case"blur":return Et(Et({},e),{},{isFocused:!1});case"openDialog":return Et(Et({},JBn),{},{isFileDialogActive:!0});case"closeDialog":return Et(Et({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Et(Et({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Et(Et({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Et({},JBn);default:return e}}function QUn(){}const JUn=({fileRejections:e})=>e.length?g.jsx(j.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>X(t.palette.error.main,.08),borderColor:t=>X(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=ZBn(t);return g.jsxs(j.Box,{sx:{my:1},children:[g.jsxs(j.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?BBn(r):""]}),n.map(u=>g.jsxs(j.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,m22=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return g.jsx(j.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"}})})},v22=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 ${X(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),h22=({header:e,description:t,sx:n,...a})=>g.jsxs(j.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(OIn,{sx:{width:220}}),g.jsxs("div",{children:[g.jsx(j.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),g.jsx(j.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||g.jsxs(g.Fragment,{children:["Solte os arquivos aqui ou clique",g.jsx(j.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),qUn=({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:O,getInputProps:E,isDragActive:w,isDragReject:M,fileRejections:k}=HCt({multiple:n,disabled:t,...y}),D=!!u&&!n||b,S=l&&n&&l.length>0,B=M||!!a;return g.jsxs(j.Box,{sx:{width:1,position:"relative",...m},children:[g.jsxs(v22,{...O(),sx:{...w&&{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(j.Stack,{sx:{...D&&{opacity:0}},children:h}):g.jsx(h22,{sx:{...D&&{opacity:0}},header:C==null?void 0:C.title,description:C==null?void 0:C.description}),D&&g.jsx(m22,{file:u||b||""})]}),r&&g.jsx(j.FormHelperText,{error:!!a,sx:H=>({mx:"14px",color:t?H.palette.grey[500]:void 0}),children:r}),g.jsx(JUn,{fileRejections:k}),D&&c&&g.jsx(j.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:H=>X(H.palette.common.white,.8),bgcolor:H=>X(H.palette.grey[900],.72),"&:hover":{bgcolor:H=>X(H.palette.grey[900],.48)}},children:g.jsx(Oe,{icon:"CLOSE_MARK_BUTTON",width:18})}),S&&g.jsx(g.Fragment,{children:g.jsx(j.Box,{sx:{my:3},children:g.jsx(po2,{files:l,thumbnail:f,onRemove:s,onHandleMainImage:d,mainUrl:_})})})]})},C22=({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)"}})},b22=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 ${X(e.palette.grey[500],.32)}`})),y22=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})})),eGn=({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}=HCt({multiple:!1,disabled:a,...l}),v=!!t||n,C=_||!!e;return g.jsxs(g.Fragment,{children:[g.jsxs(b22,{...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(C22,{file:t||n||""}),g.jsxs(y22,{className:"placeholder",sx:{"&:hover":{opacity:.72},...v&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>X(h.palette.grey[900],.64)},...C&&{color:"error.main",bgcolor:"error.lighter"}},children:[g.jsx(Oe,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),g.jsx(j.Typography,{variant:"caption",children:t?"Atualizar foto":"Carregar foto"})]})]}),r&&r,g.jsx(JUn,{fileRejections:m})]})},p22=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:X(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),O22=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:l,isDragActive:f,isDragReject:s}=HCt({disabled:n,...u}),d=s||t;return g.jsxs(p22,{...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(Oe,{icon:"CLOUD_UPLOAD",width:28})]})},tGn=({onFileCropped:e,onImageUploaded:t,onCancel:n})=>{const a=o.useId(),[r,u]=o.useState(),[c,l,f]=ISn(),[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)}},nGn=({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(OUn,{open:t,onClose:n,dialogTitle:a,actions:g.jsxs(g.Fragment,{children:[g.jsx(j.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),g.jsx(j.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),fullWidth:!0,maxWidth:"sm",keepMounted:!0,children:g.jsxs(j.Stack,{gap:2,children:[g.jsx(JZn,{imageSrc:l,aspectRatio:f,onInitialized:s,zoom:d,onZoomChange:_}),g.jsxs(j.Stack,{gap:1.5,children:[g.jsxs(j.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",children:[g.jsx(j.Typography,{variant:"body1",children:"Zoom"}),g.jsx(j.Slider,{value:d,onChange:(m,v)=>_(Array.isArray(v)?v[0]:v),min:.1,max:2,size:"medium",step:.0125})]}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(j.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(Oe,{icon:"DELETE_MARK_BUTTON_02"}),onClick:u,children:"Remover"}),g.jsx(j.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(Oe,{icon:"PLAY_SIMPLE"}),onClick:c,children:"Pré-visualizar"}),g.jsx(j.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:g.jsx(Oe,{icon:"SEARCH_IMAGE"}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})})},j22=j.styled(j.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),w22=j.styled(j.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:j.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),M22=j.styled(j.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),rGn=({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:O,closePreviewImage:E}=tGn({onFileCropped:e,onImageUploaded:t,onCancel:n});return g.jsxs(g.Fragment,{children:[g.jsxs(j22,{children:[c&&g.jsx(dCt,{}),g.jsx(qUn,{...s,id:d,file:l,onDrop:w=>{if(w.length>0){_(!0);const M=new FileReader;M.addEventListener("load",()=>{var D;const k=((D=M.result)==null?void 0:D.toString())||"";t(k),e(void 0)}),M.readAsDataURL(w[0])}},image:u,tabIndex:f}),(l||u)&&g.jsxs(w22,{className:"actions",children:[g.jsx(j.Button,{color:"inherit",startIcon:g.jsx(Oe,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:m,children:"Remover"}),g.jsx(j.Button,{color:"inherit",startIcon:g.jsx(Oe,{icon:"SEARCH_IMAGE",color:"primary.maon"}),onClick:v,children:"Editar"})]})]}),g.jsx(nGn,{id:d,open:C,onClose:h,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:b,onPreview:p,onInitialized:y}),g.jsx(j.Dialog,{open:!!O,onClose:E,scroll:"body",PaperProps:{sx:{p:2}},children:O&&g.jsx("img",{src:O,alt:"Preview"})})]})},L22=j.styled(j.Stack)(({theme:e})=>({backgroundColor:"#fff",border:`1px solid ${e.palette.grey[300]}`})),aGn=({children:e,...t})=>g.jsx(L22,{borderRadius:1,gap:3,padding:3,...t,children:e}),P22=j.styled(j.Box)(()=>({marginLeft:"4px",fontWeight:"fontWeightBold"})),E22=j.styled(j.Button)(()=>({fontWeight:"fontWeightSemiBold"})),k22=j.styled(Oe)(({theme:e})=>({color:e.palette.primary.main})),S22=({selectedTitle:e,onSelect:t,options:n})=>{const a=$Sn();return g.jsxs(g.Fragment,{children:[g.jsx(E22,{disableRipple:!0,color:"inherit",onClick:a.onOpen,endIcon:g.jsx(k22,{icon:a.open?"CHEVRON_UP":"ARROW_DOWN_SIMPLE"}),children:g.jsx(P22,{component:"span",children:e.label})}),g.jsx(pUn,{open:a.open,onClose:a.onClose,children:n.map(r=>g.jsx(j.MenuItem,{selected:r.value===e.value,onClick:()=>{a.onClose(),t(r.value)},children:r.label},r.value))})]})},D22=j.styled(j.Stack)({display:"grid",gridTemplateColumns:"auto auto"}),B22=j.styled(j.Typography)(({theme:e})=>({color:e.palette.grey[600]})),W22=j.styled(j.Typography)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]})),I22=({data:e,...t})=>e.length===0?null:g.jsx(D22,{gap:1,...t,children:e.map(n=>[g.jsx(B22,{variant:"body2",children:n.label},`label:${n.id}`),g.jsx(W22,{variant:"body2",children:n.value},`value:${n.id}`)])}),$22=j.styled(j.Stack)(({theme:e})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${e.palette.grey[300]}`})),x22=j.styled(j.Stack)(({theme:e})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${e.palette.grey[300]}`})),z22=j.styled(j.Stack)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),H22=j.styled(j.Stack)(({theme:e})=>({height:"100%",width:"50%",flex:1,[e.breakpoints.down(1680)]:{width:"70%"}})),A22=j.styled(j.Typography)(({theme:e})=>({color:e.palette.grey[800],fontSize:18,fontWeight:700})),R22=j.styled(j.Typography)(({theme:e})=>({color:e.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),V22=j.styled(j.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}})),F22=j.styled(Zce)(()=>({height:1,"& .simplebar-content":{height:1}})),N22=j.styled(j.Stack)(()=>({position:"fixed",width:"202px"})),T22=({title:e,sections:t,headerLeftContent:n,headerRightContent:a,onClickBack:r})=>g.jsx(j.Stack,{children:g.jsxs(j.Stack,{direction:"row",children:[g.jsx($22,{children:g.jsx(F22,{children:g.jsxs(N22,{children:[g.jsx(j.Typography,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO RÁPIDO"}),t.map((u,c)=>g.jsxs(j.Stack,{children:[g.jsxs(V22,{onClick:()=>{u.ref.current&&u.ref.current.scrollIntoView({block:"end",behavior:"smooth"})},children:[u.title,u.isRequired&&g.jsx("span",{children:"*"})]}),c<t.length-1&&g.jsx(j.Divider,{})]},c))]})})}),g.jsxs(j.Stack,{width:"100%",alignItems:"center",mb:8,children:[g.jsx(x22,{children:g.jsxs(z22,{children:[g.jsxs(j.Stack,{flexDirection:"row",gap:2,children:[g.jsx(j.IconButton,{color:"primary",onClick:()=>r(),children:g.jsx(Oe,{icon:"CHEVRON_LEFT"})}),g.jsx(j.Typography,{variant:"h4",children:e}),n]}),g.jsxs(j.Stack,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[g.jsx(gSn,{disabled:!0}),a]})]})}),g.jsx(H22,{children:t.map(u=>g.jsxs(j.Stack,{ref:u.ref,paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",children:[g.jsx(A22,{children:u.title}),g.jsx(R22,{children:u.subTitle}),g.jsx(aGn,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:u.child})]},u.title))})]})]})}),Z22=j.styled(j.Box)(({theme:e})=>({padding:24,borderRadius:8,height:"auto",maxWidth:800,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.grey[300]}`})),U22=j.styled(j.Stack)(({theme:e})=>({minHeight:180,maxWidth:700,border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff",padding:24})),G22=j.styled(j.Box)(()=>({maxWidth:70,maxHeight:40,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),Y22=j.styled(j.Box)(({theme:e})=>({backgroundColor:e.palette.background.default,maxWidth:90,maxHeight:80,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),iGn=j.styled(j.Stack)(({theme:e})=>({border:`4px dotted ${e.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff"})),K22=j.styled(j.Box)(({theme:e})=>({width:"auto",height:120,overflow:"hidden",padding:2,borderBottom:`4px dotted ${e.palette.grey[300]}`})),X22=({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(Z22,{children:g.jsxs(j.Stack,{gap:3,display:"flex",flex:1,children:[g.jsx(j.Typography,{variant:"overline",color:"text.disabled",children:e??"PRÉ-VISUALIZAÇÃO"}),g.jsxs(U22,{children:[g.jsxs(j.Stack,{direction:"row",pb:3,gap:.5,children:[g.jsx(j.Box,{height:0,width:10,children:g.jsx(Oe,{icon:"CIRCLE",width:30,color:"error.main"})}),g.jsx(j.Box,{height:0,width:10,children:g.jsx(Oe,{icon:"CIRCLE",width:30,color:"warning.main"})}),g.jsx(j.Box,{height:0,width:10,children:g.jsx(Oe,{icon:"CIRCLE",width:30,color:"success.main"})})]}),g.jsxs(j.Stack,{flexDirection:"row",gap:2,justifyContent:"space-between",children:[g.jsxs(j.Stack,{gap:1,width:"100%",children:[g.jsxs(j.Stack,{direction:"row",gap:1.5,pb:.5,children:[t&&g.jsx(G22,{children:g.jsx("img",{alt:"Logo",src:t})}),g.jsxs(j.Stack,{children:[g.jsx(j.Typography,{variant:"overline",color:"grey.600",pb:.5,children:n??"SUAEMPRESA"}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(j.Typography,{variant:"caption",color:"grey.600",children:a??"https://www.exemplo.com"}),g.jsx(Oe,{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(j.Stack,{direction:"row",gap:1,alignItems:"center",children:c.map((m,v)=>g.jsxs(g.Fragment,{children:[g.jsx(j.Typography,{variant:"caption",color:"text.disabled",children:m}),v<c.length-1&&g.jsx(j.Box,{width:4,height:16,children:g.jsx(Oe,{icon:"CIRCLE",color:"text.disabled",width:10})})]}))}),l&&g.jsx(j.Stack,{pt:2,children:l.map((m,v)=>g.jsxs(j.Stack,{gap:1,children:[g.jsx(j.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(Y22,{children:g.jsx("img",{alt:"ProductImage",src:f})})]})]}),_&&g.jsxs(j.Stack,{gap:3,display:"flex",flex:1,width:"100%",children:[g.jsx(j.Typography,{variant:"overline",color:"text.disabled",children:"pré-visualização link de compartilhamento".toUpperCase()}),g.jsxs(iGn,{children:[d&&g.jsx(K22,{children:g.jsx("img",{alt:"PreviewLinkImage",src:d,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:8}})}),g.jsxs(j.Stack,{gap:.2,p:2,width:"100%",children:[g.jsx(j.Typography,{variant:"caption",children:r??"Suampresa | Páscoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),g.jsx(j.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(j.Typography,{variant:"caption",color:"grey.500",children:a??"https://www.exemplo.com"})]})]}),g.jsx(iGn,{children:g.jsxs(j.Stack,{direction:"row",gap:1,alignItems:"center",children:[g.jsx(j.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(j.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"})]})]})})]})]})}),Q22=j.styled(zBn)(({theme:e})=>({backgroundColor:`${j.alpha(e.palette.grey[400],.2)}`,cursor:"pointer"})),J22=j.styled(Zce)(()=>({maxHeight:"260px"})),q22=({items:e})=>{const{setValue:t,reset:n,watch:a,getValues:r}=Ie.useFormContext(),[u,c]=o.useState(-1),[l,f]=o.useState(""),s=Object.fromEntries(e.map((y,O)=>[O,[]])),[d,_]=o.useState(s),m=a("name");o.useEffect(()=>()=>{n({name:m,config:{}})},[n]);const v=(y,O)=>{c(O?y:-1)},C=(y,O,E)=>{const w=E.target.checked?[...d[u],O]:d[u].filter(M=>M!==O);_({...d,[u]:w}),p(y,w)},h=y=>{f(y)},b=()=>{const O=e[u].list.every(E=>d[u].includes(E.value))?[]:[...e[u].list.map(E=>E.value)];_({...d,[u]:O}),p(e[u].name,O)},p=(y,O)=>{const E={},w=r("config"),M=e[u];if(M){const k=M.list.filter(D=>d[u].includes(D.value)).map(D=>D.value);E[M.name]={type:"FIELD",values:M.name===y?O:k},t("config",{...w,...E})}};return g.jsx(g.Fragment,{children:e.map((y,O)=>g.jsxs(j.Accordion,{expanded:u===O,onChange:(E,w)=>v(O,w),children:[g.jsx(j.AccordionSummary,{expandIcon:g.jsx(Oe,{icon:"CHEVRON_UP"}),id:`${O}`,children:g.jsxs(j.Stack,{alignItems:"center",direction:"row",children:[g.jsx(j.Typography,{variant:"subtitle2",color:"grey.600",children:y.label}),g.jsxs(Q22,{variant:"soft",color:"primary",marginLeft:1,children:[d[O].length," selecionados"]})]})}),g.jsxs(j.AccordionDetails,{children:[g.jsxs(j.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[g.jsx(ymt,{onSearch:h,onChange:E=>h(E.target.value),iconPosition:"start",size:"small",placeholder:"Buscar",fullWidth:!0}),g.jsx(j.Button,{onClick:()=>b(),size:"small",children:g.jsx(j.Typography,{variant:"overline",children:"TODOS"})})]}),g.jsx(J22,{children:g.jsx(j.List,{children:u>-1&&y.list.filter(E=>E.label.toLowerCase().includes(l.toLowerCase())).map((E,w)=>g.jsx(j.ListItem,{children:g.jsx(j.FormControlLabel,{control:g.jsx(j.Checkbox,{size:"small",checked:d[u].includes(E.value),onChange:M=>C(y.name,E.value,M),name:E.label}),label:g.jsx(j.Typography,{variant:"caption",color:"grey.600",children:E.label})})},w))})})]})]},O))})},eu2=({columns:e,rows:t,loading:n,totalRows:a})=>{const{apiRef:r,page:u,perPage:c,handlePaginationModelChange:l}=WRn(),{setValue:f,reset:s,watch:d}=Ie.useFormContext(),_=d("name");o.useEffect(()=>()=>{s({name:_,config:{}})},[s]);const[m,v]=o.useState([]),[C,h]=o.useState(),b=y=>{v(y),f("config.products.values",{type:"FIELD",...y})},p=()=>{const y=C==null?void 0:C.toLowerCase();return t.filter(O=>Object.values(O).some(E=>typeof E=="string"||E instanceof String?E.toLowerCase().includes(y||""):!1))};return g.jsxs(j.Stack,{gap:2,children:[g.jsxs(j.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(ymt,{onSearch:y=>h(y),onChange:y=>h(y.target.value),iconPosition:"start",size:"small",placeholder:"Buscar"}),g.jsxs(j.Typography,{variant:"body1",color:"text.disabled",children:[m.length," selecionados"]})]}),g.jsx(WTn,{apiRef:r,columns:e,rows:p(),pagination:!0,paginationModel:{page:u,pageSize:c},rowCount:a,paginationMode:"server",onPaginationModelChange:l,initialState:{pagination:{paginationModel:{pageSize:5,page:u}}},loading:n,fetching:n,checkboxSelection:!0,onRowSelectionModelChange:b})]})},oGn=bt(j.ToggleButton)(({theme:e})=>({width:"100%","&.Mui-selected":{backgroundColor:e.palette.primary.main,color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.primary.main}}})),tu2=bt(j.ToggleButtonGroup)(()=>({display:"flex",justifyContent:"space-between"})),nu2=({rules:e})=>{const[t,n]=o.useState();o.useEffect(()=>{e&&e.length>0&&n(e[0].value)},[]);const a=(r,u)=>{u!==null&&n(u)};return g.jsxs(j.Stack,{gap:2,children:[g.jsx(qt,{name:"name",label:"Nome da regra"}),g.jsx(j.Typography,{color:"grey.500",variant:"overline",children:"Selecione a regra"}),e&&g.jsxs(tu2,{color:"primary",value:t,size:"small",exclusive:!0,onChange:a,children:[e.map((r,u)=>g.jsx(oGn,{value:r.value,size:"small",color:"primary",children:g.jsx(j.Typography,{variant:"body2",children:r.toggleTitle})},u)),g.jsx(oGn,{value:"advanced",size:"small",children:g.jsx(j.Typography,{variant:"body2",children:"Avançado"})})]}),t==="advanced"||!e?g.jsx(g.Fragment,{children:"componente aqui"}):e.map((r,u)=>r.value===t?g.jsx("div",{children:r.component},u):null)]})},qt=({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(j.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}})})},uGn=({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(j.FormControlLabel,{control:g.jsx(j.Switch,{...c,checked:c.value,onChange:(f,s)=>{c.onChange(f),n&&n(f,s)},inputProps:{tabIndex:a}}),...r}),(!!l||t)&&g.jsx(j.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})]})})},ru2=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],au2=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],iu2=j.styled(j.Stack)(({theme:e})=>({border:`1px solid ${j.alpha(e.palette.primary.main,.3)}`,backgroundColor:j.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),ou2=j.styled(j.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),uu2=j.styled(j.IconButton)(()=>({height:"38px",alignSelf:"center"})),cu2=({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(iu2,{children:[g.jsx(Oe,{icon:"INFO_CIRCLE"}),g.jsx(j.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(qt,{name:"name",label:"Nome do webhook"}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(qt,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),g.jsx(qt,{name:"filter",label:"Filtro"})]}),t&&e&&g.jsxs(g.Fragment,{children:[g.jsx(qt,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(qt,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),g.jsx(qt,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:g.jsx(j.InputAdornment,{position:"end",children:g.jsx(ou2,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:g.jsx(Oe,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),g.jsx(qt,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsxs(j.Stack,{width:"35%",gap:2,children:[g.jsx(j.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),g.jsx(qBn,{name:"content_type",options:ru2,row:!0,decorated:!0})]}),g.jsxs(j.Stack,{gap:2,children:[g.jsx(j.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),g.jsx(qBn,{name:"http_method",options:au2,row:!0,decorated:!0})]})]}),g.jsx(j.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),g.jsx(uGn,{name:"active",label:"Ativo"}),g.jsx(j.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((f,s)=>g.jsxs(j.Stack,{direction:"row",gap:2,children:[g.jsx(qt,{name:`headers.${s}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),g.jsx(qt,{name:`headers.${s}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),g.jsx(uu2,{onClick:()=>c(s),color:"error",children:g.jsx(Oe,{icon:"DELETE_MARK_BUTTON_02"})})]},f.id)),g.jsx(yRn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>l(),children:"Adicionar novo cabeçalho"}),g.jsx(j.Divider,{})]})},cGn=({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(dSn,{...c,...r,onChange:f=>{a&&a(f,c.value),c.onChange(f)},error:!!l,helperText:(l==null?void 0:l.message)||t})})},lGn=({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(VBn,{ref:f,...a,name:u,value:l,error:!!s,helperText:(s==null?void 0:s.message)||t,onChange:({target:{value:d}})=>c(d)})})},lu2=({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(j.Stack,{gap:1.5,...t,children:[g.jsxs(j.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[g.jsx(lGn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:g.jsx(j.InputAdornment,{position:"end",children:g.jsx(j.CircularProgress,{size:24})})},rules:a,onKeyDown:m,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),g.jsxs(j.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[g.jsx(qt,{name:c,label:"Logradouro",onKeyDown:m,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),g.jsx(qt,{name:l,label:"Número",onKeyDown:m,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),g.jsxs(j.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[g.jsx(qt,{name:f,label:"Bairro",onKeyDown:m,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),g.jsx(qt,{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(j.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[g.jsx(cGn,{name:d,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),g.jsx(qt,{name:_,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},fu2=({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(j.FormControlLabel,{control:g.jsx(j.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!l||n)&&g.jsx(j.FormHelperText,{error:!!l,children:l?l==null?void 0:l.message:n})]})})},su2=({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(j.FormControl,{component:"fieldset",children:[a&&g.jsx(j.FormLabel,{component:"legend",sx:{typography:"body2"},required:l,children:a}),g.jsx(j.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(j.FormControlLabel,{control:g.jsx(j.Checkbox,{checked:_.includes(C.value),onChange:()=>m.onChange(d(_,C.value))}),label:C.label,...f},C.value))}),(!!v||c)&&g.jsx(j.FormHelperText,{error:!!v,sx:C=>({color:f.disabled?C.palette.grey[500]:void 0}),children:v?v==null?void 0:v.message:c})]})})},du2=({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),O=document.querySelector(`input[name=${e}${y+1}]`);h.length>C&&(m.target.value=h[0]),h.length>=C&&y<6&&O!==null&&O.focus(),v(m)};WSn("paste",s,u);const _=t.some(m=>f[m]);return g.jsxs(j.Stack,{children:[g.jsx(j.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(j.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(j.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},gu2=({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(kNn,{...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}}})}})},mu2=({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}})})},vu2=({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(j.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),Cu2=({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(xBn,{value:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||t,...a,...l,name:e})})},bu2=({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(j.Autocomplete,{...l,onChange:(s,d)=>{r&&r(d),l.onChange(d)},renderInput:s=>g.jsx(j.TextField,{label:t,error:!!f,helperText:f?f==null?void 0:f.message:a,...s}),...u})})},yu2=({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(PCt,{...c,onChange:f=>{c.onChange(f),a&&a(f)},fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...r})})},pu2=({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}=BCt(_,a,c,r,u);return g.jsx(qt,{...s,name:e,type:m?"text":"password",InputProps:{endAdornment:g.jsx(j.InputAdornment,{position:"end",children:g.jsx(j.IconButton,{onClick:()=>v(!m),edge:"end","aria-label":"Mostrar/Ocultar senha",children:g.jsx(Oe,{icon:m?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const O=BCt(y,a,c,r,u);return!O.hasNumberChar||!O.hasSpecialCharacter||!O.hasUpperCaseChar||!O.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}}})},qBn=({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(j.FormControl,{component:"fieldset",sx:{...l&&{paddingLeft:1.5}},children:[a&&g.jsx(j.FormLabel,{component:"legend",id:C,sx:{typography:"body2"},required:d,children:a}),g.jsx(j.RadioGroup,{...m,...h,onChange:(p,y)=>{h.onChange(p),f&&f(p,y)},"aria-labelledby":C,row:n,children:r.map(p=>g.jsx(j.FormControlLabel,{value:p.value,control:g.jsx(j.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 ${j.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:j.alpha(y.primary.main,.05)}}})},p.value))}),(!!b||c)&&g.jsx(j.FormHelperText,{error:!!b,sx:p=>({color:_?p.palette.grey[500]:void 0}),children:b?b==null?void 0:b.message:c})]})})},Ou2=({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}}})}})},ju2=({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:O}=tGn({onFileCropped:e,onImageUploaded:t,onCancel:n});return g.jsxs(g.Fragment,{children:[g.jsxs(j.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[c&&g.jsx(M22,{}),g.jsx(eGn,{...s,id:d,file:l,onDrop:E=>{if(E.length>0){_(!0);const w=new FileReader;w.addEventListener("load",()=>{var k;const M=((k=w.result)==null?void 0:k.toString())||"";t(M),e(void 0)}),w.readAsDataURL(E[0])}},image:u,tabIndex:f})]}),g.jsx(nGn,{id:d,open:v,onClose:C,label:r,aspectRatio:a,imageSrc:u,onRemove:m,onSave:h,onPreview:b,onInitialized:p}),g.jsx(j.Dialog,{open:!!y,onClose:O,scroll:"body",PaperProps:{sx:{p:2}},children:y&&g.jsx("img",{src:y,alt:"Preview"})})]})};function fGn(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 wu2=({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}=fGn(e);return g.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>g.jsx(ju2,{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(j.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},Mu2=({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}=fGn(e);return g.jsx(Ie.Controller,{name:e,control:d,rules:t,render:({field:{value:C},fieldState:{error:h}})=>g.jsx(rGn,{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(j.FormHelperText,{error:!!h,sx:{px:2},children:h?h==null?void 0:h.message:n}),aspect:a,label:r,image:u,...s})})},sGn=j.styled(j.Button)(({theme:e})=>({borderColor:e.palette.grey[300]})),dGn=j.styled(j.Box)(({theme:e})=>({border:"1.5px solid",borderColor:e.palette.grey[300],height:450,width:"40%",borderRadius:8})),Lu2=({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=j.debounce(_,400),h=t.filter(W=>!e.some(x=>x.id===W.id)),b=e.filter(W=>W.name.toLowerCase().includes(m.toLowerCase())),p=d?b:t.filter(W=>e.some(x=>x.id===W.id)),[y,O]=o.useState([]),[E,w]=o.useState([]),M=()=>{r(y),O([])},k=()=>{u(E),w([])},D=W=>{w(W?p:[])},S=W=>{O(W?h:[])},B=(W,x)=>{w(x?T=>[...T,W]:T=>T.filter(A=>A.id!==W.id))},H=(W,x)=>{O(x?T=>[...T,W]:T=>T.filter(A=>A.id!==W.id))},N=W=>{W.key==="Enter"&&W.preventDefault()};return g.jsx(j.Stack,{children:g.jsxs(j.Stack,{direction:"row",alignItems:"center",gap:3,children:[g.jsx(dGn,{display:"flex",flex:1,children:g.jsxs(j.Stack,{flex:1,children:[g.jsxs(j.Stack,{direction:"row",gap:1,padding:2,children:[g.jsx(j.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(j.Stack,{children:[g.jsx(j.Typography,{variant:"subtitle2",color:"text.primary",children:`${l} cadastrados`}),g.jsx(j.Typography,{variant:"caption",color:"text.disabled",children:`${y.length}/${h.length} selecionados`})]})]}),g.jsx(j.Divider,{}),g.jsxs(j.Stack,{p:2,flex:1,children:[g.jsxs(j.Stack,{direction:"row",gap:1,children:[g.jsx(ymt,{iconPosition:"start",placeholder:"Buscar",onKeyDown:N,size:"small",fullWidth:!0,trigger:"change",onSearch:W=>C(W)}),s]}),g.jsx(FBn,{isLoading:n,loading:g.jsx(j.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:g.jsx(j.CircularProgress,{})}),isEmpty:h.length===0,empty:g.jsx(gCt,{text:c?`Nenhum ${a} encontrado`:`Nenhum ${a} disponível`,sx:{svg:{height:140}}}),children:g.jsx(Zce,{sx:{maxHeight:280},children:h.map(W=>g.jsxs(j.Stack,{gap:1,marginTop:"8px",children:[g.jsxs(j.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[g.jsx(j.Checkbox,{size:"small",checked:y.includes(W),onChange:x=>H(W,x.target.checked)}),W.label]}),g.jsx(j.Divider,{})]},W.id))})})]})]})}),g.jsxs(j.Stack,{gap:3,children:[g.jsx(sGn,{variant:"outlined",onClick:M,children:g.jsx(Oe,{icon:"ARROW_RIGHT_SIMPLE"})}),g.jsx(sGn,{variant:"outlined",onClick:k,children:g.jsx(Oe,{icon:"ARROW_LEFT_SIMPLE"})})]}),g.jsx(dGn,{display:"flex",flex:1,children:g.jsxs(j.Stack,{flex:1,children:[g.jsxs(j.Stack,{direction:"row",gap:1,padding:2,children:[g.jsx(j.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(j.Stack,{children:[g.jsx(j.Typography,{variant:"subtitle2",color:"text.primary",children:`${f} selecionados`}),g.jsx(j.Typography,{variant:"caption",color:"text.disabled",children:`${E.length}/${p.length} selecionados`})]})]}),g.jsx(j.Divider,{}),g.jsxs(j.Stack,{p:2,gap:1,children:[d&&g.jsx(ymt,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:W=>v(W??""),onKeyDown:N}),g.jsx(FBn,{isLoading:n,loading:g.jsx(j.Stack,{alignItems:"center",justifyContent:"center",flex:1,children:g.jsx(j.CircularProgress,{})}),isEmpty:p.length===0,empty:g.jsx(gCt,{text:m?`Nenhum ${a} encontrado`:`Nenhum ${a} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:g.jsx(Zce,{sx:{maxHeight:280},children:p.map(W=>g.jsxs(j.Stack,{gap:1,children:[g.jsxs(j.Stack,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[g.jsx(j.Checkbox,{size:"small",checked:E.includes(W),onChange:x=>B(W,x.target.checked)}),W.label]}),g.jsx(j.Divider,{})]},W.id))})})]})]})})]})})},Pu2=Object.freeze(Object.defineProperty({__proto__:null,default:Ger},Symbol.toStringTag,{value:"Module"}));R.ActionButton=yRn,R.Address=lu2,R.Autocomplete=dSn,R.AutocompleteField=cGn,R.BuilderLayout=mDo,R.BuilderSidebar=Fzo,R.Carousel=PEo,R.CarouselArrowIndex=TEo,R.CarouselArrows=BEo,R.CarouselDots=DEo,R.Checkbox=fu2,R.Codes=du2,R.ColorPickerField=gu2,R.ColorPickerInput=kNn,R.Common=tr2,R.CommonSSR=rr2,R.Confirm=ar2,R.CustomAvatar=kTn,R.CustomAvatarGroup=STn,R.DataGrid=WTn,R.DatePicker=_u2,R.DateRangePicker=mu2,R.DateTimePicker=vu2,R.Delayed=cr2,R.DialogAnimate=btr,R.Drawer=br2,R.EmptyContent=qHn,R.EmptyView=gCt,R.Error=pr2,R.FabButtonAnimate=nzn,R.Field=qt,R.FilterRule=q22,R.FixedProgressBar=dCt,R.Form=hu2,R.FrameSkeleton=T22,R.HelpButton=gSn,R.Icon=Oe,R.IconButtonAnimate=rzn,R.Iconify=bZn,R.IllustrationEmptyContent=jIn,R.ImageCrop=JZn,R.Incrementer=xBn,R.IncrementerField=Cu2,R.Label=zBn,R.Lightbox=USo,R.ListingRules=nu2,R.LoadingScreen=Ka2,R.ManualRule=eu2,R.MaskedInput=VBn,R.MaskedInputField=lGn,R.MaterialDesignContent=Wyt,R.MenuPopover=pUn,R.Modal=OUn,R.ModalActions=vi2,R.MotionContainer=Wtr,R.MotionLazyContainer=wyt,R.MotionViewport=Btr,R.MultiCheckbox=su2,R.MultipleChipField=bu2,R.NoData=wIn,R.NumberInput=PCt,R.NumberInputField=yu2,R.PasswordField=pu2,R.PasswordRules=Oi2,R.PopoverSelect=S22,R.Portal=jUn,R.RadioGroupField=qBn,R.Result=FBn,R.SavedChanges=Ti2,R.Scrollbar=Zce,R.SearchInput=ymt,R.SeoPreview=X22,R.SnackbarContent=Byt,R.SnackbarProvider=Dzn,R.SplashScreen=Zi2,R.Steps=Yi2,R.StyledTab=Ki2,R.StyledTabs=Xi2,R.Summary=I22,R.SwapList=Lu2,R.Switch=uGn,R.TRANSITION=MIn,R.TabPanel=Qi2,R.TableEmptyRows=QEo,R.TableHeadCustom=qEo,R.TableNoData=KEo,R.TablePaginationCustom=tko,R.TableSelectedAction=eko,R.TableSkeleton=XEo,R.TextAnimate=ytr,R.TextMaxLine=KO,R.ThemeProvider=ETn,R.TimePicker=Ou2,R.Transition=Wvt,R.Upload=qUn,R.UploadAvatar=eGn,R.UploadAvatarWithCropField=wu2,R.UploadBox=O22,R.UploadIllustration=OIn,R.UploadWithCrop=rGn,R.UploadWithCropField=Mu2,R.Webhook=cu2,R.WhiteBox=aGn,R.color=It2,R.compare=Ezo,R.cssStyles=FEo,R.emptyRows=ZEo,R.file=ji2,R.formatNumber=ja2,R.formatTime=$i2,R.getComparator=UEo,R.loadable=Ni2,R.mask=Vi2,R.number=ha2,R.routes=zi2,R.sort=Ri2,R.useActiveElement=vDo,R.useApiMessage=zzo,R.useCarousel=EEo,R.useCopyToClipboard=hDo,R.useDatagrid=WRn,R.useDeepCompareEffect=Szo,R.useEventListener=WSn,R.useIsMounting=Bzo,R.useLightBox=KSo,R.useOffSetTop=xzo,R.useOnClickOutside=$zo,R.usePagination=Izo,R.usePopover=$Sn,R.useResponsive=izn,R.useSnackbar=Bzn,R.useTable=GEo,R.useTabs=Wzo,R.useToggle=ISn,R.uuidv4=Fi2,R.validators=bi2,R.varBgColor=xXn,R.varBgKenburns=zXn,R.varBgPan=HXn,R.varBounce=WXn,R.varContainer=avt,R.varFade=sle,R.varFlip=SXn,R.varHover=$Xn,R.varPath=PXn,R.varRotate=IXn,R.varScale=BXn,R.varSlide=DXn,R.varTranEnter=$e,R.varTranExit=Ne,R.varTranHover=EXn,R.varZoom=kXn,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|