dynamic-mui 2.4.0 → 2.5.0

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.
Files changed (112) hide show
  1. package/dist/{index-B7i3cvH0.mjs → AIForm-Czsvpf7g.mjs} +4178 -4336
  2. package/dist/AIForm-LoeI18mO.js +43 -0
  3. package/dist/accordion-8p1FoyfL.js +1 -0
  4. package/dist/{accordion-Bc3bEKtC.mjs → accordion-CQ4Vldth.mjs} +1 -1
  5. package/dist/{addressfield-bU-3Rnkq.mjs → addressfield-N7DifI3i.mjs} +52 -40
  6. package/dist/addressfield-T4e_d87q.js +1 -0
  7. package/dist/ai/index.cjs +1 -0
  8. package/dist/ai/index.mjs +14 -0
  9. package/dist/asyncautocomplete-BB_MyjIj.mjs +92 -0
  10. package/dist/asyncautocomplete-CpO6EO3W.js +1 -0
  11. package/dist/bar-BOse0ZkP.js +1 -0
  12. package/dist/{bar-DUZXtBln.mjs → bar-CbpJ-MEV.mjs} +1 -1
  13. package/dist/cascadeselect-C30RVgmc.js +1 -0
  14. package/dist/cascadeselect-PzCw6JHX.mjs +66 -0
  15. package/dist/colorpicker-CMhVJNQT.mjs +111 -0
  16. package/dist/colorpicker-DoNrfUY7.js +1 -0
  17. package/dist/consentfield-Bp1dXs7L.js +1 -0
  18. package/dist/{consentfield-DxqzSUsQ.mjs → consentfield-DIa3sXrr.mjs} +18 -16
  19. package/dist/{datatable-vq0d5mZg.mjs → datatable-CO0Iv6R6.mjs} +1 -1
  20. package/dist/datatable-CyfyY3Wh.js +1 -0
  21. package/dist/dynamic-mui.cjs +1 -1
  22. package/dist/dynamic-mui.d.ts +2 -0
  23. package/dist/dynamic-mui.mjs +207 -33
  24. package/dist/editabletable-CCDJ2BPB.js +1 -0
  25. package/dist/{editabletable-C5eH6sPe.mjs → editabletable-C_MA7QEb.mjs} +30 -28
  26. package/dist/{fileupload-XnztToJ2.mjs → fileupload-DX3dxKFN.mjs} +26 -13
  27. package/dist/fileupload-WV5shCIK.js +1 -0
  28. package/dist/formrepeater-Cxu8Dk8P.js +1 -0
  29. package/dist/{formrepeater-CDhYRFqz.mjs → formrepeater-D5K8qgAA.mjs} +24 -20
  30. package/dist/{formwizard-C2QaC746.mjs → formwizard-B-HCfrnp.mjs} +1 -1
  31. package/dist/formwizard-HRF3hTyF.js +1 -0
  32. package/dist/geofield-0k7PkHRa.js +1 -0
  33. package/dist/{geofield-_dw7uIT2.mjs → geofield-DlqMZ_hl.mjs} +35 -31
  34. package/dist/{group-CZgTXmJP.mjs → group-BFDXdAfg.mjs} +1 -1
  35. package/dist/group-mONe185y.js +1 -0
  36. package/dist/{intlphone-357BAzba.mjs → intlphone-Bbk2UF9T.mjs} +16 -12
  37. package/dist/intlphone-zZ0xd-DG.js +1 -0
  38. package/dist/keyvaluefield-B6oRZzic.js +1 -0
  39. package/dist/{keyvaluefield-BRX83BRS.mjs → keyvaluefield-BynOkgTq.mjs} +16 -14
  40. package/dist/line-ChQNdVfl.js +1 -0
  41. package/dist/{line-JDUXJ2fy.mjs → line-DebtzkF3.mjs} +1 -1
  42. package/dist/lineitemlist-CI0LwIUz.js +1 -0
  43. package/dist/{lineitemlist-D84p4ZC5.mjs → lineitemlist-CjFNpqI5.mjs} +29 -25
  44. package/dist/{list-B6gocnmr.mjs → list-B5wBsflP.mjs} +2 -2
  45. package/dist/list-CJFKxKyN.js +1 -0
  46. package/dist/locationfield-CrOMF7jt.js +1 -0
  47. package/dist/locationfield-DQj3yDCa.mjs +118 -0
  48. package/dist/markdowneditor-Jaz7uTyZ.js +2 -0
  49. package/dist/{markdowneditor-B0CYYefE.mjs → markdowneditor-emqJhQV7.mjs} +15 -11
  50. package/dist/matrixfield-BPJsawGk.js +1 -0
  51. package/dist/{matrixfield-D9IJr1qQ.mjs → matrixfield-j5mf9lh5.mjs} +39 -35
  52. package/dist/{mixChart-ISf3Kbr-.mjs → mixChart-Doq4lt7Z.mjs} +2 -2
  53. package/dist/mixChart-rgyMCdnp.js +1 -0
  54. package/dist/{multitextbox-CrHH_t_8.mjs → multitextbox-CyZiTd_E.mjs} +23 -23
  55. package/dist/multitextbox-DQbcEqkM.js +1 -0
  56. package/dist/{npsscale-BS-ooCks.mjs → npsscale-BIkJMD4Z.mjs} +17 -13
  57. package/dist/npsscale-oUUyPdxP.js +1 -0
  58. package/dist/numberstepper-DRIvgtcH.js +1 -0
  59. package/dist/{numberstepper-Dc7wEzfb.mjs → numberstepper-thjufBMI.mjs} +13 -9
  60. package/dist/{pie-BpGQ6Aor.mjs → pie-4SHUYmRs.mjs} +1 -1
  61. package/dist/pie-COA-uozf.js +1 -0
  62. package/dist/richtexteditor-BSV7hG6d.js +1 -0
  63. package/dist/{richtexteditor-DHDVUoic.mjs → richtexteditor-CvZ3Y7X1.mjs} +4 -2
  64. package/dist/{signature-CDaNiDTO.js → signature-6QvVbfkT.js} +2 -2
  65. package/dist/{signature-Twiet_Pp.mjs → signature-DeDxnc8U.mjs} +4 -2
  66. package/dist/stepper-CDsErlLH.js +1 -0
  67. package/dist/{stepper-PK1xI0po.mjs → stepper-Sx3SWXTM.mjs} +4 -4
  68. package/dist/{summaryfield-CDDYwbfV.mjs → summaryfield-CAJjGmE2.mjs} +5 -5
  69. package/dist/summaryfield-DxzQ3g6Z.js +1 -0
  70. package/dist/tabs-CnDP2ngC.js +1 -0
  71. package/dist/{tabs-BJ9HBvyr.mjs → tabs-CvHNZU5o.mjs} +1 -1
  72. package/dist/tagsinput-DZcLPuX1.js +1 -0
  73. package/dist/tagsinput-bWU3Mem0.mjs +58 -0
  74. package/package.json +16 -11
  75. package/dist/accordion-CI-d8sBW.js +0 -1
  76. package/dist/addressfield-BVtAZyuA.js +0 -1
  77. package/dist/asyncautocomplete-BojHePYN.mjs +0 -89
  78. package/dist/asyncautocomplete-CGUaYa8k.js +0 -1
  79. package/dist/bar-D-Mi7Kmk.js +0 -1
  80. package/dist/cascadeselect-CMqn7Tql.mjs +0 -64
  81. package/dist/cascadeselect-Cu_sJIFt.js +0 -1
  82. package/dist/colorpicker-C6X7x0s_.js +0 -1
  83. package/dist/colorpicker-CXWSUm_s.mjs +0 -98
  84. package/dist/consentfield-BbwsP80E.js +0 -1
  85. package/dist/datatable-BThXDunv.js +0 -1
  86. package/dist/editabletable-Bv2TfEOc.js +0 -1
  87. package/dist/fileupload-CmWZnxyT.js +0 -1
  88. package/dist/formrepeater-COl6gNZi.js +0 -1
  89. package/dist/formwizard-hlQ_NCsd.js +0 -1
  90. package/dist/geofield-wtSTkcE0.js +0 -1
  91. package/dist/group-D95eDbtd.js +0 -1
  92. package/dist/index-DX3lZIKI.js +0 -43
  93. package/dist/intlphone-DR5-jK9f.js +0 -1
  94. package/dist/keyvaluefield-C89E1mqp.js +0 -1
  95. package/dist/line-B_-WceU1.js +0 -1
  96. package/dist/lineitemlist-VAV6uqyg.js +0 -1
  97. package/dist/list-DFdCIA2P.js +0 -1
  98. package/dist/locationfield-DSV_O6aK.js +0 -1
  99. package/dist/locationfield-En3apdDQ.mjs +0 -119
  100. package/dist/markdowneditor-LUCZHsC6.js +0 -2
  101. package/dist/matrixfield-BxngfAiS.js +0 -1
  102. package/dist/mixChart-C3o184UT.js +0 -1
  103. package/dist/multitextbox-DETwPeJY.js +0 -1
  104. package/dist/npsscale-5fQ1nTCy.js +0 -1
  105. package/dist/numberstepper-FRaiyZz0.js +0 -1
  106. package/dist/pie-DvzqIIDM.js +0 -1
  107. package/dist/richtexteditor-B7iljrHN.js +0 -1
  108. package/dist/stepper-Cf2nMTEt.js +0 -1
  109. package/dist/summaryfield-XXHz95hU.js +0 -1
  110. package/dist/tabs-B3s52APG.js +0 -1
  111. package/dist/tagsinput-B2W--DfP.mjs +0 -58
  112. package/dist/tagsinput-Dz7D54iz.js +0 -1
@@ -7,12 +7,12 @@ import k from "@mui/material/TextField";
7
7
  import y from "@mui/material/FormControl";
8
8
  import C from "@mui/material/FormLabel";
9
9
  import { alpha as S } from "@mui/material/styles";
10
- import { u as j, m as M, a as H } from "./index-B7i3cvH0.mjs";
11
- function R(t) {
10
+ import { j, m as M, k as H } from "./AIForm-Czsvpf7g.mjs";
11
+ function I(t) {
12
12
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
13
13
  }
14
- function T(t) {
15
- let e = R(t || "");
14
+ function R(t) {
15
+ let e = I(t || "");
16
16
  return e = e.replace(/^###\s+(.*)$/gm, "<h3>$1</h3>"), e = e.replace(/^##\s+(.*)$/gm, "<h2>$1</h2>"), e = e.replace(/^#\s+(.*)$/gm, "<h1>$1</h1>"), e = e.replace(/(?:^-\s+.*(?:\n|$))+/gm, (a) => `<ul>${a.trimEnd().split(`
17
17
  `).map((n) => n.replace(/^-\s+(.*)$/, "<li>$1</li>")).join("")}</ul>`), e = e.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, '<a href="$2">$1</a>'), e = e.replace(/`([^`]+)`/g, "<code>$1</code>"), e = e.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), e = e.replace(/\*([^*]+)\*/g, "<em>$1</em>"), e = e.split(/\n{2,}/).map((a) => {
18
18
  const o = a.trim();
@@ -20,7 +20,7 @@ function T(t) {
20
20
  }).join(""), e;
21
21
  }
22
22
  function U({ attributes: t = {}, rules: e = {}, onChange: a }) {
23
- const { id: o = "", label: n, rows: i = 6, MuiAttributes: f = {} } = t, { sx: h, ...g } = f, [m, s] = u.useState(t.value || ""), [p, x] = u.useState(!1);
23
+ const { id: o = "", label: n, rows: i = 6, MuiAttributes: h = {} } = t, { sx: f, ...g } = h, [m, s] = u.useState(t.value || ""), [p, x] = u.useState(!1);
24
24
  j(() => {
25
25
  s(t.value || "");
26
26
  }, [t.value]);
@@ -32,9 +32,11 @@ function U({ attributes: t = {}, rules: e = {}, onChange: a }) {
32
32
  v,
33
33
  {
34
34
  direction: "row",
35
- justifyContent: "space-between",
36
- alignItems: "center",
37
- sx: { mb: 1 },
35
+ sx: {
36
+ justifyContent: "space-between",
37
+ alignItems: "center",
38
+ mb: 1
39
+ },
38
40
  children: [
39
41
  n ? /* @__PURE__ */ l(C, { component: "legend", children: n }) : /* @__PURE__ */ l("span", {}),
40
42
  /* @__PURE__ */ l(
@@ -54,7 +56,7 @@ function U({ attributes: t = {}, rules: e = {}, onChange: a }) {
54
56
  w,
55
57
  {
56
58
  "data-testid": "markdown-preview",
57
- dangerouslySetInnerHTML: { __html: T(m) },
59
+ dangerouslySetInnerHTML: { __html: R(m) },
58
60
  sx: {
59
61
  minHeight: (r) => r.spacing(i * 3),
60
62
  p: 2,
@@ -78,9 +80,11 @@ function U({ attributes: t = {}, rules: e = {}, onChange: a }) {
78
80
  minRows: i,
79
81
  fullWidth: !0,
80
82
  placeholder: "Write markdown…",
81
- inputProps: { "aria-label": n || "markdown editor" },
82
83
  ...g,
83
- sx: M(H, h)
84
+ sx: M(H, f),
85
+ slotProps: {
86
+ htmlInput: { "aria-label": n || "markdown editor" }
87
+ }
84
88
  }
85
89
  )
86
90
  ] });
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("react"),w=require("@mui/material/Table"),B=require("@mui/material/TableBody"),c=require("@mui/material/TableCell"),L=require("@mui/material/TableContainer"),O=require("@mui/material/TableHead"),A=require("@mui/material/TableRow"),U=require("@mui/material/Radio"),D=require("@mui/material/Checkbox"),G=require("@mui/material/FormControl"),J=require("@mui/material/FormLabel"),K=require("@mui/material/FormHelperText"),M=require("@mui/material/styles"),x=require("./AIForm-LoeI18mO.js"),N=a=>(a||[]).map(s=>typeof s=="string"?{id:s,label:s}:{id:String(s.id),label:s.label??String(s.id)}),Q=a=>(a||[]).map(s=>typeof s=="string"?{value:s,label:s}:{value:String(s.value),label:s.label??String(s.value)});function V({attributes:a={},rules:s={},onChange:k}){const{MuiAttributes:R={},id:b="",rows:p=[],columns:g=[],multiple:d=!1,label:v=""}=a,f=o.useMemo(()=>N(p),[p]),y=o.useMemo(()=>Q(g),[g]),[i,q]=o.useState(a.value||{}),[j,F]=o.useState(!1),[S,$]=o.useState("");x.useUpdateEffect(()=>{q(a.value||{})},[a.value]);const m=s?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,W=e=>{let r=!0,n="";return m&&(f.every(u=>{const l=e[u.id];return d?Array.isArray(l)&&l.length>0:l!=null&&l!==""})||(r=!1,n=s?.validation?.find(l=>l.rule==="mandatory"||l.rule==="mandatoryselect")?.message||"Required")),{isValid:r,message:n}},C=e=>{q(e);const r=W(e);F(!r.isValid),$(r.message),k?.({id:b,value:e,option:e})},z=(e,r)=>{C({...i,[e]:r})},H=(e,r,n)=>{const h=Array.isArray(i[e])?i[e]:[],u=n?[...h,r]:h.filter(l=>l!==r);C({...i,[e]:u})},T=(e,r)=>{const n=i[e];return d?Array.isArray(n)&&n.includes(r):n===r},{sx:P,...E}=R;return t.jsxs(G,{required:m,error:j,component:"fieldset",fullWidth:!0,children:[v&&t.jsx(J,{required:m,error:j,sx:{mb:1,fontWeight:600},children:v}),t.jsx(L,{sx:x.mergeSx(x.premiumSurfaceSx,{width:"100%"}),children:t.jsxs(w,{size:"small",...E,sx:P,children:[t.jsx(O,{children:t.jsxs(A,{sx:e=>({backgroundColor:M.alpha(e.palette.primary.main,.06)}),children:[t.jsx(c,{sx:{fontWeight:700}}),y.map(e=>t.jsx(c,{align:"center",sx:{fontWeight:700},children:e.label},e.value))]})}),t.jsx(B,{children:f.map(e=>t.jsxs(A,{hover:!0,sx:r=>({transition:"background-color .18s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{backgroundColor:M.alpha(r.palette.primary.main,.04)}}),children:[t.jsx(c,{component:"th",scope:"row",sx:{fontWeight:500},children:e.label}),y.map(r=>t.jsx(c,{align:"center",padding:"checkbox",children:d?t.jsx(D,{checked:T(e.id,r.value),onChange:n=>H(e.id,r.value,n.target.checked),slotProps:{input:{"aria-label":`${e.label} ${r.label}`}}}):t.jsx(U,{name:`matrix-${b}-${e.id}`,checked:T(e.id,r.value),onChange:()=>z(e.id,r.value),slotProps:{input:{"aria-label":`${e.label} ${r.label}`}}})},r.value))]},e.id))})]})}),S&&t.jsx(K,{children:S})]})}exports.default=V;
@@ -1,4 +1,4 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
2
  import s from "react";
3
3
  import w from "@mui/material/Table";
4
4
  import B from "@mui/material/TableBody";
@@ -12,13 +12,13 @@ import J from "@mui/material/FormControl";
12
12
  import K from "@mui/material/FormLabel";
13
13
  import N from "@mui/material/FormHelperText";
14
14
  import { alpha as R } from "@mui/material/styles";
15
- import { u as O, m as Q, b as V } from "./index-B7i3cvH0.mjs";
16
- const X = (n) => (n || []).map(
17
- (a) => typeof a == "string" ? { id: a, label: a } : { id: String(a.id), label: a.label ?? String(a.id) }
18
- ), Y = (n) => (n || []).map(
19
- (a) => typeof a == "string" ? { value: a, label: a } : { value: String(a.value), label: a.label ?? String(a.value) }
15
+ import { j as O, m as Q, l as V } from "./AIForm-Czsvpf7g.mjs";
16
+ const X = (o) => (o || []).map(
17
+ (t) => typeof t == "string" ? { id: t, label: t } : { id: String(t.id), label: t.label ?? String(t.id) }
18
+ ), Y = (o) => (o || []).map(
19
+ (t) => typeof t == "string" ? { value: t, label: t } : { value: String(t.value), label: t.label ?? String(t.value) }
20
20
  );
21
- function ce({ attributes: n = {}, rules: a = {}, onChange: $ }) {
21
+ function ce({ attributes: o = {}, rules: t = {}, onChange: $ }) {
22
22
  const {
23
23
  MuiAttributes: F = {},
24
24
  id: h = "",
@@ -26,51 +26,51 @@ function ce({ attributes: n = {}, rules: a = {}, onChange: $ }) {
26
26
  columns: g = [],
27
27
  multiple: c = !1,
28
28
  label: v = ""
29
- } = n, x = s.useMemo(() => X(b), [b]), y = s.useMemo(() => Y(g), [g]), [o, S] = s.useState(n.value || {}), [C, W] = s.useState(!1), [T, z] = s.useState("");
29
+ } = o, x = s.useMemo(() => X(b), [b]), y = s.useMemo(() => Y(g), [g]), [n, S] = s.useState(o.value || {}), [C, W] = s.useState(!1), [T, z] = s.useState("");
30
30
  O(() => {
31
- S(n.value || {});
32
- }, [n.value]);
33
- const p = a?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, q = (e) => {
31
+ S(o.value || {});
32
+ }, [o.value]);
33
+ const p = t?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, j = (e) => {
34
34
  let r = !0, l = "";
35
35
  return p && (x.every((m) => {
36
36
  const i = e[m.id];
37
37
  return c ? Array.isArray(i) && i.length > 0 : i != null && i !== "";
38
- }) || (r = !1, l = a?.validation?.find(
38
+ }) || (r = !1, l = t?.validation?.find(
39
39
  (i) => i.rule === "mandatory" || i.rule === "mandatoryselect"
40
40
  )?.message || "Required")), { isValid: r, message: l };
41
41
  }, k = (e) => {
42
42
  S(e);
43
- const r = q(e);
43
+ const r = j(e);
44
44
  W(!r.isValid), z(r.message), $?.({ id: h, value: e, option: e });
45
- }, H = (e, r) => {
46
- k({ ...o, [e]: r });
47
- }, j = (e, r, l) => {
48
- const f = Array.isArray(o[e]) ? o[e] : [], m = l ? [...f, r] : f.filter((i) => i !== r);
49
- k({ ...o, [e]: m });
45
+ }, q = (e, r) => {
46
+ k({ ...n, [e]: r });
47
+ }, H = (e, r, l) => {
48
+ const f = Array.isArray(n[e]) ? n[e] : [], m = l ? [...f, r] : f.filter((i) => i !== r);
49
+ k({ ...n, [e]: m });
50
50
  }, A = (e, r) => {
51
- const l = o[e];
51
+ const l = n[e];
52
52
  return c ? Array.isArray(l) && l.includes(r) : l === r;
53
53
  }, { sx: E, ...P } = F;
54
54
  return /* @__PURE__ */ d(J, { required: p, error: C, component: "fieldset", fullWidth: !0, children: [
55
- v && /* @__PURE__ */ t(K, { required: p, error: C, sx: { mb: 1, fontWeight: 600 }, children: v }),
56
- /* @__PURE__ */ t(
55
+ v && /* @__PURE__ */ a(K, { required: p, error: C, sx: { mb: 1, fontWeight: 600 }, children: v }),
56
+ /* @__PURE__ */ a(
57
57
  L,
58
58
  {
59
59
  sx: Q(V, { width: "100%" }),
60
60
  children: /* @__PURE__ */ d(w, { size: "small", ...P, sx: E, children: [
61
- /* @__PURE__ */ t(U, { children: /* @__PURE__ */ d(
61
+ /* @__PURE__ */ a(U, { children: /* @__PURE__ */ d(
62
62
  M,
63
63
  {
64
64
  sx: (e) => ({
65
65
  backgroundColor: R(e.palette.primary.main, 0.06)
66
66
  }),
67
67
  children: [
68
- /* @__PURE__ */ t(u, { sx: { fontWeight: 700 } }),
69
- y.map((e) => /* @__PURE__ */ t(u, { align: "center", sx: { fontWeight: 700 }, children: e.label }, e.value))
68
+ /* @__PURE__ */ a(u, { sx: { fontWeight: 700 } }),
69
+ y.map((e) => /* @__PURE__ */ a(u, { align: "center", sx: { fontWeight: 700 }, children: e.label }, e.value))
70
70
  ]
71
71
  }
72
72
  ) }),
73
- /* @__PURE__ */ t(B, { children: x.map((e) => /* @__PURE__ */ d(
73
+ /* @__PURE__ */ a(B, { children: x.map((e) => /* @__PURE__ */ d(
74
74
  M,
75
75
  {
76
76
  hover: !0,
@@ -81,24 +81,28 @@ function ce({ attributes: n = {}, rules: a = {}, onChange: $ }) {
81
81
  }
82
82
  }),
83
83
  children: [
84
- /* @__PURE__ */ t(u, { component: "th", scope: "row", sx: { fontWeight: 500 }, children: e.label }),
85
- y.map((r) => /* @__PURE__ */ t(u, { align: "center", padding: "checkbox", children: c ? /* @__PURE__ */ t(
84
+ /* @__PURE__ */ a(u, { component: "th", scope: "row", sx: { fontWeight: 500 }, children: e.label }),
85
+ y.map((r) => /* @__PURE__ */ a(u, { align: "center", padding: "checkbox", children: c ? /* @__PURE__ */ a(
86
86
  G,
87
87
  {
88
88
  checked: A(e.id, r.value),
89
- onChange: (l) => j(e.id, r.value, l.target.checked),
90
- inputProps: {
91
- "aria-label": `${e.label} ${r.label}`
89
+ onChange: (l) => H(e.id, r.value, l.target.checked),
90
+ slotProps: {
91
+ input: {
92
+ "aria-label": `${e.label} ${r.label}`
93
+ }
92
94
  }
93
95
  }
94
- ) : /* @__PURE__ */ t(
96
+ ) : /* @__PURE__ */ a(
95
97
  D,
96
98
  {
97
99
  name: `matrix-${h}-${e.id}`,
98
100
  checked: A(e.id, r.value),
99
- onChange: () => H(e.id, r.value),
100
- inputProps: {
101
- "aria-label": `${e.label} ${r.label}`
101
+ onChange: () => q(e.id, r.value),
102
+ slotProps: {
103
+ input: {
104
+ "aria-label": `${e.label} ${r.label}`
105
+ }
102
106
  }
103
107
  }
104
108
  ) }, r.value))
@@ -109,7 +113,7 @@ function ce({ attributes: n = {}, rules: a = {}, onChange: $ }) {
109
113
  ] })
110
114
  }
111
115
  ),
112
- T && /* @__PURE__ */ t(N, { children: T })
116
+ T && /* @__PURE__ */ a(N, { children: T })
113
117
  ] });
114
118
  }
115
119
  export {
@@ -4,14 +4,14 @@ import l from "@mui/material/Box";
4
4
  import f from "@mui/material/CircularProgress";
5
5
  const d = c.lazy(async () => {
6
6
  const [
7
- { ChartContainer: i },
7
+ { ChartsContainer: i },
8
8
  { LinePlot: s },
9
9
  { BarPlot: a },
10
10
  { ChartsXAxis: e },
11
11
  { ChartsYAxis: n },
12
12
  { axisClasses: r }
13
13
  ] = await Promise.all([
14
- import("@mui/x-charts/ChartContainer"),
14
+ import("@mui/x-charts/ChartsContainer"),
15
15
  import("@mui/x-charts/LineChart"),
16
16
  import("@mui/x-charts/BarChart"),
17
17
  import("@mui/x-charts/ChartsXAxis"),
@@ -0,0 +1 @@
1
+ "use strict";var m=Object.create;var x=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var M=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of f(r))!A.call(t,i)&&i!==e&&x(t,i,{get:()=>r[i],enumerable:!(n=p(r,i))||n.enumerable});return t};var o=(t,r,e)=>(e=t!=null?m(b(t)):{},M(r||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("react"),u=require("@mui/material/Box"),y=require("@mui/material/CircularProgress"),P=c.lazy(async()=>{const[{ChartsContainer:t},{LinePlot:r},{BarPlot:e},{ChartsXAxis:n},{ChartsYAxis:i},{axisClasses:a}]=await Promise.all([import("@mui/x-charts/ChartsContainer"),import("@mui/x-charts/LineChart"),import("@mui/x-charts/BarChart"),import("@mui/x-charts/ChartsXAxis"),import("@mui/x-charts/ChartsYAxis"),import("@mui/x-charts/ChartsAxis")]);return{default:({MuiChartContainerAttributes:h={},MuiChartXAxisAttributes:C={},MuiChartYAxisAttributes:j={},MuiChartSX:d={}})=>s.jsxs(t,{sx:{[`.${a.left} .${a.label}`]:{transform:"translate(-25px, 0)"},[`.${a.right} .${a.label}`]:{transform:"translate(30px, 0)"},...d},...h,children:[s.jsx(e,{}),s.jsx(r,{}),s.jsx(n,{...C}),s.jsx(i,{...j})]})}});function g({attributes:t={}}){const{id:r,MuiBoxAttributes:e={},MuiChartContainerAttributes:n={},MuiChartXAxisAttributes:i={},MuiChartYAxisAttributes:a={},MuiChartSX:l={}}=t;return s.jsx(u,{sx:{width:"100%",maxWidth:600},...e,children:s.jsx(c.Suspense,{fallback:s.jsx(u,{sx:{display:"flex",justifyContent:"center",p:2},children:s.jsx(y,{})}),children:s.jsx(P,{MuiChartContainerAttributes:n,MuiChartXAxisAttributes:i,MuiChartYAxisAttributes:a,MuiChartSX:l})})},r)}exports.default=g;
@@ -1,9 +1,9 @@
1
- import { jsx as a, jsxs as k } from "react/jsx-runtime";
2
- import { useRef as S, useState as j, useEffect as R } from "react";
1
+ import { jsx as o, jsxs as k } from "react/jsx-runtime";
2
+ import { useRef as j, useState as S, useEffect as R } from "react";
3
3
  import { Stack as q, Box as w, TextField as O, Button as $, Icon as d, IconButton as B } from "@mui/material";
4
- import { u as v, a as C } from "./index-B7i3cvH0.mjs";
4
+ import { j as v, k as C } from "./AIForm-Czsvpf7g.mjs";
5
5
  function T({ attributes: r = {}, rules: p = {}, onChange: i, submitTick: c, messages: m }) {
6
- const { id: u = "" } = r, h = m?.required || "Required", f = S(null), [t, o] = j(() => {
6
+ const { id: s = "" } = r, h = m?.required || "Required", f = j(null), [t, a] = S(() => {
7
7
  if (r.value && typeof r.value == "object") {
8
8
  const e = Object.entries(r.value).map(([l, n]) => ({
9
9
  key: l,
@@ -12,41 +12,41 @@ function T({ attributes: r = {}, rules: p = {}, onChange: i, submitTick: c, mess
12
12
  if (e.length > 0) return e;
13
13
  }
14
14
  return [{ key: "t1", value: "" }];
15
- }), s = p?.validation?.some((e) => e.rule === "mandatory") || !1;
15
+ }), u = p?.validation?.some((e) => e.rule === "mandatory") || !1;
16
16
  v(() => {
17
- c && s && !t[0]?.value && f.current?.focus();
17
+ c && u && !t[0]?.value && f.current?.focus();
18
18
  }, [c]), v(() => {
19
19
  if (r.value && typeof r.value == "object") {
20
20
  const e = Object.entries(r.value).map(([l, n]) => ({
21
21
  key: l,
22
22
  value: String(n)
23
23
  }));
24
- JSON.stringify(e) !== JSON.stringify(t) && o(e.length > 0 ? e : [{ key: "t1", value: "" }]);
25
- } else r.value || o([{ key: "t1", value: "" }]);
24
+ JSON.stringify(e) !== JSON.stringify(t) && a(e.length > 0 ? e : [{ key: "t1", value: "" }]);
25
+ } else r.value || a([{ key: "t1", value: "" }]);
26
26
  }, [r.value]), R(() => {
27
27
  const e = t.reduce((l, n) => (l[n.key] = n.value, l), {});
28
- i && i({ id: u, value: e });
29
- }, [t, u]);
28
+ i && i({ id: s, value: e });
29
+ }, [t, s]);
30
30
  const y = () => {
31
31
  const e = t.length + 1;
32
- o([...t, { key: `t${e}`, value: "" }]);
32
+ a([...t, { key: `t${e}`, value: "" }]);
33
33
  }, g = (e) => {
34
34
  const l = t.filter((n, I) => I !== e);
35
- o(l);
35
+ a(l);
36
36
  }, x = (e, l) => {
37
37
  const n = [...t];
38
- n[e].value = l, o(n);
38
+ n[e].value = l, a(n);
39
39
  };
40
- return /* @__PURE__ */ a(q, { spacing: 2, sx: { width: "100%" }, children: t.map((e, l) => /* @__PURE__ */ k(w, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
41
- /* @__PURE__ */ a(
40
+ return /* @__PURE__ */ o(q, { spacing: 2, sx: { width: "100%" }, children: t.map((e, l) => /* @__PURE__ */ k(w, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
41
+ /* @__PURE__ */ o(
42
42
  O,
43
43
  {
44
44
  fullWidth: !0,
45
- id: l === 0 ? u : `${u}_${e.key}`,
45
+ id: l === 0 ? s : `${s}_${e.key}`,
46
46
  inputRef: l === 0 ? f : void 0,
47
- required: s,
48
- error: s && !e.value,
49
- helperText: s && !e.value ? h : "",
47
+ required: u,
48
+ error: u && !e.value,
49
+ helperText: u && !e.value ? h : "",
50
50
  label: `Value ${e.key}`,
51
51
  value: e.value,
52
52
  onChange: (n) => x(l, n.target.value),
@@ -54,21 +54,21 @@ function T({ attributes: r = {}, rules: p = {}, onChange: i, submitTick: c, mess
54
54
  sx: C
55
55
  }
56
56
  ),
57
- l === t.length - 1 ? /* @__PURE__ */ a(
57
+ l === t.length - 1 ? /* @__PURE__ */ o(
58
58
  $,
59
59
  {
60
60
  variant: "contained",
61
61
  color: "primary",
62
62
  onClick: y,
63
63
  sx: { minWidth: "40px", p: 1 },
64
- children: /* @__PURE__ */ a(d, { children: "add" })
64
+ children: /* @__PURE__ */ o(d, { children: "add" })
65
65
  }
66
- ) : /* @__PURE__ */ a(
66
+ ) : /* @__PURE__ */ o(
67
67
  B,
68
68
  {
69
69
  color: "error",
70
70
  onClick: () => g(l),
71
- children: /* @__PURE__ */ a(d, { children: "remove" })
71
+ children: /* @__PURE__ */ o(d, { children: "remove" })
72
72
  }
73
73
  )
74
74
  ] }, l)) });
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),a=require("@mui/material"),d=require("./AIForm-LoeI18mO.js");function k({attributes:r={},rules:h={},onChange:f,submitTick:v,messages:m}){const{id:o=""}=r,x=m?.required||"Required",p=i.useRef(null),[l,u]=i.useState(()=>{if(r.value&&typeof r.value=="object"){const e=Object.entries(r.value).map(([n,t])=>({key:n,value:String(t)}));if(e.length>0)return e}return[{key:"t1",value:""}]}),c=h?.validation?.some(e=>e.rule==="mandatory")||!1;d.useUpdateEffect(()=>{v&&c&&!l[0]?.value&&p.current?.focus()},[v]),d.useUpdateEffect(()=>{if(r.value&&typeof r.value=="object"){const e=Object.entries(r.value).map(([n,t])=>({key:n,value:String(t)}));JSON.stringify(e)!==JSON.stringify(l)&&u(e.length>0?e:[{key:"t1",value:""}])}else r.value||u([{key:"t1",value:""}])},[r.value]),i.useEffect(()=>{const e=l.reduce((n,t)=>(n[t.key]=t.value,n),{});f&&f({id:o,value:e})},[l,o]);const y=()=>{const e=l.length+1;u([...l,{key:`t${e}`,value:""}])},g=e=>{const n=l.filter((t,I)=>I!==e);u(n)},j=(e,n)=>{const t=[...l];t[e].value=n,u(t)};return s.jsx(a.Stack,{spacing:2,sx:{width:"100%"},children:l.map((e,n)=>s.jsxs(a.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[s.jsx(a.TextField,{fullWidth:!0,id:n===0?o:`${o}_${e.key}`,inputRef:n===0?p:void 0,required:c,error:c&&!e.value,helperText:c&&!e.value?x:"",label:`Value ${e.key}`,value:e.value,onChange:t=>j(n,t.target.value),size:"small",sx:d.premiumInputSx}),n===l.length-1?s.jsx(a.Button,{variant:"contained",color:"primary",onClick:y,sx:{minWidth:"40px",p:1},children:s.jsx(a.Icon,{children:"add"})}):s.jsx(a.IconButton,{color:"error",onClick:()=>g(n),children:s.jsx(a.Icon,{children:"remove"})})]},n))})}exports.default=k;
@@ -7,34 +7,34 @@ import A from "@mui/material/FormControl";
7
7
  import F from "@mui/material/FormLabel";
8
8
  import L from "@mui/material/FormHelperText";
9
9
  import { alpha as l } from "@mui/material/styles";
10
- import { u as V, P as s, d as N } from "./index-B7i3cvH0.mjs";
11
- function K({ attributes: a = {}, rules: p = {}, onChange: k, submitTick: d, messages: M }) {
10
+ import { j as V, P as s, o as N } from "./AIForm-Czsvpf7g.mjs";
11
+ function K({ attributes: a = {}, rules: p = {}, onChange: k, submitTick: m, messages: M }) {
12
12
  const {
13
- id: m = "",
13
+ id: d = "",
14
14
  label: i,
15
15
  min: R = 0,
16
16
  max: $ = 10,
17
17
  lowLabel: E = "Not likely",
18
- highLabel: I = "Very likely",
18
+ highLabel: j = "Very likely",
19
19
  MuiAttributes: c = {}
20
- } = a, U = typeof a.value == "number" ? a.value : "", [u, f] = n.useState(U), [W, x] = n.useState(!1), [y, h] = n.useState("");
20
+ } = a, I = typeof a.value == "number" ? a.value : "", [u, f] = n.useState(I), [U, x] = n.useState(!1), [y, h] = n.useState("");
21
21
  V(() => {
22
22
  f(typeof a.value == "number" ? a.value : "");
23
23
  }, [a.value]);
24
24
  const g = p?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, b = (e) => g ? typeof e != "number" ? { isValid: !1, message: p?.validation?.find((r) => r.rule === "mandatory" || r.rule === "mandatoryselect")?.message || M?.required || "Required" } : { isValid: !0, message: "" } : { isValid: !0, message: "" };
25
25
  V(() => {
26
- if (d) {
26
+ if (m) {
27
27
  const e = b(u);
28
28
  x(!e.isValid), h(e.message);
29
29
  }
30
- }, [d]);
31
- const j = (e) => {
30
+ }, [m]);
31
+ const W = (e) => {
32
32
  f(e);
33
33
  const o = b(e);
34
- x(!o.isValid), h(o.message), k?.({ id: m, value: e });
34
+ x(!o.isValid), h(o.message), k?.({ id: d, value: e });
35
35
  }, v = [];
36
36
  for (let e = R; e <= $; e += 1) v.push(e);
37
- return /* @__PURE__ */ S(A, { id: m, required: g, error: W, component: "fieldset", sx: { width: "100%" }, children: [
37
+ return /* @__PURE__ */ S(A, { id: d, required: g, error: U, component: "fieldset", sx: { width: "100%" }, children: [
38
38
  i && /* @__PURE__ */ t(F, { sx: { mb: 1, fontWeight: 500 }, component: "legend", children: i }),
39
39
  /* @__PURE__ */ t(C, { role: "radiogroup", "aria-label": i || "nps scale", sx: { display: "flex", flexWrap: "wrap", gap: 0.75 }, children: v.map((e) => {
40
40
  const o = u === e;
@@ -45,7 +45,7 @@ function K({ attributes: a = {}, rules: p = {}, onChange: k, submitTick: d, mess
45
45
  "aria-checked": o,
46
46
  variant: o ? "contained" : "outlined",
47
47
  color: "primary",
48
- onClick: () => j(e),
48
+ onClick: () => W(e),
49
49
  ...c,
50
50
  sx: (r) => ({
51
51
  minWidth: 44,
@@ -76,8 +76,12 @@ function K({ attributes: a = {}, rules: p = {}, onChange: k, submitTick: d, mess
76
76
  );
77
77
  }) }),
78
78
  /* @__PURE__ */ S(C, { sx: { display: "flex", justifyContent: "space-between", mt: 0.75 }, children: [
79
- /* @__PURE__ */ t(w, { variant: "caption", color: "text.secondary", children: E }),
80
- /* @__PURE__ */ t(w, { variant: "caption", color: "text.secondary", children: I })
79
+ /* @__PURE__ */ t(w, { variant: "caption", sx: {
80
+ color: "text.secondary"
81
+ }, children: E }),
82
+ /* @__PURE__ */ t(w, { variant: "caption", sx: {
83
+ color: "text.secondary"
84
+ }, children: j })
81
85
  ] }),
82
86
  y && /* @__PURE__ */ t(L, { children: y })
83
87
  ] });
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("react"),q=require("@mui/material/Box"),k=require("@mui/material/Button"),S=require("@mui/material/Typography"),A=require("@mui/material/FormControl"),$=require("@mui/material/FormLabel"),N=require("@mui/material/FormHelperText"),s=require("@mui/material/styles"),l=require("./AIForm-LoeI18mO.js");function P({attributes:t={},rules:c={},onChange:j,submitTick:d,messages:M}){const{id:p="",label:n,min:E=0,max:I=10,lowLabel:R="Not likely",highLabel:C="Very likely",MuiAttributes:u={}}=t,w=typeof t.value=="number"?t.value:"",[m,x]=i.useState(w),[U,y]=i.useState(!1),[f,h]=i.useState("");l.useUpdateEffect(()=>{x(typeof t.value=="number"?t.value:"")},[t.value]);const g=c?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,b=e=>g?typeof e!="number"?{isValid:!1,message:c?.validation?.find(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")?.message||M?.required||"Required"}:{isValid:!0,message:""}:{isValid:!0,message:""};l.useUpdateEffect(()=>{if(d){const e=b(m);y(!e.isValid),h(e.message)}},[d]);const V=e=>{x(e);const a=b(e);y(!a.isValid),h(a.message),j?.({id:p,value:e})},v=[];for(let e=E;e<=I;e+=1)v.push(e);return o.jsxs(A,{id:p,required:g,error:U,component:"fieldset",sx:{width:"100%"},children:[n&&o.jsx($,{sx:{mb:1,fontWeight:500},component:"legend",children:n}),o.jsx(q,{role:"radiogroup","aria-label":n||"nps scale",sx:{display:"flex",flexWrap:"wrap",gap:.75},children:v.map(e=>{const a=m===e;return o.jsx(k,{role:"radio","aria-checked":a,variant:a?"contained":"outlined",color:"primary",onClick:()=>V(e),...u,sx:r=>({minWidth:44,height:44,px:0,fontWeight:600,borderRadius:`${l.PREMIUM_RADIUS}px`,transition:`transform .18s ${l.PREMIUM_EASING}, box-shadow .18s ${l.PREMIUM_EASING}, background-color .18s ${l.PREMIUM_EASING}`,...a?{boxShadow:`0 4px 12px ${s.alpha(r.palette.primary.main,.35)}`}:{borderColor:s.alpha(r.palette.text.primary,.2),"&:hover":{borderColor:r.palette.primary.main,backgroundColor:s.alpha(r.palette.primary.main,.06)}},"&:hover":{transform:"translateY(-1px)",...a?{boxShadow:`0 6px 16px ${s.alpha(r.palette.primary.main,.4)}`}:{borderColor:r.palette.primary.main,backgroundColor:s.alpha(r.palette.primary.main,.06)}},...u.sx||{}}),children:e},e)})}),o.jsxs(q,{sx:{display:"flex",justifyContent:"space-between",mt:.75},children:[o.jsx(S,{variant:"caption",sx:{color:"text.secondary"},children:R}),o.jsx(S,{variant:"caption",sx:{color:"text.secondary"},children:C})]}),f&&o.jsx(N,{children:f})]})}exports.default=P;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),C=require("react"),N=require("@mui/material/Stack"),T=require("@mui/material/InputBase"),k=require("@mui/material/IconButton"),P=require("@mui/material/FormControl"),$=require("@mui/material/FormLabel"),D=require("@mui/material/FormHelperText"),E=require("@mui/icons-material/Remove"),H=require("@mui/icons-material/Add"),c=require("@mui/material/styles"),w=require("./AIForm-LoeI18mO.js"),n=(o,u=0)=>{const i=Number(o);return Number.isFinite(i)?i:u};function L({attributes:o={},rules:u={},onChange:i}){const{MuiAttributes:I={},id:b="",min:s,max:l,step:h=1,label:d}=o,{sx:A,...F}=I,f=s!=null,g=l!=null,m=e=>{let t=e;return f&&(t=Math.max(t,n(s))),g&&(t=Math.min(t,n(l))),t},[a,v]=C.useState(()=>m(n(o.value,0))),[y,x]=C.useState(String(a)),S=u?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1;w.useUpdateEffect(()=>{const e=m(n(o.value,0));v(e),x(String(e))},[o.value]);const p=e=>{const t=m(e);v(t),x(String(t)),i?.({id:b,value:t})},q=f&&a<=n(s),M=g&&a>=n(l),R=()=>{q||p(a-n(h,1))},z=()=>{M||p(a+n(h,1))},B=()=>{p(n(y,a))},j={borderRadius:0,px:1.25,color:"text.primary",transition:"background-color .18s","&:hover":e=>({backgroundColor:c.alpha(e.palette.primary.main,.08)}),"&.Mui-disabled":{color:"text.disabled"}};return r.jsxs(P,{component:"fieldset",error:!1,children:[d&&r.jsx($,{component:"legend",required:S,sx:{mb:1},children:d}),r.jsxs(N,{direction:"row",sx:w.mergeSx(e=>({alignItems:"center",display:"inline-flex",width:"fit-content",borderRadius:"10px",overflow:"hidden",border:`1px solid ${c.alpha(e.palette.text.primary,.16)}`,backgroundColor:e.palette.background.paper,transition:"box-shadow .2s, border-color .2s","&:hover":{borderColor:c.alpha(e.palette.primary.main,.5)},"&:focus-within":{borderColor:e.palette.primary.main,boxShadow:`0 0 0 3px ${c.alpha(e.palette.primary.main,.16)}`}}),A),children:[r.jsx(k,{"aria-label":"decrement",onClick:R,disabled:q,size:"small",sx:j,children:r.jsx(E,{fontSize:"small"})}),r.jsx(T,{...F,value:y,inputProps:{"aria-label":d||b||"value",inputMode:"numeric",style:{textAlign:"center",width:56}},onChange:e=>x(e.target.value),onBlur:B,sx:{"& input":{py:.75}}}),r.jsx(k,{"aria-label":"increment",onClick:z,disabled:M,size:"small",sx:j,children:r.jsx(H,{fontSize:"small"})})]}),S&&r.jsx(D,{sx:{mx:0},children:""})]})}exports.default=L;
@@ -9,7 +9,7 @@ import E from "@mui/material/FormHelperText";
9
9
  import H from "@mui/icons-material/Remove";
10
10
  import L from "@mui/icons-material/Add";
11
11
  import { alpha as m } from "@mui/material/styles";
12
- import { u as P, m as U } from "./index-B7i3cvH0.mjs";
12
+ import { j as P, m as U } from "./AIForm-Czsvpf7g.mjs";
13
13
  const t = (n, c = 0) => {
14
14
  const i = Number(n);
15
15
  return Number.isFinite(i) ? i : c;
@@ -22,19 +22,19 @@ function re({ attributes: n = {}, rules: c = {}, onChange: i }) {
22
22
  max: s,
23
23
  step: b = 1,
24
24
  label: d
25
- } = n, { sx: B, ...F } = A, h = l != null, v = s != null, u = (e) => {
25
+ } = n, { sx: B, ...F } = A, h = l != null, v = s != null, p = (e) => {
26
26
  let r = e;
27
27
  return h && (r = Math.max(r, t(l))), v && (r = Math.min(r, t(s))), r;
28
- }, [a, g] = I.useState(() => u(t(n.value, 0))), [S, p] = I.useState(String(a)), y = c?.validation?.some(
28
+ }, [a, g] = I.useState(() => p(t(n.value, 0))), [S, u] = I.useState(String(a)), y = c?.validation?.some(
29
29
  (e) => e.rule === "mandatory" || e.rule === "mandatoryselect"
30
30
  ) || !1;
31
31
  P(() => {
32
- const e = u(t(n.value, 0));
33
- g(e), p(String(e));
32
+ const e = p(t(n.value, 0));
33
+ g(e), u(String(e));
34
34
  }, [n.value]);
35
35
  const x = (e) => {
36
- const r = u(e);
37
- g(r), p(String(r)), i?.({ id: f, value: r });
36
+ const r = p(e);
37
+ g(r), u(String(r)), i?.({ id: f, value: r });
38
38
  }, M = h && a <= t(l), C = v && a >= t(s), N = () => {
39
39
  M || x(a - t(b, 1));
40
40
  }, R = () => {
@@ -57,9 +57,13 @@ function re({ attributes: n = {}, rules: c = {}, onChange: i }) {
57
57
  T,
58
58
  {
59
59
  direction: "row",
60
- alignItems: "center",
61
60
  sx: U(
62
61
  (e) => ({
62
+ // `alignItems` was a Stack system prop before v9. Folded
63
+ // into the base style object rather than left in an sx
64
+ // array — mergeSx already returns SxProps, and SxProps
65
+ // arrays cannot be nested inside another sx array.
66
+ alignItems: "center",
63
67
  display: "inline-flex",
64
68
  width: "fit-content",
65
69
  borderRadius: "10px",
@@ -99,7 +103,7 @@ function re({ attributes: n = {}, rules: c = {}, onChange: i }) {
99
103
  inputMode: "numeric",
100
104
  style: { textAlign: "center", width: 56 }
101
105
  },
102
- onChange: (e) => p(e.target.value),
106
+ onChange: (e) => u(e.target.value),
103
107
  onBlur: j,
104
108
  sx: {
105
109
  "& input": { py: 0.75 }
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import a, { Suspense as s } from "react";
3
3
  import n from "@mui/material/Box";
4
4
  import f from "@mui/material/CircularProgress";
5
- import { g as m } from "./index-B7i3cvH0.mjs";
5
+ import { i as m } from "./AIForm-Czsvpf7g.mjs";
6
6
  const c = a.lazy(
7
7
  () => import("@mui/x-charts/PieChart").then((r) => ({ default: r.PieChart }))
8
8
  );
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.create;var u=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var x=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!d.call(e,i)&&i!==r&&u(e,i,{get:()=>t[i],enumerable:!(s=a(t,i))||s.enumerable});return e};var f=(e,t,r)=>(r=e!=null?c(h(e)):{},x(t||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),j=require("@mui/material/Box"),C=require("@mui/material/CircularProgress"),y=require("./AIForm-LoeI18mO.js"),P=o.lazy(()=>import("@mui/x-charts/PieChart").then(e=>({default:e.PieChart})));function g({attributes:e={}}){const{MuiChartAttributes:t={},id:r=""}=e,s=y.getMuiX("PieChart")||P;return n.jsx(o.Suspense,{fallback:n.jsx(j,{sx:{display:"flex",justifyContent:"center",p:2},children:n.jsx(C,{})}),children:n.jsx(s,{height:300,...t},r)})}exports.default=g;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("react"),p=require("@mui/material/Box"),h=require("@mui/material/Paper"),x=require("@mui/material/Divider"),g=require("@mui/material/IconButton"),j=require("@mui/material/Tooltip"),M=require("@mui/material/FormLabel"),q=require("@mui/material/FormControl"),S=require("@mui/icons-material/FormatBold"),R=require("@mui/icons-material/FormatItalic"),y=require("@mui/icons-material/FormatUnderlined"),E=require("@mui/icons-material/FormatListBulleted"),C=require("@mui/icons-material/FormatListNumbered"),L=require("@mui/icons-material/Link"),v=require("@mui/icons-material/FormatClear"),n=require("@mui/material/styles"),o=require("./AIForm-LoeI18mO.js"),U=[{command:"bold",label:"Bold",icon:r.jsx(S,{fontSize:"small"})},{command:"italic",label:"Italic",icon:r.jsx(R,{fontSize:"small"})},{command:"underline",label:"Underline",icon:r.jsx(y,{fontSize:"small"})},{command:"insertUnorderedList",label:"Bulleted list",icon:r.jsx(E,{fontSize:"small"})},{command:"insertOrderedList",label:"Numbered list",icon:r.jsx(C,{fontSize:"small"})},{command:"createLink",label:"Insert link",icon:r.jsx(L,{sx:{fontSize:"small"}}),prompt:!0},{command:"removeFormat",label:"Clear formatting",icon:r.jsx(v,{fontSize:"small"})}];function F({attributes:a={},onChange:u}){const{id:i="",label:s,minHeight:b=160,MuiAttributes:d={}}=a,l=m.useRef(null);m.useEffect(()=>{const e=l.current;if(!e)return;const t=a.value??"";e.innerHTML!==t&&(e.innerHTML=t)},[a.value]);const f=e=>{l.current?.focus();try{if(e.prompt){const t=window.prompt("Enter a URL");t&&document.execCommand(e.command,!1,t)}else document.execCommand(e.command)}catch{}l.current&&u?.({id:i,value:l.current.innerHTML})},I=e=>{u?.({id:i,value:e.currentTarget.innerHTML})};return r.jsxs(q,{fullWidth:!0,children:[s&&r.jsx(M,{sx:{mb:.75,fontWeight:500},component:"legend",children:s}),r.jsxs(h,{variant:"outlined",sx:e=>({borderRadius:`${o.PREMIUM_RADIUS+2}px`,borderColor:n.alpha(e.palette.text.primary,.12),overflow:"hidden",transition:`box-shadow .2s ${o.PREMIUM_EASING}, border-color .2s ${o.PREMIUM_EASING}`,"&:hover":{borderColor:n.alpha(e.palette.primary.main,.5),boxShadow:`0 2px 10px ${n.alpha(e.palette.common.black,.06)}`},"&:focus-within":{borderColor:e.palette.primary.main,boxShadow:`0 0 0 3px ${n.alpha(e.palette.primary.main,.16)}`}}),children:[r.jsx(p,{sx:e=>({display:"flex",flexWrap:"wrap",alignItems:"center",gap:.25,px:.75,py:.5,backgroundColor:n.alpha(e.palette.text.primary,.03)}),children:U.map((e,t)=>r.jsxs(m.Fragment,{children:[(t===3||t===5)&&r.jsx(x,{orientation:"vertical",flexItem:!0,sx:{mx:.25,my:.5}}),r.jsx(j,{title:e.label,children:r.jsx(g,{size:"small","aria-label":e.label,onMouseDown:c=>c.preventDefault(),onClick:()=>f(e),sx:c=>({borderRadius:`${o.PREMIUM_RADIUS-2}px`,transition:`background-color .18s ${o.PREMIUM_EASING}, transform .18s ${o.PREMIUM_EASING}`,"&:hover":{backgroundColor:n.alpha(c.palette.primary.main,.1),transform:"translateY(-1px)"}}),children:e.icon})})]},e.command))}),r.jsx(x,{}),r.jsx(p,{id:i,ref:l,role:"textbox","aria-multiline":"true","aria-label":s||"rich text",contentEditable:!0,suppressContentEditableWarning:!0,onInput:I,...d,sx:e=>({minHeight:b,px:1.75,py:1.25,outline:"none",lineHeight:1.6,color:e.palette.text.primary,backgroundColor:e.palette.background.paper,"& p":{margin:"0 0 0.5em"},"& ul, & ol":{paddingLeft:"1.5em",margin:"0 0 0.5em"},"& a":{color:e.palette.primary.main},...d.sx||{}})})]})]})}exports.default=F;
@@ -15,14 +15,16 @@ import w from "@mui/icons-material/FormatListNumbered";
15
15
  import T from "@mui/icons-material/Link";
16
16
  import z from "@mui/icons-material/FormatClear";
17
17
  import { alpha as t } from "@mui/material/styles";
18
- import { P as l, d as b } from "./index-B7i3cvH0.mjs";
18
+ import { P as l, o as b } from "./AIForm-Czsvpf7g.mjs";
19
19
  const E = [
20
20
  { command: "bold", label: "Bold", icon: /* @__PURE__ */ o(R, { fontSize: "small" }) },
21
21
  { command: "italic", label: "Italic", icon: /* @__PURE__ */ o(k, { fontSize: "small" }) },
22
22
  { command: "underline", label: "Underline", icon: /* @__PURE__ */ o(F, { fontSize: "small" }) },
23
23
  { command: "insertUnorderedList", label: "Bulleted list", icon: /* @__PURE__ */ o(M, { fontSize: "small" }) },
24
24
  { command: "insertOrderedList", label: "Numbered list", icon: /* @__PURE__ */ o(w, { fontSize: "small" }) },
25
- { command: "createLink", label: "Insert link", icon: /* @__PURE__ */ o(T, { fontSize: "small" }), prompt: !0 },
25
+ { command: "createLink", label: "Insert link", icon: /* @__PURE__ */ o(T, { sx: {
26
+ fontSize: "small"
27
+ } }), prompt: !0 },
26
28
  { command: "removeFormat", label: "Clear formatting", icon: /* @__PURE__ */ o(z, { fontSize: "small" }) }
27
29
  ];
28
30
  function V({ attributes: a = {}, onChange: s }) {