@dartech/arsenal-ui 1.4.94 → 1.4.95
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +1 -1
- package/package.json +1 -1
- package/src/theme/tableThemeOptions.d.ts +7 -7
package/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{createTheme as e,responsiveFontSizes as r,styled as t,ThemeProvider as n}from"@mui/material/styles";import{jsx as i,jsxs as l,Fragment as a}from"react/jsx-runtime";import{__rest as o,__awaiter as s}from"tslib";import c from"@mui/material/TextField";import d from"@mui/material/MenuItem";import u,{useRef as p,useEffect as m,useState as g,useCallback as h,useMemo as f,createElement as b,forwardRef as v,createContext as y,useContext as C,memo as O,useImperativeHandle as x,Suspense as E}from"react";import{useController as j,useWatch as T,useFormContext as S,Controller as w,useFieldArray as V,useForm as L}from"react-hook-form";import k from"@mui/material/SvgIcon";import R from"@mui/material/IconButton";import M from"@mui/material/InputAdornment";import N from"@mui/material/Button";import I from"@mui/material/Dialog";import F from"@mui/material/DialogActions";import D from"@mui/material/DialogContent";import P from"@mui/material/DialogContentText";import A from"@mui/material/DialogTitle";import q from"@mui/material/Box";import $ from"@mui/material/Typography";import z from"@mui/material/CircularProgress";import B from"@mui/material/FormControl";import H from"@mui/material/FormControlLabel";import _ from"@mui/material/FormHelperText";import W from"@mui/material/Checkbox";import J from"@mui/material/Radio";import G from"@mui/material/RadioGroup";import Y from"@mui/material/FormLabel";import Z from"@mui/material/Autocomplete";import K from"lodash/get";import{useQuery as U}from"@tanstack/react-query";import X from"qs";import Q from"@mui/material/Tooltip";import{useNavigate as ee,useLocation as re,Link as te,useSearchParams as ne,Outlet as ie}from"react-router-dom";import le from"@uiw/react-codemirror";import{langs as ae}from"@uiw/codemirror-extensions-langs";import{abcdef as oe}from"@uiw/codemirror-theme-abcdef";import se from"@mui/material/Switch";import{DatePicker as ce}from"@mui/x-date-pickers/DatePicker";import{format as de,parse as ue,isValid as pe,isMatch as me}from"date-fns";import{DateTimePicker as ge}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as he}from"@mui/x-date-pickers/TimePicker";import fe from"@mui/material/Chip";import be from"@mui/material/Unstable_Grid2";import{toString as ve,parse as ye}from"duration-fns";import Ce from"react-input-mask";import Oe from"@mui/material/Pagination";import xe from"@mui/material/TablePagination";import{useGridApiContext as Ee,useGridSelector as je,gridPageSelector as Te,gridPageCountSelector as Se,gridRowCountSelector as we,gridPageSizeSelector as Ve,GridColumnMenuContainer as Le,GridFilterMenuItem as ke,DataGrid as Re,GridActionsCellItem as Me}from"@mui/x-data-grid";import Ne from"@mui/material/Table";import Ie from"@mui/material/TableBody";import Fe from"@mui/material/TableCell";import De from"@mui/material/TableContainer";import Pe from"@mui/material/TableHead";import Ae from"@mui/material/TableRow";import qe from"@mui/material/TableFooter";import $e from"@mui/material/Backdrop";import ze from"@mui/material/TableSortLabel";import Be from"@mui/material/Menu";import He from"@mui/icons-material/MoreHoriz";import _e from"@mui/material/Paper";import We from"@mui/material/Tab";import Je from"@mui/material/Tabs";import Ge from"@mui/material/Accordion";import Ye from"@mui/material/AccordionSummary";import Ze from"@mui/material/AccordionDetails";import Ke from"@mui/material/AccordionActions";import{ExpandMore as Ue}from"@mui/icons-material";import Xe from"@mui/icons-material/Delete";import Qe from"@mui/material/Stepper";import er from"@mui/material/Step";import rr from"@mui/material/StepLabel";import tr from"@mui/material/StepContent";import nr from"@mui/material/StepConnector";import{AdapterDateFns as ir}from"@mui/x-date-pickers/AdapterDateFns";import{LocalizationProvider as lr}from"@mui/x-date-pickers/LocalizationProvider";import ar from"@mui/material/Select";import or from"lodash/isNil";import sr from"@mui/material/InputLabel";import cr from"classnames";import{toast as dr}from"react-toastify";import ur from"@mui/material/CssBaseline";import pr from"@mui/material/Drawer";import mr from"@mui/material/List";import gr from"@mui/material/ListItem";import hr from"@mui/material/ListItemIcon";import fr from"@mui/material/ListItemButton";import br from"@mui/material/ListSubheader";import vr from"@mui/material/ListItemText";import yr from"@mui/material/Toolbar";import Cr from"@mui/material/ButtonBase";import Or from"@mui/material/Collapse";import xr from"@mui/material/Breadcrumbs";import Er from"@mui/icons-material/NavigateNext";var jr;!function(e){e.STRING="STRING",e.INTEGER="INTEGER",e.BIG_INTEGER="BIG_INTEGER",e.BIG_DECIMAL="BIG_DECIMAL",e.FLOAT="FLOAT",e.LONG="LONG",e.DOUBLE="DOUBLE",e.BOOLEAN="BOOLEAN",e.ENTITY_REFERENCE="ENTITY_REFERENCE",e.ENTITY="ENTITY",e.FILE="FILE",e.FILE_REFERENCE="FILE_REFERENCE",e.JSON="JSON",e.DATE="DATE",e.TIME="TIME",e.DATE_TIME="DATE_TIME",e.ANY="ANY"}(jr||(jr={}));const Tr="yyyy-MM-dd",Sr="HH:mm:ss",wr="yyyy-MM-dd'T'HH:mm:ss.SSSZ";var Vr;!function(e){e.UP="UP",e.DOWN="DOWN",e.CEILING="CEILING",e.FLOOR="FLOOR",e.HALF_UP="HALF_UP",e.HALF_DOWN="HALF_DOWN",e.HALF_EVEN="HALF_EVEN",e.UNNECESSARY="UNNECESSARY"}(Vr||(Vr={}));const Lr=({transparent:e,position:r,bgcolor:t})=>i(q,Object.assign({position:null!=r?r:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:t||(e?"none":"rgba(255, 255, 255, .3)"),zIndex:10},{children:i(z,{})})),kr=({open:e,title:r,description:t,closeButtonTitle:n="Close",onClose:a,confirmButtonTitle:o="Confirm",confirmButtonDisabled:s=!1,disableBackdropClick:c=!1,onConfirm:d,children:u,dialogProps:p,loading:m,maxWidth:g="xs",hideCloseButton:h=!1})=>i("div",{children:l(I,Object.assign({open:e,onClose:c?(e,r)=>{if("backdropClick"===r)return null;a()}:a,disableEscapeKeyDown:c,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:g},p,{children:[m&&i(Lr,{}),l(A,Object.assign({id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"}},{children:[i($,Object.assign({variant:"inherit"},{children:r})),!h&&i(R,Object.assign({sx:{padding:0},onClick:a},{children:i(k,{children:i("g",Object.assign({opacity:"0.6"},{children:i("path",{d:"M4.39704 4.554L4.47004 4.47C4.59702 4.34299 4.76538 4.26576 4.94449 4.25236C5.1236 4.23897 5.30157 4.29029 5.44604 4.397L5.53004 4.47L12 10.939L18.47 4.469C18.5393 4.3974 18.622 4.34031 18.7136 4.30104C18.8051 4.26178 18.9035 4.24114 19.0031 4.24032C19.1027 4.2395 19.2014 4.25853 19.2936 4.29628C19.3857 4.33403 19.4694 4.38976 19.5398 4.46022C19.6102 4.53067 19.6659 4.61443 19.7035 4.70662C19.7412 4.79881 19.7601 4.89758 19.7592 4.99716C19.7583 5.09675 19.7376 5.19515 19.6982 5.28664C19.6589 5.37812 19.6017 5.46085 19.53 5.53L13.061 12L19.531 18.47C19.6579 18.5971 19.7349 18.7655 19.7482 18.9446C19.7614 19.1237 19.7099 19.3016 19.603 19.446L19.53 19.53C19.403 19.657 19.2347 19.7343 19.0556 19.7476C18.8765 19.761 18.6985 19.7097 18.554 19.603L18.47 19.53L12 13.061L5.53004 19.531C5.38852 19.6676 5.19903 19.7431 5.00238 19.7413C4.80574 19.7395 4.61766 19.6605 4.47867 19.5214C4.33968 19.3823 4.26089 19.1941 4.25928 18.9975C4.25766 18.8008 4.33335 18.6114 4.47004 18.47L10.939 12L4.46904 5.53C4.34217 5.40289 4.26512 5.23447 4.25191 5.05537C4.2387 4.87626 4.29019 4.69836 4.39704 4.554L4.47004 4.47L4.39704 4.554Z",fill:"black"})}))})}))]})),l(D,{children:[t&&i(P,Object.assign({id:"alert-dialog-description"},{children:t})),i(q,Object.assign({maxWidth:"100%",overflow:"hidden"},{children:u}))]}),l(F,{children:[!h&&i(N,Object.assign({onClick:a,variant:"outlined"},{children:n})),o&&d?i(N,Object.assign({onClick:d,color:"primary",variant:"contained",autoFocus:!0,disabled:s,disableElevation:!0},{children:o})):null]})]}))}),Rr={code:"",name:"",version:0,properties:[]},Mr={code:"",name:"",version:0,properties:{}},Nr="Please, fill this field",Ir="Incorrect date format",Fr=e=>{var r,{control:t,validate:n,name:s="",label:d="",required:u=!1,defaultValue:p="",disabled:m=!1,textarea:g=!1,hideErrorMessage:h=!1,onChange:f,requiredErrorText:b=""}=e,v=o(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const y=j({name:s,control:t,defaultValue:p,rules:{required:!!u&&(b||Nr),validate:n}}),C=y.field,{ref:O,onChange:x,value:E}=C,T=o(C,["ref","onChange","value"]),{fieldState:{error:S}}=y;return i(c,Object.assign({},T,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:O,name:s,label:u?l(a,{children:[d," ",i("span",{children:"*"})]}):d,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!S,helperText:!h&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"},disabled:m,multiline:g,minRows:g?3:1,value:null!=E?E:"",onChange:f||x,InputLabelProps:{shrink:!!v.placeholder},inputProps:Object.assign(Object.assign({},null!==(r=null==v?void 0:v.inputProps)&&void 0!==r?r:{}),{value:null!=E?E:""})},v))};function Dr(e,r){const t=p();m((()=>()=>{t.current&&clearTimeout(t.current)}),[]);return(...n)=>{clearTimeout(t.current),t.current=setTimeout((()=>{e(...n)}),r)}}const Pr=()=>{const[e,r]=g(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},Ar=e=>{var r,{control:t,validate:n,name:s="",label:d="",required:u=!1,defaultValue:p="",disabled:f=!1,textarea:b=!1,hideErrorMessage:v=!1,onChange:y,requiredErrorText:C=""}=e,O=o(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const{field:{ref:x,onChange:E},fieldState:{error:S}}=j({name:s,control:t,defaultValue:p,rules:{required:!!u&&(C||Nr),validate:n}}),w=T({control:t,name:s}),[V,L]=g("");m((()=>{!V&&w&&L(w)}),[V,w]);const k=Dr((e=>{E(e)}),200),R=h((e=>{L(e.target.value),k(e.target.value)}),[k]);return i(c,Object.assign({fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:x,name:s,label:u?l(a,{children:[d," ",i("span",{children:"*"})]}):d,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!S,helperText:!v&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"},disabled:f,multiline:b,minRows:b?3:1,value:null!=V?V:"",onChange:R},O,{inputProps:Object.assign(Object.assign({},null!==(r=null==O?void 0:O.inputProps)&&void 0!==r?r:{}),{value:null!=V?V:""})}))},qr=()=>i(k,{children:i("path",{d:"M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z",fill:"#8B8C9E"})}),$r=e=>{var r,{control:t,validate:n,name:s="",label:u="",required:p=!1,defaultValue:m="",disabled:g=!1,hideErrorMessage:f=!1,onChange:b,labelKey:v,valueKey:y,options:C=[],requiredErrorText:O=""}=e,x=o(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","requiredErrorText"]);const E=j({name:s,control:t,defaultValue:m,rules:{required:!!p&&(O||Nr),validate:n}}),T=E.field,{ref:S,onChange:w,value:V}=T,L=o(T,["ref","onChange","value"]),{fieldState:{error:N}}=E,I=h((e=>"string"==typeof e?e:y?e[y]:e.value),[y]),F=h((e=>"string"==typeof e?e:v?e[v]:e.label),[v]),D=h((()=>{b?b(null):w(null)}),[w,b]);return i(c,Object.assign({},L,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:S,name:s,label:p?l(a,{children:[u," ",i("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!N,helperText:!f&&(null==N?void 0:N.message),FormHelperTextProps:{variant:"standard"},disabled:g,value:null!=V?V:"",onChange:b||w},x,{inputProps:Object.assign(Object.assign({},null!==(r=null==x?void 0:x.inputProps)&&void 0!==r?r:{}),{value:null!=V?V:""}),InputProps:Object.assign({endAdornment:!p&&V?i(M,Object.assign({position:"end",sx:{mr:0}},{children:i(R,Object.assign({onClick:D,size:"small"},{children:i(k,Object.assign({fontSize:"small"},{children:i("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}))})):null},null==x?void 0:x.InputProps),SelectProps:{sx:{"& .MuiSelect-select .notranslate::after":x.placeholder?{content:`"${x.placeholder}"`,opacity:.42}:{}}}},{children:C.map(((e,r)=>i(d,Object.assign({value:I(e)},{children:F(e)}),r)))}))},zr=e=>{var{control:r,validate:t,name:n="",label:a="",required:s=!1,defaultValue:c,disabled:d=!1,hideErrorMessage:u=!1,onChange:p}=e,m=o(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange"]);const g=j({name:n,control:r,defaultValue:null!=c&&c}),h=g.field,{ref:b,onChange:v,value:y}=h,C=o(h,["ref","onChange","value"]),{fieldState:{error:O}}=g,x=f((()=>{if("boolean"==typeof y)return y;if("string"==typeof y){if("false"===y)return v(!1),!1;if("true"===y)return v(!0),!0}return!1}),[y,v]);return l(B,Object.assign({error:!!O,component:"fieldset",variant:"standard",disabled:d},{children:[i(H,{control:i(W,Object.assign({},C,{checked:x,onChange:p||v,name:n,inputRef:b,disabled:d,color:"secondary"},m)),label:a}),!u&&(null==O?void 0:O.message)&&i(_,Object.assign({variant:"standard"},{children:O.message}))]}))},Br=({name:e,label:r,values:t=[],control:n,required:a,defaultValue:s,disabled:c,hideErrorMessage:d,labelKey:u,valueKey:p,validate:m,onChange:g,row:f,radioProps:b,requiredErrorText:v=""})=>{const y=j({name:e,control:n,defaultValue:s,rules:{required:!!a&&(v||Nr),validate:m}}),C=y.field,{onChange:O}=C,x=o(C,["onChange"]),{fieldState:{error:E}}=y,T=h((e=>"string"==typeof e?e:p?e[p]:e.value),[p]),S=h((e=>"string"==typeof e?e:u?e[u]:e.label),[u]),w=h((e=>"string"==typeof e?e===x.value:e===("string"==typeof x.value?"true"===x.value:x.value)),[x.value]),V=h((e=>{"true"===e.target.value||"false"===e.target.value?O("true"===e.target.value):O(e)}),[O]);return l(B,Object.assign({disabled:c,error:!!E},{children:[i(Y,Object.assign({id:"radio-buttons-group"},{children:r})),i(G,Object.assign({},x,{row:f,"aria-labelledby":"radio-buttons-group",onChange:g||V},{children:t.map(((e,r)=>i(H,{value:T(e),control:i(J,Object.assign({},b,{checked:w(T(e))})),label:S(e)},r)))})),!d&&(null==E?void 0:E.message)&&i(_,Object.assign({variant:"standard"},{children:E.message}))]}))};var Hr=({valueKey:e,labelKey:r})=>{const t=h(((r,t)=>{if(r&&t){if("string"==typeof r)return r===t;if(e)return K(r,e)===K(t,e)||K(r,e)===t;if(r.value)return r.value===t.value||r.value===t}return!1}),[e]),n=h((e=>e?"string"==typeof e?e:r&&K(e,r,"")?K(e,r,"")+"":e.label+""||e.name+""||e.value+""||e.code+""||"--no label--":""),[r]),i=h(((e,r)=>b(q,Object.assign({},e,{component:"li",key:e.id}),n(r))),[n]);return{isOptionEqualToValue:t,getOptionLabel:n,renderOption:i}};const _r=e=>{var{control:r,validate:t,name:n="",label:s="",required:d=!1,defaultValue:u="",disabled:p=!1,hideErrorMessage:h=!1,onChange:f,labelKey:b,valueKey:v,options:y=[],multiple:C,textFieldProps:O={},disableCloseOnSelect:x,useStringValue:E,requiredErrorText:T="",startAdornment:S,endAdornment:w}=e,V=o(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","multiple","textFieldProps","disableCloseOnSelect","useStringValue","requiredErrorText","startAdornment","endAdornment"]);const L=j({name:n,control:r,defaultValue:u||(C?[]:null),rules:{required:!!d&&(T||Nr),validate:t}}),k=L.field,{ref:R,onChange:M,value:N}=k,I=o(k,["ref","onChange","value"]),{fieldState:{error:F}}=L,[D,P]=g(),{getOptionLabel:A,isOptionEqualToValue:q,renderOption:$}=Hr({valueKey:v,labelKey:b});return m((()=>{"string"==typeof N&&v&&E&&void 0===D&&y.length&&y[0]&&"object"==typeof y[0]&&P(y.find((e=>K(e,v)===N)))}),[D,y,E,N,v]),i(Z,Object.assign({},I,{value:E?null!=D?D:null:N,fullWidth:!0,disablePortal:!0,size:"small",readOnly:p,options:y,multiple:C,getOptionLabel:A,isOptionEqualToValue:q,disableCloseOnSelect:x||C,filterSelectedOptions:C,onChange:f||((e,r)=>{M(E&&v?K(r,v):r),P(r)}),renderOption:$,renderInput:e=>i(c,Object.assign({},e,{variant:"outlined",name:n,label:d?l(a,{children:[s," ",i("span",{children:"*"})]}):s,InputLabelProps:{shrink:!!(null==V?void 0:V.placeholder)},sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==V?void 0:V.placeholder,error:!!F,inputRef:R,helperText:!h&&(null==F?void 0:F.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign(Object.assign({},e.InputProps),{startAdornment:S||e.InputProps.startAdornment,endAdornment:w||e.InputProps.endAdornment})},O))},V))};const Wr=()=>i("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:""});function Jr(e){var{name:r,label:t,control:n,required:s=!1,searchBy:d,labelKey:p,multiple:b=!1,mongoQueryJson:v,disabled:y,valueKey:C,sortBy:O="",hideErrorMessage:x,disableCloseOnSelect:E,textFieldProps:T,onChange:S,queryFunction:w,validate:V,itemQueryFunction:L,requiredErrorText:k="",startAdornment:R,endAdornment:N}=e,I=o(e,["name","label","control","required","searchBy","labelKey","multiple","mongoQueryJson","disabled","valueKey","sortBy","hideErrorMessage","disableCloseOnSelect","textFieldProps","onChange","queryFunction","validate","itemQueryFunction","requiredErrorText","startAdornment","endAdornment"]);const F=j({control:n,name:r,defaultValue:b?[]:null,rules:{required:!!s&&(k||Nr),validate:V}}),D=F.field,{ref:P,onChange:A,value:q}=D,$=o(D,["ref","onChange","value"]),{fieldState:{error:B,isDirty:H}}=F,{getOptionLabel:_,isOptionEqualToValue:W,renderOption:J}=Hr({valueKey:C,labelKey:p}),[G,Y]=g([]),[Q,ee]=g(!1),[re,te]=g(""),[ne,ie]=g(""),[le,ae]=g(0),oe=f((()=>!!G.length&&Q),[Q,G]),{data:se,isFetching:ce}=U(["options",le,ne],(()=>{const e=X.parse(Object.assign({page:`${le}`,size:"20",sort:O},ne?{[d]:ne}:{}),{ignoreQueryPrefix:!0});return w(e)}),{onSuccess(e){Y(ne?e.collection:r=>1===r.length?e.collection:[...r,...e.collection])}}),de=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>de(e,r)));{const t={};for(const n in e)t[n]=de(e[n],r);return t}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},ue=Dr((e=>{if(ae(0),v){const r=de(v,e);ie(JSON.stringify(r))}else ie(e)}),500),pe=h(((e,r)=>{Y([]),te(r),ue(r)}),[ue]),me=h(((e,r)=>{A(r),S&&S(e,r)}),[A,S]);m((()=>{if(!H&&q&&L){let e=q;"object"==typeof q&&C in q&&(e=K(q,C)),L(e).then((e=>{A(e),te(K(e,p))})).catch(console.error)}}),[q,H,C,p,L,A]);const ge=h((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&G.length<(null==se?void 0:se.totalItems)&&ae((e=>e+1))}),[se,G]);return i(Z,Object.assign({},$,{fullWidth:!0,disablePortal:!0,size:"small",readOnly:y,options:G,multiple:b,getOptionLabel:_,isOptionEqualToValue:W,disableCloseOnSelect:E||b,filterSelectedOptions:b,inputValue:re,value:q,onChange:me,loading:ce,clearOnBlur:!1,open:oe,filterOptions:e=>e,onOpen:()=>{ee(!0)},onClose:()=>{ee(!1),ie("")},onInputChange:pe,ListboxProps:{onScroll:ge},renderOption:J,popupIcon:i(Wr,{}),renderInput:e=>i(c,Object.assign({},e,{label:s?l(a,{children:[t," ",i("span",{children:"*"})]}):t,InputLabelProps:{shrink:!!(null==I?void 0:I.placeholder)},placeholder:null==I?void 0:I.placeholder,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},variant:"outlined",error:!!B,inputRef:P,helperText:!x&&(null==B?void 0:B.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign(Object.assign({},e.InputProps),{endAdornment:N||l(u.Fragment,{children:[ce?i(M,Object.assign({position:"end"},{children:i(z,{color:"inherit",size:20})})):null,e.InputProps.endAdornment]}),startAdornment:R||e.InputProps.startAdornment})},T))},I))}const Gr=({copyText:e,helpText:r="Copy"})=>{const[t,n]=g(r);return t?i(Q,Object.assign({title:t,placement:"top"},{children:i(R,Object.assign({onClick:()=>{navigator.clipboard.writeText(e),n("Copied!"),setTimeout((()=>{n(r)}),1e3)}},{children:i(k,Object.assign({fontSize:"small"},{children:i("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})}))}))})):null},Yr=({text:e,buttonProps:r={}})=>{const t=ee(),{state:n}=re(),l=f((()=>null==n?void 0:n.from),[n]),a=h((()=>{t(l||-1)}),[t,l]);return i(q,Object.assign({mr:2},{children:e?i(N,Object.assign({color:"inherit",onClick:l?null:a,component:te,to:null!=l?l:""},r,{children:e})):i(R,Object.assign({onClick:a},{children:i(k,{children:i("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})}))}))},Zr=v(((e,r)=>{var{control:t,name:n,mode:s="json",label:c,width:d="100%",height:u="200px",readOnly:p,required:m=!1,validateJson:g=!1,hideErrorMessage:b=!1,fontSize:v=16,validate:y=!0,parseValue:C,requiredErrorText:O="",useCleanValue:x}=e,E=o(e,["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"]);const T=j({control:t,name:n,rules:{required:!!m&&(O||Nr),validate:e=>{if(e&&g&&"string"==typeof e)try{return JSON.parse(e),!0}catch(e){return console.error(e),"Invalid JSON"}return!0}}}),S=T.field,{onChange:w,value:V,ref:L}=S,k=o(S,["onChange","value","ref"]),{fieldState:{error:R}}=T,M=f((()=>({json:[ae.json()],javascript:[ae.javascript()],python:[ae.python()]})),[]),N=f((()=>"text"===s&&"string"!=typeof V?JSON.stringify(V,null,2):"json"===s&&"string"!=typeof V?null===V?"":x?JSON.stringify(V,null,2).replace(/\\"/g,""):JSON.stringify(V,null,2):"string"==typeof V&&"text"!==s&&x?V.replace(/\\"/g,""):V),[V,x,s]),I=h((e=>{if(C)try{const r=JSON.parse(e);w(r)}catch(r){w(e)}else w(e)}),[w,C]);return l(q,Object.assign({display:"flex",flexDirection:"column",width:"100%"},{children:[i(q,{children:c&&i($,Object.assign({variant:"subtitle1",display:"inline",style:{marginRight:10}},{children:m?l(a,{children:[c," ",i(q,Object.assign({component:"span",color:"#D6331F"},{children:"*"}))]}):c}))}),l(a,{children:[i(le,Object.assign({},k,{ref:r||L,basicSetup:{autocompletion:!0,history:!0},theme:oe,width:d,height:u,style:{fontSize:v,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:p,value:N,onChange:I,extensions:"text"===s?[]:M[s]},E)),R&&!b&&i(_,Object.assign({variant:"standard",error:!0},{children:R.message}))]})]}))})),Kr=(e,r)=>{const t=[...e];return t.splice(r,1),t},Ur=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};function Xr(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}const Qr=(e,r,t,n="asc")=>{const i=e[t],l=r[t];return i<l?"asc"===n?-1:1:i>l?"asc"===n?1:-1:0},et=e=>{if(!e)return"";if("string"==typeof e)try{return JSON.stringify(JSON.parse(e),null,2)}catch(r){return e}else try{return JSON.stringify(e,null,2)}catch(e){return"Failed to stringify JSON"}},rt=e=>{try{return JSON.parse(e)}catch(e){return null}},tt=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=tt(r[e])})),r}catch(r){return e}},nt=v((({value:e,height:r=200,fontSize:t=16},n)=>{const[a,o]=g(!0),s=h((e=>{const r=t=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-t.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===t.target.scrollTop&&(o(!1),e.scrollDOM.removeEventListener("scroll",r))};e.scrollDOM.scrollHeight>3e4?(o(!0),e.scrollDOM.addEventListener("scroll",r),e.scrollDOM.scrollTo(0,e.scrollDOM.scrollHeight-1e3),setTimeout((()=>{e.scrollDOM.scrollTo({top:e.scrollDOM.scrollHeight,behavior:"smooth"})}),300)):o(!1)}),[]);return l(q,Object.assign({position:"relative"},{children:[a&&i(Lr,{bgcolor:"#fff"}),i(le,{ref:n,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:`${r}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:s,extensions:[ae.json()],style:{fontSize:t,width:"100%"}})]}))})),it=({open:e,onClose:r,value:t,jsonViewProps:n})=>{const a=p();return l(I,Object.assign({disableEscapeKeyDown:!0,open:e,onClose:r,fullWidth:!0,maxWidth:"md",style:{width:800,left:"30%"}},{children:[i(D,{children:i(nt,Object.assign({value:t},n,{ref:a}))}),l(F,{children:[i(Gr,{copyText:t}),i(N,Object.assign({onClick:r,variant:"contained",color:"secondary"},{children:"Close"}))]})]}))};var lt=({value:e,copyButton:r=!1,textField:t=!1})=>{const{open:n,onOpen:a,onClose:o}=Pr(),s=h((e=>{e.stopPropagation(),a()}),[a]);return l(q,Object.assign({width:"100%"},{children:[l(q,Object.assign({display:"flex",alignItems:"center",justifyContent:"flex-end",pt:1,mb:2},{children:[r&&i(Gr,{copyText:et(e)}),i(Q,Object.assign({title:"Open",placement:"top"},{children:i(R,Object.assign({size:"small",onClick:s},{children:i(k,{children:i("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})}))}))]})),t?i(q,Object.assign({overflow:"hidden",whiteSpace:"nowrap"},{children:"object"==typeof e?JSON.stringify(e):e})):i(nt,{value:e}),i(it,{open:n,value:et(e),onClose:o,jsonViewProps:{height:450}})]}))};const at={spacing:4,palette:{primary:{main:"#E0613A",dark:"#d9512e",light:"#E0613A"},secondary:{main:"#007994",dark:"#262842",light:"#cbe8ee"},text:{disabled:"#A9A9B8"},success:{main:"#2DB77B",light:"#DBFCEE"},grey:{100:"#F7F8FC",700:"#101F2B"}},typography:{fontSize:14,allVariants:{fontFamily:["Euclid","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},h1:{fontWeight:400},h3:{fontWeight:500},h4:{fontWeight:500}}};var ot=e(at);var st={components:{MuiButtonBase:{defaultProps:{disableElevation:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:"#D15C3B"},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:ot.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:ot.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:ot.spacing(3),minWidth:ot.spacing(25),background:ot.palette.background.default,paddingRight:ot.spacing(3)},input:{minWidth:ot.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:qr},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:ot.spacing(25)}}},MuiInputLabel:{styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:ot.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:ot.spacing(3),minWidth:ot.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:ot.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:i(qr,{})},styleOverrides:{root:{"& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment":{right:12}},paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},listbox:{"::-webkit-scrollbar":{width:"6px",backgroundColor:"white"},"::-webkit-scrollbar-thumb":{borderRadius:"10px",backgroundColor:"rgba(38, 40, 66, 0.24)"}}}},MuiMenu:{styleOverrides:{list:{paddingTop:0,paddingBottom:0,background:"white","& li.Mui-selected":{background:"rgba(38, 40, 66, 0.08) !important"}}}},MuiPopover:{styleOverrides:{paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"}}},MuiFormLabel:{styleOverrides:{root:{color:"#6D6E85",fontSize:14,fontWeight:500,"&.Mui-focused":{color:"#6D6E85"},"& span":{color:"#D6331F"}},asterisk:{color:"#D6331F","&$error":{color:"#D6331F"}}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:14},backgroundColor:ot.palette.secondary.dark,padding:ot.spacing(2,3),borderRadius:8,textAlign:"center"}}}};var ct={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:ot.spacing(3),border:"1px solid rgba(38, 40, 66, 0.08)",overflow:"hidden"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:"#F7F8FC"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover":{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},"&:active, &:focus":{backgroundColor:"#EEEEF0"}}}},MuiTableCell:{styleOverrides:{root:{padding:ot.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:ot.spacing(4)}},head:{padding:ot.spacing(2,2),color:"#6D6E85"},body:{wordBreak:"break-all"}}},MuiTableSortLabel:{styleOverrides:{root:{maxHeight:"24px",lineHeight:1}}},MuiTablePagination:{styleOverrides:{root:{"& .MuiInputBase-root":{border:"1px solid #2628421F",borderRadius:4,minWidth:58,height:32,paddingRight:ot.spacing(2),"& .MuiSelect-select":{paddingRight:"4px !important",color:ot.palette.secondary.dark,"&:focus":{backgroundColor:"transparent"}}}}}},MuiPaginationItem:{styleOverrides:{root:{height:32,minWidth:32,borderRadius:4,border:"1px solid transparent",margin:"0, 2px","&.Mui-selected":{borderColor:"#2628421F",backgroundColor:"#F7F8FC"}}}},MuiDataGrid:{defaultProps:{headerHeight:40,getRowHeight:()=>"auto"},styleOverrides:{root:{borderRadius:ot.spacing(3),width:"100%",color:ot.palette.secondary.dark,border:"1px solid #26284214"},columnHeaders:{backgroundColor:ot.palette.grey[100],borderTopLeftRadius:ot.spacing(3),borderTopRightRadius:ot.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},columnHeaderTitle:{color:"#6D6E85",fontWeight:500},row:{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},columnSeparator:{display:"none"},withBorder:{borderColor:"#E0E3EA"},cell:{minHeight:"48px !important",textOverflow:"ellipsis",wordBreak:"break-all",lineHeight:"unset",padding:ot.spacing(1.25,3),borderColor:"#E0E3EA","&:focus":{outline:"none"}},actionsCell:{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}}}}};var dt={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:ot.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:ot.palette.secondary.main}}}}}};var ut={components:{MuiTypography:{styleOverrides:{h1:{[ot.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[ot.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[ot.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}};const pt=(()=>{if(document){const e="https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";if(!document.querySelectorAll(`link[href="${e}"]`).length){const r=document.createElement("link");r.href=e,r.rel="stylesheet",document.head.appendChild(r)}}return r(e(ot,{components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},st.components),ct.components),dt.components),ut.components),{MuiToolbar:{styleOverrides:{root:{[ot.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:ot.spacing(2.5),padding:ot.spacing(2.5,4),lineHeight:"20px",fontSize:"1rem",textTransform:"none"},outlined:{color:"#262842",backgroundColor:"#FFFFFF !important",border:"1px solid rgba(38, 40, 66, 0.12)"},text:{color:ot.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:ot.spacing(3)},paperWidthXs:{maxWidth:500}}},MuiDialogContent:{styleOverrides:{root:{color:"#6D6E85"}}},MuiDialogActions:{styleOverrides:{root:{background:"#F7F8FC",borderTop:"1px solid rgba(38, 40, 66, 0.08)",padding:ot.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:ot.palette.secondary.main}}},MuiTab:{styleOverrides:{root:{fontSize:14,fontWeight:500,textTransform:"none",padding:"10px 12px",lineHeight:"1.125rem",minHeight:"38px",color:"#8B8C9E","&.Mui-selected":{color:ot.palette.secondary.main}}}}})}))})(),mt=({value:e,canCopy:r,copyValue:t,shortId:n,fullText:a=!1,textParams:o})=>{const{displayAs:s="text",tooltipLinkComponent:c=null,dateFormat:d=null,statusVariant:u=null}=o||{};switch(s){case"boolean":return i(k,e?Object.assign({color:"primary",fontSize:"small"},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):Object.assign({fontSize:"small"},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})}));case"date":return e?d?i(Yi,{children:d.map(((r,t)=>i(q,{children:de(new Date(e),r)},t)))}):l(Yi,{children:[i(q,{children:de(new Date(e),"dd.MM.yyyy")}),i(q,{children:de(new Date(e),"HH:mm:ss")})]}):"";case"status":return i(Yi,{children:i(vi,{text:e,status:u||"default"})});case"json_text":return i(lt,{value:e,textField:!0});case"json_code":return i(lt,{value:e,copyButton:!0});case"array":return i(q,{children:null==e?void 0:e.map(((e,r)=>i(q,{children:e},r)))});case"collapsed_array":return e&&i(q,{children:i(Q,Object.assign({arrow:!0,title:c||e.map(((e,r)=>i(q,Object.assign({fontSize:14,style:{paddingTop:pt.spacing(1)}},{children:e}),r)))},{children:i(q,{children:e.length>1?`${e[0]} (+${e.length-1})`:e[0]})}))});case"number":return i(q,Object.assign({display:"flex",justifyContent:"flex-end"},{children:i(Yi,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})}));default:return e?l(q,Object.assign({display:"flex",alignItems:"center",width:"100%"},{children:[n?i(Yi,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):a?i(q,Object.assign({sx:{whiteSpace:"normal"}},{children:"string"==typeof e?e:JSON.stringify(e)})):i(Yi,{children:"string"==typeof e?e:JSON.stringify(e)}),r&&i(Gr,{copyText:t?"string"==typeof t?t:JSON.stringify(t):e})]})):""}},gt=new RegExp("^[-+]?[0-9]+$"),ht=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),ft=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const t of e)if(ft(t,r))return!0;if("object"==typeof e)for(const t in e)if(ft(e[t],r))return!0}return!1},bt=e=>e===jr.DATE||e===jr.DATE_TIME||e===jr.TIME,vt=new Intl.NumberFormat("ru-RU",{style:"decimal"}),yt=e=>!e&&0!==e&&!1!==e,Ct=(e,r,t)=>{if(null==r)return null;if(ft(r))return r;let n=r;switch(e){case jr.BOOLEAN:n=!!r||!(!r&&null!==r)&&null;break;case jr.INTEGER:case jr.BIG_INTEGER:case jr.BIG_DECIMAL:case jr.FLOAT:case jr.LONG:case jr.DOUBLE:n=Number(r);break;case jr.DATE:case jr.DATE_TIME:case jr.TIME:if(r)try{const e=t.formatText.replace(/[Z,z,x]+/g,"XX");n=de(ue(r,e,new Date),e)}catch(e){console.error(e)}break;case jr.JSON:try{"string"!=typeof r&&(n=JSON.stringify(r)),n=JSON.parse(n)}catch(e){console.log(e),n=null}break;case jr.ANY:try{n="string"==typeof r?JSON.parse(n):r}catch(e){n=r}break;case jr.ENTITY:n=Ot(t.properties,r)}return n},Ot=(e,r)=>{if(r){const t={};return e.forEach((e=>{const{key:n,propertyType:i}=e,l=r[n];Array.isArray(l)?t[n]=l.map((r=>Ct(i,r,{formatText:e.format,properties:e.properties}))):t[n]=Ct(i,l,{formatText:e.format,properties:e.properties})})),t}return null},xt=(e,r)=>{const t={};return e.forEach((e=>{const{key:n,name:i,isRequired:l,isMultiple:a,sortOrder:o,isEnabled:s,uiSettings:c,validationNode:d}=e,u=e.propertyType?"string"==typeof e.propertyType?e.propertyType:e.propertyType.value:null,p=Object.assign({name:i,propertyType:u,isRequired:l,isMultiple:a,sortOrder:o,isEnabled:s,validationNode:d,uiSettings:c},((e,r)=>{const t={};let n,i="";return r?e.isMultiple?(i="values",n=e.value):(i="value",n=e.value):e.isMultiple?(i="defaultValues",n=e.defaultValue):(i="defaultValue",n=e.defaultValue),Array.isArray(n)?t[i]=n.map((r=>Ct(e.propertyType,r,{formatText:e.format,properties:e.properties}))):t[i]=Ct(e.propertyType,n,{formatText:e.format,properties:e.properties}),t})(Object.assign(Object.assign({},e),{propertyType:u}),r));if("isViewableInList"in e&&(p.isViewableInList=e.isViewableInList),c)if("string"==typeof c)try{p.uiSettings=JSON.parse(c)}catch(e){console.log(e),p.uiSettings=c}else p.uiSettings=c;else p.uiSettings=null;u===jr.BIG_DECIMAL&&(p.precisionScale=e.precisionScale,p.roundingMode=e.roundingMode),u!==jr.DATE&&u!==jr.TIME&&u!==jr.DATE_TIME||(p.format=e.format),u===jr.STRING&&(p.restrictedValues=e.restrictedValues),u===jr.ENTITY_REFERENCE&&(p.source=e.source,p.definitionCode=e.definitionCode,p.definitionVersion=e.definitionVersion,p.labelPropertyCode=e.labelPropertyCode,p.valuePropertyCode=e.valuePropertyCode),u===jr.ENTITY&&(p.properties=xt(e.properties,r)),t[n]=p})),t};function Et(e,r){return Object.keys(e).map((t=>{const n=Object.assign(Object.assign({key:t},e[t]),r||{});if(n.propertyType===jr.ENTITY&&(n.properties=Et(n.properties,r)),n.propertyType===jr.JSON)try{null==n.defaultValue?n.defaultValue="":n.defaultValue=JSON.stringify(n.defaultValue,null,2)}catch(e){n.defaultValue=""}return n.isMultiple&&("defaultValues"in n&&(n.defaultValue=n.defaultValues),"values"in n&&(n.value=n.values)),n})).sort(((e,r)=>Qr(e,r,"sortOrder")))}const jt=(e,r)=>{if(r)try{const e=r.replace(/Z/g,"XXX");return de(new Date,e),e}catch(r){return console.error("Incorrect format",r),e}return e},Tt=e=>{let r=[];return r=Array.isArray(e.properties)?e.properties:Et(e.properties),r.reduce(((e,r)=>{const t=JSON.parse(JSON.stringify(e));return r.propertyType===jr.ENTITY?t[r.key]=Tt(r):t[r.key]=r.propertyType,t}),{})},St=({propertyType:e,useExpression:r,required:t})=>{let n=[{value:"widget",label:"Fill array (widget)",sortOrder:1}];return t||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===jr.JSON||e===jr.ENTITY||e===jr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e!==jr.JSON&&e!==jr.ANY&&e!==jr.ENTITY||n.push({value:"json_valid",label:"JSON editor",sortOrder:2}),n=n.sort(((e,r)=>Qr(e,r,"sortOrder"))),n},wt=({propertyType:e,useExpression:r,required:t})=>{let n=[{value:"widget",label:"Widget",sortOrder:1}];switch(t||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===jr.JSON||e===jr.ENTITY||e===jr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e===jr.JSON&&n.push({value:"dem_builder",label:"DEM Builder",sortOrder:2}),e){case jr.STRING:n[0].label="Text input";break;case jr.INTEGER:case jr.BIG_INTEGER:case jr.BIG_DECIMAL:case jr.FLOAT:case jr.LONG:case jr.DOUBLE:n[0].label="Number input";break;case jr.BOOLEAN:n[0].label="Switch";break;case jr.ENTITY_REFERENCE:n[0].label="Entity reference field";break;case jr.JSON:n[0].label="JSON editor";break;case jr.DATE:n[0].label="Date picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case jr.DATE_TIME:n[0].label="Date & Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case jr.TIME:n[0].label="Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case jr.ANY:n[0].label="Textarea"}return n=n.sort(((e,r)=>Qr(e,r,"sortOrder"))),n},Vt={required:Nr,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},Lt=e=>{var r,t,{control:n,validate:s,name:d="",label:u="",required:p=!1,defaultValue:m=null,disabled:g=!1,hideErrorMessage:h=!1,onChange:b,decimal:v=!1,valueAsNumber:y=!0,useFormattedInputValue:C=!1,errorText:O}=e,x=o(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","decimal","valueAsNumber","useFormattedInputValue","errorText"]);const E=f((()=>O||Vt),[O]),T=j({name:d,control:n,defaultValue:m,rules:{required:!!p&&E.required,validate:e=>0==+e||(null===e?!p||E.required:v&&!ht.test(e)||/^-*0+$/.test(e)?E.notValidNumber:v||gt.test(e)?!s||("function"!=typeof s||s(e)):E.notValidInteger)}}),S=T.field,{ref:w,onChange:V,value:L}=S,k=o(S,["ref","onChange","value"]),{fieldState:{error:R}}=T;return i(c,Object.assign({},k,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:w,name:d,label:p?l(a,{children:[u," ",i("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!R,helperText:!h&&(null==R?void 0:R.message),disabled:g,value:C?null!==(r=null==L?void 0:L.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))&&void 0!==r?r:"":null!=L?L:"",onChange:e=>{var r;const t=e.target.value.replace(/\s/g,""),n=e.nativeEvent.data;if(!isNaN(n)||v&&"."===n||"-"===n||"+"===n||t){if(b)b(e);else if(y)if(e.target.value)if("0"===e.target.value)V(0);else if(v){const n=e.target.value.split(".")[1];V(!ht.test(t)||/^0+$/.test(n)||/^-*0+$/.test(t)?e.target.value:+parseFloat(t).toFixed(null!==(r=null==n?void 0:n.length)&&void 0!==r?r:0))}else V(Number.isNaN(+t)?e.target.value:+t);else V(null)}else V(e.target.value)},FormHelperTextProps:{variant:"standard"},inputProps:Object.assign({},null!==(t=null==x?void 0:x.inputProps)&&void 0!==t?t:{})},x))},kt=e=>{var{control:r,name:t,label:n,defaultValue:l}=e,a=o(e,["control","name","label","defaultValue"]);const s=j({control:r,name:t,defaultValue:l}).field,{ref:c,onChange:d,value:u}=s,p=o(s,["ref","onChange","value"]),g=f((()=>{if("boolean"==typeof u)return u;if("string"==typeof u){if("false"===u)return d(!1),!1;if("true"===u)return d(!0),!0}return!1}),[u,d]);m((()=>{null===u&&d(!1)}),[u,d]);return i(H,{label:n,name:t,control:i(se,Object.assign({},p,{color:"primary",size:"small",inputRef:c,onChange:e=>{const{checked:r}=e.target;d(r)},checked:g},a))})};var Rt="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";const Mt=()=>i("img",{src:Rt,alt:""}),Nt=e=>{var{control:r,name:t,required:n,label:s,placeholder:d,defaultValue:u,format:p=Tr,hideErrorMessage:f=!1,textFieldProps:b={},requiredErrorText:v="",validate:y,validateErrorText:C}=e,O=o(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"]);const[x,E]=g(Tr),{field:T,fieldState:{error:S}}=j({control:r,name:t,defaultValue:u,rules:{required:!!n&&(v||Nr),validate:y||(e=>!(""!==e&&!me(e,x))||(C||Ir))}}),w=h((e=>{T.onChange(pe(e)?de(e,x):e)}),[T,x]);return m((()=>{const e=p.replace(/[Z,z,x]+/g,"XX");try{me(de(new Date,e),e),E(e)}catch(e){console.error(e)}}),[p]),l(a,{children:[i(Y,Object.assign({required:n},{children:s})),i(ce,Object.assign({},T,x?{inputFormat:x}:{},{value:x?ue(T.value,x,new Date):T.value,onChange:w,components:{OpenPickerIcon:Mt}},O,{renderInput:e=>i(c,Object.assign({},e,{fullWidth:!0,size:"small",variant:"outlined",name:t,error:!!S,helperText:!f&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:d})},b))}))]})},It=()=>i("img",{src:Rt,alt:""}),Ft=e=>{var{control:r,name:t,required:n,label:s,placeholder:d,defaultValue:u,format:p=wr,hideErrorMessage:f=!1,textFieldProps:b,requiredErrorText:v="",validate:y,validateErrorText:C}=e,O=o(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"]);const[x,E]=g(),{field:T,fieldState:{error:S}}=j({control:r,name:t,defaultValue:u,rules:{required:!!n&&(v||Nr),validate:y||(e=>!(""!==e&&!me(e,x))||(C||Ir))}}),w=h((e=>{T.onChange(pe(e)?de(e,x):e)}),[T,x]);return m((()=>{const e=p.replace(/[Z,z,x]+/g,"XX");try{me(de(new Date,e),e),E(e)}catch(e){console.error(e)}}),[p]),i(ge,Object.assign({},T,{ampm:!1,label:n?l(a,{children:[s," ",i("span",{children:"*"})]}):s,value:x?ue(T.value,x,new Date):T.value},x?{inputFormat:x}:{},{onChange:w,components:{OpenPickerIcon:It}},O,{renderInput:e=>i(c,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:d}),variant:"outlined",name:t,error:!!S,helperText:!f&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"}},b))}))},Dt=e=>{var{control:r,name:t,required:n,label:s,textFieldProps:d={},format:u=Sr,hideErrorMessage:p=!1,requiredErrorText:h="",placeholder:f,defaultValue:b}=e,v=o(e,["control","name","required","label","textFieldProps","format","hideErrorMessage","requiredErrorText","placeholder","defaultValue"]);const y=j({control:r,name:t,defaultValue:b,rules:{required:!!n&&(h||Nr),validate:e=>!!me(e,u)||"Incorrect date format"}}),C=y.field,{onChange:O,ref:x,value:E}=C,T=o(C,["onChange","ref","value"]),{fieldState:{error:S}}=y,[w,V]=g(null);return m((()=>{if(E&&u){let e=ue(E,u,new Date);pe(e)||(e=ue(E,"HH:mm:ss.SSS",new Date)),V(e)}}),[E,u]),i(he,Object.assign({},T,{mask:"",inputRef:x,label:n?l(a,{children:[s," ",i("span",{children:"*"})]}):s,ampm:!1,value:w,inputFormat:u,onChange:e=>{V(e),O(pe(e)?de(e,u):e)}},v,{renderInput:e=>i(c,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:f}),variant:"outlined",name:t,error:!!S,helperText:!p&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"}}))}))},Pt=e=>{var r,t,n,{name:s,control:d,label:u,required:p,defaultValue:m=null,onChange:b,textFieldLabel:v}=e,y=o(e,["name","control","label","required","defaultValue","onChange","textFieldLabel"]);const[C,O]=g(""),[x,E]=g(null),T=j({control:d,name:s,defaultValue:m,rules:{required:p&&Nr}}),S=T.field,{onChange:w,value:V}=S,L=o(S,["onChange","value"]),{formState:{errors:M}}=T,N=f((()=>b||w),[b,w]),I=h((e=>{const{value:r}=e.target;O(r)}),[]),F=h((()=>{E(null),!C||Array.isArray(V)&&V.includes(C)?Array.isArray(V)&&V.includes(C)&&E("This value already exists"):(N([...null!=V?V:[],C]),O(""))}),[C,N,V]),D=h((e=>{N(V.filter((r=>r!==e)))}),[V,N]),P=h((e=>{"Enter"!==e.key&&13!==e.keyCode||(e.stopPropagation(),e.preventDefault(),F())}),[F]);return l(a,{children:[i(Y,Object.assign({required:p},{children:u})),i(q,Object.assign({display:"flex",flexWrap:"wrap"},{children:null==V?void 0:V.map(((e,r)=>i(fe,{sx:{mr:1,mb:1},variant:"outlined",label:e,onDelete:()=>D(e)},r)))})),i("input",Object.assign({type:"hidden"},d.register(s),{onChange:N,value:V},L)),i(c,Object.assign({fullWidth:!0,variant:"outlined",size:"small",label:v||""===v?v:`Add ${u}`,value:C,onChange:I,error:!!(null===(r=M[s])||void 0===r?void 0:r.message),helperText:null===(t=M[s])||void 0===t?void 0:t.message,FormHelperTextProps:{variant:"standard"},name:s,onKeyDown:P,InputProps:{endAdornment:i(R,Object.assign({size:"small",onClick:F},{children:i(k,{children:i("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})}))},inputProps:Object.assign({},null!==(n=null==y?void 0:y.inputProps)&&void 0!==n?n:{})},y)),x&&i(_,Object.assign({error:!0},{children:x}))]})},At=({name:e="period",control:r,label:t="Period",required:n,isSecondsVisible:o=!1})=>{var s;const[d,u]=g(),{setValue:p,register:f,formState:{errors:b}}=S(),v=T({control:r,name:e}),y=h((r=>{const{name:t,value:n}=r.target,i=Object.assign({},null!=d?d:{});n?(i[t]=+n,p(e,ve(i),{shouldValidate:!0})):(delete i[t],p(e,"",{shouldValidate:!0})),u(i)}),[p,e,d]),C=null===(s=b[e])||void 0===s?void 0:s.message;return m((()=>{v&&!d&&u(ye(v))}),[d,v]),l(a,{children:[i("input",Object.assign({type:"hidden"},f(e,{required:n&&"Please, fill one of the fields"}))),i($,Object.assign({variant:"subtitle1"},{children:n?l(a,{children:[t," ",i(q,Object.assign({component:"span",color:"#D6331F"},{children:"*"}))]}):t})),C&&i(_,Object.assign({error:!0},{children:C})),l(be,Object.assign({container:!0,columns:2,spacing:2,flexWrap:"wrap"},{children:[i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",value:(null==d?void 0:d.years)||"",error:!!C,name:"years",label:"Years",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.months)||"",name:"months",label:"Months",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.weeks)||"",name:"weeks",label:"Weeks",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.days)||"",name:"days",label:"Days",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.hours)||"",name:"hours",label:"Hours",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.minutes)||"",name:"minutes",label:"Minutes",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),o&&i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.seconds)||"",name:"seconds",label:"Seconds",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}))]}))]})};const qt=e=>{var{control:r,name:t,label:n,required:s,mask:d="+7 (799) 999 99 99",requiredErrorText:u="",inputMaskProps:p,disabled:m,invalidErrorText:g}=e,h=o(e,["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","invalidErrorText"]);return i(w,{control:r,name:t,rules:{required:!!s&&(u||Nr),validate:e=>!s&&!e||(!!/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(e)||(g||"Incorrect phone number format"))},render:({field:e,fieldState:{error:r}})=>i(Ce,Object.assign({disabled:m,mask:d,value:e.value,onChange:e.onChange,onBlur:e.onBlur},p,{children:i(c,Object.assign({fullWidth:!0,size:"small",label:s&&n?l(a,{children:[n," ",i("span",{children:"*"})]}):n,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",InputProps:{startAdornment:i(M,Object.assign({position:"start"},{children:i("img",{src:"data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",alt:""})}))}},h,{error:!!r,FormHelperTextProps:{variant:"standard"},helperText:null==r?void 0:r.message}))}))})};var $t="data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.99995 8L9.99995 12L14 8H5.99995Z' fill='%236D7C8B'/%3e%3c/svg%3e";const zt=()=>i("img",{src:$t,alt:""});var Bt=()=>{const e=Ee(),r=je(e,Te),t=je(e,Se),n=je(e,we),a=je(e,Ve),o=r=>e.current.setPage(r);return l(q,Object.assign({px:2,display:"flex",alignItems:"center"},{children:[i(xe,{component:"div",page:r,count:n,rowsPerPage:a,rowsPerPageOptions:[10,20,50,100],onPageChange:(e,r)=>o(r),onRowsPerPageChange:r=>e.current.setPageSize(parseInt(r.target.value,10)),labelRowsPerPage:"Строк на странице",labelDisplayedRows:({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`,ActionsComponent:void 0,SelectProps:{IconComponent:zt}}),i(Oe,{count:t,page:r+1,onChange:(e,r)=>o(r-1)})]}))};var Ht=e=>{var{hideMenu:r,currentColumn:t,onUnsort:n}=e,l=o(e,["hideMenu","currentColumn","onUnsort"]);return i(Le,Object.assign({hideMenu:r,currentColumn:t},l,{children:i(ke,{onClick:r,column:t})}))};var _t=({mode:e})=>{const[r,t]=ne(),n=+r.get("page")||0,i=+r.get("size")||10;return m((()=>{"server"===e&&(r.has("page")||r.set("page","0"),r.has("size")||r.set("size","10"),t(r,{replace:!0}))}),[e,r,t]),{page:n,size:i,onPageChange:e=>{r.set("page",`${e}`),t(r,{replace:!0})},onSizeChange:e=>{r.set("size",`${e}`),t(r,{replace:!0})}}};var Wt=()=>{const[e,r]=ne(),t=e.getAll("sort").map((e=>e.split(",")));return{onColumnHeaderClick:({field:t,colDef:n})=>{if(n.sortable){let n=!1;const i=e.getAll("sort");e.delete("sort"),i.forEach((r=>{const[i,l]=r.split(",");i===t?(n=!0,"asc"===l&&e.append("sort",`${i},desc`)):e.append("sort",`${i},${l}`)})),n||e.append("sort",`${t},asc`),r(e,{replace:!0})}},getSortedColumns:e=>e.map((e=>{const r=t.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))}};var Jt=e=>{const[r,t]=g(10);m((()=>{t(e)}),[e]);return{pageSize:r,handlePageSizeChange:e=>t(e)}},Gt="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.47341 10.4087C3.3698 10.2747 3.32108 10.1063 3.33715 9.9377C3.35321 9.76909 3.43285 9.61291 3.55989 9.50088C3.68693 9.38886 3.85185 9.3294 4.02115 9.33457C4.19045 9.33974 4.35144 9.40915 4.47141 9.52872L8.00008 13.0574L11.5287 9.52872L11.5914 9.47338C11.7254 9.36978 11.8938 9.32106 12.0624 9.33712C12.231 9.35318 12.3872 9.43282 12.4992 9.55987C12.6113 9.68691 12.6707 9.85183 12.6656 10.0211C12.6604 10.1904 12.591 10.3514 12.4714 10.4714L8.47141 14.4714L8.40874 14.5267C8.28047 14.6262 8.12031 14.6755 7.95829 14.6653C7.79627 14.6551 7.64354 14.5862 7.52874 14.4714L3.52874 10.4714L3.47341 10.4087ZM12.5267 5.59138C12.6304 5.72538 12.6791 5.89379 12.663 6.0624C12.6469 6.23102 12.5673 6.3872 12.4403 6.49922C12.3132 6.61124 12.1483 6.67071 11.979 6.66554C11.8097 6.66037 11.6487 6.59095 11.5287 6.47138L8.00008 2.94272L4.47141 6.47138L4.40874 6.52672C4.27475 6.63032 4.10634 6.67905 3.93773 6.66298C3.76911 6.64692 3.61293 6.56728 3.50091 6.44024C3.38889 6.31319 3.32942 6.14827 3.33459 5.97897C3.33976 5.80967 3.40918 5.64869 3.52874 5.52872L7.52874 1.52872L7.59141 1.47338C7.71968 1.37388 7.87985 1.3246 8.04187 1.33479C8.20388 1.34498 8.35662 1.41393 8.47141 1.52872L12.4714 5.52872L12.5267 5.59138Z' fill='%23262842'/%3e%3c/svg%3e",Yt="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3c/g%3e%3c/svg%3e",Zt="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3c/g%3e%3c/svg%3e";const Kt=()=>i("img",{src:Gt,alt:""}),Ut=()=>i("img",{src:Yt,alt:""}),Xt=()=>i("img",{src:Zt,alt:""}),Qt=e=>{var{columns:r,rows:t,rowCount:n,loading:l,disableMargin:a,mode:s="server",initialPageSize:c=10,pagination:d=!0,onCellClick:u}=e,p=o(e,["columns","rows","rowCount","loading","disableMargin","mode","initialPageSize","pagination","onCellClick"]);const{page:m,size:g,onPageChange:h,onSizeChange:f}=_t({mode:s}),{onColumnHeaderClick:b,getSortedColumns:v}=Wt(),{pageSize:y,handlePageSizeChange:C}=Jt(c),O={sortingMode:s,paginationMode:s,pageSize:"server"===s?g:d?y:n,onPageSizeChange:"server"===s?f:C,components:{BaseTooltip:Q,Pagination:Bt,ColumnUnsortedIcon:e=>(o(e,["sortingOrder"]),i(Kt,{})),ColumnSortedDescendingIcon:e=>(o(e,["sortingOrder"]),i(Xt,{})),ColumnSortedAscendingIcon:e=>(o(e,["sortingOrder"]),i(Ut,{}))}};return"server"===s&&(O.onColumnHeaderClick=b,O.page=m,O.onPageChange=h,O.components.ColumnMenu=Ht),i(q,Object.assign({mt:a?0:2},{children:i(Re,Object.assign({autoHeight:!0,hideFooterPagination:!d,hideFooter:!d,disableSelectionOnClick:!0,loading:l,rows:t,disableColumnMenu:!0,columns:v(r),rowCount:n,rowsPerPageOptions:[10,20,50,100],onCellClick:u},O,p))}))},en=({icon:e,label:r,showInMenu:t,onClick:n,location:l})=>{var a;return l?i(R,Object.assign({component:te,to:l.pathname,state:null!==(a=l.state)&&void 0!==a?a:null,size:"small"},{children:i(Q,Object.assign({title:r,arrow:!0},{children:u.cloneElement(e,{fontSize:"small"})}))})):i(Me,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:i(Q,Object.assign({title:r,arrow:!0},{children:e})),onClick:n,label:r,showInMenu:t})};var rn=()=>{const[e,r]=ne(),t=f((()=>{var r;return null!==(r=e.get("page"))&&void 0!==r?r:0}),[e]),n=f((()=>{var r;return null!==(r=e.get("size"))&&void 0!==r?r:10}),[e]),i=h((e=>{r((r=>(r.set("page",`${e}`),r)))}),[r]),l=h((e=>{r((r=>(r.set("size",`${e}`),r)))}),[r]);return m((()=>{e.has("page")||r((e=>(e.set("page","0"),e))),e.has("size")||r((e=>(e.set("size","10"),e)))}),[e,r]),{page:t,size:n,onPageChange:i,onSizeChange:l}};var tn=()=>{const[e,r]=ne(),t=f((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),n=h((e=>{r((r=>{r.delete("sort");let n=!1;return t.forEach((([t,i])=>{t===e?(n=!0,"asc"===i&&r.append("sort",`${t},desc`)):r.append("sort",`${t},${i}`)})),n||r.append("sort",`${e},asc`),r}))}),[t,r]),i=h((e=>{const r=t.find((([r,t])=>r===e));return!!r&&r[1]}),[t]);return{sortParams:t,onSortChanged:n,getColumnSorting:i}};const nn=t(ze)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),ln=()=>i("img",{src:$t,alt:""}),an=()=>i("img",{src:Gt,alt:""}),on=()=>i("img",{src:Yt,alt:""}),sn=()=>i("img",{src:Zt,alt:""});function cn({columns:e=[],rows:r=[],totalCount:t,children:n,pagination:a=!0,loading:o=!1,onRowClick:s,emptyDataText:c,verticalAlign:d="middle",labelRowsPerPage:u},p){const{page:m,size:g,onPageChange:h,onSizeChange:f}=rn(),{onSortChanged:b,getColumnSorting:v}=tn();return i(q,Object.assign({sx:{overflow:"auto"}},{children:l(De,Object.assign({sx:{width:"100%",display:"table",tableLayout:"fixed"}},{children:[i($e,Object.assign({open:o,sx:{position:"absolute",top:0,left:0}},{children:i(Lr,{})})),l(Ne,Object.assign({ref:p},{children:[i(Pe,{children:i(Ae,{children:e.map(((e,r)=>{const t=!!e.sortKey&&v(e.sortKey);return i(Fe,Object.assign({align:e.align?e.align:"left",sortDirection:t,sx:{width:e.width?`${e.width}%`:"unset"}},{children:i(nn,Object.assign({active:!!t,hideSortIcon:!e.sortKey,direction:t||"asc",IconComponent:"asc"===t?on:"desc"===t?sn:an,onClick:()=>e.sortKey?b(e.sortKey):{}},{children:e.label}))}),r)}))})}),i(Ie,{children:r.length?r.map(((r,t)=>i(Ae,Object.assign({hover:!0,onClick:s?()=>s(r):r.onClick,sx:{verticalAlign:d}},{children:e.map(((e,n)=>i(Fe,Object.assign({align:e.align?e.align:"left",sx:{maxWidth:e.width?`${e.width}%`:"unset"}},{children:i(q,Object.assign({sx:{maxWidth:"90%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",padding:({spacing:e})=>e(2.4,0)}},{children:i(q,{children:e.renderCell?e.renderCell(r,t):r[e.id]})}))}),n)))}),t))):i(Ae,Object.assign({sx:{verticalAlign:d}},{children:i(Fe,Object.assign({align:"center",colSpan:e.length},{children:null!=c?c:"Нет данных"}))}))}),a||n?i(qe,{children:l(Ae,{children:[n&&i(Fe,Object.assign({colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3}},{children:n})),a&&r.length?i(xe,{rowsPerPageOptions:[5,10,25],count:t,rowsPerPage:+g,page:+m,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`:void 0,SelectProps:{IconComponent:ln},onPageChange:(e,r)=>h(r),onRowsPerPageChange:e=>f(+e.target.value)}):null]})}):null]}))]}))}))}const dn=v(cn),un=({actionsList:e})=>{const[r,t]=g(null),n=Boolean(r),a=()=>{t(null)};return l("div",{children:[i(R,Object.assign({"aria-label":"more",id:"more-button","aria-controls":n?"more-menu":void 0,"aria-expanded":n?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),t(e.currentTarget)}},{children:i(He,{})})),i(Be,Object.assign({id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:r,open:n,onClose:e=>{e.stopPropagation(),a()},PaperProps:{style:{minWidth:"127px"}}},{children:e.map((e=>i(d,Object.assign({onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(),a()}},{children:e.title}),e.title)))}))]})},pn=e=>{const{children:r,value:t,index:n}=e,l=o(e,["children","value","index"]);return i("div",Object.assign({role:"tabpanel",hidden:t!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`},l,{children:t===n?r:null}))},mn=e=>{var r;const{tabs:t}=e,n=ee(),a=re(),o=f((()=>new URLSearchParams(a.search)),[a.search]),s=o.get("tab");return l(q,{children:[i(_e,{children:i(Je,Object.assign({value:s||(null===(r=t[0])||void 0===r?void 0:r.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{o.set("tab",r),n({pathname:a.pathname,search:o.toString()},{replace:!0})}},{children:t.map((e=>i(We,{value:e.name,label:e.label},e.name)))}))}),i(q,Object.assign({mt:2},{children:t.map((e=>{var r;return i(pn,Object.assign({value:s||(null===(r=t[0])||void 0===r?void 0:r.name),index:e.name},{children:e.component}),e.name)}))}))]})},gn=({title:e,text:r,json:t})=>l(q,Object.assign({sx:{paddingBottom:8}},{children:[i(q,Object.assign({sx:{fontSize:"14px",fontWeight:600,color:"#536DFE"}},{children:e})),r&&i(q,Object.assign({sx:{fontSize:"18px",wordWrap:"break-word"}},{children:r})),t&&i(nt,{value:t,height:300})]})),hn=Object.values(Vr).sort(((e,r)=>e.localeCompare(r)));var fn=({propertyFieldName:e,control:r})=>l(a,{children:[i(be,{children:i(Lt,{required:!0,control:r,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),i(be,{children:i($r,{required:!0,control:r,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:Vr.HALF_UP,options:hn})})]});var bn=({propertyFieldName:e,control:r,defaultValue:t=""})=>i(be,{children:i(Fr,{required:!0,control:r,defaultValue:t,name:`${e}.format`,label:"Format"})});const vn=()=>i("div",{style:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),yn=({data:e})=>l(Qe,Object.assign({nonLinear:!0,orientation:"vertical",connector:i(nr,{sx:{marginLeft:4}}),sx:{width:"100%"}},{children:[e.filter(Boolean).map(((e,r)=>l(er,Object.assign({expanded:!0},{children:[i(rr,Object.assign({sx:{display:"flex",alignItems:"flex-start"},StepIconComponent:vn,StepIconProps:{icon:"",completed:!1,active:!0}},{children:e.label})),i(tr,Object.assign({sx:{marginLeft:4}},{children:e.content}))]}),r))),i(er,{})]})),Cn=({properties:e=[]})=>{const r=f((()=>e?e.map((e=>{const r="string"==typeof e.propertyType?e.propertyType:e.propertyType?e.propertyType.value:"";return{label:l(q,Object.assign({display:"flex",flexDirection:"column"},{children:[l("b",{children:[e.name,e.isRequired?"*":""]}),l("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",r]})]})),content:"ENTITY"===e.propertyType&&i(Cn,{properties:e.properties})}})):[]),[e]);return i(yn,{data:r})};var On=Cn;const xn={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""};var En=({control:e,parentPropertyFieldName:r,entityDefinition:t=!1,globalParameter:n=!1,entityReferenceDefinitionSources:o,entityReferenceValueComponent:c,fileReferenceValueComponent:d})=>{const u=p(null),{field:{onChange:m}}=j({control:e,name:`${r}.properties`}),f=T({control:e,name:`${r}.properties`,defaultValue:[]}),b=T({control:e,name:`${r}.name`}),{append:v,remove:y}=V({control:e,name:`${r}.properties`}),C=Pr(),[O,x]=g(0),E=h((()=>{if((null==f?void 0:f.length)>0){v(xn);const e=f.length;x(e)}else v(xn);u.current.addProperty()}),[f,v]),S=()=>s(void 0,void 0,void 0,(function*(){m(u.current.getProperties()),C.onClose()}));return l(a,{children:[i(be,{children:i($,Object.assign({variant:"h6"},{children:"Properties"}))}),i(be,{children:i(On,{properties:f})}),i(be,{children:i(N,Object.assign({variant:"contained",color:"primary",onClick:C.onOpen},{children:"Edit properties"}))}),l(I,Object.assign({disableEscapeKeyDown:!0,open:C.open,onClose:S,fullWidth:!0,maxWidth:"md"},{children:[l(A,{children:[b||"Entity"," Properties"]}),i(D,Object.assign({style:{height:"500px",overflow:"hidden"}},{children:l(be,Object.assign({container:!0,direction:"row",spacing:2,style:{height:"100%"}},{children:[l(be,Object.assign({xs:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"}},{children:[i(Qe,Object.assign({nonLinear:!0,activeStep:O,orientation:"vertical",style:{paddingLeft:"4px"}},{children:f.map(((e,r)=>l(er,Object.assign({onClick:()=>(e=>x(e))(r),style:{cursor:"pointer"}},{children:[i(rr,Object.assign({StepIconProps:{icon:""},style:{wordBreak:"break-word"}},{children:e.name||"(no name)"})),i(tr,{})]}),r)))})),i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:E},{children:"Add property"}))]})),i(be,Object.assign({container:!0,wrap:"nowrap",direction:"column",spacing:2,style:{height:"100%",overflowY:"auto",width:"75%"}},{children:i(Xn,{ref:u,properties:f,hideAddButton:!0,parentRemove:y,focusOnIndex:O,entityDefinition:t,globalParameter:n,entityReferenceDefinitionSources:o,entityReferenceValueComponent:c,fileReferenceValueComponent:d})}))]}))})),i(F,{children:i(N,Object.assign({variant:"contained",color:"primary",onClick:S},{children:"Ok"}))})]}))]})};var jn=({propertyFieldName:e,control:r,sources:t=[{label:"Arsenal Entities",value:"ARSENAL_ENTITIES"}]})=>l(a,{children:[i(be,{children:i($r,{required:!0,control:r,name:`${e}.source`,label:"Source",options:t})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${e}.definitionCode`,label:"Definition Code"})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]});const Tn=({control:e,propertyType:r,propertyFieldName:t,entityDefinition:n=!1,globalParameter:l=!1,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})=>{switch(r){case jr.STRING:return i(Pt,{name:`${t}.restrictedValues`,control:e,label:"Restricted Values"});case jr.BIG_DECIMAL:return i(fn,{propertyFieldName:t,control:e});case jr.DATE:return i(bn,{control:e,propertyFieldName:t,defaultValue:Tr});case jr.TIME:return i(bn,{control:e,propertyFieldName:t,defaultValue:Sr});case jr.DATE_TIME:return i(bn,{control:e,propertyFieldName:t,defaultValue:wr});case jr.ENTITY_REFERENCE:return i(jn,{control:e,propertyFieldName:t,sources:a});case jr.ENTITY:return i(En,{control:e,parentPropertyFieldName:t,globalParameter:l,entityDefinition:n,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s});default:return null}};var Sn=({control:e,name:r,label:t,required:n,restrictedValues:a,requiredErrorText:o="",requiredSelectErrorText:s=""})=>{const{field:{onChange:c,ref:u},fieldState:{error:p}}=j({control:e,name:r,rules:{required:!!n&&(Array.isArray(a)&&a.length?s||"Please, select a value":o||Nr)}}),m=T({control:e,name:r});return Array.isArray(a)&&a.length?l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!p},{children:[i(sr,Object.assign({htmlFor:"type-select"},{children:t})),i(ar,Object.assign({labelId:"type-select",label:t,value:m||"",onChange:c,ref:u},{children:a.map((e=>i(d,Object.assign({value:e},{children:e}),e)))}))]})):i(Fr,{hideErrorMessage:!0,required:n,control:e,name:r,label:t})};var wn=({name:e})=>{const{control:r,setValue:t,register:n}=S(),o=T({control:r,name:e}),c=h((r=>s(void 0,void 0,void 0,(function*(){const n=r.target.files[0];(new FileReader).readAsDataURL(n);const i=yield(e=>new Promise(((r,t)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{r(n.result)},n.onerror=e=>{t(e)}})))(n);t(e,i)}))),[e,t]);return l(a,{children:[l(q,Object.assign({mb:2,display:"flex",flex:"row"},{children:[i($,{children:"Does file uploaded:"}),i(k,o?Object.assign({sx:{paddingLeft:2}},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):Object.assign({sx:{paddingLeft:2}},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})}))]})),l(N,Object.assign({component:"label",variant:"contained",size:"large",color:"primary",sx:{marginTop:4}},{children:[o?"Change file":"Upload file",i("input",Object.assign({type:"hidden"},n(`${e}`,{required:!0}))),i("input",{type:"file",hidden:!0,onChange:c})]}))]})};const Vn=({property:e,name:r,label:t,useExpression:n,control:l,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})=>{var c;switch("string"==typeof e.propertyType?e.propertyType:null===(c=e.propertyType)||void 0===c?void 0:c.value){case jr.BIG_DECIMAL:case jr.FLOAT:case jr.DOUBLE:return i(Lt,{required:!0,decimal:!0,hideErrorMessage:!0,control:l,name:r,label:t,valueAsNumber:!0});case jr.INTEGER:case jr.BIG_INTEGER:case jr.LONG:return i(Lt,{required:!0,hideErrorMessage:!0,control:l,name:r,label:t,valueAsNumber:!0});case jr.BOOLEAN:return i(kt,{control:l,name:r,defaultValue:!1});case jr.DATE:return i(Nt,{hideErrorMessage:!0,control:l,name:r,label:t,format:e.format});case jr.TIME:return i(Dt,{hideErrorMessage:!0,control:l,name:r,label:t,format:e.format});case jr.DATE_TIME:return i(Ft,{hideErrorMessage:!0,control:l,name:r,label:t,format:e.format});case jr.JSON:return i(Zr,{control:l,name:r,label:t,parseValue:!0,hideErrorMessage:!0,validateJson:!0});case jr.STRING:return i(Sn,{control:l,name:r,label:t,restrictedValues:e.restrictedValues});case jr.ENTITY_REFERENCE:return o?i(o,{name:r,property:e}):i(Sn,{name:r,label:t,control:l});case jr.FILE:return i(wn,{name:r});case jr.FILE_REFERENCE:return s?i(s,{name:r}):i(Sn,{name:r,label:t,control:l});case jr.ANY:return i(Zr,{control:l,name:r,hideErrorMessage:!0,label:t});case jr.ENTITY:return i(pi,{properties:e.properties,dataFieldName:r,useExpression:n,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s});default:return i("div",{children:"No widget"})}};var Ln=({value:e,property:r,label:t,isDirty:n,required:i=!1,useExpression:l=!1,multipleOptions:a=!1})=>{const o=f((()=>t?`${t} (value)`:`${r.name} (value)`),[t,r]),s=f((()=>t?`${t} (widget)`:`${r.name} (widget)`),[t,r]),c=f((()=>{var e;return"string"==typeof r.propertyType?r.propertyType:null===(e=r.propertyType)||void 0===e?void 0:e.value}),[r]),[d,u]=g(null),p=f((()=>a?St({propertyType:c,required:i,useExpression:l}):wt({propertyType:c,required:i,useExpression:l})),[l,i,c,a]),b=f((()=>{switch(c){case jr.STRING:case jr.DATE:case jr.TIME:case jr.DATE_TIME:case jr.ENTITY_REFERENCE:case jr.ANY:case jr.FILE:case jr.FILE_REFERENCE:return"";case jr.JSON:return{};case jr.BOOLEAN:return!1;case jr.INTEGER:case jr.BIG_DECIMAL:case jr.BIG_INTEGER:case jr.DOUBLE:case jr.LONG:case jr.FLOAT:return 0;default:return null}}),[c]),v=f((()=>c===jr.JSON||c===jr.ANY),[c]),y=h((()=>{ft(e,v)?u("expression"):null==e||ft(e,v)||"widget"===d||"string"===d||u("widget")}),[e,d,v]);return m((()=>{d?n||y():!yt(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?l&&ft(e,v)?u("expression"):u("widget"):u("null")}),[e,d,p,l,n,y,v,i,r]),{propertyType:c,valueLabel:o,fillOptionLabel:s,fillOption:d,fillOptions:p,setFillOption:u,defaultProperyValue:b,checkFillOption:y}};const kn=t(sr)((()=>({inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"}}))),Rn=({control:e,property:r,name:t,useExpression:n,label:a,required:o,title:s,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:g,requiredErrorText:f=""})=>{const{field:{value:b,onChange:v},fieldState:{error:y,isDirty:C}}=j({name:t,control:e,defaultValue:r.defaultValue,rules:{validate:e=>!o||null!==e||(f||Nr)}}),O=p({}),{propertyType:x,valueLabel:E,fillOptionLabel:T,fillOption:S,fillOptions:w,setFillOption:V,defaultProperyValue:L}=Ln({value:b,property:r,isDirty:C,label:a,required:o,useExpression:n}),k=h((e=>{const t=e.target.value;O.current=Object.assign(Object.assign({},O.current),{[S]:b}),V(t);const n=O.current[t];if("null"===t)v(null,{shouldDirty:!0});else if("widget"===t)if(x===jr.JSON&&b&&"string"!=typeof b&&"dem_builder"===S&&"properties"in b){const e=Object.assign(Object.assign({},b),{properties:xt(b.property||[])});try{v(null!=n?n:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else v(null!=n?n:r.defaultValue||L);else if("expression"===t||"string"===t)v(null!=n?n:"",{shouldDirty:!0});else if("dem_builder"===t){const e={code:"",name:"",version:0,properties:[]};if(b)try{const e=JSON.parse(b);e.properties=Et(e.properties||{}),v(null!=n?n:e,{shouldDirty:!0})}catch(r){v(null!=n?n:e,{shouldDirty:!0})}else v(null!=n?n:e,{shouldDirty:!0})}}),[L,b,V,S,x,v,r]);return m((()=>{C||or(r.defaultValue||r.value)||""===r.defaultValue&&""===r.value||!or(b)||v(r.defaultValue||r.value)}),[C,r,v,b]),m((()=>{var e;(void 0===b||r.isRequired&&null===b&&or(r.defaultValue||r.value))&&v(null!==(e=O.current[S])&&void 0!==e?e:L),r.isRequired||null!==r.defaultValue&&null!==r.value||v(null)}),[b,v,L,r,S]),l(be,Object.assign({xs:12},{children:[s&&i(q,Object.assign({mb:2},{children:i($,Object.assign({variant:"h6"},{children:s}))})),w?i(q,Object.assign({mb:2},{children:l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined"},{children:[i(kn,Object.assign({htmlFor:"type-select"},{children:T})),i(ar,Object.assign({labelId:"type-select",label:T,value:S||"",onChange:k},{children:w.map((e=>i(d,Object.assign({value:e.value},{children:e.label}),e.value)))}))]}))})):null,"expression"===S&&(x===jr.JSON||x===jr.ENTITY||x===jr.ANY?i(Zr,{name:t,control:e,label:E,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):i(Fr,{control:e,name:t,label:E,hideErrorMessage:!0})),"string"===S&&i(Fr,{control:e,name:t,label:E,hideErrorMessage:!0}),"json_notvalid"===S&&i(Zr,{name:t,control:e,label:E,hideErrorMessage:!0}),"widget"===S&&i(Vn,{control:e,property:r,name:t,useExpression:n,label:E,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:g}),"dem_builder"===S&&i(ri,{control:e,title:"JSON",definitionFieldName:t,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:g}),y&&i(_,Object.assign({error:!0},{children:y.message}))]}))};var Mn=({control:e,name:r,property:t,useExpression:n,required:a,label:o,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:d})=>{const{fields:u,append:p,remove:m}=V({control:e,name:r});return l(be,Object.assign({container:!0,spacing:2,direction:"column",xs:12},{children:[Array.isArray(u)&&u.length?u.map(((u,p)=>i(be,Object.assign({xs:12},{children:l(q,Object.assign({display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"}},{children:[i(Rn,{control:e,required:a,property:t,useExpression:n,name:`${r}.${p}`,label:`${o||t.name} (${p+1})`,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:d}),i(q,Object.assign({mt:"8px",ml:"4px"},{children:i(R,Object.assign({id:"close-button",size:"small",onClick:()=>m(p)},{children:i(k,Object.assign({fontSize:"small"},{children:i("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}))}))]}))}),u.id))):null,i(be,{children:i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:()=>p(null)},{children:"Add value"}))})]}))};const Nn=({control:e,property:r,name:t,useExpression:n,required:a,label:o,title:s,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:h,requiredErrorText:f=""})=>{var b;const[v,y]=g(!1),{field:{value:C,onChange:O},fieldState:{error:x,isDirty:E}}=j({control:e,name:t,defaultValue:null!==(b=r.defaultValue)&&void 0!==b?b:[],rules:{validate:e=>!(a&&!e)||(f||Nr)}}),T=p({}),{propertyType:S,valueLabel:w,fillOptionLabel:V,fillOption:L,fillOptions:k,setFillOption:R,checkFillOption:M}=Ln({property:r,value:C,isDirty:E,label:o,required:a,useExpression:n,multipleOptions:!0});return m((()=>{C||O(r.isRequired&&r.isMultiple?[]:null)}),[C,r,O]),m((()=>{C&&!v&&(y(!0),M())}),[M,v,C]),l(be,{children:[s&&i(q,Object.assign({mb:2},{children:i($,Object.assign({variant:"h6"},{children:s}))})),k?i(q,Object.assign({mb:2},{children:l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined"},{children:[i(kn,Object.assign({htmlFor:"type-select"},{children:V})),i(ar,Object.assign({labelId:"type-select",label:V,value:L||"",onChange:e=>{y(!0),T.current=Object.assign(Object.assign({},T.current),{[L]:C});const r=e.target.value,t=T.current[r];"null"===r?O(null):"expression"===r||"json_valid"===r||"json_notvalid"===r?O(null!=t?t:"",{shouldDirty:!0}):"widget"===r&&O(null!=t?t:[],{shouldDirty:!0}),R(r)}},{children:k.map((e=>i(d,Object.assign({value:e.value},{children:e.label}),e.value)))}))]}))})):null,"expression"===L&&(S===jr.JSON||S===jr.ENTITY||S===jr.ANY?i(Zr,{name:t,control:e,label:w,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):i(Fr,{required:!0,hideErrorMessage:!0,control:e,name:t,label:w})),"json_valid"===L&&i(Zr,{name:t,control:e,label:w,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===L&&i(Mn,{control:e,property:r,name:t,useExpression:n,required:a,label:o,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:h}),x&&i(_,Object.assign({error:!0},{children:x.message}))]})},In=({control:e,propertyFieldName:r,name:t,label:n="",required:l,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})=>{const c=T({control:e,name:`${r}.propertyType`}),d=T({control:e,name:`${r}.isMultiple`}),u=T({control:e,name:`${r}.format`}),p=T({control:e,name:`${r}.restrictedValues`}),m=T({control:e,name:`${r}.properties`}),g=T({control:e,name:`${r}.isRequired`}),h=f((()=>Object.assign(Object.assign(Object.assign(Object.assign({name:n,isRequired:null!=l?l:g,isMultiple:d},!!u&&{format:u}),{restrictedValues:p}),!!m&&{properties:m}),{propertyType:"string"==typeof c?c:c.value,defaultValue:null,defaultValues:[],sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null})),[c,u,p,d,n,g,m,l]);return i(lr,Object.assign({dateAdapter:ir},{children:i(d?Nn:Rn,{control:e,name:t,property:h,title:n,required:l,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})}))};var Fn=({name:e})=>{const r=f((()=>({type:""})),[]),{control:t}=S(),{fields:n,append:a,remove:o}=V({control:t,name:e});return l(q,Object.assign({mt:2},{children:[i(N,Object.assign({variant:"outlined",size:"small",onClick:()=>a(r)},{children:"Add node"})),n.map((({id:r},t)=>i(_n,{removeHandle:()=>o(t),name:`${e}.${t}`},r)))]}))};const Dn=y(""),Pn=({name:e,control:r})=>l(a,{children:[i($,Object.assign({variant:"body2",gutterBottom:!0},{children:"Node"})),i(q,{children:i(Fr,{control:r,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),i(q,Object.assign({mt:2},{children:i(Fr,{control:r,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})}))]}),An=({name:e,control:r})=>l(a,{children:[i($,Object.assign({variant:"body2",gutterBottom:!0},{children:"Node"})),i(q,{children:i(Fr,{control:r,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),i(q,Object.assign({mt:2},{children:i(Fr,{control:r,name:`${e}.minimum`,label:"Minimum",type:"number"})})),i(q,Object.assign({mt:2},{children:i(Fr,{control:r,name:`${e}.maximum`,label:"Maximum",type:"number"})})),l(q,Object.assign({mt:2},{children:[i(zr,{control:r,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),i(zr,{control:r,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]}))]}),qn=["STRING_REGEX","JSON_SCHEMA"],$n=new Set([jr.INTEGER,jr.FLOAT,jr.DOUBLE,jr.BIG_DECIMAL,jr.BIG_INTEGER,jr.LONG]);var zn=({name:e})=>{const{control:r,setValue:t}=S(),n=C(Dn),o=T({control:r,name:`${e}.type`}),s=f((()=>{if("STRING_REGEX"===o)return i(Fr,{control:r,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===o)switch(!0){case n===jr.STRING:return i(Pn,{name:`${e}.node`,control:r});case $n.has(n):return i(An,{name:`${e}.node`,control:r});case n===jr.JSON:return i(Zr,{label:"Properties",control:r,name:`${e}.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+n}return null}),[n,o,r,e]);return m((()=>{$n.has(n)&&"JSON_SCHEMA"===o&&(t(`${e}.node.exclusiveMinimum`,!1),t(`${e}.node.exclusiveMaximum`,!1))}),[n,o,t,e]),i(yn,{data:[{label:"Validator",content:l(a,{children:[i(q,{children:i($r,{control:r,name:`${e}.type`,label:"Type",options:qn,onChange:r=>{t(e,{}),t(`${e}.type`,r.target.value)}})}),i(q,Object.assign({mt:2},{children:s}))]})}]})};const Bn=["AND","OR","NOT","NODE"],Hn=({name:e,removeHandle:r})=>{const{control:t}=S(),n=T({control:t,name:`${e}.type`}),o=f((()=>({AND:i(Fn,{name:`${e}.nodes`}),OR:i(Fn,{name:`${e}.nodes`}),NODE:i(zn,{name:`${e}.validator`}),NOT:i(Hn,{name:`${e}.node`})})),[e]);return i(yn,{data:[{label:"Node Type",content:l(a,{children:[l(q,Object.assign({display:"flex",alignItems:"flex-end"},{children:[i($r,{required:!0,control:t,name:`${e}.type`,label:"Type",options:Bn}),r&&i(q,Object.assign({ml:2},{children:i(R,Object.assign({onClick:r,color:"primary"},{children:i(Xe,{})}))}))]})),i(q,{children:o[n]})]})}]})};var _n=Hn;const Wn=({name:e})=>{const[r,t]=g(!1),{setValue:n,getValues:o}=S(),s=h((r=>{t(r.target.checked),r.target.checked||n(e,null)}),[n,e]);return m((()=>{o(e)&&t(!0)}),[e,o]),l(a,{children:[l(q,Object.assign({display:"flex",justifyContent:"space-between"},{children:[i($,Object.assign({variant:"h6"},{children:"Validator"})),i(H,{label:"Enable",control:i(W,{color:"primary",checked:r,onChange:s})})]})),r&&i(_n,{name:e})]})};var Jn=({name:e,label:r="",propertyFieldName:t,type:n,decimal:l=!1,options:a=[],required:o=!1})=>{const{control:s}=S(),c=f((()=>`${t}.${e}`),[e,t]);switch(n){case"text":return i(Fr,{control:s,name:c,label:r,required:o});case"number":return i(Lt,{control:s,name:c,label:r,decimal:l,required:o});case"select":return i($r,{control:s,name:c,label:r,options:a,required:o});case"autocomplete":return i(_r,{control:s,name:c,label:r,options:a,required:o});case"json":return i(Zr,{control:s,name:c,label:r,mode:"json",required:o});default:return null}};var Gn=e=>({customCheckboxes:f((()=>e.length?e.filter((e=>"checkbox"===e.type)):[]),[e]),customFields:f((()=>e.length?e.filter((e=>"checkbox"!==e.type)):[]),[e])});const Yn=Object.values(jr).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),Zn=O((({setValue:e,control:r,propertyFieldName:t,entityDefinition:n=!1,globalParameter:o=!1,customPropertyFields:s=[],entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u})=>{var p;const g=T({control:r,name:`${t}.propertyType`}),h=T({control:r,name:`${t}.isMultiple`}),b=T({control:r,name:`${t}.isRequired`}),{customCheckboxes:v,customFields:y}=Gn(s),C=f((()=>{let e=o?"Value":"Default Value";return h&&(e+="s"),e}),[o,h]);return m((()=>{g&&"string"==typeof g&&e(`${t}.propertyType`,Yn.find((e=>e.value===g)))}),[g,e,t]),l(be,Object.assign({container:!0,direction:"column",spacing:2},{children:[i(be,{children:i(Fr,{required:!0,control:r,name:`${t}.key`,label:"Key"})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${t}.name`,label:"Name"})}),i(be,{children:i(_r,{required:!0,control:r,name:`${t}.propertyType`,label:"Type",options:Yn,onChange:(r,n)=>{const i=`${t}.propertyType`,l=`${t}.${o?"value":"defaultValue"}`;e(l,h?[]:null),e(i,n)}})}),i(be,{children:i(Lt,{required:!0,control:r,name:`${t}.sortOrder`,label:"Sort Order"})}),i(be,{children:i(Zr,{control:r,name:`${t}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),l(be,{children:[i(zr,{control:r,name:`${t}.isMultiple`,label:"Multiple"}),i(zr,{control:r,name:`${t}.isEnabled`,label:"Enabled"}),i(zr,{control:r,name:`${t}.isRequired`,label:"Required"}),n&&i(zr,{control:r,name:`${t}.isViewableInList`,label:"Is viewable in list"}),v.length?i(a,{children:v.map(((e,n)=>i(zr,{control:r,name:`${t}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},n)))}):null]}),g&&l(a,{children:[i(be,{children:i(Dn.Provider,Object.assign({value:null!==(p=g.value)&&void 0!==p?p:g},{children:i(Wn,{name:`${t}.validationNode`})}))}),i(Tn,{control:r,propertyType:"string"==typeof g?g:g.value,propertyFieldName:t,globalParameter:o,entityDefinition:n,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),i(In,{control:r,propertyFieldName:t,name:`${t}.${o?"value":"defaultValue"}`,label:C,required:!!o&&b,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u})]}),y.length?i(a,{children:y.map(((e,r)=>i(be,{children:i(Jn,Object.assign({},e,{propertyFieldName:t}))},r)))}):null]}))}));var Kn=({entityDefinition:e,globalParameter:r,customPropertyFields:t,index:n,arrLength:a,entityReferenceDefinitionSources:o,entityReferenceValueComponent:s,control:c,setValue:d,fileReferenceValueComponent:u,handleRemoveParameter:p,error:m,item:h,extRefs:f})=>{const[b,v]=g(n===a&&!h.key);return i(be,Object.assign({sm:12,ref:e=>f.current[n]=e},{children:l(Ge,Object.assign({expanded:b,onChange:()=>v(!b),elevation:3},{children:[i(Ye,Object.assign({expandIcon:i(Ue,{})},{children:i($,Object.assign({color:m&&m[n]?"secondary":"initial",style:{wordBreak:"break-word"}},{children:h.name||`Property ${n+1}`}))})),i(Ze,{children:b&&i(Zn,{control:c,setValue:d,propertyFieldName:`properties.${n}`,entityDefinition:e,globalParameter:r,customPropertyFields:t,entityReferenceDefinitionSources:o,entityReferenceValueComponent:s,fileReferenceValueComponent:u})}),i(Ke,{children:i(N,Object.assign({variant:"contained",size:"small",color:"secondary",onClick:()=>p(n)},{children:"Remove"}))})]}))}))};const Un={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},Xn=v((({properties:e,parentFieldName:r,hideAddButton:t,focusOnIndex:n,required:o,entityDefinition:s=!1,globalParameter:c=!1,customPropertyFields:d=[],parentRemove:u,entityReferenceDefinitionSources:g,entityReferenceValueComponent:f,fileReferenceValueComponent:b},v)=>{var y;const{clearErrors:C,control:O,setValue:E,getValues:T,reset:S,trigger:w,watch:k}=L({mode:"all",defaultValues:{properties:e}}),{fields:R,append:M,remove:I}=V({control:O,name:"properties"}),{fieldState:{error:F}}=j({control:O,name:"properties",rules:{validate:e=>!o||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),D=p([]),P=h((()=>{M(Un),C("properties")}),[M,C]),A=h((e=>{u&&u(e),I(e)}),[u,I]);return m((()=>{"number"==typeof n&&D.current[n]&&D.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,D]),m((()=>{var r;e.length&&!(null===(r=T("properties"))||void 0===r?void 0:r.length)&&S({properties:e})}),[e,T,S]),x(v,(()=>({getProperties:()=>T("properties"),addProperty:P,removeProperty:A,trigger:w})),[T,P,A,w]),l(a,{children:[F&&F.message&&i(be,Object.assign({sm:12},{children:i($,Object.assign({color:"secondary"},{children:F.message}))})),Array.isArray(R)&&R.map(((e,r,t)=>i(Kn,{item:e,index:r,arrLength:t.length-1,control:O,setValue:E,customPropertyFields:d,entityDefinition:s,globalParameter:c,error:F,handleRemoveParameter:A,fileReferenceValueComponent:b,entityReferenceValueComponent:f,entityReferenceDefinitionSources:g,extRefs:D},e.id))),!t&&l(be,Object.assign({xs:12},{children:[i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:P},{children:"Add property"})),F&&i(_,Object.assign({error:!0},{children:null===(y=F.root)||void 0===y?void 0:y.message}))]}))]})})),Qn={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},ei=({control:e,parentFieldName:r,hideAddButton:t,focusOnIndex:n,required:o,entityDefinition:s=!1,globalParameter:c=!1,customPropertyFields:d=[],parentRemove:u,entityReferenceDefinitionSources:g,entityReferenceValueComponent:b,fileReferenceValueComponent:v})=>{var y;const C=f((()=>r?`${r}.properties`:"properties"),[r]),{clearErrors:O,setValue:x}=S(),{fields:E,append:T,remove:w}=V({control:e,name:C}),{fieldState:{error:L}}=j({control:e,name:C,rules:{validate:e=>!o||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),k=p([]),R=h((()=>{T(Qn),O("properties")}),[T,O]),M=h((e=>{u&&u(e),w(e)}),[u,w]);return m((()=>{"number"==typeof n&&k.current[n]&&k.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,k]),l(a,{children:[L&&L.message&&i(be,Object.assign({sm:12},{children:i($,Object.assign({color:"secondary"},{children:L.message}))})),Array.isArray(E)&&E.map(((r,t,n)=>i(be,Object.assign({sm:12,ref:e=>k.current[t]=e},{children:l(Ge,Object.assign({defaultExpanded:t===n.length-1&&!r.key,elevation:3},{children:[i(Ye,Object.assign({expandIcon:i(Ue,{})},{children:i($,Object.assign({color:L&&L[t]?"secondary":"initial",style:{wordBreak:"break-word"}},{children:r.name||`Property ${t+1}`}))})),i(Ze,{children:i(Zn,{control:e,setValue:x,propertyFieldName:`${C}.${t}`,entityDefinition:s,globalParameter:c,customPropertyFields:d,entityReferenceDefinitionSources:g,entityReferenceValueComponent:b,fileReferenceValueComponent:v})}),i(Ke,{children:i(N,Object.assign({variant:"contained",size:"small",color:"secondary",onClick:()=>M(t)},{children:"Remove"}))})]}))}),r.id))),!t&&l(be,Object.assign({xs:12},{children:[i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:R},{children:"Add property"})),L&&i(_,Object.assign({error:!0},{children:null===(y=L.root)||void 0===y?void 0:y.message}))]}))]})},ri=v((({control:e,definitionFieldName:r,title:t,hideCodeField:n,hideVersionField:a,hideNameField:o,required:s=!1,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u},p)=>{const{control:m,getValues:g}=S(),h=g(`${r}.properties`);return l(be,Object.assign({container:!0,direction:"column",spacing:2},{children:[t&&i(be,Object.assign({sm:12},{children:i(q,Object.assign({my:2},{children:i($,Object.assign({variant:"h6"},{children:t}))}))})),!o&&i(be,Object.assign({sm:12},{children:i(Fr,{required:!0,control:null!=e?e:m,name:r?`${r}.name`:"name",label:"Name"})})),!n&&i(be,Object.assign({sm:12},{children:i(Fr,{required:!0,control:null!=e?e:m,name:r?`${r}.code`:"code",label:"Code"})})),!a&&i(be,Object.assign({sm:12},{children:i(Lt,{required:!0,control:null!=e?e:m,name:r?`${r}.version`:"version",label:"Version"})})),p?i(Xn,{ref:p,properties:h,required:s,parentFieldName:r,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u}):i(ei,{control:e,required:s,parentFieldName:r,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u})]}))})),ti={name:"Name",key:"Key",propertyType:"Property Type",defaultValue:"Default Value",defaultValues:"Default Values",sortOrder:"Sort Order",isRequired:"Required",isMultiple:"Multiple",isEnabled:"Enabled",isViewableInList:"Is Viewable In List",precisionScale:"Precision Scale",roundingMode:"Rounding Mode",format:"Format",definitionCode:"Definition Code",definitionVersion:"Definition Version",labelPropertyCode:"Label Property Code",valuePropertyCode:"Value Property Code",restrictedValues:"Restricted Values",value:"Value",values:"Values",uiSettings:"UI Settings",validationNode:"Validation Node"},ni=({value:e,type:r})=>r!==jr.JSON&&r!==jr.ENTITY&&r!==jr.ANY||!e?i($,Object.assign({variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"}},{children:null===e?"null":e.toString()})):i(nt,{value:e}),ii=(e,r,t)=>{switch(r){case"isRequired":case"isMultiple":case"isEnabled":case"isViewableInList":return e?i(k,Object.assign({color:"primary",fontSize:"small"},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})):null;case"restrictedValues":return e?i(q,Object.assign({display:"flex",flexWrap:"wrap"},{children:e.map((e=>i(fe,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))})):null;case"defaultValue":case"value":return i(ni,{value:e,type:t});case"values":case"defaultValues":return Array.isArray(e)&&t!==jr.ENTITY&&t!==jr.JSON&&t!==jr.ANY?l("div",{children:["[",null==e?void 0:e.map(((e,r)=>i("div",{children:i(ni,{value:e,type:t})},r))),"]"]}):i(nt,{value:e});case"uiSettings":case"validationNode":return e?i(nt,{value:e}):null;default:return i($,Object.assign({variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"}},{children:e}))}};var li=({property:e})=>{const r=f((()=>(e&&(e.isMultiple?(delete e.defaultValue,delete e.value):(delete e.defaultValues,delete e.values)),e)),[e]);return i(Ne,Object.assign({size:"small"},{children:i(Ie,{children:Object.keys(ti).map((e=>e in r?l(Ae,{children:[i(Fe,Object.assign({width:"30%"},{children:i($,{children:ti[e]})})),i(Fe,{children:ii(r[e],e,r.propertyType)})]},e):null))})}))};var ai=O((({properties:e,parentNames:r=[]})=>{const t=f((()=>{let r=!1;return e.every((e=>e.propertyType!==jr.ENTITY||(r=!0,!1))),r}),[e]);return l(q,Object.assign({mt:4},{children:[i($,Object.assign({variant:"h6"},{children:"Properties"})),l(Qe,Object.assign({orientation:"vertical",style:{paddingLeft:"4px"}},{children:[e.map((e=>l(er,Object.assign({expanded:!0},{children:[i(rr,{StepIconProps:{icon:"",completed:!1,active:!0}}),i(tr,{children:i(oi,{property:e,parentNames:[...r],defaultExpanded:!1})})]}),e.key))),t&&i(er,{})]}))]}))}));const oi=({property:e,parentNames:r=[],defaultExpanded:t=!0})=>{const[n,a]=g(!0);return m((()=>{a(t)}),[t]),l(Ge,Object.assign({elevation:3,style:{backgroundColor:r.length%2==1?"#f1f1f1":"#fff"},expanded:n,onChange:()=>a((e=>!e))},{children:[i(Ye,Object.assign({expandIcon:i(k,{children:i("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})})},{children:i($,Object.assign({style:{wordBreak:"break-word",fontWeight:"600"}},{children:e.name}))})),i(Ze,{children:l(q,Object.assign({width:"100%"},{children:[i(li,{property:e}),e.propertyType===jr.ENTITY&&i(ai,{properties:Et(e.properties),parentNames:[...r,e.name]})]}))})]}))},si=({properties:e,expandAll:r=!0})=>{const t=f((()=>Array.isArray(e)?e:e?Et(e):[]),[e]);return i(q,Object.assign({display:"flex",flexDirection:"column"},{children:t.length?t.map((e=>i(oi,{property:e,defaultExpanded:r},e.key))):i($,{children:"No properties"})}))},ci=({property:e,name:r,useExpression:t,label:n,required:a,title:o,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u,requiredErrorText:g=""})=>{const{control:f,clearErrors:b,setValue:v}=S(),{field:{value:y},fieldState:{error:C,isDirty:O}}=j({name:r,control:f,rules:{validate:e=>!a||null!==e||(g||Nr)}}),x=p({}),{propertyType:E,valueLabel:T,fillOptionLabel:w,fillOption:V,fillOptions:L,setFillOption:k,defaultProperyValue:R}=Ln({value:y,property:e,isDirty:O,label:n,required:a,useExpression:t}),M=h((t=>{const n=t.target.value;x.current=Object.assign(Object.assign({},x.current),{[V]:y}),k(n);const i=x.current[n];if("null"===n)v(r,null,{shouldDirty:!0});else if("widget"===n)if(E===jr.JSON&&y&&"string"!=typeof y&&"dem_builder"===V&&"properties"in y){const e=Object.assign(Object.assign({},y),{properties:xt(y.property||[])});try{v(r,null!=i?i:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else v(r,null!=i?i:e.defaultValue||R);else if("expression"===n||"string"===n)v(r,null!=i?i:"",{shouldDirty:!0});else if("dem_builder"===n){const e={code:"",name:"",version:0,properties:[]};if(y)try{const e=JSON.parse(y);e.properties=Et(e.properties||{}),v(r,null!=i?i:e,{shouldDirty:!0})}catch(t){v(r,null!=i?i:e,{shouldDirty:!0})}else v(r,null!=i?i:e,{shouldDirty:!0})}b()}),[r,b,y,k,V,E,e,v,R]);return m((()=>{O||or(e.defaultValue||e.value)||""===e.defaultValue&&""===e.value||!or(y)||v(r,e.defaultValue||e.value)}),[O,e,v,y,r]),m((()=>{var t;(void 0===y||e.isRequired&&null===y&&!e.defaultValue&&!e.value)&&v(r,null!==(t=x.current[V])&&void 0!==t?t:R),e.isRequired||null!==e.defaultValue&&null!==e.value||v(r,null)}),[y,v,r,R,e,V]),l(be,Object.assign({xs:12},{children:[o&&i(q,Object.assign({mb:2},{children:i($,Object.assign({variant:"h6"},{children:o}))})),L?i(q,Object.assign({mb:2},{children:l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined"},{children:[i(kn,Object.assign({htmlFor:"type-select"},{children:w})),i(ar,Object.assign({labelId:"type-select",label:w,value:V||"",onChange:M},{children:L.map((e=>i(d,Object.assign({value:e.value},{children:e.label}),e.value)))}))]}))})):null,"expression"===V&&(E===jr.JSON||E===jr.ENTITY||E===jr.ANY?i(Zr,{name:r,control:f,label:T,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:E===jr.ANY?"text":"json"}):i(Fr,{control:f,name:r,label:T,hideErrorMessage:!0})),"string"===V&&i(Fr,{control:f,name:r,label:T,hideErrorMessage:!0}),"json_notvalid"===V&&i(Zr,{name:r,control:f,label:T,hideErrorMessage:!0}),"widget"===V&&i(Vn,{control:f,property:e,name:r,useExpression:t,label:T,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u}),"dem_builder"===V&&i(ri,{title:"JSON",definitionFieldName:r,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u}),C&&i(_,Object.assign({error:!0},{children:C.message}))]}))};var di=({name:e,property:r,useExpression:t,required:n,label:a,entityReferenceDefinitionSources:o,entityReferenceValueComponent:s,fileReferenceValueComponent:c})=>{const{control:d,setValue:u,clearErrors:p}=S(),m=T({control:d,name:e}),g=h((()=>{m&&Array.isArray(m)?u(`${e}.${m.length}`,null):u(e,[]),p(e)}),[e,m,u,p]),f=h((r=>{u(e,Kr(m,r))}),[e,m,u]);return l(be,Object.assign({container:!0,spacing:2,direction:"column",xs:12},{children:[Array.isArray(m)&&m.length?m.map(((d,u)=>i(be,Object.assign({xs:12},{children:l(q,Object.assign({display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"}},{children:[i(ci,{required:n,property:r,useExpression:t,name:`${e}.${u}`,label:`${a||r.name} (${u+1})`,entityReferenceDefinitionSources:o,entityReferenceValueComponent:s,fileReferenceValueComponent:c}),i(q,Object.assign({mt:"8px",ml:"4px"},{children:i(R,Object.assign({id:"close-button",size:"small",onClick:()=>f(u)},{children:i(k,Object.assign({fontSize:"small"},{children:i("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}))}))]}))}),u))):null,i(be,{children:i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:g},{children:"Add value"}))})]}))};const ui=({property:e,name:r,useExpression:t,required:n,label:a,title:o,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u,requiredErrorText:h=""})=>{var f;const[b,v]=g(!1),{control:y,clearErrors:C,setValue:O,watch:x}=S(),{field:{ref:E,onChange:T},fieldState:{error:w,isDirty:V}}=j({control:y,name:r,defaultValue:null!==(f=e.defaultValue)&&void 0!==f?f:[],rules:{validate:e=>!(n&&!e)||(h||Nr)}}),L=x(r),k=p({}),{propertyType:R,valueLabel:M,fillOptionLabel:N,fillOption:I,fillOptions:F,setFillOption:D,checkFillOption:P}=Ln({property:e,value:L,isDirty:V,label:a,required:n,useExpression:t,multipleOptions:!0});return m((()=>{L||T(e.isRequired&&e.isMultiple?[]:null)}),[L,e,T]),m((()=>{L&&!b&&(v(!0),P())}),[P,b,L]),l(be,{children:[o&&i(q,Object.assign({mb:2},{children:i($,Object.assign({variant:"h6"},{children:o}))})),F?i(q,Object.assign({mb:2},{children:l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined"},{children:[i(kn,Object.assign({htmlFor:"type-select"},{children:N})),i(ar,Object.assign({labelId:"type-select",label:N,value:I||"",onChange:e=>{v(!0),k.current=Object.assign(Object.assign({},k.current),{[I]:L});const t=e.target.value,n=k.current[t];"null"===t?O(r,null):"expression"===t||"json_valid"===t||"json_notvalid"===t?O(r,null!=n?n:"",{shouldDirty:!0}):"widget"===t&&O(r,null!=n?n:[],{shouldDirty:!0}),D(t),C(r)}},{children:F.map((e=>i(d,Object.assign({value:e.value},{children:e.label}),e.value)))}))]}))})):null,"expression"===I&&(R===jr.JSON||R===jr.ENTITY||R===jr.ANY?i(Zr,{name:r,control:y,label:M,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:R===jr.ANY?"text":"json"}):i(Fr,{required:!0,hideErrorMessage:!0,control:y,name:r,label:M})),"json_valid"===I&&i(Zr,{name:r,control:y,label:M,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===I&&i(di,{property:e,name:r,useExpression:t,required:n,label:a,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u}),w&&i(_,Object.assign({error:!0},{children:w.message}))]})},pi=({properties:e,dataFieldName:r,useExpression:t=!1,title:n,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})=>{const c=f((()=>e?e.map((e=>{var n;const c="string"==typeof e.propertyType?e.propertyType:null===(n=e.propertyType)||void 0===n?void 0:n.value;return{label:l(q,Object.assign({display:"flex",flexDirection:"column"},{children:[l("b",{children:[e.name,e.isRequired?"*":""]}),l("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",c]})]})),content:e.isMultiple?i(ui,{property:e,name:`${r}.${e.key}`,useExpression:t,label:e.name,required:e.isRequired,entityReferenceValueComponent:o,fileReferenceValueComponent:s,entityReferenceDefinitionSources:a}):i(ci,{property:e,name:`${r}.${e.key}`,useExpression:t,label:e.name,required:e.isRequired,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})}})):[]),[e,r,t,o,a,s]);return i(lr,Object.assign({dateAdapter:ir},{children:l(be,Object.assign({container:!0,direction:"column",spacing:2},{children:[n&&i(be,Object.assign({xs:12},{children:i("div",Object.assign({style:{fontWeight:"600"}},{children:n}))})),i(yn,{data:c})]}))}))};var mi=({property:e,data:r})=>{const{name:t}=e,n=h(((e,r)=>{const t=e,n=document.createElement("a");document.body.appendChild(n),n.href=t,n.target="_self",n.download=r,n.click()}),[]);return i(N,Object.assign({component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>n(r,t)},{children:"Download File"}))};const gi=({property:e,data:r,properties:t})=>{const n=e=>i(q,Object.assign({style:{backgroundColor:"#fff",border:"1px solid #ccc",borderRadius:"4px",padding:"4px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},{children:null===e?"null":e.toString()}));switch(e.propertyType){case jr.JSON:return i(nt,{value:r});case jr.ENTITY:return i(fi,{properties:t,data:r});case jr.ANY:return"object"==typeof r?i(nt,{value:r}):n(r);case jr.FILE_REFERENCE:return null===r?n(r):i(N,Object.assign({component:te,color:"primary",variant:"contained",target:"_blank",to:r,sx:{marginTop:4}},{children:"Download via link"}));case jr.FILE:return null===r?n(r):i(mi,{data:r,property:e});default:return n(r)}};var hi=({property:e,data:r,hasBackground:t=!1})=>{const n=f((()=>e.propertyType===jr.ENTITY?Array.isArray(e.properties)?e.properties:Et(e.properties):[]),[e]);return i(q,Object.assign({style:{backgroundColor:t?"#f1f1f1":"none"}},{children:i(gi,{property:e,data:r,properties:n})}))};const fi=({properties:e,data:r})=>{const t=f((()=>e&&r?e.map((e=>{const{key:t,name:n,isMultiple:o,propertyType:s}=e,c=r[e.key]?r[e.key]:null;return{label:l(q,Object.assign({display:"flex",flexDirection:"column"},{children:[i("b",{children:n}),l("span",{children:[t," | ",o?"multiple":"single"," | ",s]})]})),content:o&&Array.isArray(c)&&e.propertyType!==jr.ANY?i(a,{children:c.map(((r,t)=>i(q,Object.assign({mb:2},{children:i(hi,{property:e,data:r,hasBackground:!0})}),t)))}):i(hi,{property:e,data:c})}})):[]),[e,r]);return i(be,Object.assign({container:!0,direction:"column",spacing:2},{children:i(yn,{data:t})}))},bi=t(q)((({theme:e})=>({backgroundColor:"#eee",fontSize:"14px",padding:"0 8px",borderRadius:"10px",width:"fit-content","&.success":{backgroundColor:"#a9dfa9"},"&.error":{backgroundColor:"#ff7e7e"},"&.warning":{backgroundColor:e.palette.warning.main}}))),vi=({text:e,status:r="default"})=>i(bi,Object.assign({className:cr("root",{[r]:!0})},{children:e})),yi=({properties:e,parentKey:r="",activePath:t="",prefix:n="",onClick:a})=>i(Qe,Object.assign({orientation:"vertical",onClick:e=>e.stopPropagation()},{children:e&&e.map((e=>{var o;const s=r?`${r}.${e.key}`:e.key,c=null!==(o=e.propertyType.value)&&void 0!==o?o:e.propertyType;return l(er,Object.assign({expanded:!0,onClick:()=>{return e=s,void a(n?`${n}.${e}`:e);var e}},{children:[i(rr,Object.assign({StepIconProps:{icon:"",completed:!1,active:t===s}},{children:l(q,Object.assign({sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}}},{children:[e.name," - ",e.key," - ",c]}))})),i(tr,{children:i("div",{children:c===jr.ENTITY&&i(yi,{onClick:a,activePath:t,properties:e.properties,parentKey:s},e.key)})})]}),e.key)}))}));var Ci=yi;const Oi=({open:e=!1,onClose:r,onPaste:t,properties:n})=>{const[a,o]=g("");return l(I,Object.assign({open:e,onClose:r,fullWidth:!0,maxWidth:"md"},{children:[i(A,{children:"JSON path picker"}),l(D,{children:[(null==n?void 0:n.length)?n.map(((e,r)=>l("div",{children:[i($,Object.assign({variant:"h6"},{children:e.title})),i(Ci,{properties:e.properties,prefix:e.pathPrefix,onClick:o,activePath:a})]},r))):i($,{children:"Please, add properties"}),a&&l($,Object.assign({variant:"h6",gutterBottom:!0},{children:["Selected path : $(",a,")"]}))]}),l(F,{children:[i(N,Object.assign({variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${a})`),dr.success("Copied!")}},{children:"Copy"})),i(N,Object.assign({variant:"contained",color:"primary",onClick:()=>{t(`$(${a})`),dr.success("Pasted!")}},{children:"Paste"})),i(N,Object.assign({variant:"contained",color:"secondary",onClick:r},{children:"Close"}))]})]}))},xi=y({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),Ei=()=>C(xi),ji=({children:e})=>{const[r,t]=g("true"===localStorage.getItem("sidebar_collapsed")),n=h((()=>{t(!r),localStorage.setItem("sidebar_collapsed",`${!r}`),window.dispatchEvent(new CustomEvent("sidebar_collapsed",{detail:{collapsed:!r}}))}),[r]),l=h(((e,r)=>{localStorage.setItem(`${e.toLowerCase()}_collapsed`,`${!r}`)}),[]);return i(xi.Provider,Object.assign({value:{collapsed:r,toggleCollapse:n,toggleRootElementLink:l}},{children:e}))},Ti=t("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),Si=t(pr)((e=>({width:248,flexShrink:0,position:"relative",transition:"all 0.3s ease-in-out",zIndex:999,"& .MuiDrawer-paper":{backgroundColor:e.theme.palette.secondary.main,width:248,boxSizing:"border-box",borderRight:"none",borderRadius:0,transition:"all 0.3s ease-in-out",overflow:"hidden"},"&.collapsed":{width:70,"& .MuiDrawer-paper":{width:70}}}))),wi=t(yr)((({theme:e})=>({backgroundColor:"#fff",borderRight:"1px solid rgba(38, 40, 66, 0.08)",position:"relative","& span":{paddingLeft:10,paddingTop:5,fontSize:24,fontWeight:600,transition:".3s ease .1s",whiteSpace:"nowrap"},"&:after":{transition:"opacity .3s",content:"attr(data-title)",fontSize:30,position:"absolute",left:"50%",transform:"translate3d(-50%, 0, 0)",opacity:0,visibility:"hidden"},"&.collapsed":{justifyContent:"center","& img":{width:40},"& span":{opacity:0,visibility:"hidden",transitionDelay:"0s"},"&:after":{opacity:1,visibility:"visible",transitionDelay:".1s"}}}))),Vi=t(mr)((e=>({padding:e.theme.spacing(3),margin:0}))),Li=t(gr)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),ki=t(fr)((({theme:e})=>({borderRadius:e.spacing(2.5),padding:e.spacing(2),height:e.spacing(11),alignItems:"center","&.active":{backgroundColor:"rgba(38, 40, 66, 0.12)","&.main":{backgroundColor:"rgba(255, 255, 255, 0.12)",borderLeft:"4px solid #E0613A"}},"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{width:e.spacing(11.5),"&.active":{"&.main":{border:"none",backgroundColor:"#E0613A"}}}}))),Ri=t(hr)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),Mi=t(br)((({theme:e})=>({textTransform:"uppercase",borderRadius:e.spacing(2.5),backgroundColor:e.palette.secondary.main,color:"#fff",paddingLeft:0,paddingRight:0,position:"relative","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{fontSize:24,textAlign:"center",fontWeight:"bold",paddingRight:0}}))),Ni=t(vr)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),Ii=t(mr)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),Fi=t(Cr)((e=>({position:"absolute",top:e.theme.spacing(10),left:"calc(100% - 16px)",width:e.theme.spacing(8),height:e.theme.spacing(8),border:"1px solid #E0E3EA",borderRadius:"50%",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.12)",backgroundColor:"#fff",zIndex:1e3,opacity:0,transition:"all 0.3s ease-in-out","&.collapsed":{img:{transition:"all 0.3s ease-in-out",transform:"rotate(180deg)"}}})));var Di=({route:e,isActive:r,isSubmenu:t})=>{const{collapsed:n}=Ei(),[o,s]=u.useState(null),c=Boolean(o),d=e=>{s(e.currentTarget)},p=()=>{s(null)},m=h((({children:r})=>n&&!t?i(Q,Object.assign({title:e.name,placement:"right"},{children:r})):r),[n,e,t]);return e.link?i(Li,Object.assign({disablePadding:!0},{component:te,replace:!0,to:{pathname:e.link,search:e.query}},{children:i(m,{children:l(ki,Object.assign({className:cr({active:r,main:e.main,collapsed:n})},{children:[e.icon&&i(Ri,Object.assign({className:cr({collapsed:n})},{children:e.icon})),i(Ni,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:cr({collapsed:n,main:e.main}),sx:n&&!t?{display:"none"}:{}})]}))})})):e.children&&n?l(a,{children:[i(Mi,Object.assign({className:"collapsed"},{children:i(Q,Object.assign({title:e.name,placement:"right"},{children:i(ki,Object.assign({className:cr({active:r,main:e.main,collapsed:n}),sx:{justifyContent:"center"},onClick:d},{children:e.name.substring(0,1)}))}))})),i(Be,Object.assign({open:c,anchorEl:o,onClose:p,PaperProps:{sx:{width:300,maxHeight:440}},MenuListProps:{sx:{bgcolor:"secondary.main"}},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}},{children:e.children.map(((e,r)=>i(zi,{route:e,isSubmenu:!0},r)))}))]}):i(Mi,{children:e.name})},Pi="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg opacity='0.6'%3e%3cpath d='M10.3533 2.81334C10.447 2.90709 10.4996 3.03417 10.4996 3.16667C10.4996 3.29917 10.447 3.42626 10.3533 3.52001L5.87334 8.00001L10.3533 12.48C10.4025 12.5258 10.4419 12.581 10.4692 12.6423C10.4965 12.7036 10.5112 12.7699 10.5124 12.837C10.5136 12.9041 10.5012 12.9708 10.4761 13.0331C10.4509 13.0953 10.4135 13.1519 10.366 13.1994C10.3186 13.2468 10.262 13.2843 10.1997 13.3094C10.1375 13.3346 10.0708 13.3469 10.0037 13.3457C9.93652 13.3446 9.87032 13.3299 9.80898 13.3025C9.74765 13.2752 9.69245 13.2358 9.64667 13.1867L4.81334 8.35334C4.71971 8.25959 4.66711 8.13251 4.66711 8.00001C4.66711 7.86751 4.71971 7.74042 4.81334 7.64667L9.64667 2.81334C9.74042 2.71971 9.86751 2.66711 10 2.66711C10.1325 2.66711 10.2596 2.71971 10.3533 2.81334Z' fill='white'/%3e%3c/g%3e%3c/svg%3e";var Ai=({route:e,isActive:r,isListOpen:t,handleClick:n,isSubmenu:a})=>i(Mi,{children:i(Vi,Object.assign({sx:{padding:0,margin:0}},{children:i(Li,Object.assign({disablePadding:!0,onClick:n},{children:l(ki,Object.assign({className:cr({active:r,main:e.main}),sx:{justifyContent:"space-between"}},{children:[i(Ni,{primary:e.name,className:cr({main:e.main}),sx:a?{}:{display:"none"}}),e.name,i(q,{component:"img",src:Pi,mr:3,sx:{transition:"transform .3s",transform:`rotate(${t?0:"-90deg"})`}})]}))}))}))});function qi({route:e,isActive:r,isListOpen:t,handleClick:n,isSubmenu:a}){const{collapsed:o}=Ei();return(null==e?void 0:e.link)?i(Li,Object.assign({disablePadding:!0,onClick:n},{children:l(ki,Object.assign({className:cr({active:r,main:e.main,collapsed:o})},{children:[e.icon&&i(Ri,{children:e.icon}),i(Ni,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:cr({collapsed:o,main:e.main}),sx:o&&!a?{display:"none"}:{}}),i(q,{component:"img",src:Pi,mr:3,sx:{transition:"transform .3s",transform:`rotate(${t?"-90deg":0})`}})]}))})):(null==e?void 0:e.rootLink)?i(Ai,{route:e,handleClick:n,isListOpen:t}):i(Mi,{children:e.name})}const $i=({route:e,isSubmenu:r})=>{var t,n,o;const s=re(),{collapsed:c,toggleRootElementLink:d}=Ei(),[u,p]=g(!1),[b,v]=g("true"===localStorage.getItem(`${e.name.toLowerCase()}_collapsed`)),y=f((()=>!(!e.link&&!e.rootLink)&&s.pathname.startsWith(e.link||e.rootLink)),[s.pathname,e]),C=h((()=>{e&&e.rootLink&&(d(e.name,b),v(!b))}),[b,e,d]);return m((()=>{p(y)}),[y]),(null==e?void 0:e.rootLink)&&(null===(t=e.children)||void 0===t?void 0:t.length)&&(!c||c&&r)?l(a,{children:[i(qi,{route:e,isActive:y,handleClick:C,isListOpen:b,isSubmenu:r}),i(Or,Object.assign({in:!b,timeout:"auto"},{children:i(Ii,{children:e.children.map((e=>i($i,{route:e,isSubmenu:r},e.name)))})}))]}):(null===(n=e.children)||void 0===n?void 0:n.length)&&(!c||c&&r)?l(a,{children:[i(qi,{route:e,isActive:y,handleClick:()=>{p(!u)},isListOpen:u||!e.link,isSubmenu:r}),i(Or,Object.assign({in:u||!e.link,timeout:"auto"},{children:i(Ii,{children:null===(o=e.children)||void 0===o?void 0:o.map(((e,t)=>i($i,{route:e,isSubmenu:r},e.name)))})}))]}):i(Di,{route:e,isActive:y,isSubmenu:r})};var zi=$i;const Bi=({src:e,alt:r})=>i(q,Object.assign({sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"}},{children:i("img",{src:e,alt:r})}));var Hi=({title:e,routes:r,id:t,logo:n,collapsedLogo:a,footer:o,collapsedFooter:s})=>{const{collapsed:c,toggleCollapse:d}=Ei();return l(Ti,{children:[i(Fi,Object.assign({className:cr("button-collapse",{collapsed:c}),onClick:d},{children:i("img",{src:"data:image/svg+xml,%3csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6.47054 0.861939C6.59552 0.986958 6.66573 1.1565 6.66573 1.33327C6.66573 1.51005 6.59552 1.67959 6.47054 1.80461L2.27521 5.99994L6.47054 10.1953C6.59198 10.321 6.65917 10.4894 6.65766 10.6642C6.65614 10.839 6.58602 11.0062 6.46242 11.1298C6.33881 11.2534 6.1716 11.3235 5.99681 11.3251C5.82201 11.3266 5.65361 11.2594 5.52787 11.1379L0.861207 6.47127C0.736226 6.34625 0.666016 6.17672 0.666016 5.99994C0.666016 5.82316 0.736226 5.65362 0.861207 5.52861L5.52787 0.861939C5.65289 0.736958 5.82243 0.666748 5.99921 0.666748C6.17598 0.666748 6.34552 0.736958 6.47054 0.861939V0.861939Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:"collapse"})})),l(Si,Object.assign({variant:"permanent",anchor:"left",className:cr({collapsed:c}),id:t},{children:[(!!e||!!n)&&i(wi,Object.assign({className:cr({collapsed:c}),"data-title":e.substring(0,1)},{children:l(q,Object.assign({display:"flex",flexDirection:"column"},{children:[!!e&&i(q,Object.assign({component:"span"},{children:e})),!!n&&i(q,{component:"img",src:c?a:n,alt:"Lending Hub KZ"})]}))})),l(q,Object.assign({height:""+(n||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between"},{children:[i(Vi,Object.assign({sx:{overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{background:"rgba(196, 196, 196, 0.8)",borderRadius:"16px",backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"}}},{children:r.map((e=>i(zi,{route:e},e.name)))})),o&&i(q,Object.assign({borderTop:"1px solid #FFFFFF1F"},{children:c?s:o}))]}))]}))]})};const _i=({routes:e,theme:r=pt,title:t="",id:a,logo:o,collapsedLogo:s,footer:c,collapsedFooter:d})=>l(n,Object.assign({theme:r},{children:[i(ur,{}),i(ji,{children:i(Hi,{title:t,routes:e,id:a,logo:o,collapsedLogo:s,footer:c,collapsedFooter:d})})]})),Wi=({children:e,toolbar:r,contentSx:t,sx:n})=>l(q,Object.assign({component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},n)},{children:[i(yr,Object.assign({sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"}},{children:r})),i(q,Object.assign({sx:Object.assign(Object.assign({},t),{height:"calc(100vh - 56px)",overflow:"scroll"})},{children:i(E,Object.assign({fallback:i(Lr,{})},{children:null!=e?e:i(ie,{})}))}))]})),Ji=t(te)((()=>({textDecoration:"none",color:"inherit"}))),Gi=({crumbs:e})=>i(xr,Object.assign({separator:i(Er,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}}},{children:e.map(((e,r)=>e.link?i(Ji,Object.assign({to:e.link,className:"breadcrumb"},{children:e.title}),r):i($,Object.assign({className:"breadcrumb"},{children:e.title}),r)))})),Yi=({children:e})=>{const[r,t]=g(!1),n=h((e=>{t((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{t((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return i(Q,Object.assign({title:e,arrow:!0,disableHoverListener:!r},{children:i("div",Object.assign({ref:n,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:e}))}))};export{kr as AlertDialog,Yr as BackButton,Gi as Breadcrumbs,Wi as ContentLayout,Zr as ControlAceEditor,Pt as ControlArrayInput,_r as ControlAutocomplete,zr as ControlCheckbox,Nt as ControlDate,Ft as ControlDateTime,Ar as ControlDebouncedInput,Fr as ControlInput,Lt as ControlNumberInput,At as ControlPeriodInput,qt as ControlPhoneInput,Jr as ControlQueryAutocomplete,Br as ControlRadio,$r as ControlSelect,kt as ControlSwitch,Dt as ControlTime,Gr as CopyButton,ri as CreateDefinition,Xn as CreatePropertiesList,ei as CreatePropertiesListContext,Zn as CreatePropertyFormFields,Tr as DATE_DEFAULT_FORMAT,wr as DATE_TIME_DEFAULT_FORMAT,Ir as DEFAULT_DATE_VALIDATION_ERROR_TEXT,Vt as DEFAULT_ERROR_TEXT,Nr as DEFAULT_REQUIRED_ERROR_TEXT,pi as DefinitionFiller,fi as DefinitionValueView,gn as InfoItem,it as JsonModalView,Oi as JsonPathPicker,nt as JsonView,Lr as Loader,Bi as MenuIcon,ui as MultiplePropertyFiller,Yi as OverflowTip,qr as PopupIconComponent,ci as PropertyFiller,jr as PropertyType,In as PropertyValueField,Vr as RoundingMode,mn as RouteTabs,_i as Sidebar,dn as SimpleTable,vi as Status,yn as StepperView,Sr as TIME_DEFAULT_FORMAT,pn as TabPanel,Qt as Table,en as TableAction,un as TableActionCell,si as ViewPropertiesList,oi as ViewProperty,Xr as capitalize,tt as deepParseJson,Rr as defaultDefinitionArrayValue,Mr as defaultDefinitionObjectValue,gt as digitsOnly,ht as floatsOnly,Ot as formatDefinitionData,mt as formatTableRowValue,jt as getDemPropertyDateFormat,Tt as getEntityStarterValue,et as getJsonStringValue,St as getMultiplePropertyFillOptions,wt as getSinglePropertyFillOptions,bt as isDateType,ft as isExpression,yt as isPropertyValueEmpty,vt as numberFormat,xt as propertiesArrayToObject,Et as propertiesObjectToArray,Kr as removeArrayItem,rt as safeParseJson,Qr as sortArrayOfObjects,pt as theme,Dr as useDebounce,Pr as useToggle,Ur as validateJson};
|
1
|
+
import{createTheme as e,responsiveFontSizes as r,styled as t,ThemeProvider as n}from"@mui/material/styles";import{jsx as i,jsxs as l,Fragment as a}from"react/jsx-runtime";import{__rest as o,__awaiter as s}from"tslib";import c from"@mui/material/TextField";import d from"@mui/material/MenuItem";import u,{useRef as p,useEffect as m,useState as g,useCallback as h,useMemo as f,createElement as b,forwardRef as v,createContext as y,useContext as C,memo as O,useImperativeHandle as x,Suspense as E}from"react";import{useController as j,useWatch as T,useFormContext as S,Controller as w,useFieldArray as V,useForm as L}from"react-hook-form";import k from"@mui/material/SvgIcon";import R from"@mui/material/IconButton";import M from"@mui/material/InputAdornment";import N from"@mui/material/Button";import I from"@mui/material/Dialog";import F from"@mui/material/DialogActions";import D from"@mui/material/DialogContent";import P from"@mui/material/DialogContentText";import A from"@mui/material/DialogTitle";import q from"@mui/material/Box";import $ from"@mui/material/Typography";import z from"@mui/material/CircularProgress";import B from"@mui/material/FormControl";import H from"@mui/material/FormControlLabel";import _ from"@mui/material/FormHelperText";import W from"@mui/material/Checkbox";import J from"@mui/material/Radio";import G from"@mui/material/RadioGroup";import Y from"@mui/material/FormLabel";import Z from"@mui/material/Autocomplete";import K from"lodash/get";import{useQuery as U}from"@tanstack/react-query";import X from"qs";import Q from"@mui/material/Tooltip";import{useNavigate as ee,useLocation as re,Link as te,useSearchParams as ne,Outlet as ie}from"react-router-dom";import le from"@uiw/react-codemirror";import{langs as ae}from"@uiw/codemirror-extensions-langs";import{abcdef as oe}from"@uiw/codemirror-theme-abcdef";import se from"@mui/material/Switch";import{DatePicker as ce}from"@mui/x-date-pickers/DatePicker";import{format as de,parse as ue,isValid as pe,isMatch as me}from"date-fns";import{DateTimePicker as ge}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as he}from"@mui/x-date-pickers/TimePicker";import fe from"@mui/material/Chip";import be from"@mui/material/Unstable_Grid2";import{toString as ve,parse as ye}from"duration-fns";import Ce from"react-input-mask";import Oe from"@mui/material/Pagination";import xe from"@mui/material/TablePagination";import{useGridApiContext as Ee,useGridSelector as je,gridPageSelector as Te,gridPageCountSelector as Se,gridRowCountSelector as we,gridPageSizeSelector as Ve,GridColumnMenuContainer as Le,GridFilterMenuItem as ke,DataGrid as Re,GridActionsCellItem as Me}from"@mui/x-data-grid";import Ne from"@mui/material/Table";import Ie from"@mui/material/TableBody";import Fe from"@mui/material/TableCell";import De from"@mui/material/TableContainer";import Pe from"@mui/material/TableHead";import Ae from"@mui/material/TableRow";import qe from"@mui/material/TableFooter";import $e from"@mui/material/Backdrop";import ze from"@mui/material/TableSortLabel";import Be from"@mui/material/Menu";import He from"@mui/icons-material/MoreHoriz";import _e from"@mui/material/Paper";import We from"@mui/material/Tab";import Je from"@mui/material/Tabs";import Ge from"@mui/material/Accordion";import Ye from"@mui/material/AccordionSummary";import Ze from"@mui/material/AccordionDetails";import Ke from"@mui/material/AccordionActions";import{ExpandMore as Ue}from"@mui/icons-material";import Xe from"@mui/icons-material/Delete";import Qe from"@mui/material/Stepper";import er from"@mui/material/Step";import rr from"@mui/material/StepLabel";import tr from"@mui/material/StepContent";import nr from"@mui/material/StepConnector";import{AdapterDateFns as ir}from"@mui/x-date-pickers/AdapterDateFns";import{LocalizationProvider as lr}from"@mui/x-date-pickers/LocalizationProvider";import ar from"@mui/material/Select";import or from"lodash/isNil";import sr from"@mui/material/InputLabel";import cr from"classnames";import{toast as dr}from"react-toastify";import ur from"@mui/material/CssBaseline";import pr from"@mui/material/Drawer";import mr from"@mui/material/List";import gr from"@mui/material/ListItem";import hr from"@mui/material/ListItemIcon";import fr from"@mui/material/ListItemButton";import br from"@mui/material/ListSubheader";import vr from"@mui/material/ListItemText";import yr from"@mui/material/Toolbar";import Cr from"@mui/material/ButtonBase";import Or from"@mui/material/Collapse";import xr from"@mui/material/Breadcrumbs";import Er from"@mui/icons-material/NavigateNext";var jr;!function(e){e.STRING="STRING",e.INTEGER="INTEGER",e.BIG_INTEGER="BIG_INTEGER",e.BIG_DECIMAL="BIG_DECIMAL",e.FLOAT="FLOAT",e.LONG="LONG",e.DOUBLE="DOUBLE",e.BOOLEAN="BOOLEAN",e.ENTITY_REFERENCE="ENTITY_REFERENCE",e.ENTITY="ENTITY",e.FILE="FILE",e.FILE_REFERENCE="FILE_REFERENCE",e.JSON="JSON",e.DATE="DATE",e.TIME="TIME",e.DATE_TIME="DATE_TIME",e.ANY="ANY"}(jr||(jr={}));const Tr="yyyy-MM-dd",Sr="HH:mm:ss",wr="yyyy-MM-dd'T'HH:mm:ss.SSSZ";var Vr;!function(e){e.UP="UP",e.DOWN="DOWN",e.CEILING="CEILING",e.FLOOR="FLOOR",e.HALF_UP="HALF_UP",e.HALF_DOWN="HALF_DOWN",e.HALF_EVEN="HALF_EVEN",e.UNNECESSARY="UNNECESSARY"}(Vr||(Vr={}));const Lr=({transparent:e,position:r,bgcolor:t})=>i(q,Object.assign({position:null!=r?r:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:t||(e?"none":"rgba(255, 255, 255, .3)"),zIndex:10},{children:i(z,{})})),kr=({open:e,title:r,description:t,closeButtonTitle:n="Close",onClose:a,confirmButtonTitle:o="Confirm",confirmButtonDisabled:s=!1,disableBackdropClick:c=!1,onConfirm:d,children:u,dialogProps:p,loading:m,maxWidth:g="xs",hideCloseButton:h=!1})=>i("div",{children:l(I,Object.assign({open:e,onClose:c?(e,r)=>{if("backdropClick"===r)return null;a()}:a,disableEscapeKeyDown:c,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:g},p,{children:[m&&i(Lr,{}),l(A,Object.assign({id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"}},{children:[i($,Object.assign({variant:"inherit"},{children:r})),!h&&i(R,Object.assign({sx:{padding:0},onClick:a},{children:i(k,{children:i("g",Object.assign({opacity:"0.6"},{children:i("path",{d:"M4.39704 4.554L4.47004 4.47C4.59702 4.34299 4.76538 4.26576 4.94449 4.25236C5.1236 4.23897 5.30157 4.29029 5.44604 4.397L5.53004 4.47L12 10.939L18.47 4.469C18.5393 4.3974 18.622 4.34031 18.7136 4.30104C18.8051 4.26178 18.9035 4.24114 19.0031 4.24032C19.1027 4.2395 19.2014 4.25853 19.2936 4.29628C19.3857 4.33403 19.4694 4.38976 19.5398 4.46022C19.6102 4.53067 19.6659 4.61443 19.7035 4.70662C19.7412 4.79881 19.7601 4.89758 19.7592 4.99716C19.7583 5.09675 19.7376 5.19515 19.6982 5.28664C19.6589 5.37812 19.6017 5.46085 19.53 5.53L13.061 12L19.531 18.47C19.6579 18.5971 19.7349 18.7655 19.7482 18.9446C19.7614 19.1237 19.7099 19.3016 19.603 19.446L19.53 19.53C19.403 19.657 19.2347 19.7343 19.0556 19.7476C18.8765 19.761 18.6985 19.7097 18.554 19.603L18.47 19.53L12 13.061L5.53004 19.531C5.38852 19.6676 5.19903 19.7431 5.00238 19.7413C4.80574 19.7395 4.61766 19.6605 4.47867 19.5214C4.33968 19.3823 4.26089 19.1941 4.25928 18.9975C4.25766 18.8008 4.33335 18.6114 4.47004 18.47L10.939 12L4.46904 5.53C4.34217 5.40289 4.26512 5.23447 4.25191 5.05537C4.2387 4.87626 4.29019 4.69836 4.39704 4.554L4.47004 4.47L4.39704 4.554Z",fill:"black"})}))})}))]})),l(D,{children:[t&&i(P,Object.assign({id:"alert-dialog-description"},{children:t})),i(q,Object.assign({maxWidth:"100%",overflow:"hidden"},{children:u}))]}),l(F,{children:[!h&&i(N,Object.assign({onClick:a,variant:"outlined"},{children:n})),o&&d?i(N,Object.assign({onClick:d,color:"primary",variant:"contained",autoFocus:!0,disabled:s,disableElevation:!0},{children:o})):null]})]}))}),Rr={code:"",name:"",version:0,properties:[]},Mr={code:"",name:"",version:0,properties:{}},Nr="Please, fill this field",Ir="Incorrect date format",Fr=e=>{var r,{control:t,validate:n,name:s="",label:d="",required:u=!1,defaultValue:p="",disabled:m=!1,textarea:g=!1,hideErrorMessage:h=!1,onChange:f,requiredErrorText:b=""}=e,v=o(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const y=j({name:s,control:t,defaultValue:p,rules:{required:!!u&&(b||Nr),validate:n}}),C=y.field,{ref:O,onChange:x,value:E}=C,T=o(C,["ref","onChange","value"]),{fieldState:{error:S}}=y;return i(c,Object.assign({},T,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:O,name:s,label:u?l(a,{children:[d," ",i("span",{children:"*"})]}):d,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!S,helperText:!h&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"},disabled:m,multiline:g,minRows:g?3:1,value:null!=E?E:"",onChange:f||x,InputLabelProps:{shrink:!!v.placeholder},inputProps:Object.assign(Object.assign({},null!==(r=null==v?void 0:v.inputProps)&&void 0!==r?r:{}),{value:null!=E?E:""})},v))};function Dr(e,r){const t=p();m((()=>()=>{t.current&&clearTimeout(t.current)}),[]);return(...n)=>{clearTimeout(t.current),t.current=setTimeout((()=>{e(...n)}),r)}}const Pr=()=>{const[e,r]=g(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},Ar=e=>{var r,{control:t,validate:n,name:s="",label:d="",required:u=!1,defaultValue:p="",disabled:f=!1,textarea:b=!1,hideErrorMessage:v=!1,onChange:y,requiredErrorText:C=""}=e,O=o(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const{field:{ref:x,onChange:E},fieldState:{error:S}}=j({name:s,control:t,defaultValue:p,rules:{required:!!u&&(C||Nr),validate:n}}),w=T({control:t,name:s}),[V,L]=g("");m((()=>{!V&&w&&L(w)}),[V,w]);const k=Dr((e=>{E(e)}),200),R=h((e=>{L(e.target.value),k(e.target.value)}),[k]);return i(c,Object.assign({fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:x,name:s,label:u?l(a,{children:[d," ",i("span",{children:"*"})]}):d,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!S,helperText:!v&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"},disabled:f,multiline:b,minRows:b?3:1,value:null!=V?V:"",onChange:R},O,{inputProps:Object.assign(Object.assign({},null!==(r=null==O?void 0:O.inputProps)&&void 0!==r?r:{}),{value:null!=V?V:""})}))},qr=()=>i(k,{children:i("path",{d:"M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z",fill:"#8B8C9E"})}),$r=e=>{var r,{control:t,validate:n,name:s="",label:u="",required:p=!1,defaultValue:m="",disabled:g=!1,hideErrorMessage:f=!1,onChange:b,labelKey:v,valueKey:y,options:C=[],requiredErrorText:O=""}=e,x=o(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","requiredErrorText"]);const E=j({name:s,control:t,defaultValue:m,rules:{required:!!p&&(O||Nr),validate:n}}),T=E.field,{ref:S,onChange:w,value:V}=T,L=o(T,["ref","onChange","value"]),{fieldState:{error:N}}=E,I=h((e=>"string"==typeof e?e:y?e[y]:e.value),[y]),F=h((e=>"string"==typeof e?e:v?e[v]:e.label),[v]),D=h((()=>{b?b(null):w(null)}),[w,b]);return i(c,Object.assign({},L,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:S,name:s,label:p?l(a,{children:[u," ",i("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!N,helperText:!f&&(null==N?void 0:N.message),FormHelperTextProps:{variant:"standard"},disabled:g,value:null!=V?V:"",onChange:b||w},x,{inputProps:Object.assign(Object.assign({},null!==(r=null==x?void 0:x.inputProps)&&void 0!==r?r:{}),{value:null!=V?V:""}),InputProps:Object.assign({endAdornment:!p&&V?i(M,Object.assign({position:"end",sx:{mr:0}},{children:i(R,Object.assign({onClick:D,size:"small"},{children:i(k,Object.assign({fontSize:"small"},{children:i("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}))})):null},null==x?void 0:x.InputProps),SelectProps:{sx:{"& .MuiSelect-select .notranslate::after":x.placeholder?{content:`"${x.placeholder}"`,opacity:.42}:{}}}},{children:C.map(((e,r)=>i(d,Object.assign({value:I(e)},{children:F(e)}),r)))}))},zr=e=>{var{control:r,validate:t,name:n="",label:a="",required:s=!1,defaultValue:c,disabled:d=!1,hideErrorMessage:u=!1,onChange:p}=e,m=o(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange"]);const g=j({name:n,control:r,defaultValue:null!=c&&c}),h=g.field,{ref:b,onChange:v,value:y}=h,C=o(h,["ref","onChange","value"]),{fieldState:{error:O}}=g,x=f((()=>{if("boolean"==typeof y)return y;if("string"==typeof y){if("false"===y)return v(!1),!1;if("true"===y)return v(!0),!0}return!1}),[y,v]);return l(B,Object.assign({error:!!O,component:"fieldset",variant:"standard",disabled:d},{children:[i(H,{control:i(W,Object.assign({},C,{checked:x,onChange:p||v,name:n,inputRef:b,disabled:d,color:"secondary"},m)),label:a}),!u&&(null==O?void 0:O.message)&&i(_,Object.assign({variant:"standard"},{children:O.message}))]}))},Br=({name:e,label:r,values:t=[],control:n,required:a,defaultValue:s,disabled:c,hideErrorMessage:d,labelKey:u,valueKey:p,validate:m,onChange:g,row:f,radioProps:b,requiredErrorText:v=""})=>{const y=j({name:e,control:n,defaultValue:s,rules:{required:!!a&&(v||Nr),validate:m}}),C=y.field,{onChange:O}=C,x=o(C,["onChange"]),{fieldState:{error:E}}=y,T=h((e=>"string"==typeof e?e:p?e[p]:e.value),[p]),S=h((e=>"string"==typeof e?e:u?e[u]:e.label),[u]),w=h((e=>"string"==typeof e?e===x.value:e===("string"==typeof x.value?"true"===x.value:x.value)),[x.value]),V=h((e=>{"true"===e.target.value||"false"===e.target.value?O("true"===e.target.value):O(e)}),[O]);return l(B,Object.assign({disabled:c,error:!!E},{children:[i(Y,Object.assign({id:"radio-buttons-group"},{children:r})),i(G,Object.assign({},x,{row:f,"aria-labelledby":"radio-buttons-group",onChange:g||V},{children:t.map(((e,r)=>i(H,{value:T(e),control:i(J,Object.assign({},b,{checked:w(T(e))})),label:S(e)},r)))})),!d&&(null==E?void 0:E.message)&&i(_,Object.assign({variant:"standard"},{children:E.message}))]}))};var Hr=({valueKey:e,labelKey:r})=>{const t=h(((r,t)=>{if(r&&t){if("string"==typeof r)return r===t;if(e)return K(r,e)===K(t,e)||K(r,e)===t;if(r.value)return r.value===t.value||r.value===t}return!1}),[e]),n=h((e=>e?"string"==typeof e?e:r&&K(e,r,"")?K(e,r,"")+"":e.label+""||e.name+""||e.value+""||e.code+""||"--no label--":""),[r]),i=h(((e,r)=>b(q,Object.assign({},e,{component:"li",key:e.id}),n(r))),[n]);return{isOptionEqualToValue:t,getOptionLabel:n,renderOption:i}};const _r=e=>{var{control:r,validate:t,name:n="",label:s="",required:d=!1,defaultValue:u="",disabled:p=!1,hideErrorMessage:h=!1,onChange:f,labelKey:b,valueKey:v,options:y=[],multiple:C,textFieldProps:O={},disableCloseOnSelect:x,useStringValue:E,requiredErrorText:T="",startAdornment:S,endAdornment:w}=e,V=o(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","multiple","textFieldProps","disableCloseOnSelect","useStringValue","requiredErrorText","startAdornment","endAdornment"]);const L=j({name:n,control:r,defaultValue:u||(C?[]:null),rules:{required:!!d&&(T||Nr),validate:t}}),k=L.field,{ref:R,onChange:M,value:N}=k,I=o(k,["ref","onChange","value"]),{fieldState:{error:F}}=L,[D,P]=g(),{getOptionLabel:A,isOptionEqualToValue:q,renderOption:$}=Hr({valueKey:v,labelKey:b});return m((()=>{"string"==typeof N&&v&&E&&void 0===D&&y.length&&y[0]&&"object"==typeof y[0]&&P(y.find((e=>K(e,v)===N)))}),[D,y,E,N,v]),i(Z,Object.assign({},I,{value:E?null!=D?D:null:N,fullWidth:!0,disablePortal:!0,size:"small",readOnly:p,options:y,multiple:C,getOptionLabel:A,isOptionEqualToValue:q,disableCloseOnSelect:x||C,filterSelectedOptions:C,onChange:f||((e,r)=>{M(E&&v?K(r,v):r),P(r)}),renderOption:$,renderInput:e=>i(c,Object.assign({},e,{variant:"outlined",name:n,label:d?l(a,{children:[s," ",i("span",{children:"*"})]}):s,InputLabelProps:{shrink:!!(null==V?void 0:V.placeholder)},sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==V?void 0:V.placeholder,error:!!F,inputRef:R,helperText:!h&&(null==F?void 0:F.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign(Object.assign({},e.InputProps),{startAdornment:S||e.InputProps.startAdornment,endAdornment:w||e.InputProps.endAdornment})},O))},V))};const Wr=()=>i("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:""});function Jr(e){var{name:r,label:t,control:n,required:s=!1,searchBy:d,labelKey:p,multiple:b=!1,mongoQueryJson:v,disabled:y,valueKey:C,sortBy:O="",hideErrorMessage:x,disableCloseOnSelect:E,textFieldProps:T,onChange:S,queryFunction:w,validate:V,itemQueryFunction:L,requiredErrorText:k="",startAdornment:R,endAdornment:N}=e,I=o(e,["name","label","control","required","searchBy","labelKey","multiple","mongoQueryJson","disabled","valueKey","sortBy","hideErrorMessage","disableCloseOnSelect","textFieldProps","onChange","queryFunction","validate","itemQueryFunction","requiredErrorText","startAdornment","endAdornment"]);const F=j({control:n,name:r,defaultValue:b?[]:null,rules:{required:!!s&&(k||Nr),validate:V}}),D=F.field,{ref:P,onChange:A,value:q}=D,$=o(D,["ref","onChange","value"]),{fieldState:{error:B,isDirty:H}}=F,{getOptionLabel:_,isOptionEqualToValue:W,renderOption:J}=Hr({valueKey:C,labelKey:p}),[G,Y]=g([]),[Q,ee]=g(!1),[re,te]=g(""),[ne,ie]=g(""),[le,ae]=g(0),oe=f((()=>!!G.length&&Q),[Q,G]),{data:se,isFetching:ce}=U(["options",le,ne],(()=>{const e=X.parse(Object.assign({page:`${le}`,size:"20",sort:O},ne?{[d]:ne}:{}),{ignoreQueryPrefix:!0});return w(e)}),{onSuccess(e){Y(ne?e.collection:r=>1===r.length?e.collection:[...r,...e.collection])}}),de=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>de(e,r)));{const t={};for(const n in e)t[n]=de(e[n],r);return t}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},ue=Dr((e=>{if(ae(0),v){const r=de(v,e);ie(JSON.stringify(r))}else ie(e)}),500),pe=h(((e,r)=>{Y([]),te(r),ue(r)}),[ue]),me=h(((e,r)=>{A(r),S&&S(e,r)}),[A,S]);m((()=>{if(!H&&q&&L){let e=q;"object"==typeof q&&C in q&&(e=K(q,C)),L(e).then((e=>{A(e),te(K(e,p))})).catch(console.error)}}),[q,H,C,p,L,A]);const ge=h((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&G.length<(null==se?void 0:se.totalItems)&&ae((e=>e+1))}),[se,G]);return i(Z,Object.assign({},$,{fullWidth:!0,disablePortal:!0,size:"small",readOnly:y,options:G,multiple:b,getOptionLabel:_,isOptionEqualToValue:W,disableCloseOnSelect:E||b,filterSelectedOptions:b,inputValue:re,value:q,onChange:me,loading:ce,clearOnBlur:!1,open:oe,filterOptions:e=>e,onOpen:()=>{ee(!0)},onClose:()=>{ee(!1),ie("")},onInputChange:pe,ListboxProps:{onScroll:ge},renderOption:J,popupIcon:i(Wr,{}),renderInput:e=>i(c,Object.assign({},e,{label:s?l(a,{children:[t," ",i("span",{children:"*"})]}):t,InputLabelProps:{shrink:!!(null==I?void 0:I.placeholder)},placeholder:null==I?void 0:I.placeholder,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},variant:"outlined",error:!!B,inputRef:P,helperText:!x&&(null==B?void 0:B.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign(Object.assign({},e.InputProps),{endAdornment:N||l(u.Fragment,{children:[ce?i(M,Object.assign({position:"end"},{children:i(z,{color:"inherit",size:20})})):null,e.InputProps.endAdornment]}),startAdornment:R||e.InputProps.startAdornment})},T))},I))}const Gr=({copyText:e,helpText:r="Copy"})=>{const[t,n]=g(r);return t?i(Q,Object.assign({title:t,placement:"top"},{children:i(R,Object.assign({onClick:()=>{navigator.clipboard.writeText(e),n("Copied!"),setTimeout((()=>{n(r)}),1e3)}},{children:i(k,Object.assign({fontSize:"small"},{children:i("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})}))}))})):null},Yr=({text:e,buttonProps:r={}})=>{const t=ee(),{state:n}=re(),l=f((()=>null==n?void 0:n.from),[n]),a=h((()=>{t(l||-1)}),[t,l]);return i(q,Object.assign({mr:2},{children:e?i(N,Object.assign({color:"inherit",onClick:l?null:a,component:te,to:null!=l?l:""},r,{children:e})):i(R,Object.assign({onClick:a},{children:i(k,{children:i("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})}))}))},Zr=v(((e,r)=>{var{control:t,name:n,mode:s="json",label:c,width:d="100%",height:u="200px",readOnly:p,required:m=!1,validateJson:g=!1,hideErrorMessage:b=!1,fontSize:v=16,validate:y=!0,parseValue:C,requiredErrorText:O="",useCleanValue:x}=e,E=o(e,["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"]);const T=j({control:t,name:n,rules:{required:!!m&&(O||Nr),validate:e=>{if(e&&g&&"string"==typeof e)try{return JSON.parse(e),!0}catch(e){return console.error(e),"Invalid JSON"}return!0}}}),S=T.field,{onChange:w,value:V,ref:L}=S,k=o(S,["onChange","value","ref"]),{fieldState:{error:R}}=T,M=f((()=>({json:[ae.json()],javascript:[ae.javascript()],python:[ae.python()]})),[]),N=f((()=>"text"===s&&"string"!=typeof V?JSON.stringify(V,null,2):"json"===s&&"string"!=typeof V?null===V?"":x?JSON.stringify(V,null,2).replace(/\\"/g,""):JSON.stringify(V,null,2):"string"==typeof V&&"text"!==s&&x?V.replace(/\\"/g,""):V),[V,x,s]),I=h((e=>{if(C)try{const r=JSON.parse(e);w(r)}catch(r){w(e)}else w(e)}),[w,C]);return l(q,Object.assign({display:"flex",flexDirection:"column",width:"100%"},{children:[i(q,{children:c&&i($,Object.assign({variant:"subtitle1",display:"inline",style:{marginRight:10}},{children:m?l(a,{children:[c," ",i(q,Object.assign({component:"span",color:"#D6331F"},{children:"*"}))]}):c}))}),l(a,{children:[i(le,Object.assign({},k,{ref:r||L,basicSetup:{autocompletion:!0,history:!0},theme:oe,width:d,height:u,style:{fontSize:v,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:p,value:N,onChange:I,extensions:"text"===s?[]:M[s]},E)),R&&!b&&i(_,Object.assign({variant:"standard",error:!0},{children:R.message}))]})]}))})),Kr=(e,r)=>{const t=[...e];return t.splice(r,1),t},Ur=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};function Xr(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}const Qr=(e,r,t,n="asc")=>{const i=e[t],l=r[t];return i<l?"asc"===n?-1:1:i>l?"asc"===n?1:-1:0},et=e=>{if(!e)return"";if("string"==typeof e)try{return JSON.stringify(JSON.parse(e),null,2)}catch(r){return e}else try{return JSON.stringify(e,null,2)}catch(e){return"Failed to stringify JSON"}},rt=e=>{try{return JSON.parse(e)}catch(e){return null}},tt=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=tt(r[e])})),r}catch(r){return e}},nt=v((({value:e,height:r=200,fontSize:t=16},n)=>{const[a,o]=g(!0),s=h((e=>{const r=t=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-t.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===t.target.scrollTop&&(o(!1),e.scrollDOM.removeEventListener("scroll",r))};e.scrollDOM.scrollHeight>3e4?(o(!0),e.scrollDOM.addEventListener("scroll",r),e.scrollDOM.scrollTo(0,e.scrollDOM.scrollHeight-1e3),setTimeout((()=>{e.scrollDOM.scrollTo({top:e.scrollDOM.scrollHeight,behavior:"smooth"})}),300)):o(!1)}),[]);return l(q,Object.assign({position:"relative"},{children:[a&&i(Lr,{bgcolor:"#fff"}),i(le,{ref:n,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:`${r}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:s,extensions:[ae.json()],style:{fontSize:t,width:"100%"}})]}))})),it=({open:e,onClose:r,value:t,jsonViewProps:n})=>{const a=p();return l(I,Object.assign({disableEscapeKeyDown:!0,open:e,onClose:r,fullWidth:!0,maxWidth:"md",style:{width:800,left:"30%"}},{children:[i(D,{children:i(nt,Object.assign({value:t},n,{ref:a}))}),l(F,{children:[i(Gr,{copyText:t}),i(N,Object.assign({onClick:r,variant:"contained",color:"secondary"},{children:"Close"}))]})]}))};var lt=({value:e,copyButton:r=!1,textField:t=!1})=>{const{open:n,onOpen:a,onClose:o}=Pr(),s=h((e=>{e.stopPropagation(),a()}),[a]);return l(q,Object.assign({width:"100%"},{children:[l(q,Object.assign({display:"flex",alignItems:"center",justifyContent:"flex-end",pt:1,mb:2},{children:[r&&i(Gr,{copyText:et(e)}),i(Q,Object.assign({title:"Open",placement:"top"},{children:i(R,Object.assign({size:"small",onClick:s},{children:i(k,{children:i("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})}))}))]})),t?i(q,Object.assign({overflow:"hidden",whiteSpace:"nowrap"},{children:"object"==typeof e?JSON.stringify(e):e})):i(nt,{value:e}),i(it,{open:n,value:et(e),onClose:o,jsonViewProps:{height:450}})]}))};const at={spacing:4,palette:{primary:{main:"#E0613A",dark:"#d9512e",light:"#E0613A"},secondary:{main:"#007994",dark:"#262842",light:"#cbe8ee"},text:{disabled:"#A9A9B8"},success:{main:"#2DB77B",light:"#DBFCEE"},grey:{100:"#F7F8FC",700:"#101F2B"}},typography:{fontSize:14,allVariants:{fontFamily:["Euclid","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},h1:{fontWeight:400},h3:{fontWeight:500},h4:{fontWeight:500}}};var ot=e(at);var st={components:{MuiButtonBase:{defaultProps:{disableElevation:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:"#D15C3B"},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:ot.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:ot.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:ot.spacing(3),minWidth:ot.spacing(25),background:ot.palette.background.default,paddingRight:ot.spacing(3)},input:{minWidth:ot.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:qr},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:ot.spacing(25)}}},MuiInputLabel:{styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:ot.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:ot.spacing(3),minWidth:ot.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:ot.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:i(qr,{})},styleOverrides:{root:{"& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment":{right:12}},paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},listbox:{"::-webkit-scrollbar":{width:"6px",backgroundColor:"white"},"::-webkit-scrollbar-thumb":{borderRadius:"10px",backgroundColor:"rgba(38, 40, 66, 0.24)"}}}},MuiMenu:{styleOverrides:{list:{paddingTop:0,paddingBottom:0,background:"white","& li.Mui-selected":{background:"rgba(38, 40, 66, 0.08) !important"}}}},MuiPopover:{styleOverrides:{paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"}}},MuiFormLabel:{styleOverrides:{root:{color:"#6D6E85",fontSize:14,fontWeight:500,"&.Mui-focused":{color:"#6D6E85"},"& span":{color:"#D6331F"}},asterisk:{color:"#D6331F","&$error":{color:"#D6331F"}}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:14},backgroundColor:ot.palette.secondary.dark,padding:ot.spacing(2,3),borderRadius:8,textAlign:"center"}}}};var ct={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:ot.spacing(3),border:"1px solid rgba(38, 40, 66, 0.08)",overflow:"hidden"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:"#F7F8FC"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover":{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},"&:active, &:focus":{backgroundColor:"#EEEEF0"}}}},MuiTableCell:{styleOverrides:{root:{padding:ot.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:ot.spacing(4)}},head:{padding:ot.spacing(2,2),color:"#6D6E85"},body:{wordBreak:"break-all"}}},MuiTableSortLabel:{styleOverrides:{root:{maxHeight:"24px",lineHeight:1}}},MuiTablePagination:{styleOverrides:{root:{"& .MuiInputBase-root":{border:"1px solid #2628421F",borderRadius:4,minWidth:58,height:32,paddingRight:ot.spacing(2),"& .MuiSelect-select":{paddingRight:"4px !important",color:ot.palette.secondary.dark,"&:focus":{backgroundColor:"transparent"}}}}}},MuiPaginationItem:{styleOverrides:{root:{height:32,minWidth:32,borderRadius:4,border:"1px solid transparent",margin:"0, 2px","&.Mui-selected":{borderColor:"#2628421F",backgroundColor:"#F7F8FC"}}}},MuiDataGrid:{defaultProps:{headerHeight:40,getRowHeight:()=>"auto"},styleOverrides:{root:{borderRadius:ot.spacing(3),width:"100%",color:ot.palette.secondary.dark,border:"1px solid #26284214","& .MuiDataGrid-actionsCell":{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}},columnHeaders:{backgroundColor:ot.palette.grey[100],borderTopLeftRadius:ot.spacing(3),borderTopRightRadius:ot.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},columnHeaderTitle:{color:"#6D6E85",fontWeight:500},row:{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},columnSeparator:{display:"none"},withBorder:{borderColor:"#E0E3EA"},cell:{minHeight:"48px !important",textOverflow:"ellipsis",wordBreak:"break-all",lineHeight:"unset",padding:ot.spacing(1.25,3),borderColor:"#E0E3EA","&:focus":{outline:"none"}}}}}};var dt={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:ot.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:ot.palette.secondary.main}}}}}};var ut={components:{MuiTypography:{styleOverrides:{h1:{[ot.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[ot.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[ot.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}};const pt=(()=>{if(document){const e="https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";if(!document.querySelectorAll(`link[href="${e}"]`).length){const r=document.createElement("link");r.href=e,r.rel="stylesheet",document.head.appendChild(r)}}return r(e(ot,{components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},st.components),ct.components),dt.components),ut.components),{MuiToolbar:{styleOverrides:{root:{[ot.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:ot.spacing(2.5),padding:ot.spacing(2.5,4),lineHeight:"20px",fontSize:"1rem",textTransform:"none"},outlined:{color:"#262842",backgroundColor:"#FFFFFF !important",border:"1px solid rgba(38, 40, 66, 0.12)"},text:{color:ot.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:ot.spacing(3)},paperWidthXs:{maxWidth:500}}},MuiDialogContent:{styleOverrides:{root:{color:"#6D6E85"}}},MuiDialogActions:{styleOverrides:{root:{background:"#F7F8FC",borderTop:"1px solid rgba(38, 40, 66, 0.08)",padding:ot.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:ot.palette.secondary.main}}},MuiTab:{styleOverrides:{root:{fontSize:14,fontWeight:500,textTransform:"none",padding:"10px 12px",lineHeight:"1.125rem",minHeight:"38px",color:"#8B8C9E","&.Mui-selected":{color:ot.palette.secondary.main}}}}})}))})(),mt=({value:e,canCopy:r,copyValue:t,shortId:n,fullText:a=!1,textParams:o})=>{const{displayAs:s="text",tooltipLinkComponent:c=null,dateFormat:d=null,statusVariant:u=null}=o||{};switch(s){case"boolean":return i(k,e?Object.assign({color:"primary",fontSize:"small"},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):Object.assign({fontSize:"small"},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})}));case"date":return e?d?i(Yi,{children:d.map(((r,t)=>i(q,{children:de(new Date(e),r)},t)))}):l(Yi,{children:[i(q,{children:de(new Date(e),"dd.MM.yyyy")}),i(q,{children:de(new Date(e),"HH:mm:ss")})]}):"";case"status":return i(Yi,{children:i(vi,{text:e,status:u||"default"})});case"json_text":return i(lt,{value:e,textField:!0});case"json_code":return i(lt,{value:e,copyButton:!0});case"array":return i(q,{children:null==e?void 0:e.map(((e,r)=>i(q,{children:e},r)))});case"collapsed_array":return e&&i(q,{children:i(Q,Object.assign({arrow:!0,title:c||e.map(((e,r)=>i(q,Object.assign({fontSize:14,style:{paddingTop:pt.spacing(1)}},{children:e}),r)))},{children:i(q,{children:e.length>1?`${e[0]} (+${e.length-1})`:e[0]})}))});case"number":return i(q,Object.assign({display:"flex",justifyContent:"flex-end"},{children:i(Yi,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})}));default:return e?l(q,Object.assign({display:"flex",alignItems:"center",width:"100%"},{children:[n?i(Yi,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):a?i(q,Object.assign({sx:{whiteSpace:"normal"}},{children:"string"==typeof e?e:JSON.stringify(e)})):i(Yi,{children:"string"==typeof e?e:JSON.stringify(e)}),r&&i(Gr,{copyText:t?"string"==typeof t?t:JSON.stringify(t):e})]})):""}},gt=new RegExp("^[-+]?[0-9]+$"),ht=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),ft=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const t of e)if(ft(t,r))return!0;if("object"==typeof e)for(const t in e)if(ft(e[t],r))return!0}return!1},bt=e=>e===jr.DATE||e===jr.DATE_TIME||e===jr.TIME,vt=new Intl.NumberFormat("ru-RU",{style:"decimal"}),yt=e=>!e&&0!==e&&!1!==e,Ct=(e,r,t)=>{if(null==r)return null;if(ft(r))return r;let n=r;switch(e){case jr.BOOLEAN:n=!!r||!(!r&&null!==r)&&null;break;case jr.INTEGER:case jr.BIG_INTEGER:case jr.BIG_DECIMAL:case jr.FLOAT:case jr.LONG:case jr.DOUBLE:n=Number(r);break;case jr.DATE:case jr.DATE_TIME:case jr.TIME:if(r)try{const e=t.formatText.replace(/[Z,z,x]+/g,"XX");n=de(ue(r,e,new Date),e)}catch(e){console.error(e)}break;case jr.JSON:try{"string"!=typeof r&&(n=JSON.stringify(r)),n=JSON.parse(n)}catch(e){console.log(e),n=null}break;case jr.ANY:try{n="string"==typeof r?JSON.parse(n):r}catch(e){n=r}break;case jr.ENTITY:n=Ot(t.properties,r)}return n},Ot=(e,r)=>{if(r){const t={};return e.forEach((e=>{const{key:n,propertyType:i}=e,l=r[n];Array.isArray(l)?t[n]=l.map((r=>Ct(i,r,{formatText:e.format,properties:e.properties}))):t[n]=Ct(i,l,{formatText:e.format,properties:e.properties})})),t}return null},xt=(e,r)=>{const t={};return e.forEach((e=>{const{key:n,name:i,isRequired:l,isMultiple:a,sortOrder:o,isEnabled:s,uiSettings:c,validationNode:d}=e,u=e.propertyType?"string"==typeof e.propertyType?e.propertyType:e.propertyType.value:null,p=Object.assign({name:i,propertyType:u,isRequired:l,isMultiple:a,sortOrder:o,isEnabled:s,validationNode:d,uiSettings:c},((e,r)=>{const t={};let n,i="";return r?e.isMultiple?(i="values",n=e.value):(i="value",n=e.value):e.isMultiple?(i="defaultValues",n=e.defaultValue):(i="defaultValue",n=e.defaultValue),Array.isArray(n)?t[i]=n.map((r=>Ct(e.propertyType,r,{formatText:e.format,properties:e.properties}))):t[i]=Ct(e.propertyType,n,{formatText:e.format,properties:e.properties}),t})(Object.assign(Object.assign({},e),{propertyType:u}),r));if("isViewableInList"in e&&(p.isViewableInList=e.isViewableInList),c)if("string"==typeof c)try{p.uiSettings=JSON.parse(c)}catch(e){console.log(e),p.uiSettings=c}else p.uiSettings=c;else p.uiSettings=null;u===jr.BIG_DECIMAL&&(p.precisionScale=e.precisionScale,p.roundingMode=e.roundingMode),u!==jr.DATE&&u!==jr.TIME&&u!==jr.DATE_TIME||(p.format=e.format),u===jr.STRING&&(p.restrictedValues=e.restrictedValues),u===jr.ENTITY_REFERENCE&&(p.source=e.source,p.definitionCode=e.definitionCode,p.definitionVersion=e.definitionVersion,p.labelPropertyCode=e.labelPropertyCode,p.valuePropertyCode=e.valuePropertyCode),u===jr.ENTITY&&(p.properties=xt(e.properties,r)),t[n]=p})),t};function Et(e,r){return Object.keys(e).map((t=>{const n=Object.assign(Object.assign({key:t},e[t]),r||{});if(n.propertyType===jr.ENTITY&&(n.properties=Et(n.properties,r)),n.propertyType===jr.JSON)try{null==n.defaultValue?n.defaultValue="":n.defaultValue=JSON.stringify(n.defaultValue,null,2)}catch(e){n.defaultValue=""}return n.isMultiple&&("defaultValues"in n&&(n.defaultValue=n.defaultValues),"values"in n&&(n.value=n.values)),n})).sort(((e,r)=>Qr(e,r,"sortOrder")))}const jt=(e,r)=>{if(r)try{const e=r.replace(/Z/g,"XXX");return de(new Date,e),e}catch(r){return console.error("Incorrect format",r),e}return e},Tt=e=>{let r=[];return r=Array.isArray(e.properties)?e.properties:Et(e.properties),r.reduce(((e,r)=>{const t=JSON.parse(JSON.stringify(e));return r.propertyType===jr.ENTITY?t[r.key]=Tt(r):t[r.key]=r.propertyType,t}),{})},St=({propertyType:e,useExpression:r,required:t})=>{let n=[{value:"widget",label:"Fill array (widget)",sortOrder:1}];return t||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===jr.JSON||e===jr.ENTITY||e===jr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e!==jr.JSON&&e!==jr.ANY&&e!==jr.ENTITY||n.push({value:"json_valid",label:"JSON editor",sortOrder:2}),n=n.sort(((e,r)=>Qr(e,r,"sortOrder"))),n},wt=({propertyType:e,useExpression:r,required:t})=>{let n=[{value:"widget",label:"Widget",sortOrder:1}];switch(t||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===jr.JSON||e===jr.ENTITY||e===jr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e===jr.JSON&&n.push({value:"dem_builder",label:"DEM Builder",sortOrder:2}),e){case jr.STRING:n[0].label="Text input";break;case jr.INTEGER:case jr.BIG_INTEGER:case jr.BIG_DECIMAL:case jr.FLOAT:case jr.LONG:case jr.DOUBLE:n[0].label="Number input";break;case jr.BOOLEAN:n[0].label="Switch";break;case jr.ENTITY_REFERENCE:n[0].label="Entity reference field";break;case jr.JSON:n[0].label="JSON editor";break;case jr.DATE:n[0].label="Date picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case jr.DATE_TIME:n[0].label="Date & Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case jr.TIME:n[0].label="Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case jr.ANY:n[0].label="Textarea"}return n=n.sort(((e,r)=>Qr(e,r,"sortOrder"))),n},Vt={required:Nr,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},Lt=e=>{var r,t,{control:n,validate:s,name:d="",label:u="",required:p=!1,defaultValue:m=null,disabled:g=!1,hideErrorMessage:h=!1,onChange:b,decimal:v=!1,valueAsNumber:y=!0,useFormattedInputValue:C=!1,errorText:O}=e,x=o(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","decimal","valueAsNumber","useFormattedInputValue","errorText"]);const E=f((()=>O||Vt),[O]),T=j({name:d,control:n,defaultValue:m,rules:{required:!!p&&E.required,validate:e=>0==+e||(null===e?!p||E.required:v&&!ht.test(e)||/^-*0+$/.test(e)?E.notValidNumber:v||gt.test(e)?!s||("function"!=typeof s||s(e)):E.notValidInteger)}}),S=T.field,{ref:w,onChange:V,value:L}=S,k=o(S,["ref","onChange","value"]),{fieldState:{error:R}}=T;return i(c,Object.assign({},k,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:w,name:d,label:p?l(a,{children:[u," ",i("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!R,helperText:!h&&(null==R?void 0:R.message),disabled:g,value:C?null!==(r=null==L?void 0:L.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))&&void 0!==r?r:"":null!=L?L:"",onChange:e=>{var r;const t=e.target.value.replace(/\s/g,""),n=e.nativeEvent.data;if(!isNaN(n)||v&&"."===n||"-"===n||"+"===n||t){if(b)b(e);else if(y)if(e.target.value)if("0"===e.target.value)V(0);else if(v){const n=e.target.value.split(".")[1];V(!ht.test(t)||/^0+$/.test(n)||/^-*0+$/.test(t)?e.target.value:+parseFloat(t).toFixed(null!==(r=null==n?void 0:n.length)&&void 0!==r?r:0))}else V(Number.isNaN(+t)?e.target.value:+t);else V(null)}else V(e.target.value)},FormHelperTextProps:{variant:"standard"},inputProps:Object.assign({},null!==(t=null==x?void 0:x.inputProps)&&void 0!==t?t:{})},x))},kt=e=>{var{control:r,name:t,label:n,defaultValue:l}=e,a=o(e,["control","name","label","defaultValue"]);const s=j({control:r,name:t,defaultValue:l}).field,{ref:c,onChange:d,value:u}=s,p=o(s,["ref","onChange","value"]),g=f((()=>{if("boolean"==typeof u)return u;if("string"==typeof u){if("false"===u)return d(!1),!1;if("true"===u)return d(!0),!0}return!1}),[u,d]);m((()=>{null===u&&d(!1)}),[u,d]);return i(H,{label:n,name:t,control:i(se,Object.assign({},p,{color:"primary",size:"small",inputRef:c,onChange:e=>{const{checked:r}=e.target;d(r)},checked:g},a))})};var Rt="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";const Mt=()=>i("img",{src:Rt,alt:""}),Nt=e=>{var{control:r,name:t,required:n,label:s,placeholder:d,defaultValue:u,format:p=Tr,hideErrorMessage:f=!1,textFieldProps:b={},requiredErrorText:v="",validate:y,validateErrorText:C}=e,O=o(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"]);const[x,E]=g(Tr),{field:T,fieldState:{error:S}}=j({control:r,name:t,defaultValue:u,rules:{required:!!n&&(v||Nr),validate:y||(e=>!(""!==e&&!me(e,x))||(C||Ir))}}),w=h((e=>{T.onChange(pe(e)?de(e,x):e)}),[T,x]);return m((()=>{const e=p.replace(/[Z,z,x]+/g,"XX");try{me(de(new Date,e),e),E(e)}catch(e){console.error(e)}}),[p]),l(a,{children:[i(Y,Object.assign({required:n},{children:s})),i(ce,Object.assign({},T,x?{inputFormat:x}:{},{value:x?ue(T.value,x,new Date):T.value,onChange:w,components:{OpenPickerIcon:Mt}},O,{renderInput:e=>i(c,Object.assign({},e,{fullWidth:!0,size:"small",variant:"outlined",name:t,error:!!S,helperText:!f&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:d})},b))}))]})},It=()=>i("img",{src:Rt,alt:""}),Ft=e=>{var{control:r,name:t,required:n,label:s,placeholder:d,defaultValue:u,format:p=wr,hideErrorMessage:f=!1,textFieldProps:b,requiredErrorText:v="",validate:y,validateErrorText:C}=e,O=o(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"]);const[x,E]=g(),{field:T,fieldState:{error:S}}=j({control:r,name:t,defaultValue:u,rules:{required:!!n&&(v||Nr),validate:y||(e=>!(""!==e&&!me(e,x))||(C||Ir))}}),w=h((e=>{T.onChange(pe(e)?de(e,x):e)}),[T,x]);return m((()=>{const e=p.replace(/[Z,z,x]+/g,"XX");try{me(de(new Date,e),e),E(e)}catch(e){console.error(e)}}),[p]),i(ge,Object.assign({},T,{ampm:!1,label:n?l(a,{children:[s," ",i("span",{children:"*"})]}):s,value:x?ue(T.value,x,new Date):T.value},x?{inputFormat:x}:{},{onChange:w,components:{OpenPickerIcon:It}},O,{renderInput:e=>i(c,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:d}),variant:"outlined",name:t,error:!!S,helperText:!f&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"}},b))}))},Dt=e=>{var{control:r,name:t,required:n,label:s,textFieldProps:d={},format:u=Sr,hideErrorMessage:p=!1,requiredErrorText:h="",placeholder:f,defaultValue:b}=e,v=o(e,["control","name","required","label","textFieldProps","format","hideErrorMessage","requiredErrorText","placeholder","defaultValue"]);const y=j({control:r,name:t,defaultValue:b,rules:{required:!!n&&(h||Nr),validate:e=>!!me(e,u)||"Incorrect date format"}}),C=y.field,{onChange:O,ref:x,value:E}=C,T=o(C,["onChange","ref","value"]),{fieldState:{error:S}}=y,[w,V]=g(null);return m((()=>{if(E&&u){let e=ue(E,u,new Date);pe(e)||(e=ue(E,"HH:mm:ss.SSS",new Date)),V(e)}}),[E,u]),i(he,Object.assign({},T,{mask:"",inputRef:x,label:n?l(a,{children:[s," ",i("span",{children:"*"})]}):s,ampm:!1,value:w,inputFormat:u,onChange:e=>{V(e),O(pe(e)?de(e,u):e)}},v,{renderInput:e=>i(c,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:f}),variant:"outlined",name:t,error:!!S,helperText:!p&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"}}))}))},Pt=e=>{var r,t,n,{name:s,control:d,label:u,required:p,defaultValue:m=null,onChange:b,textFieldLabel:v}=e,y=o(e,["name","control","label","required","defaultValue","onChange","textFieldLabel"]);const[C,O]=g(""),[x,E]=g(null),T=j({control:d,name:s,defaultValue:m,rules:{required:p&&Nr}}),S=T.field,{onChange:w,value:V}=S,L=o(S,["onChange","value"]),{formState:{errors:M}}=T,N=f((()=>b||w),[b,w]),I=h((e=>{const{value:r}=e.target;O(r)}),[]),F=h((()=>{E(null),!C||Array.isArray(V)&&V.includes(C)?Array.isArray(V)&&V.includes(C)&&E("This value already exists"):(N([...null!=V?V:[],C]),O(""))}),[C,N,V]),D=h((e=>{N(V.filter((r=>r!==e)))}),[V,N]),P=h((e=>{"Enter"!==e.key&&13!==e.keyCode||(e.stopPropagation(),e.preventDefault(),F())}),[F]);return l(a,{children:[i(Y,Object.assign({required:p},{children:u})),i(q,Object.assign({display:"flex",flexWrap:"wrap"},{children:null==V?void 0:V.map(((e,r)=>i(fe,{sx:{mr:1,mb:1},variant:"outlined",label:e,onDelete:()=>D(e)},r)))})),i("input",Object.assign({type:"hidden"},d.register(s),{onChange:N,value:V},L)),i(c,Object.assign({fullWidth:!0,variant:"outlined",size:"small",label:v||""===v?v:`Add ${u}`,value:C,onChange:I,error:!!(null===(r=M[s])||void 0===r?void 0:r.message),helperText:null===(t=M[s])||void 0===t?void 0:t.message,FormHelperTextProps:{variant:"standard"},name:s,onKeyDown:P,InputProps:{endAdornment:i(R,Object.assign({size:"small",onClick:F},{children:i(k,{children:i("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})}))},inputProps:Object.assign({},null!==(n=null==y?void 0:y.inputProps)&&void 0!==n?n:{})},y)),x&&i(_,Object.assign({error:!0},{children:x}))]})},At=({name:e="period",control:r,label:t="Period",required:n,isSecondsVisible:o=!1})=>{var s;const[d,u]=g(),{setValue:p,register:f,formState:{errors:b}}=S(),v=T({control:r,name:e}),y=h((r=>{const{name:t,value:n}=r.target,i=Object.assign({},null!=d?d:{});n?(i[t]=+n,p(e,ve(i),{shouldValidate:!0})):(delete i[t],p(e,"",{shouldValidate:!0})),u(i)}),[p,e,d]),C=null===(s=b[e])||void 0===s?void 0:s.message;return m((()=>{v&&!d&&u(ye(v))}),[d,v]),l(a,{children:[i("input",Object.assign({type:"hidden"},f(e,{required:n&&"Please, fill one of the fields"}))),i($,Object.assign({variant:"subtitle1"},{children:n?l(a,{children:[t," ",i(q,Object.assign({component:"span",color:"#D6331F"},{children:"*"}))]}):t})),C&&i(_,Object.assign({error:!0},{children:C})),l(be,Object.assign({container:!0,columns:2,spacing:2,flexWrap:"wrap"},{children:[i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",value:(null==d?void 0:d.years)||"",error:!!C,name:"years",label:"Years",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.months)||"",name:"months",label:"Months",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.weeks)||"",name:"weeks",label:"Weeks",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.days)||"",name:"days",label:"Days",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.hours)||"",name:"hours",label:"Hours",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.minutes)||"",name:"minutes",label:"Minutes",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})),o&&i(be,Object.assign({sm:1},{children:i(c,{variant:"outlined",size:"small",error:!!C,value:(null==d?void 0:d.seconds)||"",name:"seconds",label:"Seconds",type:"number",onChange:y,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}))]}))]})};const qt=e=>{var{control:r,name:t,label:n,required:s,mask:d="+7 (799) 999 99 99",requiredErrorText:u="",inputMaskProps:p,disabled:m,invalidErrorText:g}=e,h=o(e,["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","invalidErrorText"]);return i(w,{control:r,name:t,rules:{required:!!s&&(u||Nr),validate:e=>!s&&!e||(!!/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(e)||(g||"Incorrect phone number format"))},render:({field:e,fieldState:{error:r}})=>i(Ce,Object.assign({disabled:m,mask:d,value:e.value,onChange:e.onChange,onBlur:e.onBlur},p,{children:i(c,Object.assign({fullWidth:!0,size:"small",label:s&&n?l(a,{children:[n," ",i("span",{children:"*"})]}):n,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",InputProps:{startAdornment:i(M,Object.assign({position:"start"},{children:i("img",{src:"data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",alt:""})}))}},h,{error:!!r,FormHelperTextProps:{variant:"standard"},helperText:null==r?void 0:r.message}))}))})};var $t="data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.99995 8L9.99995 12L14 8H5.99995Z' fill='%236D7C8B'/%3e%3c/svg%3e";const zt=()=>i("img",{src:$t,alt:""});var Bt=()=>{const e=Ee(),r=je(e,Te),t=je(e,Se),n=je(e,we),a=je(e,Ve),o=r=>e.current.setPage(r);return l(q,Object.assign({px:2,display:"flex",alignItems:"center"},{children:[i(xe,{component:"div",page:r,count:n,rowsPerPage:a,rowsPerPageOptions:[10,20,50,100],onPageChange:(e,r)=>o(r),onRowsPerPageChange:r=>e.current.setPageSize(parseInt(r.target.value,10)),labelRowsPerPage:"Строк на странице",labelDisplayedRows:({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`,ActionsComponent:void 0,SelectProps:{IconComponent:zt}}),i(Oe,{count:t,page:r+1,onChange:(e,r)=>o(r-1)})]}))};var Ht=e=>{var{hideMenu:r,currentColumn:t,onUnsort:n}=e,l=o(e,["hideMenu","currentColumn","onUnsort"]);return i(Le,Object.assign({hideMenu:r,currentColumn:t},l,{children:i(ke,{onClick:r,column:t})}))};var _t=({mode:e})=>{const[r,t]=ne(),n=+r.get("page")||0,i=+r.get("size")||10;return m((()=>{"server"===e&&(r.has("page")||r.set("page","0"),r.has("size")||r.set("size","10"),t(r,{replace:!0}))}),[e,r,t]),{page:n,size:i,onPageChange:e=>{r.set("page",`${e}`),t(r,{replace:!0})},onSizeChange:e=>{r.set("size",`${e}`),t(r,{replace:!0})}}};var Wt=()=>{const[e,r]=ne(),t=e.getAll("sort").map((e=>e.split(",")));return{onColumnHeaderClick:({field:t,colDef:n})=>{if(n.sortable){let n=!1;const i=e.getAll("sort");e.delete("sort"),i.forEach((r=>{const[i,l]=r.split(",");i===t?(n=!0,"asc"===l&&e.append("sort",`${i},desc`)):e.append("sort",`${i},${l}`)})),n||e.append("sort",`${t},asc`),r(e,{replace:!0})}},getSortedColumns:e=>e.map((e=>{const r=t.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))}};var Jt=e=>{const[r,t]=g(10);m((()=>{t(e)}),[e]);return{pageSize:r,handlePageSizeChange:e=>t(e)}},Gt="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.47341 10.4087C3.3698 10.2747 3.32108 10.1063 3.33715 9.9377C3.35321 9.76909 3.43285 9.61291 3.55989 9.50088C3.68693 9.38886 3.85185 9.3294 4.02115 9.33457C4.19045 9.33974 4.35144 9.40915 4.47141 9.52872L8.00008 13.0574L11.5287 9.52872L11.5914 9.47338C11.7254 9.36978 11.8938 9.32106 12.0624 9.33712C12.231 9.35318 12.3872 9.43282 12.4992 9.55987C12.6113 9.68691 12.6707 9.85183 12.6656 10.0211C12.6604 10.1904 12.591 10.3514 12.4714 10.4714L8.47141 14.4714L8.40874 14.5267C8.28047 14.6262 8.12031 14.6755 7.95829 14.6653C7.79627 14.6551 7.64354 14.5862 7.52874 14.4714L3.52874 10.4714L3.47341 10.4087ZM12.5267 5.59138C12.6304 5.72538 12.6791 5.89379 12.663 6.0624C12.6469 6.23102 12.5673 6.3872 12.4403 6.49922C12.3132 6.61124 12.1483 6.67071 11.979 6.66554C11.8097 6.66037 11.6487 6.59095 11.5287 6.47138L8.00008 2.94272L4.47141 6.47138L4.40874 6.52672C4.27475 6.63032 4.10634 6.67905 3.93773 6.66298C3.76911 6.64692 3.61293 6.56728 3.50091 6.44024C3.38889 6.31319 3.32942 6.14827 3.33459 5.97897C3.33976 5.80967 3.40918 5.64869 3.52874 5.52872L7.52874 1.52872L7.59141 1.47338C7.71968 1.37388 7.87985 1.3246 8.04187 1.33479C8.20388 1.34498 8.35662 1.41393 8.47141 1.52872L12.4714 5.52872L12.5267 5.59138Z' fill='%23262842'/%3e%3c/svg%3e",Yt="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3c/g%3e%3c/svg%3e",Zt="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3c/g%3e%3c/svg%3e";const Kt=()=>i("img",{src:Gt,alt:""}),Ut=()=>i("img",{src:Yt,alt:""}),Xt=()=>i("img",{src:Zt,alt:""}),Qt=e=>{var{columns:r,rows:t,rowCount:n,loading:l,disableMargin:a,mode:s="server",initialPageSize:c=10,pagination:d=!0,onCellClick:u}=e,p=o(e,["columns","rows","rowCount","loading","disableMargin","mode","initialPageSize","pagination","onCellClick"]);const{page:m,size:g,onPageChange:h,onSizeChange:f}=_t({mode:s}),{onColumnHeaderClick:b,getSortedColumns:v}=Wt(),{pageSize:y,handlePageSizeChange:C}=Jt(c),O={sortingMode:s,paginationMode:s,pageSize:"server"===s?g:d?y:n,onPageSizeChange:"server"===s?f:C,components:{BaseTooltip:Q,Pagination:Bt,ColumnUnsortedIcon:e=>(o(e,["sortingOrder"]),i(Kt,{})),ColumnSortedDescendingIcon:e=>(o(e,["sortingOrder"]),i(Xt,{})),ColumnSortedAscendingIcon:e=>(o(e,["sortingOrder"]),i(Ut,{}))}};return"server"===s&&(O.onColumnHeaderClick=b,O.page=m,O.onPageChange=h,O.components.ColumnMenu=Ht),i(q,Object.assign({mt:a?0:2},{children:i(Re,Object.assign({autoHeight:!0,hideFooterPagination:!d,hideFooter:!d,disableSelectionOnClick:!0,loading:l,rows:t,disableColumnMenu:!0,columns:v(r),rowCount:n,rowsPerPageOptions:[10,20,50,100],onCellClick:u},O,p))}))},en=({icon:e,label:r,showInMenu:t,onClick:n,location:l})=>{var a;return l?i(R,Object.assign({component:te,to:l.pathname,state:null!==(a=l.state)&&void 0!==a?a:null,size:"small"},{children:i(Q,Object.assign({title:r,arrow:!0},{children:u.cloneElement(e,{fontSize:"small"})}))})):i(Me,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:i(Q,Object.assign({title:r,arrow:!0},{children:e})),onClick:n,label:r,showInMenu:t})};var rn=()=>{const[e,r]=ne(),t=f((()=>{var r;return null!==(r=e.get("page"))&&void 0!==r?r:0}),[e]),n=f((()=>{var r;return null!==(r=e.get("size"))&&void 0!==r?r:10}),[e]),i=h((e=>{r((r=>(r.set("page",`${e}`),r)))}),[r]),l=h((e=>{r((r=>(r.set("size",`${e}`),r)))}),[r]);return m((()=>{e.has("page")||r((e=>(e.set("page","0"),e))),e.has("size")||r((e=>(e.set("size","10"),e)))}),[e,r]),{page:t,size:n,onPageChange:i,onSizeChange:l}};var tn=()=>{const[e,r]=ne(),t=f((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),n=h((e=>{r((r=>{r.delete("sort");let n=!1;return t.forEach((([t,i])=>{t===e?(n=!0,"asc"===i&&r.append("sort",`${t},desc`)):r.append("sort",`${t},${i}`)})),n||r.append("sort",`${e},asc`),r}))}),[t,r]),i=h((e=>{const r=t.find((([r,t])=>r===e));return!!r&&r[1]}),[t]);return{sortParams:t,onSortChanged:n,getColumnSorting:i}};const nn=t(ze)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),ln=()=>i("img",{src:$t,alt:""}),an=()=>i("img",{src:Gt,alt:""}),on=()=>i("img",{src:Yt,alt:""}),sn=()=>i("img",{src:Zt,alt:""});function cn({columns:e=[],rows:r=[],totalCount:t,children:n,pagination:a=!0,loading:o=!1,onRowClick:s,emptyDataText:c,verticalAlign:d="middle",labelRowsPerPage:u},p){const{page:m,size:g,onPageChange:h,onSizeChange:f}=rn(),{onSortChanged:b,getColumnSorting:v}=tn();return i(q,Object.assign({sx:{overflow:"auto"}},{children:l(De,Object.assign({sx:{width:"100%",display:"table",tableLayout:"fixed"}},{children:[i($e,Object.assign({open:o,sx:{position:"absolute",top:0,left:0}},{children:i(Lr,{})})),l(Ne,Object.assign({ref:p},{children:[i(Pe,{children:i(Ae,{children:e.map(((e,r)=>{const t=!!e.sortKey&&v(e.sortKey);return i(Fe,Object.assign({align:e.align?e.align:"left",sortDirection:t,sx:{width:e.width?`${e.width}%`:"unset"}},{children:i(nn,Object.assign({active:!!t,hideSortIcon:!e.sortKey,direction:t||"asc",IconComponent:"asc"===t?on:"desc"===t?sn:an,onClick:()=>e.sortKey?b(e.sortKey):{}},{children:e.label}))}),r)}))})}),i(Ie,{children:r.length?r.map(((r,t)=>i(Ae,Object.assign({hover:!0,onClick:s?()=>s(r):r.onClick,sx:{verticalAlign:d}},{children:e.map(((e,n)=>i(Fe,Object.assign({align:e.align?e.align:"left",sx:{maxWidth:e.width?`${e.width}%`:"unset"}},{children:i(q,Object.assign({sx:{maxWidth:"90%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",padding:({spacing:e})=>e(2.4,0)}},{children:i(q,{children:e.renderCell?e.renderCell(r,t):r[e.id]})}))}),n)))}),t))):i(Ae,Object.assign({sx:{verticalAlign:d}},{children:i(Fe,Object.assign({align:"center",colSpan:e.length},{children:null!=c?c:"Нет данных"}))}))}),a||n?i(qe,{children:l(Ae,{children:[n&&i(Fe,Object.assign({colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3}},{children:n})),a&&r.length?i(xe,{rowsPerPageOptions:[5,10,25],count:t,rowsPerPage:+g,page:+m,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`:void 0,SelectProps:{IconComponent:ln},onPageChange:(e,r)=>h(r),onRowsPerPageChange:e=>f(+e.target.value)}):null]})}):null]}))]}))}))}const dn=v(cn),un=({actionsList:e})=>{const[r,t]=g(null),n=Boolean(r),a=()=>{t(null)};return l("div",{children:[i(R,Object.assign({"aria-label":"more",id:"more-button","aria-controls":n?"more-menu":void 0,"aria-expanded":n?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),t(e.currentTarget)}},{children:i(He,{})})),i(Be,Object.assign({id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:r,open:n,onClose:e=>{e.stopPropagation(),a()},PaperProps:{style:{minWidth:"127px"}}},{children:e.map((e=>i(d,Object.assign({onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(),a()}},{children:e.title}),e.title)))}))]})},pn=e=>{const{children:r,value:t,index:n}=e,l=o(e,["children","value","index"]);return i("div",Object.assign({role:"tabpanel",hidden:t!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`},l,{children:t===n?r:null}))},mn=e=>{var r;const{tabs:t}=e,n=ee(),a=re(),o=f((()=>new URLSearchParams(a.search)),[a.search]),s=o.get("tab");return l(q,{children:[i(_e,{children:i(Je,Object.assign({value:s||(null===(r=t[0])||void 0===r?void 0:r.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{o.set("tab",r),n({pathname:a.pathname,search:o.toString()},{replace:!0})}},{children:t.map((e=>i(We,{value:e.name,label:e.label},e.name)))}))}),i(q,Object.assign({mt:2},{children:t.map((e=>{var r;return i(pn,Object.assign({value:s||(null===(r=t[0])||void 0===r?void 0:r.name),index:e.name},{children:e.component}),e.name)}))}))]})},gn=({title:e,text:r,json:t})=>l(q,Object.assign({sx:{paddingBottom:8}},{children:[i(q,Object.assign({sx:{fontSize:"14px",fontWeight:600,color:"#536DFE"}},{children:e})),r&&i(q,Object.assign({sx:{fontSize:"18px",wordWrap:"break-word"}},{children:r})),t&&i(nt,{value:t,height:300})]})),hn=Object.values(Vr).sort(((e,r)=>e.localeCompare(r)));var fn=({propertyFieldName:e,control:r})=>l(a,{children:[i(be,{children:i(Lt,{required:!0,control:r,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),i(be,{children:i($r,{required:!0,control:r,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:Vr.HALF_UP,options:hn})})]});var bn=({propertyFieldName:e,control:r,defaultValue:t=""})=>i(be,{children:i(Fr,{required:!0,control:r,defaultValue:t,name:`${e}.format`,label:"Format"})});const vn=()=>i("div",{style:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),yn=({data:e})=>l(Qe,Object.assign({nonLinear:!0,orientation:"vertical",connector:i(nr,{sx:{marginLeft:4}}),sx:{width:"100%"}},{children:[e.filter(Boolean).map(((e,r)=>l(er,Object.assign({expanded:!0},{children:[i(rr,Object.assign({sx:{display:"flex",alignItems:"flex-start"},StepIconComponent:vn,StepIconProps:{icon:"",completed:!1,active:!0}},{children:e.label})),i(tr,Object.assign({sx:{marginLeft:4}},{children:e.content}))]}),r))),i(er,{})]})),Cn=({properties:e=[]})=>{const r=f((()=>e?e.map((e=>{const r="string"==typeof e.propertyType?e.propertyType:e.propertyType?e.propertyType.value:"";return{label:l(q,Object.assign({display:"flex",flexDirection:"column"},{children:[l("b",{children:[e.name,e.isRequired?"*":""]}),l("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",r]})]})),content:"ENTITY"===e.propertyType&&i(Cn,{properties:e.properties})}})):[]),[e]);return i(yn,{data:r})};var On=Cn;const xn={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""};var En=({control:e,parentPropertyFieldName:r,entityDefinition:t=!1,globalParameter:n=!1,entityReferenceDefinitionSources:o,entityReferenceValueComponent:c,fileReferenceValueComponent:d})=>{const u=p(null),{field:{onChange:m}}=j({control:e,name:`${r}.properties`}),f=T({control:e,name:`${r}.properties`,defaultValue:[]}),b=T({control:e,name:`${r}.name`}),{append:v,remove:y}=V({control:e,name:`${r}.properties`}),C=Pr(),[O,x]=g(0),E=h((()=>{if((null==f?void 0:f.length)>0){v(xn);const e=f.length;x(e)}else v(xn);u.current.addProperty()}),[f,v]),S=()=>s(void 0,void 0,void 0,(function*(){m(u.current.getProperties()),C.onClose()}));return l(a,{children:[i(be,{children:i($,Object.assign({variant:"h6"},{children:"Properties"}))}),i(be,{children:i(On,{properties:f})}),i(be,{children:i(N,Object.assign({variant:"contained",color:"primary",onClick:C.onOpen},{children:"Edit properties"}))}),l(I,Object.assign({disableEscapeKeyDown:!0,open:C.open,onClose:S,fullWidth:!0,maxWidth:"md"},{children:[l(A,{children:[b||"Entity"," Properties"]}),i(D,Object.assign({style:{height:"500px",overflow:"hidden"}},{children:l(be,Object.assign({container:!0,direction:"row",spacing:2,style:{height:"100%"}},{children:[l(be,Object.assign({xs:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"}},{children:[i(Qe,Object.assign({nonLinear:!0,activeStep:O,orientation:"vertical",style:{paddingLeft:"4px"}},{children:f.map(((e,r)=>l(er,Object.assign({onClick:()=>(e=>x(e))(r),style:{cursor:"pointer"}},{children:[i(rr,Object.assign({StepIconProps:{icon:""},style:{wordBreak:"break-word"}},{children:e.name||"(no name)"})),i(tr,{})]}),r)))})),i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:E},{children:"Add property"}))]})),i(be,Object.assign({container:!0,wrap:"nowrap",direction:"column",spacing:2,style:{height:"100%",overflowY:"auto",width:"75%"}},{children:i(Xn,{ref:u,properties:f,hideAddButton:!0,parentRemove:y,focusOnIndex:O,entityDefinition:t,globalParameter:n,entityReferenceDefinitionSources:o,entityReferenceValueComponent:c,fileReferenceValueComponent:d})}))]}))})),i(F,{children:i(N,Object.assign({variant:"contained",color:"primary",onClick:S},{children:"Ok"}))})]}))]})};var jn=({propertyFieldName:e,control:r,sources:t=[{label:"Arsenal Entities",value:"ARSENAL_ENTITIES"}]})=>l(a,{children:[i(be,{children:i($r,{required:!0,control:r,name:`${e}.source`,label:"Source",options:t})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${e}.definitionCode`,label:"Definition Code"})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]});const Tn=({control:e,propertyType:r,propertyFieldName:t,entityDefinition:n=!1,globalParameter:l=!1,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})=>{switch(r){case jr.STRING:return i(Pt,{name:`${t}.restrictedValues`,control:e,label:"Restricted Values"});case jr.BIG_DECIMAL:return i(fn,{propertyFieldName:t,control:e});case jr.DATE:return i(bn,{control:e,propertyFieldName:t,defaultValue:Tr});case jr.TIME:return i(bn,{control:e,propertyFieldName:t,defaultValue:Sr});case jr.DATE_TIME:return i(bn,{control:e,propertyFieldName:t,defaultValue:wr});case jr.ENTITY_REFERENCE:return i(jn,{control:e,propertyFieldName:t,sources:a});case jr.ENTITY:return i(En,{control:e,parentPropertyFieldName:t,globalParameter:l,entityDefinition:n,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s});default:return null}};var Sn=({control:e,name:r,label:t,required:n,restrictedValues:a,requiredErrorText:o="",requiredSelectErrorText:s=""})=>{const{field:{onChange:c,ref:u},fieldState:{error:p}}=j({control:e,name:r,rules:{required:!!n&&(Array.isArray(a)&&a.length?s||"Please, select a value":o||Nr)}}),m=T({control:e,name:r});return Array.isArray(a)&&a.length?l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!p},{children:[i(sr,Object.assign({htmlFor:"type-select"},{children:t})),i(ar,Object.assign({labelId:"type-select",label:t,value:m||"",onChange:c,ref:u},{children:a.map((e=>i(d,Object.assign({value:e},{children:e}),e)))}))]})):i(Fr,{hideErrorMessage:!0,required:n,control:e,name:r,label:t})};var wn=({name:e})=>{const{control:r,setValue:t,register:n}=S(),o=T({control:r,name:e}),c=h((r=>s(void 0,void 0,void 0,(function*(){const n=r.target.files[0];(new FileReader).readAsDataURL(n);const i=yield(e=>new Promise(((r,t)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{r(n.result)},n.onerror=e=>{t(e)}})))(n);t(e,i)}))),[e,t]);return l(a,{children:[l(q,Object.assign({mb:2,display:"flex",flex:"row"},{children:[i($,{children:"Does file uploaded:"}),i(k,o?Object.assign({sx:{paddingLeft:2}},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):Object.assign({sx:{paddingLeft:2}},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})}))]})),l(N,Object.assign({component:"label",variant:"contained",size:"large",color:"primary",sx:{marginTop:4}},{children:[o?"Change file":"Upload file",i("input",Object.assign({type:"hidden"},n(`${e}`,{required:!0}))),i("input",{type:"file",hidden:!0,onChange:c})]}))]})};const Vn=({property:e,name:r,label:t,useExpression:n,control:l,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})=>{var c;switch("string"==typeof e.propertyType?e.propertyType:null===(c=e.propertyType)||void 0===c?void 0:c.value){case jr.BIG_DECIMAL:case jr.FLOAT:case jr.DOUBLE:return i(Lt,{required:!0,decimal:!0,hideErrorMessage:!0,control:l,name:r,label:t,valueAsNumber:!0});case jr.INTEGER:case jr.BIG_INTEGER:case jr.LONG:return i(Lt,{required:!0,hideErrorMessage:!0,control:l,name:r,label:t,valueAsNumber:!0});case jr.BOOLEAN:return i(kt,{control:l,name:r,defaultValue:!1});case jr.DATE:return i(Nt,{hideErrorMessage:!0,control:l,name:r,label:t,format:e.format});case jr.TIME:return i(Dt,{hideErrorMessage:!0,control:l,name:r,label:t,format:e.format});case jr.DATE_TIME:return i(Ft,{hideErrorMessage:!0,control:l,name:r,label:t,format:e.format});case jr.JSON:return i(Zr,{control:l,name:r,label:t,parseValue:!0,hideErrorMessage:!0,validateJson:!0});case jr.STRING:return i(Sn,{control:l,name:r,label:t,restrictedValues:e.restrictedValues});case jr.ENTITY_REFERENCE:return o?i(o,{name:r,property:e}):i(Sn,{name:r,label:t,control:l});case jr.FILE:return i(wn,{name:r});case jr.FILE_REFERENCE:return s?i(s,{name:r}):i(Sn,{name:r,label:t,control:l});case jr.ANY:return i(Zr,{control:l,name:r,hideErrorMessage:!0,label:t});case jr.ENTITY:return i(pi,{properties:e.properties,dataFieldName:r,useExpression:n,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s});default:return i("div",{children:"No widget"})}};var Ln=({value:e,property:r,label:t,isDirty:n,required:i=!1,useExpression:l=!1,multipleOptions:a=!1})=>{const o=f((()=>t?`${t} (value)`:`${r.name} (value)`),[t,r]),s=f((()=>t?`${t} (widget)`:`${r.name} (widget)`),[t,r]),c=f((()=>{var e;return"string"==typeof r.propertyType?r.propertyType:null===(e=r.propertyType)||void 0===e?void 0:e.value}),[r]),[d,u]=g(null),p=f((()=>a?St({propertyType:c,required:i,useExpression:l}):wt({propertyType:c,required:i,useExpression:l})),[l,i,c,a]),b=f((()=>{switch(c){case jr.STRING:case jr.DATE:case jr.TIME:case jr.DATE_TIME:case jr.ENTITY_REFERENCE:case jr.ANY:case jr.FILE:case jr.FILE_REFERENCE:return"";case jr.JSON:return{};case jr.BOOLEAN:return!1;case jr.INTEGER:case jr.BIG_DECIMAL:case jr.BIG_INTEGER:case jr.DOUBLE:case jr.LONG:case jr.FLOAT:return 0;default:return null}}),[c]),v=f((()=>c===jr.JSON||c===jr.ANY),[c]),y=h((()=>{ft(e,v)?u("expression"):null==e||ft(e,v)||"widget"===d||"string"===d||u("widget")}),[e,d,v]);return m((()=>{d?n||y():!yt(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?l&&ft(e,v)?u("expression"):u("widget"):u("null")}),[e,d,p,l,n,y,v,i,r]),{propertyType:c,valueLabel:o,fillOptionLabel:s,fillOption:d,fillOptions:p,setFillOption:u,defaultProperyValue:b,checkFillOption:y}};const kn=t(sr)((()=>({inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"}}))),Rn=({control:e,property:r,name:t,useExpression:n,label:a,required:o,title:s,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:g,requiredErrorText:f=""})=>{const{field:{value:b,onChange:v},fieldState:{error:y,isDirty:C}}=j({name:t,control:e,defaultValue:r.defaultValue,rules:{validate:e=>!o||null!==e||(f||Nr)}}),O=p({}),{propertyType:x,valueLabel:E,fillOptionLabel:T,fillOption:S,fillOptions:w,setFillOption:V,defaultProperyValue:L}=Ln({value:b,property:r,isDirty:C,label:a,required:o,useExpression:n}),k=h((e=>{const t=e.target.value;O.current=Object.assign(Object.assign({},O.current),{[S]:b}),V(t);const n=O.current[t];if("null"===t)v(null,{shouldDirty:!0});else if("widget"===t)if(x===jr.JSON&&b&&"string"!=typeof b&&"dem_builder"===S&&"properties"in b){const e=Object.assign(Object.assign({},b),{properties:xt(b.property||[])});try{v(null!=n?n:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else v(null!=n?n:r.defaultValue||L);else if("expression"===t||"string"===t)v(null!=n?n:"",{shouldDirty:!0});else if("dem_builder"===t){const e={code:"",name:"",version:0,properties:[]};if(b)try{const e=JSON.parse(b);e.properties=Et(e.properties||{}),v(null!=n?n:e,{shouldDirty:!0})}catch(r){v(null!=n?n:e,{shouldDirty:!0})}else v(null!=n?n:e,{shouldDirty:!0})}}),[L,b,V,S,x,v,r]);return m((()=>{C||or(r.defaultValue||r.value)||""===r.defaultValue&&""===r.value||!or(b)||v(r.defaultValue||r.value)}),[C,r,v,b]),m((()=>{var e;(void 0===b||r.isRequired&&null===b&&or(r.defaultValue||r.value))&&v(null!==(e=O.current[S])&&void 0!==e?e:L),r.isRequired||null!==r.defaultValue&&null!==r.value||v(null)}),[b,v,L,r,S]),l(be,Object.assign({xs:12},{children:[s&&i(q,Object.assign({mb:2},{children:i($,Object.assign({variant:"h6"},{children:s}))})),w?i(q,Object.assign({mb:2},{children:l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined"},{children:[i(kn,Object.assign({htmlFor:"type-select"},{children:T})),i(ar,Object.assign({labelId:"type-select",label:T,value:S||"",onChange:k},{children:w.map((e=>i(d,Object.assign({value:e.value},{children:e.label}),e.value)))}))]}))})):null,"expression"===S&&(x===jr.JSON||x===jr.ENTITY||x===jr.ANY?i(Zr,{name:t,control:e,label:E,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):i(Fr,{control:e,name:t,label:E,hideErrorMessage:!0})),"string"===S&&i(Fr,{control:e,name:t,label:E,hideErrorMessage:!0}),"json_notvalid"===S&&i(Zr,{name:t,control:e,label:E,hideErrorMessage:!0}),"widget"===S&&i(Vn,{control:e,property:r,name:t,useExpression:n,label:E,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:g}),"dem_builder"===S&&i(ri,{control:e,title:"JSON",definitionFieldName:t,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:g}),y&&i(_,Object.assign({error:!0},{children:y.message}))]}))};var Mn=({control:e,name:r,property:t,useExpression:n,required:a,label:o,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:d})=>{const{fields:u,append:p,remove:m}=V({control:e,name:r});return l(be,Object.assign({container:!0,spacing:2,direction:"column",xs:12},{children:[Array.isArray(u)&&u.length?u.map(((u,p)=>i(be,Object.assign({xs:12},{children:l(q,Object.assign({display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"}},{children:[i(Rn,{control:e,required:a,property:t,useExpression:n,name:`${r}.${p}`,label:`${o||t.name} (${p+1})`,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:d}),i(q,Object.assign({mt:"8px",ml:"4px"},{children:i(R,Object.assign({id:"close-button",size:"small",onClick:()=>m(p)},{children:i(k,Object.assign({fontSize:"small"},{children:i("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}))}))]}))}),u.id))):null,i(be,{children:i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:()=>p(null)},{children:"Add value"}))})]}))};const Nn=({control:e,property:r,name:t,useExpression:n,required:a,label:o,title:s,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:h,requiredErrorText:f=""})=>{var b;const[v,y]=g(!1),{field:{value:C,onChange:O},fieldState:{error:x,isDirty:E}}=j({control:e,name:t,defaultValue:null!==(b=r.defaultValue)&&void 0!==b?b:[],rules:{validate:e=>!(a&&!e)||(f||Nr)}}),T=p({}),{propertyType:S,valueLabel:w,fillOptionLabel:V,fillOption:L,fillOptions:k,setFillOption:R,checkFillOption:M}=Ln({property:r,value:C,isDirty:E,label:o,required:a,useExpression:n,multipleOptions:!0});return m((()=>{C||O(r.isRequired&&r.isMultiple?[]:null)}),[C,r,O]),m((()=>{C&&!v&&(y(!0),M())}),[M,v,C]),l(be,{children:[s&&i(q,Object.assign({mb:2},{children:i($,Object.assign({variant:"h6"},{children:s}))})),k?i(q,Object.assign({mb:2},{children:l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined"},{children:[i(kn,Object.assign({htmlFor:"type-select"},{children:V})),i(ar,Object.assign({labelId:"type-select",label:V,value:L||"",onChange:e=>{y(!0),T.current=Object.assign(Object.assign({},T.current),{[L]:C});const r=e.target.value,t=T.current[r];"null"===r?O(null):"expression"===r||"json_valid"===r||"json_notvalid"===r?O(null!=t?t:"",{shouldDirty:!0}):"widget"===r&&O(null!=t?t:[],{shouldDirty:!0}),R(r)}},{children:k.map((e=>i(d,Object.assign({value:e.value},{children:e.label}),e.value)))}))]}))})):null,"expression"===L&&(S===jr.JSON||S===jr.ENTITY||S===jr.ANY?i(Zr,{name:t,control:e,label:w,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):i(Fr,{required:!0,hideErrorMessage:!0,control:e,name:t,label:w})),"json_valid"===L&&i(Zr,{name:t,control:e,label:w,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===L&&i(Mn,{control:e,property:r,name:t,useExpression:n,required:a,label:o,entityReferenceDefinitionSources:c,entityReferenceValueComponent:u,fileReferenceValueComponent:h}),x&&i(_,Object.assign({error:!0},{children:x.message}))]})},In=({control:e,propertyFieldName:r,name:t,label:n="",required:l,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})=>{const c=T({control:e,name:`${r}.propertyType`}),d=T({control:e,name:`${r}.isMultiple`}),u=T({control:e,name:`${r}.format`}),p=T({control:e,name:`${r}.restrictedValues`}),m=T({control:e,name:`${r}.properties`}),g=T({control:e,name:`${r}.isRequired`}),h=f((()=>Object.assign(Object.assign(Object.assign(Object.assign({name:n,isRequired:null!=l?l:g,isMultiple:d},!!u&&{format:u}),{restrictedValues:p}),!!m&&{properties:m}),{propertyType:"string"==typeof c?c:c.value,defaultValue:null,defaultValues:[],sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null})),[c,u,p,d,n,g,m,l]);return i(lr,Object.assign({dateAdapter:ir},{children:i(d?Nn:Rn,{control:e,name:t,property:h,title:n,required:l,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})}))};var Fn=({name:e})=>{const r=f((()=>({type:""})),[]),{control:t}=S(),{fields:n,append:a,remove:o}=V({control:t,name:e});return l(q,Object.assign({mt:2},{children:[i(N,Object.assign({variant:"outlined",size:"small",onClick:()=>a(r)},{children:"Add node"})),n.map((({id:r},t)=>i(_n,{removeHandle:()=>o(t),name:`${e}.${t}`},r)))]}))};const Dn=y(""),Pn=({name:e,control:r})=>l(a,{children:[i($,Object.assign({variant:"body2",gutterBottom:!0},{children:"Node"})),i(q,{children:i(Fr,{control:r,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),i(q,Object.assign({mt:2},{children:i(Fr,{control:r,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})}))]}),An=({name:e,control:r})=>l(a,{children:[i($,Object.assign({variant:"body2",gutterBottom:!0},{children:"Node"})),i(q,{children:i(Fr,{control:r,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),i(q,Object.assign({mt:2},{children:i(Fr,{control:r,name:`${e}.minimum`,label:"Minimum",type:"number"})})),i(q,Object.assign({mt:2},{children:i(Fr,{control:r,name:`${e}.maximum`,label:"Maximum",type:"number"})})),l(q,Object.assign({mt:2},{children:[i(zr,{control:r,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),i(zr,{control:r,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]}))]}),qn=["STRING_REGEX","JSON_SCHEMA"],$n=new Set([jr.INTEGER,jr.FLOAT,jr.DOUBLE,jr.BIG_DECIMAL,jr.BIG_INTEGER,jr.LONG]);var zn=({name:e})=>{const{control:r,setValue:t}=S(),n=C(Dn),o=T({control:r,name:`${e}.type`}),s=f((()=>{if("STRING_REGEX"===o)return i(Fr,{control:r,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===o)switch(!0){case n===jr.STRING:return i(Pn,{name:`${e}.node`,control:r});case $n.has(n):return i(An,{name:`${e}.node`,control:r});case n===jr.JSON:return i(Zr,{label:"Properties",control:r,name:`${e}.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+n}return null}),[n,o,r,e]);return m((()=>{$n.has(n)&&"JSON_SCHEMA"===o&&(t(`${e}.node.exclusiveMinimum`,!1),t(`${e}.node.exclusiveMaximum`,!1))}),[n,o,t,e]),i(yn,{data:[{label:"Validator",content:l(a,{children:[i(q,{children:i($r,{control:r,name:`${e}.type`,label:"Type",options:qn,onChange:r=>{t(e,{}),t(`${e}.type`,r.target.value)}})}),i(q,Object.assign({mt:2},{children:s}))]})}]})};const Bn=["AND","OR","NOT","NODE"],Hn=({name:e,removeHandle:r})=>{const{control:t}=S(),n=T({control:t,name:`${e}.type`}),o=f((()=>({AND:i(Fn,{name:`${e}.nodes`}),OR:i(Fn,{name:`${e}.nodes`}),NODE:i(zn,{name:`${e}.validator`}),NOT:i(Hn,{name:`${e}.node`})})),[e]);return i(yn,{data:[{label:"Node Type",content:l(a,{children:[l(q,Object.assign({display:"flex",alignItems:"flex-end"},{children:[i($r,{required:!0,control:t,name:`${e}.type`,label:"Type",options:Bn}),r&&i(q,Object.assign({ml:2},{children:i(R,Object.assign({onClick:r,color:"primary"},{children:i(Xe,{})}))}))]})),i(q,{children:o[n]})]})}]})};var _n=Hn;const Wn=({name:e})=>{const[r,t]=g(!1),{setValue:n,getValues:o}=S(),s=h((r=>{t(r.target.checked),r.target.checked||n(e,null)}),[n,e]);return m((()=>{o(e)&&t(!0)}),[e,o]),l(a,{children:[l(q,Object.assign({display:"flex",justifyContent:"space-between"},{children:[i($,Object.assign({variant:"h6"},{children:"Validator"})),i(H,{label:"Enable",control:i(W,{color:"primary",checked:r,onChange:s})})]})),r&&i(_n,{name:e})]})};var Jn=({name:e,label:r="",propertyFieldName:t,type:n,decimal:l=!1,options:a=[],required:o=!1})=>{const{control:s}=S(),c=f((()=>`${t}.${e}`),[e,t]);switch(n){case"text":return i(Fr,{control:s,name:c,label:r,required:o});case"number":return i(Lt,{control:s,name:c,label:r,decimal:l,required:o});case"select":return i($r,{control:s,name:c,label:r,options:a,required:o});case"autocomplete":return i(_r,{control:s,name:c,label:r,options:a,required:o});case"json":return i(Zr,{control:s,name:c,label:r,mode:"json",required:o});default:return null}};var Gn=e=>({customCheckboxes:f((()=>e.length?e.filter((e=>"checkbox"===e.type)):[]),[e]),customFields:f((()=>e.length?e.filter((e=>"checkbox"!==e.type)):[]),[e])});const Yn=Object.values(jr).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),Zn=O((({setValue:e,control:r,propertyFieldName:t,entityDefinition:n=!1,globalParameter:o=!1,customPropertyFields:s=[],entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u})=>{var p;const g=T({control:r,name:`${t}.propertyType`}),h=T({control:r,name:`${t}.isMultiple`}),b=T({control:r,name:`${t}.isRequired`}),{customCheckboxes:v,customFields:y}=Gn(s),C=f((()=>{let e=o?"Value":"Default Value";return h&&(e+="s"),e}),[o,h]);return m((()=>{g&&"string"==typeof g&&e(`${t}.propertyType`,Yn.find((e=>e.value===g)))}),[g,e,t]),l(be,Object.assign({container:!0,direction:"column",spacing:2},{children:[i(be,{children:i(Fr,{required:!0,control:r,name:`${t}.key`,label:"Key"})}),i(be,{children:i(Fr,{required:!0,control:r,name:`${t}.name`,label:"Name"})}),i(be,{children:i(_r,{required:!0,control:r,name:`${t}.propertyType`,label:"Type",options:Yn,onChange:(r,n)=>{const i=`${t}.propertyType`,l=`${t}.${o?"value":"defaultValue"}`;e(l,h?[]:null),e(i,n)}})}),i(be,{children:i(Lt,{required:!0,control:r,name:`${t}.sortOrder`,label:"Sort Order"})}),i(be,{children:i(Zr,{control:r,name:`${t}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),l(be,{children:[i(zr,{control:r,name:`${t}.isMultiple`,label:"Multiple"}),i(zr,{control:r,name:`${t}.isEnabled`,label:"Enabled"}),i(zr,{control:r,name:`${t}.isRequired`,label:"Required"}),n&&i(zr,{control:r,name:`${t}.isViewableInList`,label:"Is viewable in list"}),v.length?i(a,{children:v.map(((e,n)=>i(zr,{control:r,name:`${t}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},n)))}):null]}),g&&l(a,{children:[i(be,{children:i(Dn.Provider,Object.assign({value:null!==(p=g.value)&&void 0!==p?p:g},{children:i(Wn,{name:`${t}.validationNode`})}))}),i(Tn,{control:r,propertyType:"string"==typeof g?g:g.value,propertyFieldName:t,globalParameter:o,entityDefinition:n,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),i(In,{control:r,propertyFieldName:t,name:`${t}.${o?"value":"defaultValue"}`,label:C,required:!!o&&b,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u})]}),y.length?i(a,{children:y.map(((e,r)=>i(be,{children:i(Jn,Object.assign({},e,{propertyFieldName:t}))},r)))}):null]}))}));var Kn=({entityDefinition:e,globalParameter:r,customPropertyFields:t,index:n,arrLength:a,entityReferenceDefinitionSources:o,entityReferenceValueComponent:s,control:c,setValue:d,fileReferenceValueComponent:u,handleRemoveParameter:p,error:m,item:h,extRefs:f})=>{const[b,v]=g(n===a&&!h.key);return i(be,Object.assign({sm:12,ref:e=>f.current[n]=e},{children:l(Ge,Object.assign({expanded:b,onChange:()=>v(!b),elevation:3},{children:[i(Ye,Object.assign({expandIcon:i(Ue,{})},{children:i($,Object.assign({color:m&&m[n]?"secondary":"initial",style:{wordBreak:"break-word"}},{children:h.name||`Property ${n+1}`}))})),i(Ze,{children:b&&i(Zn,{control:c,setValue:d,propertyFieldName:`properties.${n}`,entityDefinition:e,globalParameter:r,customPropertyFields:t,entityReferenceDefinitionSources:o,entityReferenceValueComponent:s,fileReferenceValueComponent:u})}),i(Ke,{children:i(N,Object.assign({variant:"contained",size:"small",color:"secondary",onClick:()=>p(n)},{children:"Remove"}))})]}))}))};const Un={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},Xn=v((({properties:e,parentFieldName:r,hideAddButton:t,focusOnIndex:n,required:o,entityDefinition:s=!1,globalParameter:c=!1,customPropertyFields:d=[],parentRemove:u,entityReferenceDefinitionSources:g,entityReferenceValueComponent:f,fileReferenceValueComponent:b},v)=>{var y;const{clearErrors:C,control:O,setValue:E,getValues:T,reset:S,trigger:w,watch:k}=L({mode:"all",defaultValues:{properties:e}}),{fields:R,append:M,remove:I}=V({control:O,name:"properties"}),{fieldState:{error:F}}=j({control:O,name:"properties",rules:{validate:e=>!o||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),D=p([]),P=h((()=>{M(Un),C("properties")}),[M,C]),A=h((e=>{u&&u(e),I(e)}),[u,I]);return m((()=>{"number"==typeof n&&D.current[n]&&D.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,D]),m((()=>{var r;e.length&&!(null===(r=T("properties"))||void 0===r?void 0:r.length)&&S({properties:e})}),[e,T,S]),x(v,(()=>({getProperties:()=>T("properties"),addProperty:P,removeProperty:A,trigger:w})),[T,P,A,w]),l(a,{children:[F&&F.message&&i(be,Object.assign({sm:12},{children:i($,Object.assign({color:"secondary"},{children:F.message}))})),Array.isArray(R)&&R.map(((e,r,t)=>i(Kn,{item:e,index:r,arrLength:t.length-1,control:O,setValue:E,customPropertyFields:d,entityDefinition:s,globalParameter:c,error:F,handleRemoveParameter:A,fileReferenceValueComponent:b,entityReferenceValueComponent:f,entityReferenceDefinitionSources:g,extRefs:D},e.id))),!t&&l(be,Object.assign({xs:12},{children:[i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:P},{children:"Add property"})),F&&i(_,Object.assign({error:!0},{children:null===(y=F.root)||void 0===y?void 0:y.message}))]}))]})})),Qn={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},ei=({control:e,parentFieldName:r,hideAddButton:t,focusOnIndex:n,required:o,entityDefinition:s=!1,globalParameter:c=!1,customPropertyFields:d=[],parentRemove:u,entityReferenceDefinitionSources:g,entityReferenceValueComponent:b,fileReferenceValueComponent:v})=>{var y;const C=f((()=>r?`${r}.properties`:"properties"),[r]),{clearErrors:O,setValue:x}=S(),{fields:E,append:T,remove:w}=V({control:e,name:C}),{fieldState:{error:L}}=j({control:e,name:C,rules:{validate:e=>!o||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),k=p([]),R=h((()=>{T(Qn),O("properties")}),[T,O]),M=h((e=>{u&&u(e),w(e)}),[u,w]);return m((()=>{"number"==typeof n&&k.current[n]&&k.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,k]),l(a,{children:[L&&L.message&&i(be,Object.assign({sm:12},{children:i($,Object.assign({color:"secondary"},{children:L.message}))})),Array.isArray(E)&&E.map(((r,t,n)=>i(be,Object.assign({sm:12,ref:e=>k.current[t]=e},{children:l(Ge,Object.assign({defaultExpanded:t===n.length-1&&!r.key,elevation:3},{children:[i(Ye,Object.assign({expandIcon:i(Ue,{})},{children:i($,Object.assign({color:L&&L[t]?"secondary":"initial",style:{wordBreak:"break-word"}},{children:r.name||`Property ${t+1}`}))})),i(Ze,{children:i(Zn,{control:e,setValue:x,propertyFieldName:`${C}.${t}`,entityDefinition:s,globalParameter:c,customPropertyFields:d,entityReferenceDefinitionSources:g,entityReferenceValueComponent:b,fileReferenceValueComponent:v})}),i(Ke,{children:i(N,Object.assign({variant:"contained",size:"small",color:"secondary",onClick:()=>M(t)},{children:"Remove"}))})]}))}),r.id))),!t&&l(be,Object.assign({xs:12},{children:[i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:R},{children:"Add property"})),L&&i(_,Object.assign({error:!0},{children:null===(y=L.root)||void 0===y?void 0:y.message}))]}))]})},ri=v((({control:e,definitionFieldName:r,title:t,hideCodeField:n,hideVersionField:a,hideNameField:o,required:s=!1,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u},p)=>{const{control:m,getValues:g}=S(),h=g(`${r}.properties`);return l(be,Object.assign({container:!0,direction:"column",spacing:2},{children:[t&&i(be,Object.assign({sm:12},{children:i(q,Object.assign({my:2},{children:i($,Object.assign({variant:"h6"},{children:t}))}))})),!o&&i(be,Object.assign({sm:12},{children:i(Fr,{required:!0,control:null!=e?e:m,name:r?`${r}.name`:"name",label:"Name"})})),!n&&i(be,Object.assign({sm:12},{children:i(Fr,{required:!0,control:null!=e?e:m,name:r?`${r}.code`:"code",label:"Code"})})),!a&&i(be,Object.assign({sm:12},{children:i(Lt,{required:!0,control:null!=e?e:m,name:r?`${r}.version`:"version",label:"Version"})})),p?i(Xn,{ref:p,properties:h,required:s,parentFieldName:r,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u}):i(ei,{control:e,required:s,parentFieldName:r,entityReferenceDefinitionSources:c,entityReferenceValueComponent:d,fileReferenceValueComponent:u})]}))})),ti={name:"Name",key:"Key",propertyType:"Property Type",defaultValue:"Default Value",defaultValues:"Default Values",sortOrder:"Sort Order",isRequired:"Required",isMultiple:"Multiple",isEnabled:"Enabled",isViewableInList:"Is Viewable In List",precisionScale:"Precision Scale",roundingMode:"Rounding Mode",format:"Format",definitionCode:"Definition Code",definitionVersion:"Definition Version",labelPropertyCode:"Label Property Code",valuePropertyCode:"Value Property Code",restrictedValues:"Restricted Values",value:"Value",values:"Values",uiSettings:"UI Settings",validationNode:"Validation Node"},ni=({value:e,type:r})=>r!==jr.JSON&&r!==jr.ENTITY&&r!==jr.ANY||!e?i($,Object.assign({variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"}},{children:null===e?"null":e.toString()})):i(nt,{value:e}),ii=(e,r,t)=>{switch(r){case"isRequired":case"isMultiple":case"isEnabled":case"isViewableInList":return e?i(k,Object.assign({color:"primary",fontSize:"small"},{children:i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})):null;case"restrictedValues":return e?i(q,Object.assign({display:"flex",flexWrap:"wrap"},{children:e.map((e=>i(fe,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))})):null;case"defaultValue":case"value":return i(ni,{value:e,type:t});case"values":case"defaultValues":return Array.isArray(e)&&t!==jr.ENTITY&&t!==jr.JSON&&t!==jr.ANY?l("div",{children:["[",null==e?void 0:e.map(((e,r)=>i("div",{children:i(ni,{value:e,type:t})},r))),"]"]}):i(nt,{value:e});case"uiSettings":case"validationNode":return e?i(nt,{value:e}):null;default:return i($,Object.assign({variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"}},{children:e}))}};var li=({property:e})=>{const r=f((()=>(e&&(e.isMultiple?(delete e.defaultValue,delete e.value):(delete e.defaultValues,delete e.values)),e)),[e]);return i(Ne,Object.assign({size:"small"},{children:i(Ie,{children:Object.keys(ti).map((e=>e in r?l(Ae,{children:[i(Fe,Object.assign({width:"30%"},{children:i($,{children:ti[e]})})),i(Fe,{children:ii(r[e],e,r.propertyType)})]},e):null))})}))};var ai=O((({properties:e,parentNames:r=[]})=>{const t=f((()=>{let r=!1;return e.every((e=>e.propertyType!==jr.ENTITY||(r=!0,!1))),r}),[e]);return l(q,Object.assign({mt:4},{children:[i($,Object.assign({variant:"h6"},{children:"Properties"})),l(Qe,Object.assign({orientation:"vertical",style:{paddingLeft:"4px"}},{children:[e.map((e=>l(er,Object.assign({expanded:!0},{children:[i(rr,{StepIconProps:{icon:"",completed:!1,active:!0}}),i(tr,{children:i(oi,{property:e,parentNames:[...r],defaultExpanded:!1})})]}),e.key))),t&&i(er,{})]}))]}))}));const oi=({property:e,parentNames:r=[],defaultExpanded:t=!0})=>{const[n,a]=g(!0);return m((()=>{a(t)}),[t]),l(Ge,Object.assign({elevation:3,style:{backgroundColor:r.length%2==1?"#f1f1f1":"#fff"},expanded:n,onChange:()=>a((e=>!e))},{children:[i(Ye,Object.assign({expandIcon:i(k,{children:i("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})})},{children:i($,Object.assign({style:{wordBreak:"break-word",fontWeight:"600"}},{children:e.name}))})),i(Ze,{children:l(q,Object.assign({width:"100%"},{children:[i(li,{property:e}),e.propertyType===jr.ENTITY&&i(ai,{properties:Et(e.properties),parentNames:[...r,e.name]})]}))})]}))},si=({properties:e,expandAll:r=!0})=>{const t=f((()=>Array.isArray(e)?e:e?Et(e):[]),[e]);return i(q,Object.assign({display:"flex",flexDirection:"column"},{children:t.length?t.map((e=>i(oi,{property:e,defaultExpanded:r},e.key))):i($,{children:"No properties"})}))},ci=({property:e,name:r,useExpression:t,label:n,required:a,title:o,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u,requiredErrorText:g=""})=>{const{control:f,clearErrors:b,setValue:v}=S(),{field:{value:y},fieldState:{error:C,isDirty:O}}=j({name:r,control:f,rules:{validate:e=>!a||null!==e||(g||Nr)}}),x=p({}),{propertyType:E,valueLabel:T,fillOptionLabel:w,fillOption:V,fillOptions:L,setFillOption:k,defaultProperyValue:R}=Ln({value:y,property:e,isDirty:O,label:n,required:a,useExpression:t}),M=h((t=>{const n=t.target.value;x.current=Object.assign(Object.assign({},x.current),{[V]:y}),k(n);const i=x.current[n];if("null"===n)v(r,null,{shouldDirty:!0});else if("widget"===n)if(E===jr.JSON&&y&&"string"!=typeof y&&"dem_builder"===V&&"properties"in y){const e=Object.assign(Object.assign({},y),{properties:xt(y.property||[])});try{v(r,null!=i?i:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else v(r,null!=i?i:e.defaultValue||R);else if("expression"===n||"string"===n)v(r,null!=i?i:"",{shouldDirty:!0});else if("dem_builder"===n){const e={code:"",name:"",version:0,properties:[]};if(y)try{const e=JSON.parse(y);e.properties=Et(e.properties||{}),v(r,null!=i?i:e,{shouldDirty:!0})}catch(t){v(r,null!=i?i:e,{shouldDirty:!0})}else v(r,null!=i?i:e,{shouldDirty:!0})}b()}),[r,b,y,k,V,E,e,v,R]);return m((()=>{O||or(e.defaultValue||e.value)||""===e.defaultValue&&""===e.value||!or(y)||v(r,e.defaultValue||e.value)}),[O,e,v,y,r]),m((()=>{var t;(void 0===y||e.isRequired&&null===y&&!e.defaultValue&&!e.value)&&v(r,null!==(t=x.current[V])&&void 0!==t?t:R),e.isRequired||null!==e.defaultValue&&null!==e.value||v(r,null)}),[y,v,r,R,e,V]),l(be,Object.assign({xs:12},{children:[o&&i(q,Object.assign({mb:2},{children:i($,Object.assign({variant:"h6"},{children:o}))})),L?i(q,Object.assign({mb:2},{children:l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined"},{children:[i(kn,Object.assign({htmlFor:"type-select"},{children:w})),i(ar,Object.assign({labelId:"type-select",label:w,value:V||"",onChange:M},{children:L.map((e=>i(d,Object.assign({value:e.value},{children:e.label}),e.value)))}))]}))})):null,"expression"===V&&(E===jr.JSON||E===jr.ENTITY||E===jr.ANY?i(Zr,{name:r,control:f,label:T,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:E===jr.ANY?"text":"json"}):i(Fr,{control:f,name:r,label:T,hideErrorMessage:!0})),"string"===V&&i(Fr,{control:f,name:r,label:T,hideErrorMessage:!0}),"json_notvalid"===V&&i(Zr,{name:r,control:f,label:T,hideErrorMessage:!0}),"widget"===V&&i(Vn,{control:f,property:e,name:r,useExpression:t,label:T,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u}),"dem_builder"===V&&i(ri,{title:"JSON",definitionFieldName:r,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u}),C&&i(_,Object.assign({error:!0},{children:C.message}))]}))};var di=({name:e,property:r,useExpression:t,required:n,label:a,entityReferenceDefinitionSources:o,entityReferenceValueComponent:s,fileReferenceValueComponent:c})=>{const{control:d,setValue:u,clearErrors:p}=S(),m=T({control:d,name:e}),g=h((()=>{m&&Array.isArray(m)?u(`${e}.${m.length}`,null):u(e,[]),p(e)}),[e,m,u,p]),f=h((r=>{u(e,Kr(m,r))}),[e,m,u]);return l(be,Object.assign({container:!0,spacing:2,direction:"column",xs:12},{children:[Array.isArray(m)&&m.length?m.map(((d,u)=>i(be,Object.assign({xs:12},{children:l(q,Object.assign({display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"}},{children:[i(ci,{required:n,property:r,useExpression:t,name:`${e}.${u}`,label:`${a||r.name} (${u+1})`,entityReferenceDefinitionSources:o,entityReferenceValueComponent:s,fileReferenceValueComponent:c}),i(q,Object.assign({mt:"8px",ml:"4px"},{children:i(R,Object.assign({id:"close-button",size:"small",onClick:()=>f(u)},{children:i(k,Object.assign({fontSize:"small"},{children:i("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}))}))]}))}),u))):null,i(be,{children:i(N,Object.assign({variant:"contained",size:"small",color:"primary",onClick:g},{children:"Add value"}))})]}))};const ui=({property:e,name:r,useExpression:t,required:n,label:a,title:o,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u,requiredErrorText:h=""})=>{var f;const[b,v]=g(!1),{control:y,clearErrors:C,setValue:O,watch:x}=S(),{field:{ref:E,onChange:T},fieldState:{error:w,isDirty:V}}=j({control:y,name:r,defaultValue:null!==(f=e.defaultValue)&&void 0!==f?f:[],rules:{validate:e=>!(n&&!e)||(h||Nr)}}),L=x(r),k=p({}),{propertyType:R,valueLabel:M,fillOptionLabel:N,fillOption:I,fillOptions:F,setFillOption:D,checkFillOption:P}=Ln({property:e,value:L,isDirty:V,label:a,required:n,useExpression:t,multipleOptions:!0});return m((()=>{L||T(e.isRequired&&e.isMultiple?[]:null)}),[L,e,T]),m((()=>{L&&!b&&(v(!0),P())}),[P,b,L]),l(be,{children:[o&&i(q,Object.assign({mb:2},{children:i($,Object.assign({variant:"h6"},{children:o}))})),F?i(q,Object.assign({mb:2},{children:l(B,Object.assign({fullWidth:!0,size:"small",variant:"outlined"},{children:[i(kn,Object.assign({htmlFor:"type-select"},{children:N})),i(ar,Object.assign({labelId:"type-select",label:N,value:I||"",onChange:e=>{v(!0),k.current=Object.assign(Object.assign({},k.current),{[I]:L});const t=e.target.value,n=k.current[t];"null"===t?O(r,null):"expression"===t||"json_valid"===t||"json_notvalid"===t?O(r,null!=n?n:"",{shouldDirty:!0}):"widget"===t&&O(r,null!=n?n:[],{shouldDirty:!0}),D(t),C(r)}},{children:F.map((e=>i(d,Object.assign({value:e.value},{children:e.label}),e.value)))}))]}))})):null,"expression"===I&&(R===jr.JSON||R===jr.ENTITY||R===jr.ANY?i(Zr,{name:r,control:y,label:M,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:R===jr.ANY?"text":"json"}):i(Fr,{required:!0,hideErrorMessage:!0,control:y,name:r,label:M})),"json_valid"===I&&i(Zr,{name:r,control:y,label:M,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===I&&i(di,{property:e,name:r,useExpression:t,required:n,label:a,entityReferenceDefinitionSources:s,entityReferenceValueComponent:c,fileReferenceValueComponent:u}),w&&i(_,Object.assign({error:!0},{children:w.message}))]})},pi=({properties:e,dataFieldName:r,useExpression:t=!1,title:n,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})=>{const c=f((()=>e?e.map((e=>{var n;const c="string"==typeof e.propertyType?e.propertyType:null===(n=e.propertyType)||void 0===n?void 0:n.value;return{label:l(q,Object.assign({display:"flex",flexDirection:"column"},{children:[l("b",{children:[e.name,e.isRequired?"*":""]}),l("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",c]})]})),content:e.isMultiple?i(ui,{property:e,name:`${r}.${e.key}`,useExpression:t,label:e.name,required:e.isRequired,entityReferenceValueComponent:o,fileReferenceValueComponent:s,entityReferenceDefinitionSources:a}):i(ci,{property:e,name:`${r}.${e.key}`,useExpression:t,label:e.name,required:e.isRequired,entityReferenceDefinitionSources:a,entityReferenceValueComponent:o,fileReferenceValueComponent:s})}})):[]),[e,r,t,o,a,s]);return i(lr,Object.assign({dateAdapter:ir},{children:l(be,Object.assign({container:!0,direction:"column",spacing:2},{children:[n&&i(be,Object.assign({xs:12},{children:i("div",Object.assign({style:{fontWeight:"600"}},{children:n}))})),i(yn,{data:c})]}))}))};var mi=({property:e,data:r})=>{const{name:t}=e,n=h(((e,r)=>{const t=e,n=document.createElement("a");document.body.appendChild(n),n.href=t,n.target="_self",n.download=r,n.click()}),[]);return i(N,Object.assign({component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>n(r,t)},{children:"Download File"}))};const gi=({property:e,data:r,properties:t})=>{const n=e=>i(q,Object.assign({style:{backgroundColor:"#fff",border:"1px solid #ccc",borderRadius:"4px",padding:"4px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},{children:null===e?"null":e.toString()}));switch(e.propertyType){case jr.JSON:return i(nt,{value:r});case jr.ENTITY:return i(fi,{properties:t,data:r});case jr.ANY:return"object"==typeof r?i(nt,{value:r}):n(r);case jr.FILE_REFERENCE:return null===r?n(r):i(N,Object.assign({component:te,color:"primary",variant:"contained",target:"_blank",to:r,sx:{marginTop:4}},{children:"Download via link"}));case jr.FILE:return null===r?n(r):i(mi,{data:r,property:e});default:return n(r)}};var hi=({property:e,data:r,hasBackground:t=!1})=>{const n=f((()=>e.propertyType===jr.ENTITY?Array.isArray(e.properties)?e.properties:Et(e.properties):[]),[e]);return i(q,Object.assign({style:{backgroundColor:t?"#f1f1f1":"none"}},{children:i(gi,{property:e,data:r,properties:n})}))};const fi=({properties:e,data:r})=>{const t=f((()=>e&&r?e.map((e=>{const{key:t,name:n,isMultiple:o,propertyType:s}=e,c=r[e.key]?r[e.key]:null;return{label:l(q,Object.assign({display:"flex",flexDirection:"column"},{children:[i("b",{children:n}),l("span",{children:[t," | ",o?"multiple":"single"," | ",s]})]})),content:o&&Array.isArray(c)&&e.propertyType!==jr.ANY?i(a,{children:c.map(((r,t)=>i(q,Object.assign({mb:2},{children:i(hi,{property:e,data:r,hasBackground:!0})}),t)))}):i(hi,{property:e,data:c})}})):[]),[e,r]);return i(be,Object.assign({container:!0,direction:"column",spacing:2},{children:i(yn,{data:t})}))},bi=t(q)((({theme:e})=>({backgroundColor:"#eee",fontSize:"14px",padding:"0 8px",borderRadius:"10px",width:"fit-content","&.success":{backgroundColor:"#a9dfa9"},"&.error":{backgroundColor:"#ff7e7e"},"&.warning":{backgroundColor:e.palette.warning.main}}))),vi=({text:e,status:r="default"})=>i(bi,Object.assign({className:cr("root",{[r]:!0})},{children:e})),yi=({properties:e,parentKey:r="",activePath:t="",prefix:n="",onClick:a})=>i(Qe,Object.assign({orientation:"vertical",onClick:e=>e.stopPropagation()},{children:e&&e.map((e=>{var o;const s=r?`${r}.${e.key}`:e.key,c=null!==(o=e.propertyType.value)&&void 0!==o?o:e.propertyType;return l(er,Object.assign({expanded:!0,onClick:()=>{return e=s,void a(n?`${n}.${e}`:e);var e}},{children:[i(rr,Object.assign({StepIconProps:{icon:"",completed:!1,active:t===s}},{children:l(q,Object.assign({sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}}},{children:[e.name," - ",e.key," - ",c]}))})),i(tr,{children:i("div",{children:c===jr.ENTITY&&i(yi,{onClick:a,activePath:t,properties:e.properties,parentKey:s},e.key)})})]}),e.key)}))}));var Ci=yi;const Oi=({open:e=!1,onClose:r,onPaste:t,properties:n})=>{const[a,o]=g("");return l(I,Object.assign({open:e,onClose:r,fullWidth:!0,maxWidth:"md"},{children:[i(A,{children:"JSON path picker"}),l(D,{children:[(null==n?void 0:n.length)?n.map(((e,r)=>l("div",{children:[i($,Object.assign({variant:"h6"},{children:e.title})),i(Ci,{properties:e.properties,prefix:e.pathPrefix,onClick:o,activePath:a})]},r))):i($,{children:"Please, add properties"}),a&&l($,Object.assign({variant:"h6",gutterBottom:!0},{children:["Selected path : $(",a,")"]}))]}),l(F,{children:[i(N,Object.assign({variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${a})`),dr.success("Copied!")}},{children:"Copy"})),i(N,Object.assign({variant:"contained",color:"primary",onClick:()=>{t(`$(${a})`),dr.success("Pasted!")}},{children:"Paste"})),i(N,Object.assign({variant:"contained",color:"secondary",onClick:r},{children:"Close"}))]})]}))},xi=y({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),Ei=()=>C(xi),ji=({children:e})=>{const[r,t]=g("true"===localStorage.getItem("sidebar_collapsed")),n=h((()=>{t(!r),localStorage.setItem("sidebar_collapsed",`${!r}`),window.dispatchEvent(new CustomEvent("sidebar_collapsed",{detail:{collapsed:!r}}))}),[r]),l=h(((e,r)=>{localStorage.setItem(`${e.toLowerCase()}_collapsed`,`${!r}`)}),[]);return i(xi.Provider,Object.assign({value:{collapsed:r,toggleCollapse:n,toggleRootElementLink:l}},{children:e}))},Ti=t("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),Si=t(pr)((e=>({width:248,flexShrink:0,position:"relative",transition:"all 0.3s ease-in-out",zIndex:999,"& .MuiDrawer-paper":{backgroundColor:e.theme.palette.secondary.main,width:248,boxSizing:"border-box",borderRight:"none",borderRadius:0,transition:"all 0.3s ease-in-out",overflow:"hidden"},"&.collapsed":{width:70,"& .MuiDrawer-paper":{width:70}}}))),wi=t(yr)((({theme:e})=>({backgroundColor:"#fff",borderRight:"1px solid rgba(38, 40, 66, 0.08)",position:"relative","& span":{paddingLeft:10,paddingTop:5,fontSize:24,fontWeight:600,transition:".3s ease .1s",whiteSpace:"nowrap"},"&:after":{transition:"opacity .3s",content:"attr(data-title)",fontSize:30,position:"absolute",left:"50%",transform:"translate3d(-50%, 0, 0)",opacity:0,visibility:"hidden"},"&.collapsed":{justifyContent:"center","& img":{width:40},"& span":{opacity:0,visibility:"hidden",transitionDelay:"0s"},"&:after":{opacity:1,visibility:"visible",transitionDelay:".1s"}}}))),Vi=t(mr)((e=>({padding:e.theme.spacing(3),margin:0}))),Li=t(gr)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),ki=t(fr)((({theme:e})=>({borderRadius:e.spacing(2.5),padding:e.spacing(2),height:e.spacing(11),alignItems:"center","&.active":{backgroundColor:"rgba(38, 40, 66, 0.12)","&.main":{backgroundColor:"rgba(255, 255, 255, 0.12)",borderLeft:"4px solid #E0613A"}},"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{width:e.spacing(11.5),"&.active":{"&.main":{border:"none",backgroundColor:"#E0613A"}}}}))),Ri=t(hr)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),Mi=t(br)((({theme:e})=>({textTransform:"uppercase",borderRadius:e.spacing(2.5),backgroundColor:e.palette.secondary.main,color:"#fff",paddingLeft:0,paddingRight:0,position:"relative","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{fontSize:24,textAlign:"center",fontWeight:"bold",paddingRight:0}}))),Ni=t(vr)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),Ii=t(mr)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),Fi=t(Cr)((e=>({position:"absolute",top:e.theme.spacing(10),left:"calc(100% - 16px)",width:e.theme.spacing(8),height:e.theme.spacing(8),border:"1px solid #E0E3EA",borderRadius:"50%",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.12)",backgroundColor:"#fff",zIndex:1e3,opacity:0,transition:"all 0.3s ease-in-out","&.collapsed":{img:{transition:"all 0.3s ease-in-out",transform:"rotate(180deg)"}}})));var Di=({route:e,isActive:r,isSubmenu:t})=>{const{collapsed:n}=Ei(),[o,s]=u.useState(null),c=Boolean(o),d=e=>{s(e.currentTarget)},p=()=>{s(null)},m=h((({children:r})=>n&&!t?i(Q,Object.assign({title:e.name,placement:"right"},{children:r})):r),[n,e,t]);return e.link?i(Li,Object.assign({disablePadding:!0},{component:te,replace:!0,to:{pathname:e.link,search:e.query}},{children:i(m,{children:l(ki,Object.assign({className:cr({active:r,main:e.main,collapsed:n})},{children:[e.icon&&i(Ri,Object.assign({className:cr({collapsed:n})},{children:e.icon})),i(Ni,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:cr({collapsed:n,main:e.main}),sx:n&&!t?{display:"none"}:{}})]}))})})):e.children&&n?l(a,{children:[i(Mi,Object.assign({className:"collapsed"},{children:i(Q,Object.assign({title:e.name,placement:"right"},{children:i(ki,Object.assign({className:cr({active:r,main:e.main,collapsed:n}),sx:{justifyContent:"center"},onClick:d},{children:e.name.substring(0,1)}))}))})),i(Be,Object.assign({open:c,anchorEl:o,onClose:p,PaperProps:{sx:{width:300,maxHeight:440}},MenuListProps:{sx:{bgcolor:"secondary.main"}},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}},{children:e.children.map(((e,r)=>i(zi,{route:e,isSubmenu:!0},r)))}))]}):i(Mi,{children:e.name})},Pi="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg opacity='0.6'%3e%3cpath d='M10.3533 2.81334C10.447 2.90709 10.4996 3.03417 10.4996 3.16667C10.4996 3.29917 10.447 3.42626 10.3533 3.52001L5.87334 8.00001L10.3533 12.48C10.4025 12.5258 10.4419 12.581 10.4692 12.6423C10.4965 12.7036 10.5112 12.7699 10.5124 12.837C10.5136 12.9041 10.5012 12.9708 10.4761 13.0331C10.4509 13.0953 10.4135 13.1519 10.366 13.1994C10.3186 13.2468 10.262 13.2843 10.1997 13.3094C10.1375 13.3346 10.0708 13.3469 10.0037 13.3457C9.93652 13.3446 9.87032 13.3299 9.80898 13.3025C9.74765 13.2752 9.69245 13.2358 9.64667 13.1867L4.81334 8.35334C4.71971 8.25959 4.66711 8.13251 4.66711 8.00001C4.66711 7.86751 4.71971 7.74042 4.81334 7.64667L9.64667 2.81334C9.74042 2.71971 9.86751 2.66711 10 2.66711C10.1325 2.66711 10.2596 2.71971 10.3533 2.81334Z' fill='white'/%3e%3c/g%3e%3c/svg%3e";var Ai=({route:e,isActive:r,isListOpen:t,handleClick:n,isSubmenu:a})=>i(Mi,{children:i(Vi,Object.assign({sx:{padding:0,margin:0}},{children:i(Li,Object.assign({disablePadding:!0,onClick:n},{children:l(ki,Object.assign({className:cr({active:r,main:e.main}),sx:{justifyContent:"space-between"}},{children:[i(Ni,{primary:e.name,className:cr({main:e.main}),sx:a?{}:{display:"none"}}),e.name,i(q,{component:"img",src:Pi,mr:3,sx:{transition:"transform .3s",transform:`rotate(${t?0:"-90deg"})`}})]}))}))}))});function qi({route:e,isActive:r,isListOpen:t,handleClick:n,isSubmenu:a}){const{collapsed:o}=Ei();return(null==e?void 0:e.link)?i(Li,Object.assign({disablePadding:!0,onClick:n},{children:l(ki,Object.assign({className:cr({active:r,main:e.main,collapsed:o})},{children:[e.icon&&i(Ri,{children:e.icon}),i(Ni,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:cr({collapsed:o,main:e.main}),sx:o&&!a?{display:"none"}:{}}),i(q,{component:"img",src:Pi,mr:3,sx:{transition:"transform .3s",transform:`rotate(${t?"-90deg":0})`}})]}))})):(null==e?void 0:e.rootLink)?i(Ai,{route:e,handleClick:n,isListOpen:t}):i(Mi,{children:e.name})}const $i=({route:e,isSubmenu:r})=>{var t,n,o;const s=re(),{collapsed:c,toggleRootElementLink:d}=Ei(),[u,p]=g(!1),[b,v]=g("true"===localStorage.getItem(`${e.name.toLowerCase()}_collapsed`)),y=f((()=>!(!e.link&&!e.rootLink)&&s.pathname.startsWith(e.link||e.rootLink)),[s.pathname,e]),C=h((()=>{e&&e.rootLink&&(d(e.name,b),v(!b))}),[b,e,d]);return m((()=>{p(y)}),[y]),(null==e?void 0:e.rootLink)&&(null===(t=e.children)||void 0===t?void 0:t.length)&&(!c||c&&r)?l(a,{children:[i(qi,{route:e,isActive:y,handleClick:C,isListOpen:b,isSubmenu:r}),i(Or,Object.assign({in:!b,timeout:"auto"},{children:i(Ii,{children:e.children.map((e=>i($i,{route:e,isSubmenu:r},e.name)))})}))]}):(null===(n=e.children)||void 0===n?void 0:n.length)&&(!c||c&&r)?l(a,{children:[i(qi,{route:e,isActive:y,handleClick:()=>{p(!u)},isListOpen:u||!e.link,isSubmenu:r}),i(Or,Object.assign({in:u||!e.link,timeout:"auto"},{children:i(Ii,{children:null===(o=e.children)||void 0===o?void 0:o.map(((e,t)=>i($i,{route:e,isSubmenu:r},e.name)))})}))]}):i(Di,{route:e,isActive:y,isSubmenu:r})};var zi=$i;const Bi=({src:e,alt:r})=>i(q,Object.assign({sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"}},{children:i("img",{src:e,alt:r})}));var Hi=({title:e,routes:r,id:t,logo:n,collapsedLogo:a,footer:o,collapsedFooter:s})=>{const{collapsed:c,toggleCollapse:d}=Ei();return l(Ti,{children:[i(Fi,Object.assign({className:cr("button-collapse",{collapsed:c}),onClick:d},{children:i("img",{src:"data:image/svg+xml,%3csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6.47054 0.861939C6.59552 0.986958 6.66573 1.1565 6.66573 1.33327C6.66573 1.51005 6.59552 1.67959 6.47054 1.80461L2.27521 5.99994L6.47054 10.1953C6.59198 10.321 6.65917 10.4894 6.65766 10.6642C6.65614 10.839 6.58602 11.0062 6.46242 11.1298C6.33881 11.2534 6.1716 11.3235 5.99681 11.3251C5.82201 11.3266 5.65361 11.2594 5.52787 11.1379L0.861207 6.47127C0.736226 6.34625 0.666016 6.17672 0.666016 5.99994C0.666016 5.82316 0.736226 5.65362 0.861207 5.52861L5.52787 0.861939C5.65289 0.736958 5.82243 0.666748 5.99921 0.666748C6.17598 0.666748 6.34552 0.736958 6.47054 0.861939V0.861939Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:"collapse"})})),l(Si,Object.assign({variant:"permanent",anchor:"left",className:cr({collapsed:c}),id:t},{children:[(!!e||!!n)&&i(wi,Object.assign({className:cr({collapsed:c}),"data-title":e.substring(0,1)},{children:l(q,Object.assign({display:"flex",flexDirection:"column"},{children:[!!e&&i(q,Object.assign({component:"span"},{children:e})),!!n&&i(q,{component:"img",src:c?a:n,alt:"Lending Hub KZ"})]}))})),l(q,Object.assign({height:""+(n||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between"},{children:[i(Vi,Object.assign({sx:{overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{background:"rgba(196, 196, 196, 0.8)",borderRadius:"16px",backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"}}},{children:r.map((e=>i(zi,{route:e},e.name)))})),o&&i(q,Object.assign({borderTop:"1px solid #FFFFFF1F"},{children:c?s:o}))]}))]}))]})};const _i=({routes:e,theme:r=pt,title:t="",id:a,logo:o,collapsedLogo:s,footer:c,collapsedFooter:d})=>l(n,Object.assign({theme:r},{children:[i(ur,{}),i(ji,{children:i(Hi,{title:t,routes:e,id:a,logo:o,collapsedLogo:s,footer:c,collapsedFooter:d})})]})),Wi=({children:e,toolbar:r,contentSx:t,sx:n})=>l(q,Object.assign({component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},n)},{children:[i(yr,Object.assign({sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"}},{children:r})),i(q,Object.assign({sx:Object.assign(Object.assign({},t),{height:"calc(100vh - 56px)",overflow:"scroll"})},{children:i(E,Object.assign({fallback:i(Lr,{})},{children:null!=e?e:i(ie,{})}))}))]})),Ji=t(te)((()=>({textDecoration:"none",color:"inherit"}))),Gi=({crumbs:e})=>i(xr,Object.assign({separator:i(Er,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}}},{children:e.map(((e,r)=>e.link?i(Ji,Object.assign({to:e.link,className:"breadcrumb"},{children:e.title}),r):i($,Object.assign({className:"breadcrumb"},{children:e.title}),r)))})),Yi=({children:e})=>{const[r,t]=g(!1),n=h((e=>{t((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{t((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return i(Q,Object.assign({title:e,arrow:!0,disableHoverListener:!r},{children:i("div",Object.assign({ref:n,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:e}))}))};export{kr as AlertDialog,Yr as BackButton,Gi as Breadcrumbs,Wi as ContentLayout,Zr as ControlAceEditor,Pt as ControlArrayInput,_r as ControlAutocomplete,zr as ControlCheckbox,Nt as ControlDate,Ft as ControlDateTime,Ar as ControlDebouncedInput,Fr as ControlInput,Lt as ControlNumberInput,At as ControlPeriodInput,qt as ControlPhoneInput,Jr as ControlQueryAutocomplete,Br as ControlRadio,$r as ControlSelect,kt as ControlSwitch,Dt as ControlTime,Gr as CopyButton,ri as CreateDefinition,Xn as CreatePropertiesList,ei as CreatePropertiesListContext,Zn as CreatePropertyFormFields,Tr as DATE_DEFAULT_FORMAT,wr as DATE_TIME_DEFAULT_FORMAT,Ir as DEFAULT_DATE_VALIDATION_ERROR_TEXT,Vt as DEFAULT_ERROR_TEXT,Nr as DEFAULT_REQUIRED_ERROR_TEXT,pi as DefinitionFiller,fi as DefinitionValueView,gn as InfoItem,it as JsonModalView,Oi as JsonPathPicker,nt as JsonView,Lr as Loader,Bi as MenuIcon,ui as MultiplePropertyFiller,Yi as OverflowTip,qr as PopupIconComponent,ci as PropertyFiller,jr as PropertyType,In as PropertyValueField,Vr as RoundingMode,mn as RouteTabs,_i as Sidebar,dn as SimpleTable,vi as Status,yn as StepperView,Sr as TIME_DEFAULT_FORMAT,pn as TabPanel,Qt as Table,en as TableAction,un as TableActionCell,si as ViewPropertiesList,oi as ViewProperty,Xr as capitalize,tt as deepParseJson,Rr as defaultDefinitionArrayValue,Mr as defaultDefinitionObjectValue,gt as digitsOnly,ht as floatsOnly,Ot as formatDefinitionData,mt as formatTableRowValue,jt as getDemPropertyDateFormat,Tt as getEntityStarterValue,et as getJsonStringValue,St as getMultiplePropertyFillOptions,wt as getSinglePropertyFillOptions,bt as isDateType,ft as isExpression,yt as isPropertyValueEmpty,vt as numberFormat,xt as propertiesArrayToObject,Et as propertiesObjectToArray,Kr as removeArrayItem,rt as safeParseJson,Qr as sortArrayOfObjects,pt as theme,Dr as useDebounce,Pr as useToggle,Ur as validateJson};
|
package/package.json
CHANGED
@@ -105,6 +105,13 @@ declare const tableThemeOptions: {
|
|
105
105
|
width: string;
|
106
106
|
color: string;
|
107
107
|
border: string;
|
108
|
+
'& .MuiDataGrid-actionsCell': {
|
109
|
+
flexWrap: string;
|
110
|
+
width: string;
|
111
|
+
'& > button[aria-label="more"]': {
|
112
|
+
marginLeft: string;
|
113
|
+
};
|
114
|
+
};
|
108
115
|
};
|
109
116
|
columnHeaders: {
|
110
117
|
backgroundColor: string;
|
@@ -145,13 +152,6 @@ declare const tableThemeOptions: {
|
|
145
152
|
outline: string;
|
146
153
|
};
|
147
154
|
};
|
148
|
-
actionsCell: {
|
149
|
-
flexWrap: string;
|
150
|
-
width: string;
|
151
|
-
'& > button[aria-label="more"]': {
|
152
|
-
marginLeft: string;
|
153
|
-
};
|
154
|
-
};
|
155
155
|
};
|
156
156
|
};
|
157
157
|
};
|