moorr-react-mui 0.3.29 → 0.3.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.css +1 -1
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/index.css CHANGED
@@ -9,7 +9,7 @@
9
9
  .single-tile-component{display:block;width:100%;height:100%;border-radius:0.5rem;}.single-tile-component>.graphing-tile-controls-container.single-tile{display:block;width:100%;height:100%;}.single-tile-component>.graphing-tile-controls-container.single-tile>.graphing-tile-control-container{display:flex;width:100%;height:100%;flex-wrap:wrap;align-content:center;justify-content:center;}
10
10
  .vertical-tile-component{display:block;width:100%;height:100%;border-radius:0.5rem;}.vertical-tile-component>.graphing-tile-controls-container.vertical-tile{display:flex;width:100%;height:100%;flex-direction:column;overflow-x:hidden;overflow-y:auto;justify-content:space-between;}
11
11
  .moorr-modal-container > .moorr-modal-content-container{padding:0;display:flex;flex-direction:column;}.moorr-modal-container > .moorr-modal-content-container:focus-visible{border:none;outline:none;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e3e3e3;border-radius:5px 5px 0 0;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header > .moorr-modal-header-color-bar{width:0.25rem;height:100%;background-color:#aeaeae;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header > h6{padding:1rem;flex-grow:1;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body{display:block;flex-grow:1;overflow-y:auto;padding:1rem;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body:last-child{border-radius:0 0 5px 5px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar{width:6px;height:6px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-thumb{background-color:#a98bb3;border-radius:6px;transition:background-color 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-thumb:hover{background-color:rgb(118,70,134);}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-track{background:rgba(118,70,134,0.15);border-radius:6px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:rgba(0,0,0,0.23);}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:var(--primary-color);}.moorr-modal-container.moorr-slide-modal{align-items:flex-start;justify-content:flex-end;}.moorr-modal-container.moorr-slide-modal > .moorr-modal-content-container{height:100%;}.moorr-modal-container .MuiButton-root.MuiButton-text{font-family:"Poppins";font-size:0.9em;}
12
- .moorr-modal-container{width:100%;height:100%;}.moorr-modal-container + .moorr-modal-container.moorr-fade-modal{opacity:1;transition:opacity 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-fade-modal{opacity:0;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-slide-modal > div:first-child{opacity:0!important;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-slide-modal > .moorr-modal-content-container{transform:translate(100%,0px)!important;}.moorr-modal-container > .moorr-modal-body{padding:1rem;flex-grow:1;overflow:auto;}.moorr-modal-container > .moorr-modal-body:last-child{border-radius:0 0 5px 5px;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar{width:6px;height:6px;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-thumb{background-color:#a98bb3;border-radius:6px;transition:background-color 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-thumb:hover{background:rgb(118,70,134);}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-track{background:rgba(118,70,134,0.15);border-radius:6px;}.moorr-modal-container > .moorr-modal-body .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:rgba(0,0,0,0.23);}.moorr-modal-container > .moorr-modal-body input[text] + .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:var(--primary-color);}.moorr-modal-container > .moorr-modal-header{padding:1rem;border-radius:5px 5px 0 0;}.moorr-modal-container > .moorr-modal-header > .tabs{margin-bottom:-1rem;}.moorr-modal-container > .moorr-modal-footer{display:flex;justify-content:space-between;flex-direction:row;padding:1rem;}.moorr-modal-container > .moorr-modal-footer > .left-buttons{display:flex;justify-content:flex-start;flex-direction:row;}.moorr-modal-container > .moorr-modal-footer > .status-message{flex-grow:1;}.moorr-modal-container > .moorr-modal-footer > .right-buttons{display:flex;justify-content:flex-end;flex-direction:row;}.moorr-modal-container > .moorr-modal-footer > .left-buttons button + button,.moorr-modal-container > .moorr-modal-footer > .right-buttons button + button{margin-left:0.5rem;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained{display:flex;justify-content:center;align-items:center;padding:12px 15px;gap:10px;border-radius:100px;width:110px;height:33px;font-family:"Poppins";font-style:normal;font-weight:400;font-size:14px;line-height:14px;text-align:center;border:none;text-transform:capitalize;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained.MuiButton-containedSecondary{background:#d4c5d9;color:#541868;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained.MuiButton-containedPrimary{background:#541868;color:#ffffff;}
12
+ .moorr-modal-container{width:100%;height:100%;}.moorr-modal-container + .moorr-modal-container.moorr-fade-modal{opacity:1;transition:opacity 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-fade-modal{opacity:0;}.moorr-modal-container + .moorr-modal-container.moorr-fade-modal > .moorr-modal-content-container{transition:opacity 225ms cubic-bezier(0.4,0,0.2,1),width 225ms cubic-bezier(0.4,0,0.2,1),height 225ms cubic-bezier(0.4,0,0.2,1),margin 225ms cubic-bezier(0.4,0,0.2,1)!important;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-slide-modal > div:first-child{opacity:0!important;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-slide-modal > .moorr-modal-content-container{transform:translate(100%,0px)!important;}.moorr-modal-container > .moorr-modal-body{padding:1rem;flex-grow:1;overflow:auto;}.moorr-modal-container > .moorr-modal-body:last-child{border-radius:0 0 5px 5px;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar{width:6px;height:6px;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-thumb{background-color:#a98bb3;border-radius:6px;transition:background-color 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-thumb:hover{background:rgb(118,70,134);}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-track{background:rgba(118,70,134,0.15);border-radius:6px;}.moorr-modal-container > .moorr-modal-body .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:rgba(0,0,0,0.23);}.moorr-modal-container > .moorr-modal-body input[text] + .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:var(--primary-color);}.moorr-modal-container > .moorr-modal-header{padding:1rem;border-radius:5px 5px 0 0;}.moorr-modal-container > .moorr-modal-header > .tabs{margin-bottom:-1rem;}.moorr-modal-container > .moorr-modal-footer{display:flex;justify-content:space-between;flex-direction:row;padding:1rem;}.moorr-modal-container > .moorr-modal-footer > .left-buttons{display:flex;justify-content:flex-start;flex-direction:row;}.moorr-modal-container > .moorr-modal-footer > .status-message{flex-grow:1;}.moorr-modal-container > .moorr-modal-footer > .right-buttons{display:flex;justify-content:flex-end;flex-direction:row;}.moorr-modal-container > .moorr-modal-footer > .left-buttons button + button,.moorr-modal-container > .moorr-modal-footer > .right-buttons button + button{margin-left:0.5rem;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained{display:flex;justify-content:center;align-items:center;padding:12px 15px;gap:10px;border-radius:100px;width:110px;height:33px;font-family:"Poppins";font-style:normal;font-weight:400;font-size:14px;line-height:14px;text-align:center;border:none;text-transform:capitalize;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained.MuiButton-containedSecondary{background:#d4c5d9;color:#541868;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained.MuiButton-containedPrimary{background:#541868;color:#ffffff;}
13
13
  .moorr-modal-container.alert-modal{padding:18px;}.moorr-modal-container.alert-modal > .moorr-modal-header{padding:0;}.moorr-modal-container.alert-modal > .moorr-modal-body{padding:0;}.moorr-modal-container.alert-modal > .moorr-modal-footer{padding:0;}.moorr-modal-container.alert-modal > .moorr-modal-footer > .status-message{display:flex;justify-content:center;}
14
14
  .moorr-modal-container.confirm-modal{padding:18px;}.moorr-modal-container.confirm-modal > .moorr-modal-header{padding:0;}.moorr-modal-container.confirm-modal > .moorr-modal-body{padding:0;}.moorr-modal-container.confirm-modal > .moorr-modal-footer{padding:0;}
15
15
  .moorr-modal-container.opti-info-modal{padding:0px;}.moorr-modal-container.opti-info-modal > .moorr-modal-header{padding:0;}.moorr-modal-container.opti-info-modal > .moorr-modal-body{padding:0;}.moorr-modal-container.opti-info-modal > .moorr-modal-body > div > div > .opti-info-modal-buttons > button{border-radius:48px!important;}.moorr-modal-container.opti-info-modal > .moorr-modal-body > div > div > .opti-info-modal-buttons > .opti-info-modal-button-left{border-radius:48px!important;color:white;background-color:#a98bb3;font-size:12px;text-transform:capitalize;}.moorr-modal-container.opti-info-modal > .moorr-modal-body > div > div > .opti-info-modal-buttons > .opti-info-modal-button-right{border-radius:48px!important;color:white;background-color:#541868;font-size:12px;text-transform:capitalize;}.moorr-modal-container.opti-info-modal > .moorr-modal-footer{padding:0;}
package/index.js CHANGED
@@ -1 +1 @@
1
- import e,{forwardRef as t,useMemo as n,useCallback as o,createContext as r,useContext as i,useState as a,useRef as l,useEffect as s,useImperativeHandle as d}from"react";import c from"@mui/material/Button";import{useMediaQuery as u,Typography as m,SpeedDial as p,Box as h,SpeedDialIcon as g,SpeedDialAction as v,Slide as f,Icon as b,IconButton as y,Button as x}from"@mui/material";import{integers as E,utils as w,dates as M,decimals as C,strings as k}from"moorr-common";import T from"@mui/material/IconButton";import F from"@material-ui/core/MenuItem";import{makeStyles as N,createStyles as S,withStyles as O,StylesProvider as D}from"@material-ui/core/styles";import P from"@material-ui/core/TextField";import{StylesProvider as I,Modal as R,Backdrop as V,Fade as A}from"@material-ui/core";import{createGenerateClassName as L,StylesProvider as U}from"@material-ui/styles";import{v4 as j}from"uuid";import B,{Responsive as $}from"react-grid-layout";import z from"@mui/material/Accordion";import H from"@mui/material/AccordionSummary";import G from"@mui/material/AccordionDetails";import W from"@mui/icons-material/ExpandMore";import q from"react-dom";import{toast as K}from"react-toastify";import _ from"@mui/icons-material/Cancel";import Y from"@mui/icons-material/Close";import X from"@mui/icons-material/CheckCircle";import Z from"@mui/material/Box";import J from"@mui/material/Fade";import Q from"@mui/material/Slide";const ee=({type:t,label:n})=>(t||(t="button"),e.createElement("button",{type:t,className:"moorr-button"},e.createElement("span",null,n)));function te(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function ne(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((o=o.apply(e,t||[])).next())}))}const oe=t(((t,o)=>{var{style:r={},handleClick:i,label:a,disabled:l}=t,s=te(t,["style","handleClick","label","disabled"]);const d=u("(max-width: 600px)"),m=n((()=>d?"8rem":"172px"),[d]);return e.createElement(c,Object.assign({},s,{ref:o,disabled:l,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!l&&{backgroundColor:"#541868"}),{color:"#FFFFFF",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),r),onClick:i,variant:"contained"}),a)})),re=t(((t,r)=>{var{sx:i,item:a,label:l,qty:s,disabled:d,highlight:u,onSelectItem:p}=t,h=te(t,["sx","item","label","qty","disabled","highlight","onSelectItem"]);const g=n((()=>({width:"27px",height:"27px",color:"#FFFFFF",flexShrink:0})),[]),v=n((()=>{const e=Object.assign(Object.assign({},i),{flexGrow:1,fontFamily:"Poppins",fontSize:"14px",fontWeight:400,lineHeight:"9px",minHeight:"42px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none",gap:"0.5rem","&:hover > button":{opacity:1}});return s>0?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#FBFBFD",borderColor:!0===u?"#541868":"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[s,i]),f=o((e=>ne(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),w.isFunction(p)&&s<=0&&(yield Promise.all([p(a,1)]))}))),[s,p]),b=o((()=>!E.isValid(s)||s<=0?null:e.createElement(T,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#E37D7D",opacity:0,"&:hover":{backgroundColor:"#E37D7D"},"&:active":{backgroundColor:"#E37D7D"}}),onClick:()=>p&&p(a,Math.max(0,s-1))},"-")),[d,g,s,p]),y=o((()=>!E.isValid(s)||s<=0?null:e.createElement(T,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#541868",opacity:0,"&:hover":{backgroundColor:"#541868"},"&:active":{backgroundColor:"#541868"}}),onClick:()=>p&&p(a,s+1)},"+")),[d,g,s,p]),x=o((()=>{let t,n;return!E.isValid(s)||s<=0?(t=1,n=0):(t=`${s}`,n=1),e.createElement(m,{variant:"body1",component:"span",sx:{color:"#541868",fontWeight:700,fontSize:"14px",lineHeight:"20px",flexShrink:0,opacity:n}},t)}),[s]);return e.createElement(c,Object.assign({},h,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,disabled:d,sx:v,onClick:f}),b(),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=l?l:a),y(),x())})),ie=t(((t,o)=>{var{style:r={},handleClick:i,label:a,disabled:l}=t,s=te(t,["style","handleClick","label","disabled"]);const d=u("(max-width: 600px)"),m=n((()=>d?"8rem":"172px"),[d]);return e.createElement(c,Object.assign({},s,{ref:o,disabled:l,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!l&&{backgroundColor:"#D4C5D9"}),{color:"#541868",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),r),onClick:i,variant:"contained"}),a)})),ae=t(((t,r)=>{var{sx:i,item:a,label:l,itemSelected:s,onSelectItem:d}=t,u=te(t,["sx","item","label","itemSelected","onSelectItem"]);const p=n((()=>{const e=Object.assign(Object.assign({},i),{flexGrow:1,fontFamily:"Poppins",fontSize:"13px",fontWeight:400,lineHeight:"18px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none"});return s?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#fbfbfd",borderColor:"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[s,i]),h=o((e=>ne(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),w.isFunction(d)&&(yield Promise.all([d(a)]))}))),[d]);return e.createElement(c,Object.assign({},u,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:p,onClick:h}),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=l?l:a))})),le=e=>({root:{"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{},"&$checked":{color:"var(--primary-color)"},"& .vldt-MuiSelect-select.vldt-MuiSelect-select":{color:"var(--grey-color-2)"}},disabled:{},focused:{},error:{},notchedOutline:{},checked:{},notchedOutlineMBRequired:{flex:3,borderColor:"blue",borderWidth:2},fieldSetMBRequired:{"& fieldset":{flex:3,borderColor:"blue",borderWidth:2}},fieldSetErrorField:{"& fieldset":{borderColor:"var(--error-color)"}},blue:{color:"blue"}});N(le);const se=N((()=>S({root:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"}},label:{flex:2},field:{flex:3},required:{color:"red"},menuItem:{color:"var(--grey-color-2)","&:hover":{backgroundColor:"var(--primary-color-scale-25)",color:"var(--grey-color-2)"}},menuItemSelected:{color:"var(--grey-color-2)"},mandatory:{border:"red 2px solid",borderRadius:"4px"}})));var de=O(le)((({handleChange:t,value:n,disabled:o=!1,name:r,className:i,classes:a,size:l,menuItemLabel:s,options:d,labelPlacement:c="start",label:u,required:m=!1,isMBRequiredField:p,fullWidth:h,selectIconComponent:g})=>{const{root:v,focused:f,error:b,notchedOutline:y,notchedOutlineMBRequired:x}=a,E=se();let w;return g&&(w={IconComponent:g}),e.createElement(P,{fullWidth:!1!==h,id:"outlined-basic",variant:"outlined",value:n,onChange:t,disabled:o,name:r,className:[i].join(" "),InputProps:{classes:{root:v,focused:f,error:b,notchedOutline:!p||n&&0!==(null==n?void 0:n.length)?!m||n&&0!==(null==n?void 0:n.length)?y:E.mandatory:x}},color:"primary",size:l||"small",select:!0,SelectProps:w,defaultValue:""},e.createElement(F,{value:"",disabled:!0},e.createElement("em",null,s)),d&&d.map(((t,n)=>"-separator-"===t?e.createElement(F,{key:`separator-${n}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(F,{key:`menu-item-${n}-${t.value||t}`,value:t.value||t},t.label||t))))}));const ce={};function ue(e,t){e&&t&&(ce[e]=t)}const me=({className:t,icon:n,width:o,height:r,fill:i,stroke:a,accent:l,dropShadow:s})=>{if(w.isNullOrUndefined(n))return null;const d=ce[n]||null;return d?e.createElement(d,{className:t,fill:i,width:o,height:r,stroke:a,accent:l,dropShadow:s}):null},pe={};var he=({stylePrefix:t,children:n})=>{let o;if(t)o=pe[t]?pe[t]:pe[t]=L({seed:t});else{const e=`MoorrStylesProvider-${j()}-`;o=L({seed:e})}return e.createElement(U,{generateClassName:o,injectFirst:!0},e.createElement(I,{generateClassName:o,injectFirst:!0},e.createElement(D,{generateClassName:o},n)))};const ge=r({});function ve(){return i(ge)}const fe={};function be(e,t){e&&t&&(fe[e]=t)}const ye=({graphingTile:t,graphingTileIndex:n})=>{var o;if(!(null===(o=null==t?void 0:t.tile)||void 0===o?void 0:o.tileType))return null;const r=fe[t.tile.tileType]||null;return r?e.createElement(r,{graphingTile:t,graphingTileIndex:n}):null},xe=[20,20],Ee={lg:600,sm:0},we={lg:8,sm:2},Me=({tilePrefix:t,responsive:n,columns:o,containerPadding:r,referenceMargin:i,referenceWidth:d,graphingTiles:c})=>{const u=ve(),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a(null),x=l(null),E=()=>{const e=(null==x?void 0:x.current)?(null==x?void 0:x.current).getBoundingClientRect().width:null;y(e);const t=T(e);p(t)};let M;const C=e=>{E(),clearTimeout(M),M=setTimeout((()=>{E()}),300)};s((()=>{E()}),[x]),s((()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)})),[]),s((()=>{if(n){if(!Array.isArray(c)||0===c.length)return void f({lg:[]});const e=c.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`})));f({lg:e})}else{if(!Array.isArray(c)||0===c.length)return void g([]);g(c.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`,static:!0}))))}}),[c]);const k=()=>null==c?void 0:c.map(((n,o)=>{if(!n.tile||!n.visible)return null;if(w.isFunction(u.isTileVisible)&&n.tile.id&&!u.isTileVisible(n.tile.id))return null;let r="graphing-tile-container";n.tile.id&&(r+=` ${n.tile.id}`),!1!==n.border&&(r+=" bordered"),n.autoHeight&&(r+=" auto-height");const i=`${t?t+"_":""}tile_${o}`;return e.createElement("div",{className:r,key:i},e.createElement(ye,{graphingTile:n,graphingTileIndex:o}))})),T=e=>{if(!i||isNaN(i)||i<=0||!d||isNaN(d)||d<=0||null==e)return xe;const t=e/d*i;return[t,t]};return e.createElement("div",{ref:x,className:"graphing-tiles-container"},(()=>{if(!b||!m)return null;if(!1!==n){if(!v)return null;const t=[r||0,0];return e.createElement($,{width:b,breakpoints:Ee,cols:o||we,rowHeight:1,layouts:v,containerPadding:t,margin:m,isDraggable:!1},k())}return h?e.createElement(B,{width:b,cols:9,rowHeight:50,margin:m,isDraggable:!1,layout:h},k()):null})())},Ce={};function ke(e,t){Ce[e]=t}function Te(e){const t=Ce[null==e?void 0:e.tileType];return t?new t(e):null}function Fe(e){const t=[];return e.forEach((e=>{const n=Te(e);n&&t.push(n)})),t}class Ne{constructor(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h,this.border=!0===e.border,this.background=e.background||null,this.autoHeight=!0===e.autoHeight,this.tile=Te(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class Se{constructor(e){this.title=e.title||"",this.infoIconUrl=e.infoUrl,this.infoIconHref=e.infoHref,this.responsive=!1!==e.responsive,this.columns=e.columns||{lg:8,sm:2},this.containerPadding=e.containerPadding||0,this.referenceMargin=e.referenceMargin||null,this.referenceWidth=e.referenceWidth||null,this.tiles=[],Array.isArray(e.tiles)&&e.tiles.forEach((e=>{this.tiles.push(new Ne(e))}))}}const Oe={};function De(e,t){Oe[e]=t}function Pe(e){const t=Oe[null==e?void 0:e.controlType];return t?new t(e):null}function Ie(e){const t=[];return e.forEach((e=>{const n=Pe(e);n&&t.push(n)})),t}class Re{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class Ve extends Re{constructor(e){super(e),this.inputLabel=e.inputLabel||"",this.readOnly=!0===e.readOnly,this.readOnlyBorderless=!0===e.readOnlyBorderless,this.hasAsAtDate=!1===e.hasAsAtDate||!0===e.hasAsAtDate?e.hasAsAtDate:null,this.staticAsAtDate=!0===e.staticAsAtDate,this.validationSchemaPath=(w.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>w.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class Ae{constructor(e){this.border=e.border,this.background=e.background||null,this.control=Pe(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class Le{constructor(e){this.label=e.label||"",this.value=e.value||"",this.icon=e.icon||"",this.accent=e.accent||""}}class Ue{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))})),this.add=!0===e.add,this.edit=!0===e.edit,this.addActions=[],Array.isArray(e.addActions)&&e.addActions.forEach((e=>{this.addActions.push(new Le(e))}))}}class je{constructor(e){this.id=e.id,this.tileType=e.tileType}}class Be extends je{constructor(e){super(e),this.control=new Ae(e.control)}}class $e extends je{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))}))}}class ze extends je{constructor(e){super(e),w.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new Ue(e))):this.formGroups=[]}}ke("form-groups-tile",ze);class He extends $e{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}ke("horizontal-tile",He);class Ge extends $e{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new Se(n))}}}ke("selectable-states-tile",Ge);class We extends je{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))}))}}ke("simple-form-tile",We);class qe extends Be{constructor(e){super(e)}}ke("single-tile",qe);class Ke extends $e{constructor(e){super(e)}}ke("vertical-tile",Ke);const _e=(e,t,n)=>{s((()=>{const n=document.querySelector("#react-root");return null==n||n.addEventListener(e,t),()=>{null==n||n.removeEventListener(e,t)}}),null!=n?n:[t])},Ye=(e,t)=>{const n=document.querySelector("#react-root");null==n||n.dispatchEvent(new CustomEvent(e,{detail:null!=t?t:{}}))},Xe=({})=>{const{settings:t,handleUIReady:n}=ve(),[r,i]=a(null),[l,d]=a([]),[c,u]=a(!1);s((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{u(!0),w.isFunction(n)&&n()}),300)}),300)}),[]);const m=o((e=>{var t,n,o,r,i,a,s,c,u,m,p;if(!(null==l?void 0:l.length)||!(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.id))return;const h=l.find((t=>{var n,o;return(null===(n=t.tile)||void 0===n?void 0:n.id)===(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.id)}));if(!h)return;w.isNullOrUndefined(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.x)||(h.x=null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.x),w.isNullOrUndefined(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.y)||(h.y=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.y),w.isNullOrUndefined(null===(a=null==e?void 0:e.detail)||void 0===a?void 0:a.w)||(h.w=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.w),w.isNullOrUndefined(null===(c=null==e?void 0:e.detail)||void 0===c?void 0:c.h)||(h.h=null===(u=null==e?void 0:e.detail)||void 0===u?void 0:u.h),w.isNullOrUndefined(null===(m=null==e?void 0:e.detail)||void 0===m?void 0:m.visible)||(h.visible=null===(p=null==e?void 0:e.detail)||void 0===p?void 0:p.visible);const g=l.map((e=>new Ne(e)));d(g)}),[l]);_e("graphingGrid.updateTile",m),s((()=>{var e;t?(i(new Se(t)),d(null===(e=t.tiles)||void 0===e?void 0:e.map((e=>new Ne(e))))):i(null)}),[t]);const p=()=>(null==t?void 0:t.infoIconUrl)&&t.infoIconHref?e.createElement("a",{className:"information-anchor",href:t.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==t?void 0:t.title,src:null==t?void 0:t.infoIconUrl})):null;if(!r)return null;let h="graphing-grid-container";return c&&(h+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:h},w.isNullOrUndefined(null==t?void 0:t.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==t?void 0:t.title,p()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(Me,{graphingTiles:l,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth})))},Ze={};function Je(e,t){e&&t&&(Ze[e]=t)}const Qe=({graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:r})=>{var i;if(!(null===(i=null==o?void 0:o.control)||void 0===i?void 0:i.controlType))return null;const a=Ze[o.control.controlType]||null;return a?e.createElement(a,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},r)):null},et=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:r})=>{var i,a;let l="graphing-tile-controls-container";return(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)&&(l+=" "+(null===(a=null==t?void 0:t.tile)||void 0===a?void 0:a.tileType)),e.createElement("div",{className:l},null==o?void 0:o.map(((o,i)=>{var a,l;if(!o.control)return null;let s="graphing-tile-control-container";(null===(a=o.control)||void 0===a?void 0:a.controlType)&&(s+=" "+(null===(l=o.control)||void 0===l?void 0:l.controlType)),!1!==o.border&&(s+=" bordered");const d=`control_${n}_${i}`;return e.createElement("div",{className:s,key:d},e.createElement(Qe,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:r}))})))},tt=({className:t,context:n})=>e.createElement(ge.Provider,{value:n},e.createElement("div",{className:t},e.createElement(Xe,null))),nt=({open:t,actions:n,disabled:o,onClick:r})=>e.createElement(p,{ariaLabel:"Add a New Card",direction:"down",open:t,className:t?"add-card-open":void 0,onClick:r,icon:e.createElement(h,{sx:{display:"flex"}},e.createElement(g,{open:t,icon:e.createElement(me,{icon:"add-icon",stroke:t?"#E24242":"#FFFFFF"})})),FabProps:{className:t?"add-card-open":void 0,variant:"extended",disabled:o,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:{background:"transparent",color:"inherit",width:"auto",height:"30px",whiteSpace:"nowrap",boxShadow:"none",textTransform:"inherit","&:hover":{background:"transparent",boxShadow:"none"},"&:active":{background:"transparent",boxShadow:"none"},"&:disabled":{background:"transparent !important"},"& > div":{display:"flex",flexDirection:"row",gap:"1rem",textTransform:"inherit",justifyContent:"center"},"& > div > .MuiTypography-root.MuiTypography-button":{textTransform:"inherit",fontFamily:"Poppins",fontStyle:"normal",fontWeight:400,fontSize:"14px"},"& > div > .MuiSpeedDialIcon-root":{display:"flex",width:"30px",height:"30px",alignItems:"center",justifyContent:"center",backgroundColor:"#541868",transition:"background-color 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",borderRadius:"15px",color:"#FFFFFF"},"& > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#541868"},"& > div > .MuiSpeedDialIcon-root > svg":{transform:"rotate(0deg)",transition:"transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},"&.add-card-open > div > .MuiSpeedDialIcon-root":{backgroundColor:"#FFFFFF",color:"#E24242"},"&.add-card-open > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#FFFFFF",color:"#E24242"},"&.add-card-open > div > .MuiSpeedDialIcon-root > svg":{transform:"rotate(45deg)"},"&:disabled > div > .MuiSpeedDialIcon-root":{backgroundColor:"#DCDCDC",color:"#FFFFFF"},"&:disabled > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#DCDCDC",color:"#FFFFFF"}}},sx:{position:"absolute",width:"30px",zIndex:1,"&.add-card-open":{zIndex:1050},"& > .MuiSpeedDial-actions":{alignSelf:"flex-end",marginRight:"-15px"},"& > .MuiSpeedDial-actions .MuiSpeedDialAction-staticTooltipLabel":{whiteSpace:"nowrap"}}},n),ot=({graphingTile:t,graphingTileIndex:r})=>{const i=null==t?void 0:t.tile;if(!i)return null;const d=ve();return e.createElement("div",{className:"form-groups-tile-component"},!w.isArray(i.formGroups)||i.formGroups.length<0?null:i.formGroups.map(((i,c)=>{const u=l(null),[m,p]=a("normal"),[g,f]=a("form-group-container");s((()=>{M()}),[g,m]);const[b,y]=a(0),[x,E]=a(!0);s((()=>{if(x){const e=u.current;w.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(e.scrollHeight)}),10)}else y(0)}),[x]);const M=e=>{if(x){const e=u.current;w.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(Math.max(e.clientHeight,e.scrollHeight))}),10)}else y(0)},C=o((e=>{""===e.value?(p("add"),E(!0)):(null==d?void 0:d.handleFormGroupAdd)&&w.isFunction(d.handleFormGroupAdd)&&d.handleFormGroupAdd(i,e)}),[i,null==d?void 0:d.handleFormGroupAdd]),k=n((()=>i.addActions&&i.addActions.length?i.addActions.map(((t,n)=>e.createElement(v,{key:n.toString(),icon:e.createElement(me,{icon:t.icon,fill:t.accent,stroke:"#FFFFFF"}),tooltipTitle:e.createElement("span",null,t.label),tooltipOpen:!0,FabProps:{disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0},sx:{"& > .MuiSpeedDialAction-staticTooltipLabel":{background:"#ffffff",color:"#000000",textTransform:"inherit",fontFamily:"Poppins",fontStyle:"normal",fontWeight:400,fontSize:"12px",padding:"0.25rem 0.5rem",cursor:"pointer"},"& > .MuiSpeedDialAction-staticTooltipLabel#AddaNewCard-action-0-label":{marginRight:0},"& > .MuiFab-root":{backgroundColor:"transparent !important",color:"#ffffff",boxShadow:"none",width:"36px !important",height:"36px !important",margin:"0.375rem 1rem 0.375rem 0.25rem","&:hover":{backgroundColor:"transparent !important"},"&:active":{backgroundColor:"transparent !important",boxShadow:"none"},justifyContent:"flex-end !important"}},onClick:()=>C(t)}))):null),[i.addActions,C]),[T,F]=a(!1),N=o((e=>{e.stopPropagation(),F((e=>!e))}),[]),S=o((()=>!0!==i.add||w.isFunction(d.formGroupHasAddMode)&&!d.formGroupHasAddMode(i.id)?null:k?e.createElement(nt,{disabled:"add"==m,open:T,actions:k,onClick:N}):e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:D,disabled:"add"==m},e.createElement(me,{icon:"add-icon",stroke:"#ffffff"}))),[m,d.formGroupHasAddMode,T,k,N]),O=o((()=>!0!==i.edit||w.isFunction(d.formGroupHasEditMode)&&!d.formGroupHasEditMode(i.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-edit-button",onClick:P,disabled:"add"==m},e.createElement(me,{icon:"edit-icon",fill:"#ffffff"}))),[m,d.formGroupHasEditMode]),D=e=>{e.stopPropagation(),p("add"),E(!0)},P=e=>{e.stopPropagation(),(null==d?void 0:d.handleEdit)&&(null==d||d.handleEdit(i))},I=e=>ne(void 0,void 0,void 0,(function*(){w.isFunction(null==d?void 0:d.handleFormGroupCancel)&&(yield Promise.all([null==d?void 0:d.handleFormGroupCancel({formGroup:i})])),p("normal")})),[R,V]=a(!1),A=e=>ne(void 0,void 0,void 0,(function*(){if(w.isFunction(null==d?void 0:d.handleFormGroupSave))try{V(!0);const[e]=yield Promise.all([null==d?void 0:d.handleFormGroupSave({formGroup:i})]);if(!1===e)return}finally{V(!1)}p("normal")}));let L="form-group-container";return w.isFunction(d.isFormGroupVisible)&&(d.isFormGroupVisible(i.id)||(L+=" hidden")),L!==g&&f(L),e.createElement(z,{key:`${i.id}-{${c}}`,className:L,expanded:x,onChange:e=>{"add"!==m&&E((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(H,{className:"form-group-title",expandIcon:"add"!==m?e.createElement(W,null):null},e.createElement("span",{className:"form-group-title-text"},i.title),S(),O()),e.createElement("hr",null),e.createElement(G,{className:"form-group-components"},(()=>{if("add"===m){let t;return w.isFunction(d.renderFormGroup)&&(t=d.renderFormGroup(i,"add")),e.createElement(e.Fragment,null,t,e.createElement("hr",null),e.createElement("div",{className:"form-group-add-mode-buttons"},e.createElement("button",{className:"cancel-button",disabled:R,onClick:I},"Cancel"),e.createElement("button",{className:"save-button",disabled:R,onClick:A},"Create")))}{const n=i.controls;let o,a;if(w.isFunction(d.renderFormGroup)){if(o=d.renderFormGroup(i,"normal"),!w.isNullOrUndefined(o))return o;a=d.renderFormGroup(i,"footer")}return e.createElement(e.Fragment,null,e.createElement(et,{graphingTile:t,graphingTileIndex:r,graphingTileControls:n,ControlProps:{onUIChange:M}}),a)}})()),k&&e.createElement(h,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:T?2:-1,borderRadius:"10px",transition:"opacity 225ms cubic-bezier(0.4, 0, 0.2, 1)",opacity:T?1:0},onClick:()=>F(!1)}))})))};be("form-groups-tile",ot);const rt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const[r,i]=a(null),[l,d]=a(0),[c,u]=a(0),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a([]);s((()=>{let e=[];const t=Math.ceil(o.controls.length/o.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<o.controlsPerPage;e++){const r=n*o.controlsPerPage+e;if(r>=o.controls.length)break;t.controls.push(o.controls[r])}e.push(t)}d(t),u(0),p(null),g(null),f(null),y(e)}),o.controls);const x=e=>{let t=e-1;t<0&&(t=l-1),g(t)},E=e=>{e.stopPropagation(),x(c),f(null),p(null)},w=e=>{e.stopPropagation()},M=e=>{e.stopPropagation()},C=e=>{if(e.stopPropagation(),null!==r)return;const t=c;let n=c-1;n<0&&(n=l-1),p(t),u(n),g(null),f(t);const o=setTimeout((()=>{x(n),f(null),p(null),setTimeout((function(){i(null)}),300)}),300);i(o)},k=e=>{let t=e+1;t>=l&&(t=0),f(t)},T=e=>{e.stopPropagation(),g(null),k(c),p(null)},F=e=>{e.stopPropagation()},N=e=>{e.stopPropagation()},S=e=>{if(e.stopPropagation(),null!==r)return;const t=c;let n=c+1;n>=l&&(n=0),p(t),u(n),g(t),f(null);const o=setTimeout((()=>{g(null),k(n),p(null),setTimeout((function(){i(null)}),300)}),300);i(o)},O={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:O},e.createElement("div",{className:"horizontal-tile-pages-container"},b.map(((o,r)=>{let i="horizontal-tile-page-container";return r===c?i+=" active":r===h?i+=" navigating-from-left":r===v&&(i+=" navigating-from-right"),r===m&&(i+=" previous"),e.createElement("div",{key:`horizontal-tile-page-${r}`,className:i},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:O}),l<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:E,onMouseLeave:w,onMouseDown:M,onClick:C},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.40991 10.643L2.82991 6.05298L7.40991 1.46298L5.99991 0.0529785L-8.80003e-05 6.05298L5.99991 12.053L7.40991 10.643Z",fill:"#828282"}))),e.createElement("button",{type:"button",className:"navigate-button navigate-right-button",onMouseEnter:T,onMouseLeave:F,onMouseDown:N,onClick:S},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.589843 1.46298L5.16984 6.05298L0.589844 10.643L1.99984 12.053L7.99984 6.05298L1.99984 0.0529785L0.589843 1.46298Z",fill:"#828282"}))))),l<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(l).keys()).map((t=>{let n="paginator-anchor";return t===c&&(n+=" active"),e.createElement("a",{key:`horizontal-tile-page-index-${t}`,className:n,onMouseEnter:e=>{e.stopPropagation(),t!==c&&(t<c?(g(t),f(null)):(g(null),f(t)),p(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===c)return;const n=c,o=t;p(n),u(o),n<o?g(n):f(n)}})}))))};be("horizontal-tile",rt);const it=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[o,r]=a(""),[i,l]=a(null),[d,c]=a([]),u=ve();s((()=>{const e=Object.keys(n.states);if(c(e.map((e=>{var t;return{label:null===(t=n.states[e])||void 0===t?void 0:t.title,value:e}}))),e&&e.length>0){const t=e[0];m(t)}else r(""),l(null)}),[n.states]);const m=e=>{r(e),l(n.states[e])};return e.createElement("div",{className:"selectable-states-tile-component"},e.createElement("div",{className:"selectable-states-tile-header"},e.createElement("div",{className:"selected-state-tile-title"},e.createElement("h6",null,null==i?void 0:i.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(de,{options:d,label:"Select",value:o,handleChange:e=>{var t;m(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),(null==u?void 0:u.handleSelectableStatesTileChange)&&(null==u||u.handleSelectableStatesTileChange(e))}}))),e.createElement("div",{className:"selected-state-tile-container"},i?e.createElement(Me,{tilePrefix:o,graphingTiles:i.tiles,responsive:i.responsive,columns:i.columns,containerPadding:i.containerPadding,referenceMargin:i.referenceMargin,referenceWidth:i.referenceWidth}):null))};be("selectable-states-tile",it);const at=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=ve(),i=e=>{w.isFunction(r.handleUIChange)&&r.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!w.isArray(o.controls)||o.controls.length<0)return null;const r=o.controls;return e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r,ControlProps:{onUIChange:i}})})())};be("simple-form-tile",at);const lt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=[o.control],i={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:i},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r}))};be("single-tile",lt);const st=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=o.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r}))};function dt(e,t){const n=ve(),o=null==e?void 0:e.control,[r,i]=a(null);return s((()=>{if(!(o&&(n.data&&n.data[o.dataKey]||t)))return;const e=null!=t?t:n.data[o.dataKey];i(e)}),[o,t,n.data]),{context:n,settings:o,data:r}}be("vertical-tile",st);const ct={};function ut(e,t){ct[e]=t}function mt(e){const t=ct[e];return t?new t:null}function pt(e){const t=[];return e.forEach((e=>{const n=mt(e);n&&t.push(n)})),t}const ht=(e,t,n)=>!(!w.isNullOrUndefined(n)&&""!==(null==n?void 0:n.trim())&&"normal"!==n&&"hover"!==n&&(w.isNullOrUndefined(t)||""===(null==t?void 0:t.trim())))&&(!w.isNullOrUndefined(t)&&""!==(null==t?void 0:t.trim())||!w.isNullOrUndefined(e)&&"warning"!==(null==e?void 0:e.error_0)),gt=(e,t)=>{let n=!1,o=!1;return Object.entries(e).forEach((([e,t])=>{const r=null==t?void 0:t.error;n=n||ht(r),o=o||!0===(null==r?void 0:r.mandatory)})),w.isFunction(t)&&t(n,o),{hasErrors:n,hasMandatoryErrors:o}},vt=(e,t)=>ne(void 0,void 0,void 0,(function*(){var n;const o=(t||{})[e.key];if(!w.isArray(o))return;const r={count:0};return!0===(null===(n=null==e?void 0:e.originalEvent)||void 0===n?void 0:n.noValidate)||o.forEach(((t,n)=>{var o;const i=mt(null!==(o=null==e?void 0:e.validatorType)&&void 0!==o?o:t.type);if(w.isNullOrUndefined(i))return;e.validatorData&&(i.validatorData=e.validatorData);const a=i.validate(t,e.value);r.mandatory=!0===t.mandatory||"AsAtDate"===e.validatorType,r.errors=a,w.isArray(a)&&a.length>0&&a.forEach(((n,o)=>{r[`error_${o}`]=i.getErrorMessage(t,e.control,n),r.count+=1}))})),r})),ft=(e,t,n,o,r)=>ne(void 0,void 0,void 0,(function*(){var i;if(w.isNullOrUndefined(e)||w.isNullOrUndefined(t))return{hasErrors:!1,hasMandatoryErrors:!1};let a;w.isNullOrUndefined(n)?o((e=>(a=Object.assign({},e),e))):a=Object.assign({},n);const l=[];return null===(i=null==e?void 0:e.tiles)||void 0===i||i.forEach((e=>{var n,o,r,i,s;switch(null===(n=null==e?void 0:e.tile)||void 0===n?void 0:n.tileType){case"form-groups-tile":null===(r=null===(o=null==e?void 0:e.tile)||void 0===o?void 0:o.formGroups)||void 0===r||r.forEach((e=>{var n,o;(null===(n=null==e?void 0:e.controls)||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.controls)||void 0===o||o.forEach((e=>{var n,o;if(!(null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey)||(null==e?void 0:e.control.readOnly))return;const r=a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(r.readOnly||r.hidden)return;l.push(ne(void 0,void 0,void 0,(function*(){var n,o;const i=yield vt({originalEvent:null,control:null==e?void 0:e.control,key:null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey,value:null==r?void 0:r.value},t);!w.isNullOrUndefined(i)&&i.count>0&&(a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=i)})))})))}));break;case"simple-form-tile":null===(s=null===(i=null==e?void 0:e.tile)||void 0===i?void 0:i.controls)||void 0===s||s.forEach((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!(null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey)||(null==e?void 0:e.control.readOnly))return;const r=a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(r.readOnly||r.hidden)return;l.push(ne(void 0,void 0,void 0,(function*(){var n,o;const i=yield vt({originalEvent:null,control:null==e?void 0:e.control,key:null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey,value:null==r?void 0:r.value},t);!w.isNullOrUndefined(i)&&i.count>0&&(a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=i)})))}))));break;default:return}})),yield Promise.all(l),o(a),gt(a,r)})),bt=()=>{const[e,t]=a(0),[n,r]=a({});return{updatingCount:e,updatingFlags:n,setUpdating:o((e=>{t((e=>e+1)),r((t=>Object.assign(Object.assign({},t),{[e]:!0})))}),[e,n]),unsetUpdating:o((e=>{t((e=>e-1)),r((t=>Object.assign(Object.assign({},t),{[e]:!1})))}),[e,n])}},yt=(e,t,n,r,i,l)=>{const d=ve(),[c,u]=a(t),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a(null),[x,E]=a(!1),w=o((()=>new Promise((t=>{if(x)return void t(x);const n={};Ye(`graphingForm.validateForm.${e}`,{callback:(e,o)=>{n.hasErrors=!0===(null==n?void 0:n.hasErrors)||e,n.hasMandatoryErrors=1==(null==n?void 0:n.hasMandatoryErrors)||o;const r=!n.hasErrors&&!n.hasMandatoryErrors;r||!0===i||E(!0),t(r)}})}))),[x,e]);s((()=>{if(!n)return;ne(void 0,void 0,void 0,(function*(){yield r(null,t,f,y,null!=l?l:()=>{},n),u(t);const e=t.tiles[0];p(e);const o={};e.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),g(o)}))}),[t,n]);const[M,C]=a(!1),[k,T]=a(!1),F=o(((e,t)=>{const n=!0===t;C(!0===e),T(n)}),[]),[N,S]=a(null),O=o((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!t||!v||!N)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:r,hasMandatoryErrors:i}=yield ft(t,v,null,S,F);return(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.callback)&&(null===(o=null==e?void 0:e.detail)||void 0===o||o.callback(r,i)),{hasErrors:r,hasMandatoryErrors:i}}))),[t,v,N,F]);_e(`graphingForm.validateForm.${e}`,O);const{updatingCount:D,updatingFlags:P,setUpdating:I,unsetUpdating:R}=bt();return{context:d,settings:c,graphingTile:m,graphingControls:h,inputSchemas:v,dropdownValues:b,data:N,setData:S,updatingCount:D,updatingFlags:P,setUpdating:I,unsetUpdating:R,hasErrors:M,hasMandatoryErrors:k,handleSetHasErrors:F,canSubmit:w}};class xt{constructor(){}getErrorMessage(e,t,n){if(w.isNullOrUndefined(n))return n;if(!w.isNullOrUndefined(null==t?void 0:t.validationErrorMessages)&&!w.isNullOrUndefined(t.validationErrorMessages[n])&&w.isString(t.validationErrorMessages[n])&&""!==t.validationErrorMessages[n].trim())return t.validationErrorMessages[n];switch(n){case"mandatory":return"This field is mandatory. Please ensure it is not empty or invalid";case"required":return"This field is required. Please ensure it is not empty or invalid";case"mbRequired":return"warning";case"enum":return w.isArray(null==e?void 0:e.enum)&&e.enum.length>0?`Value must be in this list: ${e.enum.filter((e=>!w.isNullOrUndefined(e)&&""!==e)).join(", ")}`:"Value must be in enum list";case"as-at-future":return"Your current value's as at date must not be in the future"}return n}validate(e,t){const n=this.validateInputValue(e,t);return!0!==(null==e?void 0:e.mbRequired)||this.validateMbRequired(e,t)||n.push("mbRequired"),n}validateInputValue(e,t){const n=[];return!0!==(null==e?void 0:e.mandatory)||this.validateMandatory(e,t)||n.push("mandatory"),!0!==(null==e?void 0:e.required)||this.validateRequired(e,t)||n.push("required"),w.isArray(null==e?void 0:e.enum)&&(null==e?void 0:e.enum.length)>0&&!this.validateEnum(null==e?void 0:e.enum,t)&&n.push("enum"),n}validateMandatory(e,t){return!w.isNullOrUndefined(t)}validateRequired(e,t){return this.validateMandatory(e,t)}validateMbRequired(e,t){return this.validateMandatory(e,t)}validateEnum(e,t){return!(w.isArray(e)&&0!==e.length&&!w.isNullOrUndefined(t))||e.includes(t)}}class Et extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&!!t.formatted}}ut("Address",Et);class wt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);if(n.length>0)return n;if(M.isValid(t)){const e=new Date(t),o=M.todayUtc();e.getTime()>o.getTime()&&n.push("as-at-future")}return n}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&M.isValid(t)}}ut("AsAtDate",wt);class Mt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return t=C.parse(t),C.isValid(e.min)&&!this.validateMin(e.min,t)&&n.push("min"),C.isValid(e.max)&&!this.validateMax(e.max,t)&&n.push("max"),n}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}`;default:return super.getErrorMessage(e,t,n)}}validateMin(e,t){return!C.isValid(e)||!C.isValid(t)||t>=e}validateMax(e,t){return!C.isValid(e)||!C.isValid(t)||t<=e}}ut("Number",Mt);class Ct extends Mt{validateInputValue(e,t){return super.validateInputValue(e,t)}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2)}`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2)}`;default:return super.getErrorMessage(e,t,n)}}}ut("Currency",Ct);class kt extends xt{getErrorMessage(e,t,n){var o,r,i,a;switch(n=super.getErrorMessage(e,t,n)){case"min":if(M.isValid(null===(o=this.validatorData)||void 0===o?void 0:o.min)){const e=M.parse(null===(r=this.validatorData)||void 0===r?void 0:r.min);return`Value cannot be before ${M.format(e,"DD/MM/yyyy")}`}break;case"max":if(M.isValid(null===(i=this.validatorData)||void 0===i?void 0:i.max)){const e=M.parse(null===(a=this.validatorData)||void 0===a?void 0:a.max);return`Value cannot be after ${M.format(e,"DD/MM/yyyy")}`}}return n}validateInputValue(e,t){var n,o,r,i;const a=super.validateInputValue(e,t);if(0===a.length&&M.isValid(t)){const e=M.parse(t);if(M.isValid(null===(n=this.validatorData)||void 0===n?void 0:n.min)){const t=M.parse(null===(o=this.validatorData)||void 0===o?void 0:o.min);(null==t?void 0:t.getTime())>(null==e?void 0:e.getTime())&&a.push("min")}if(M.isValid(null===(r=this.validatorData)||void 0===r?void 0:r.max)){const t=M.parse(null===(i=this.validatorData)||void 0===i?void 0:i.max);(null==t?void 0:t.getTime())<(null==e?void 0:e.getTime())&&a.push("max")}}return a}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&M.isValid(t)}}ut("Date",kt);class Tt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return!w.isNullOrUndefined(e.minLength)&&E.isValid(e.minLength)&&e.minLength>0&&!this.validateMinLength(e.minLength,t)&&n.push("minLength"),!w.isNullOrUndefined(e.maxLength)&&E.isValid(e.maxLength)&&e.maxLength>0&&!this.validateMaxLength(e.maxLength,t)&&n.push("maxLength"),!w.isNullOrUndefined(e.match)&&w.isString(e.match)&&e.match.length>0&&!this.validateMatch(e.match,t)&&n.push("match"),n}getErrorMessage(e,t,n){const o=super.getErrorMessage(e,t,n);switch(o){case"minLength":return`Data not saved. Minimum ${e.minLength} characters are required`;case"maxLength":return`Data not saved. Maximum ${e.maxLength} characters are allowed`;case"match":return"Data not saved. This field contains invalid characters";default:return o}}validateMinLength(e,t){return!(!(!E.isValid(e)||e<=0||w.isNullOrUndefined(t))&&w.isString(t))||t.length>=e}validateMaxLength(e,t){return!(!(!E.isValid(e)||e<=0||w.isNullOrUndefined(t))&&w.isString(t))||t.length<=e}validateMatch(e,t){if(w.isNullOrUndefined(e)||!w.isString(e)||""===e.trim())return!0;if(w.isNullOrUndefined(t)||!w.isString(t)||""===t.trim())return!0;const n=e.match(/(\/?)(.+)\1([a-z]*)/i),o=n[2],r=n[3];return new RegExp(o,r).test(t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(w.isString(t)&&t.length>0&&""!==t.trim())}}ut("String",Tt);class Ft extends Tt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("Notes",Ft);class Nt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("ObjectId",Nt);class St extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("[ObjectId]",St);class Ot extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){var n,o,r;if(!super.validateMandatory(e,t))return!1;switch(null==t?void 0:t.ownershipType){case"Sole":return 1===(null===(n=null==t?void 0:t.owners)||void 0===n?void 0:n.length);case"Joint":return 2===(null===(o=null==t?void 0:t.owners)||void 0===o?void 0:o.length);case"Other":return(null===(r=null==t?void 0:t.owners)||void 0===r?void 0:r.length)>=1}return!1}}ut("Ownership",Ot);class Dt extends Mt{validateInputValue(e,t){return super.validateInputValue(e,t)}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}%`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}%`;default:return super.getErrorMessage(e,t,n)}}}ut("Percentage",Dt);class Pt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("SelectBoolean",Pt);class It extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(w.isString(t)&&t.length>0&&""!==t.trim()&&null!==E.parse(t))}}ut("SelectNumber",It);class Rt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!w.isNullOrUndefined(t)&&""!==t.trim()&&this.validateEnum(e.enum,t)}}ut("Select",Rt);const Vt=(e,t,n)=>{De(e,t),Je(e,n)},At=()=>{const e=Ut.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(q.unmountComponentAtNode(e),e.remove())}),300))};let Lt=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,o)=>{let r,i;"function"==typeof t.onClose&&(r=t.onClose),t.onClose=e=>{r&&r(e),n({dismissed:!1,result:e}),t.showModal=!1,At()},"function"==typeof t.onDismiss&&(i=t.onClose),t.onDismiss=()=>{i&&i(),n({dismissed:!0}),t.showModal=!1,At()},t.showModal=!0;let a=e.createElement(he,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Ut.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),q.render(a,this._container)}))}};const Ut=[],jt={},Bt=N((e=>({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}}))),$t=e=>"number"==typeof e?e+"px":e,zt=t=>{var n,o,r,i,l,d,c,u;const m=Bt(),p={};t.fixedWidth&&(p.width=t.fixedWidth),t.fixedHeight&&(p.height=t.fixedHeight),t.fixedHeight&&(p.height=t.fixedHeight),(null===(n=t.margins)||void 0===n?void 0:n.left)&&(p.marginLeft=$t(null===(o=t.margins)||void 0===o?void 0:o.left)),(null===(r=t.margins)||void 0===r?void 0:r.right)&&(p.marginRight=$t(null===(i=t.margins)||void 0===i?void 0:i.right)),(null===(l=t.margins)||void 0===l?void 0:l.top)&&(p.marginTop=$t(null===(d=t.margins)||void 0===d?void 0:d.top)),(null===(c=t.margins)||void 0===c?void 0:c.bottom)&&(p.marginBottom=$t(null===(u=t.margins)||void 0===u?void 0:u.bottom));let g=m.paper+" moorr-modal-content-container";t.contentClassName&&(g+=" "+t.contentClassName);const[v,b]=a(!1),[y,x]=a(!1);s((()=>{x(!v&&!1!==t.showModal)}),[v,y,t.showModal]);const E=e=>{b(!0),(null==t?void 0:t.onDismiss)&&t.onDismiss(e)};let M=m.modal;switch(M+=" moorr-modal-container",t.effect){case"fade":M+=" moorr-fade-modal";break;case"slide":M+=" moorr-slide-modal"}return v&&(M+=" moorr-modal-closing"),e.createElement(R,{disableEnforceFocus:!0,className:M,open:y,onClose:E,closeAfterTransition:!0,BackdropComponent:V,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),w.isFunction(t.onBackdropClick)?t.onBackdropClick(e):E("backdrop")}}},(()=>{switch(t.effect){case"fade":default:return e.createElement(A,{in:y},e.createElement(h,{className:g,sx:e=>({transition:e.transitions.create(["width","height","margin"],{duration:300,easing:e.transitions.easing.easeOut}),transitionProperty:"width, height, margin"}),style:p},t.children));case"slide":return e.createElement(f,{in:y,direction:"left",timeout:300},e.createElement("div",{className:g},t.children))}})())},Ht=(t,n)=>{switch(t){default:case"info":case"warning":case"error":(t=>{K(t,{icon:e.createElement(_,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(Y,{sx:{color:"#EB5757"}})})})(n);break;case"success":(t=>{K(t,{icon:e.createElement(X,{sx:{color:"#1B5E20"}}),style:{color:"#1B5E20",backgroundColor:"#E8F5E9",border:"2px solid #1B5E20",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(Y,{sx:{color:"#1B5E20"}})})})(n)}},Gt=t=>e.createElement(zt,{effect:"fade",contentClassName:`${t.className}-content-container`,fixedWidth:t.widthValue,fixedHeight:t.heightValue,margins:t.marginValues,showModal:t.showModal,onClose:t.onClose,onDismiss:t.onDismiss,onBackdropClick:t.onBackdropClick},e.createElement("div",{className:`${t.className} moorr-modal-container`},e.createElement("div",{className:"moorr-modal-header"},t.renderHeader),e.createElement("div",{className:"moorr-modal-body"},t.renderBody),!1===t.hasFooter?null:e.createElement("div",{className:"moorr-modal-footer"},e.createElement("div",{className:"left-buttons"},t.renderLeftButtons),e.createElement("div",{className:"status-message"},t.renderStatusMessage),e.createElement("div",{className:"right-buttons"},t.renderRightButtons)))),Wt=t=>{const{className:n,onDismiss:r,showModal:i,onClose:a,icon:l,title:s,body:d,closeLabel:c}=t,u=o((()=>{a(!1)}),[a]);o((()=>{a(!0)}),[a]);const p=o((()=>w.isString(d)?e.createElement(m,{paragraph:!0},d):w.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(w.isString(t)||!w.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):w.isNullOrUndefined(d)?e.createElement(m,{paragraph:!0},"Please alert to continue."):d),[d]),g=o((()=>e.createElement(h,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},p())),[p]),v=o((()=>w.isString(s)||!w.isNullOrUndefined(s)?s:"Alert"),[s]),f=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=l?l:e.createElement(b,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},v()),e.createElement(y,{onClick:u,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"},"data-testid":"dismiss"},e.createElement(Y,{sx:{fontSize:"1rem"}})))),[l,v,u]),x=o((()=>{const t=c||"Dismiss";return e.createElement(oe,{handleClick:u,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[c,u]);return e.createElement(Gt,{className:"alert-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===i,onDismiss:r,onBackdropClick:u,renderHeader:f(),renderBody:g(),renderStatusMessage:x()})};class qt extends Lt{constructor(e){super(e)}getComponent(){return Wt}}jt.alert=qt;const Kt=t=>{const{className:n,onDismiss:r,showModal:i,onClose:a,icon:l,title:s,body:d,cancelLabel:c,confirmLabel:u}=t,p=o((()=>{a(!1)}),[a]),g=o((()=>{a(!0)}),[a]),v=o((()=>w.isString(d)?e.createElement(m,{paragraph:!0},d):w.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(w.isString(t)||!w.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):w.isNullOrUndefined(d)?e.createElement(m,{paragraph:!0},"Please confirm to continue."):d),[d]),f=o((()=>e.createElement(h,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},v())),[v]),x=o((()=>w.isString(s)||!w.isNullOrUndefined(s)?s:"Confirm"),[s]),E=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=l?l:e.createElement(b,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},x()),e.createElement(y,{onClick:p,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"}},e.createElement(Y,{sx:{fontSize:"1rem"},"data-testid":"dismiss"})))),[l,x,p]),M=o((()=>{const t=c||"Cancel";return e.createElement(ie,{handleClick:p,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[c,p]),C=o((()=>{const t=u||"Dismiss";return e.createElement(oe,{handleClick:g,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[u,g]);return e.createElement(Gt,{className:"confirm-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===i,onDismiss:r,onBackdropClick:p,renderHeader:E(),renderBody:f(),renderLeftButtons:M(),renderRightButtons:C()})};class _t extends Lt{constructor(e){super(e)}getComponent(){return Kt}}jt.confirm=_t;const Yt=t=>{const{className:n,header:o,body:r,leftButtonLabel:i,rightButtonLabel:a,hiddenClose:l,width:s}=t,d=e=>{e.stopPropagation(),t.onDismiss()};return e.createElement(Gt,{className:"opti-info-modal"+(n?" "+n:""),widthValue:null!=s?s:"554px",showModal:!0===t.showModal,onDismiss:t.onDismiss,renderBody:e.createElement(h,{sx:{display:"flex",flexDirection:"row",position:"relative"}},e.createElement(h,{sx:{position:"absolute",right:"12px",top:"12px",cursor:"pointer"}},e.createElement("svg",{onClick:t.onDismiss,width:"20",height:"20",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.8564 6.35381L12.2707 10.9395L16.8976 15.5664L15.5609 16.903L10.9341 12.2762L6.36889 16.8414L5.13506 15.6075L9.70023 11.0424L5.07337 6.4155L6.41002 5.07885L11.0369 9.70571L15.6226 5.11998L16.8564 6.35381Z",fill:"#541868"}))),e.createElement(h,{sx:{width:"60px",background:"#541868",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px",flexShrink:0}}),e.createElement(h,{sx:{position:"absolute",top:"11.81px",left:"12px",borderRadius:"50% 50% 0% 50%",padding:"5px",background:"white"}},e.createElement("img",{style:{height:"50px",background:"#66E84B",borderRadius:"50% 50% 0% 50%",padding:"5px"},src:"/assets/img/opti/Opti-Blinked.gif"})),e.createElement(h,{sx:{padding:"1rem 1rem 1rem 1.5rem"}},e.createElement(h,{sx:{color:"#541868",fontSize:"16px",lineHeight:"22.4px",fontWeight:400}},o),e.createElement(h,{sx:{marginTop:"1rem"}},r),e.createElement(h,{className:"opti-info-modal-buttons",sx:{textAlign:"right",marginTop:"1rem"}},i&&e.createElement(x,{className:"opti-info-modal-button-left",style:{marginRight:"5px"},variant:"contained",color:"primary",onClick:()=>{},"data-testid":`${k.toKebabCase(i)}`},i),!l&&e.createElement(oe,{label:"Close",handleClick:d,"data-testid":"close"}))))})};class Xt extends Lt{constructor(e){super(e)}getComponent(){return Yt}}jt.optiInfo=Xt;const Zt=e=>{var t,n,o,r,i;const a=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!a||!jt[a])return Promise.reject("invalid-modal");const l=new jt[a]((null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.props)||{}).open();(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.then)&&l.then((t=>{var n;try{null===(n=null==e?void 0:e.detail)||void 0===n||n.then(t)}catch(e){console.error(e)}})),(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch)&&l.catch(null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.catch),l.finally((()=>{var t,n;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(n=null==e?void 0:e.detail)||void 0===n||n.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=l)};document&&(document.removeEventListener("openModal",Zt),document.addEventListener("openModal",Zt));const Jt=(e,t)=>{const[n,r]=a(null),i=l(null),d=o((e=>{if(!e)return;const n=Object.assign({},e.contentRect.toJSON());E.isValid(t)&&t>0?(clearTimeout(i.current),i.current=setTimeout((()=>{r(n)}),t)):r(n)}),[t]);return s((()=>{const t=e.current;let n;return t&&(n=new ResizeObserver((([e])=>d(e))),n.observe(t)),()=>{n&&t&&(n.unobserve(t),n.disconnect())}}),[e.current]),n},Qt=r({}),en=()=>i(Qt),tn=()=>({context:en()}),nn=(e,t,n)=>{var r,i;const{context:l}=tn();s((()=>{var e,t;w.mutexRelease(null!==(t=null===(e=null==l?void 0:l.sectionContext)||void 0===e?void 0:e.updateSessionId)&&void 0!==t?t:"default")}),[null===(r=null==l?void 0:l.sectionContext)||void 0===r?void 0:r.updateSessionId]);const[d,c]=a(0),u=o((()=>{c((e=>e+1))}),[]),[m,p]=a(!1),[h,g]=a(!1),v=o(((e,t)=>{const n=!0===t;p(!0===e),g(n)}),[]),f=o((n=>ne(void 0,void 0,void 0,(function*(){if(w.isFunction(t)){const[e]=yield Promise.all([t(n)]);if(!e)return}return l.onMoveBack&&l.onMoveBack({section:e,data:n})}))),[h,t,l.onMoveBack]),[b,y]=a(!1),[x,E]=a(!1),[M,C]=a(null);s((()=>{x&&l.onMoveNext&&l.onMoveNext({section:e,data:M})}),[x,M]);const k=o((e=>ne(void 0,void 0,void 0,(function*(){var t,o;try{y(!0),yield w.delay(350),yield w.mutex(null!==(o=null===(t=null==l?void 0:l.sectionContext)||void 0===t?void 0:t.updateSessionId)&&void 0!==o?o:"default",(()=>ne(void 0,void 0,void 0,(function*(){if(yield w.delay(350),w.isFunction(n)){const[t]=yield Promise.all([n(e)]);if(!t)return}else if(m||h)return;E(!0),C(e)}))))}finally{y(!1)}}))),[null===(i=null==l?void 0:l.sectionContext)||void 0===i?void 0:i.updateSessionId,m,h,n]),{updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:S}=bt();return{context:l.sectionContext,sectionStep:d,nextSectionStep:u,hasErrors:m,hasMandatoryErrors:h,handleSetHasErrors:v,moveBack:f,moveNext:k,awaitingMoveNext:b,updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:S}},on=(e,t,n)=>{const[r,i]=a(t),[l,d]=a(null),[c,u]=a(null),[m,p]=a(null),[h,g]=a(!1),v=o((()=>new Promise((t=>{if(h)return void t(h);const n={};Ye(`wizardSection.validateForm.${e}`,{callback:(e,o)=>{n.hasErrors=!0===(null==n?void 0:n.hasErrors)||e,n.hasMandatoryErrors=1==(null==n?void 0:n.hasMandatoryErrors)||o;const r=!n.hasErrors&&!n.hasMandatoryErrors;r||g(!0),t(r)}})}))),[h,e]),{context:f,sectionStep:b,nextSectionStep:y,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:S}=nn(e,void 0,v);s((()=>{if(!(null==f?void 0:f.validationSchemas))return;ne(void 0,void 0,void 0,(function*(){yield n(null,t,p,(()=>{}),(()=>{}),f.validationSchemas),i(t);const e=t.tiles[0];d(e);const o={};e.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),u(o)}))}),[t,null==f?void 0:f.validationSchemas]);const[O,D]=a(null),P=o((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!t||!m||!O)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:r,hasMandatoryErrors:i}=yield ft(t,m,null,D,T);return(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.callback)&&(null===(o=null==e?void 0:e.detail)||void 0===o||o.callback(r,i)),{hasErrors:r,hasMandatoryErrors:i}}))),[t,m,O,T]);return _e(`wizardSection.validateForm.${e}`,P),{context:f,sectionStep:b,nextSectionStep:y,settings:r,graphingTile:l,graphingControls:c,inputSchemas:m,data:O,setData:D,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:S}},rn=e=>{const[t,n]=a(e),[o,r]=a(null),[i,l]=a(null);return s((()=>{n(e);const t=e.tiles[0];r(t);const o={};t.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),l(o)}),[e]),{settings:t,graphingTile:o,graphingControls:i}},an=t(((t,n)=>{var{stepIndex:o,sectionStep:r,onNextSectionStep:i,onStepIncrease:a,enterTimeout:l,onEntered:s,children:d}=t,c=te(t,["stepIndex","sectionStep","onNextSectionStep","onStepIncrease","enterTimeout","onEntered","children"]);return e.createElement(J,{in:r>=o,timeout:{enter:null!=l?l:600},mountOnEnter:!0,onEntered:()=>{i&&i(),s&&s()}},e.createElement(Z,Object.assign({},c,{ref:n}),d))})),ln=t(((t,r)=>{var i,a,{section:l,children:d,animate:c,animateIn:m,animateOut:p,animateEasing:h,animateDuration:g,maxWidth:v,sx:f}=t,b=te(t,["section","children","animate","animateIn","animateOut","animateEasing","animateDuration","maxWidth","sx"]);const y=u("(max-width: 700px)"),x=en();s((()=>{x.setSectionMaxWidth(null!=v?v:0)}),[v]);const M=n((()=>{var e;let t={position:"absolute",height:"100%",top:0,overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"6px",height:"6px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#a98bb3",borderRadius:"6px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:"rgb(118, 70, 134)"},"&::-webkit-scrollbar-track":{background:"rgba(118, 70, 134, 0.15)",borderRadius:"6px"}};if(!y&&E.isValid(v)&&v>0&&!w.isNullOrUndefined(null===(e=x.containerRect)||void 0===e?void 0:e.width)&&x.containerRect.width>v){const e=Math.floor((x.containerRect.width-v)/2);t=Object.assign(Object.assign({},t),{left:e,width:`calc(100% - ${e}px)`})}else t=Object.assign(Object.assign({},t),{left:0,width:"100%",padding:y?"0 0.75rem":"0"});return t}),[y,v,null===(i=x.containerRect)||void 0===i?void 0:i.width]),C=n((()=>{var e;let t=Object.assign(Object.assign({},f),{width:"100%"});return E.isValid(v)&&v>0&&!w.isNullOrUndefined(null===(e=x.containerRect)||void 0===e?void 0:e.width)&&x.containerRect.width>v&&(t=Object.assign(Object.assign({},t),{maxWidth:v})),t}),[f,v,null===(a=x.containerRect)||void 0===a?void 0:a.width]),k=o((()=>e.createElement(Z,Object.assign({},b,{ref:r,className:`wizard-section wizard-section-${l}`,sx:M}),e.createElement(Z,{sx:C},d))),[l,M,C,d,b]),T=n((()=>{var e;return null!==(e=null!=c?c:x.animate)&&void 0!==e?e:"fade"}),[x.animate,c]),F=n((()=>({enter:!1!==m?null!=g?g:300:0,exit:!1!==p?null!=g?g:300:0})),[m,p,g]),N=n((()=>null!=h?h:"ease-in-out"),[]),S=o((()=>e.createElement(J,{easing:N,timeout:F,in:x.section===l,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{e.style.opacity="0"},onEntering:e=>{e.style.opacity="1"},onEntered:e=>{e.style.opacity="",e.style.transition="",x.setSectionMaxWidth(null!=v?v:0)}},k())),[N,F,x.section,l,k]),O=n((()=>{switch(T){case"scroll-up":return"back"!==x.moveDirection?x.section===l?"up":"down":x.section===l?"down":"up";case"scroll-down":return"back"!==x.moveDirection?x.section===l?"down":"up":x.section===l?"up":"down";case"scroll-left":return"back"!==x.moveDirection?x.section===l?"left":"right":x.section===l?"right":"left";case"scroll-right":return"back"!==x.moveDirection?x.section===l?"right":"left":x.section===l?"left":"right"}}),[x.section,x.moveDirection,l,T]),D=o((()=>e.createElement(Q,{container:x.containerRef.current,direction:O,easing:N,timeout:F,in:x.section===l,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{var t,n,o,r;switch(O){case"up":e.style.transform=e.style.webkitTransform=`translateY(${null===(t=x.containerRect)||void 0===t?void 0:t.height}px)`;break;case"down":e.style.transform=e.style.webkitTransform=`translateY(-${null===(n=x.containerRect)||void 0===n?void 0:n.height}px)`;break;case"left":e.style.transform=e.style.webkitTransform=`translateX(${null===(o=x.containerRect)||void 0===o?void 0:o.width}px)`;break;case"right":e.style.transform=e.style.webkitTransform=`translateX(-${null===(r=x.containerRect)||void 0===r?void 0:r.height}px)`}},onEntering:e=>{switch(O){case"up":case"down":e.style.transform=e.style.webkitTransform="translateY(0)";break;case"left":case"right":e.style.transform=e.style.webkitTransform="translateX(0)"}},onEntered:e=>{e.style.transform="",e.style.webkitTransform="",e.style.transition="",x.setSectionMaxWidth(null!=v?v:0)}},k())),[N,F,x.section,l,O,x.containerRect,k]),P=o((()=>{switch(T){case"fade":return S();case"scroll-up":case"scroll-down":case"scroll-left":case"scroll-right":return D()}return x.section!==l?null:k()}),[x.section,l,T,S,D,k]);return e.createElement(e.Fragment,null,P())})),sn=t((({children:t,initialSection:r,animate:i,avatar:c,isAvatarVisible:u,sx:m,onMoveBack:p,onMoveNext:h,onSectionChange:g,sectionContext:v},f)=>{const b=l(null),y=Jt(b),[x,M]=a(r);s((()=>{r&&g&&g(r)}),[r]);const[C,k]=a(null),[T,F]=a(),N=l(null),S=Jt(N),O=o(((e,t)=>{e!==x&&(M(e),k(null!=t?t:null),g&&g(e))}),[x,g]),D=n((()=>({containerRef:b,containerRect:y,section:x,moveDirection:C,onMoveBack:p,onMoveNext:h,changeSection:O,setSectionMaxWidth:F,animate:i,sectionContext:v})),[y,x,C,p,h,O,i,v]);d(f,(()=>({section:x,context:D})),[x,D]);const P=n((()=>{if(w.isNullOrUndefined(y))return null;if(w.isNullOrUndefined(c)||w.isNullOrUndefined(S))return null;let e={display:"inline-block",position:"absolute"};return e=w.isFunction(u)&&!u(x)?Object.assign(Object.assign({},e),{opacity:0}):Object.assign(Object.assign({},e),{opacity:1}),E.isValid(T)&&T>0&&(e=Object.assign(Object.assign({},e),{left:Math.floor((y.width-T)/2)-S.width})),e}),[y,c,u,S,T]),I=o((()=>w.isNullOrUndefined(T)||0===T||w.isNullOrUndefined(P)?null:c),[T,c,P]);return e.createElement(Z,{ref:b,sx:Object.assign({position:"relative"},m)},e.createElement(Qt.Provider,{value:D},e.createElement(Z,{ref:N,sx:P},I()),t))}));export{Et as AddressValidator,qt as AlertModal,wt as AsAtDateValidator,ee as Button,_t as ConfirmModal,Ct as CurrencyValidator,kt as DateValidator,de as Dropdown,Gt as FadeModal,Le as FormGroupAddActionModel,Ue as FormGroupModel,ot as FormGroupsTile,ze as FormGroupsTileModel,Ve as FormInputModel,ge as GraphingContext,Qe as GraphingControl,Re as GraphingControlModel,Ae as GraphingControlSettingsModel,Xe as GraphingGrid,tt as GraphingPage,Se as GraphingSettingsModel,ye as GraphingTile,et as GraphingTileControls,je as GraphingTileModel,Ne as GraphingTileSettingsModel,Me as GraphingTiles,rt as HorizontalTile,He as HorizontalTileModel,Lt as Modal,zt as MoorrModal,$e as MultipleControlsTileModel,Ft as NotesValidator,Mt as NumberValidator,Nt as ObjectIdValidator,St as ObjectIdsValidator,Xt as OptiInfoModal,Ot as OwnershipValidator,Dt as PercentageValidator,oe as PrimaryButton,re as QtyButton,ie as SecondaryButton,Pt as SelectBooleanValidator,ae as SelectButton,It as SelectNumberValidator,Rt as SelectValidator,it as SelectableStatesTile,Ge as SelectableStatesTileModel,at as SimpleFormTile,We as SimpleFormTileModel,Be as SingleControlTileModel,lt as SingleTile,qe as SingleTileModel,Tt as StringValidator,he as StylesProvider,me as SvgIcon,xt as Validator,st as VerticalTile,Ke as VerticalTileModel,sn as Wizard,ln as WizardSection,an as WizardSectionStep,gt as checkDataForErrors,Pe as createGraphingControl,Ie as createGraphingControls,Te as createGraphingTile,Fe as createGraphingTiles,mt as createValidator,pt as createValidators,Ye as dispatchRootEvent,ht as hasInputError,jt as modals,Ut as modalsStack,De as registerGraphingControl,Je as registerGraphingControlComponent,Vt as registerGraphingFrameworkComponent,ke as registerGraphingTile,be as registerGraphingTileComponent,ue as registerSvgIconComponent,ut as registerValidator,Ht as toastMessage,ve as useGraphingContext,yt as useGraphingForm,dt as useGraphingFramework,Jt as useResizeObserver,_e as useRootEventListener,bt as useUpdateTracker,tn as useWizard,en as useWizardContext,rn as useWizardForm,on as useWizardFormSection,nn as useWizardSection,ft as validateData,vt as validateInput};
1
+ import e,{forwardRef as t,useMemo as n,useCallback as o,createContext as r,useContext as i,useState as a,useRef as l,useEffect as s,useImperativeHandle as d}from"react";import c from"@mui/material/Button";import{useMediaQuery as u,Typography as m,SpeedDial as p,Box as h,SpeedDialIcon as g,SpeedDialAction as v,Slide as f,Icon as b,IconButton as y,Button as x}from"@mui/material";import{integers as E,utils as w,dates as M,decimals as C,strings as k}from"moorr-common";import T from"@mui/material/IconButton";import F from"@material-ui/core/MenuItem";import{makeStyles as N,createStyles as S,withStyles as O,StylesProvider as D}from"@material-ui/core/styles";import P from"@material-ui/core/TextField";import I from"@material-ui/core/Divider";import{StylesProvider as R,Modal as V,Backdrop as A,Fade as L}from"@material-ui/core";import{createGenerateClassName as U,StylesProvider as j}from"@material-ui/styles";import{v4 as B}from"uuid";import $,{Responsive as z}from"react-grid-layout";import H from"@mui/material/Accordion";import G from"@mui/material/AccordionSummary";import W from"@mui/material/AccordionDetails";import q from"@mui/icons-material/ExpandMore";import K from"react-dom";import{toast as _}from"react-toastify";import Y from"@mui/icons-material/Cancel";import X from"@mui/icons-material/Close";import Z from"@mui/icons-material/CheckCircle";import J from"@mui/material/Box";import Q from"@mui/material/Fade";import ee from"@mui/material/Slide";const te=({type:t,label:n})=>(t||(t="button"),e.createElement("button",{type:t,className:"moorr-button"},e.createElement("span",null,n)));function ne(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function oe(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((o=o.apply(e,t||[])).next())}))}const re=t(((t,o)=>{var{style:r={},handleClick:i,label:a,disabled:l}=t,s=ne(t,["style","handleClick","label","disabled"]);const d=u("(max-width: 600px)"),m=n((()=>d?"8rem":"172px"),[d]);return e.createElement(c,Object.assign({},s,{ref:o,disabled:l,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!l&&{backgroundColor:"#541868"}),{color:"#FFFFFF",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),r),onClick:i,variant:"contained"}),a)})),ie=t(((t,r)=>{var{sx:i,item:a,label:l,qty:s,disabled:d,highlight:u,onSelectItem:p}=t,h=ne(t,["sx","item","label","qty","disabled","highlight","onSelectItem"]);const g=n((()=>({width:"27px",height:"27px",color:"#FFFFFF",flexShrink:0})),[]),v=n((()=>{const e=Object.assign(Object.assign({},i),{flexGrow:1,fontFamily:"Poppins",fontSize:"14px",fontWeight:400,lineHeight:"9px",minHeight:"42px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none",gap:"0.5rem","&:hover > button":{opacity:1}});return s>0?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#FBFBFD",borderColor:!0===u?"#541868":"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[s,i]),f=o((e=>oe(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),w.isFunction(p)&&s<=0&&(yield Promise.all([p(a,1)]))}))),[s,p]),b=o((()=>!E.isValid(s)||s<=0?null:e.createElement(T,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#E37D7D",opacity:0,"&:hover":{backgroundColor:"#E37D7D"},"&:active":{backgroundColor:"#E37D7D"}}),onClick:()=>p&&p(a,Math.max(0,s-1))},"-")),[d,g,s,p]),y=o((()=>!E.isValid(s)||s<=0?null:e.createElement(T,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#541868",opacity:0,"&:hover":{backgroundColor:"#541868"},"&:active":{backgroundColor:"#541868"}}),onClick:()=>p&&p(a,s+1)},"+")),[d,g,s,p]),x=o((()=>{let t,n;return!E.isValid(s)||s<=0?(t=1,n=0):(t=`${s}`,n=1),e.createElement(m,{variant:"body1",component:"span",sx:{color:"#541868",fontWeight:700,fontSize:"14px",lineHeight:"20px",flexShrink:0,opacity:n}},t)}),[s]);return e.createElement(c,Object.assign({},h,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,disabled:d,sx:v,onClick:f}),b(),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=l?l:a),y(),x())})),ae=t(((t,o)=>{var{style:r={},handleClick:i,label:a,disabled:l}=t,s=ne(t,["style","handleClick","label","disabled"]);const d=u("(max-width: 600px)"),m=n((()=>d?"8rem":"172px"),[d]);return e.createElement(c,Object.assign({},s,{ref:o,disabled:l,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!l&&{backgroundColor:"#D4C5D9"}),{color:"#541868",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),r),onClick:i,variant:"contained"}),a)})),le=t(((t,r)=>{var{sx:i,item:a,label:l,itemSelected:s,onSelectItem:d}=t,u=ne(t,["sx","item","label","itemSelected","onSelectItem"]);const p=n((()=>{const e=Object.assign(Object.assign({},i),{flexGrow:1,fontFamily:"Poppins",fontSize:"13px",fontWeight:400,lineHeight:"18px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none"});return s?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#fbfbfd",borderColor:"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[s,i]),h=o((e=>oe(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),w.isFunction(d)&&(yield Promise.all([d(a)]))}))),[d]);return e.createElement(c,Object.assign({},u,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:p,onClick:h}),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=l?l:a))})),se=e=>({root:{"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{},"&$checked":{color:"var(--primary-color)"},"& .vldt-MuiSelect-select.vldt-MuiSelect-select":{color:"var(--grey-color-2)"}},disabled:{},focused:{},error:{},notchedOutline:{},checked:{},notchedOutlineMBRequired:{flex:3,borderColor:"blue",borderWidth:2},fieldSetMBRequired:{"& fieldset":{flex:3,borderColor:"blue",borderWidth:2}},fieldSetErrorField:{"& fieldset":{borderColor:"var(--error-color)"}},blue:{color:"blue"}});N(se);const de=N((()=>S({root:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"}},label:{flex:2},field:{flex:3},required:{color:"red"},menuItem:{color:"var(--grey-color-2)","&:hover":{backgroundColor:"var(--primary-color-scale-25)",color:"var(--grey-color-2)"}},menuItemSelected:{color:"var(--grey-color-2)"},mandatory:{border:"red 2px solid",borderRadius:"4px"}})));var ce=O(se)((({handleChange:t,value:n,disabled:o=!1,name:r,className:i,classes:a,size:l,menuItemLabel:s,options:d,labelPlacement:c="start",label:u,required:m=!1,isMBRequiredField:p,fullWidth:h,selectIconComponent:g})=>{const{root:v,focused:f,error:b,notchedOutline:y,notchedOutlineMBRequired:x}=a,E=de();let w;return g&&(w={IconComponent:g}),e.createElement(P,{fullWidth:!1!==h,id:"outlined-basic",variant:"outlined",value:n,onChange:t,disabled:o,name:r,className:[i].join(" "),InputProps:{classes:{root:v,focused:f,error:b,notchedOutline:!p||n&&0!==(null==n?void 0:n.length)?!m||n&&0!==(null==n?void 0:n.length)?y:E.mandatory:x}},color:"primary",size:l||"small",select:!0,SelectProps:w,defaultValue:""},e.createElement(F,{value:"",disabled:!0},e.createElement("em",null,s)),d&&d.map(((t,n)=>"-separator-"===t?e.createElement(I,{key:`divider-${n}`}):e.createElement(F,{key:`menu-item-${n}-${t.value||t}`,value:t.value||t},t.label||t))))}));const ue={};function me(e,t){e&&t&&(ue[e]=t)}const pe=({className:t,icon:n,width:o,height:r,fill:i,stroke:a,accent:l,dropShadow:s})=>{if(w.isNullOrUndefined(n))return null;const d=ue[n]||null;return d?e.createElement(d,{className:t,fill:i,width:o,height:r,stroke:a,accent:l,dropShadow:s}):null},he={};var ge=({stylePrefix:t,children:n})=>{let o;if(t)o=he[t]?he[t]:he[t]=U({seed:t});else{const e=`MoorrStylesProvider-${B()}-`;o=U({seed:e})}return e.createElement(j,{generateClassName:o,injectFirst:!0},e.createElement(R,{generateClassName:o,injectFirst:!0},e.createElement(D,{generateClassName:o},n)))};const ve=r({});function fe(){return i(ve)}const be={};function ye(e,t){e&&t&&(be[e]=t)}const xe=({graphingTile:t,graphingTileIndex:n})=>{var o;if(!(null===(o=null==t?void 0:t.tile)||void 0===o?void 0:o.tileType))return null;const r=be[t.tile.tileType]||null;return r?e.createElement(r,{graphingTile:t,graphingTileIndex:n}):null},Ee=[20,20],we={lg:600,sm:0},Me={lg:8,sm:2},Ce=({tilePrefix:t,responsive:n,columns:o,containerPadding:r,referenceMargin:i,referenceWidth:d,graphingTiles:c})=>{const u=fe(),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a(null),x=l(null),E=()=>{const e=(null==x?void 0:x.current)?(null==x?void 0:x.current).getBoundingClientRect().width:null;y(e);const t=T(e);p(t)};let M;const C=e=>{E(),clearTimeout(M),M=setTimeout((()=>{E()}),300)};s((()=>{E()}),[x]),s((()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)})),[]),s((()=>{if(n){if(!Array.isArray(c)||0===c.length)return void f({lg:[]});const e=c.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`})));f({lg:e})}else{if(!Array.isArray(c)||0===c.length)return void g([]);g(c.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`,static:!0}))))}}),[c]);const k=()=>null==c?void 0:c.map(((n,o)=>{if(!n.tile||!n.visible)return null;if(w.isFunction(u.isTileVisible)&&n.tile.id&&!u.isTileVisible(n.tile.id))return null;let r="graphing-tile-container";n.tile.id&&(r+=` ${n.tile.id}`),!1!==n.border&&(r+=" bordered"),n.autoHeight&&(r+=" auto-height");const i=`${t?t+"_":""}tile_${o}`;return e.createElement("div",{className:r,key:i},e.createElement(xe,{graphingTile:n,graphingTileIndex:o}))})),T=e=>{if(!i||isNaN(i)||i<=0||!d||isNaN(d)||d<=0||null==e)return Ee;const t=e/d*i;return[t,t]};return e.createElement("div",{ref:x,className:"graphing-tiles-container"},(()=>{if(!b||!m)return null;if(!1!==n){if(!v)return null;const t=[r||0,0];return e.createElement(z,{width:b,breakpoints:we,cols:o||Me,rowHeight:1,layouts:v,containerPadding:t,margin:m,isDraggable:!1},k())}return h?e.createElement($,{width:b,cols:9,rowHeight:50,margin:m,isDraggable:!1,layout:h},k()):null})())},ke={};function Te(e,t){ke[e]=t}function Fe(e){const t=ke[null==e?void 0:e.tileType];return t?new t(e):null}function Ne(e){const t=[];return e.forEach((e=>{const n=Fe(e);n&&t.push(n)})),t}class Se{constructor(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h,this.border=!0===e.border,this.background=e.background||null,this.autoHeight=!0===e.autoHeight,this.tile=Fe(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class Oe{constructor(e){this.title=e.title||"",this.infoIconUrl=e.infoUrl,this.infoIconHref=e.infoHref,this.responsive=!1!==e.responsive,this.columns=e.columns||{lg:8,sm:2},this.containerPadding=e.containerPadding||0,this.referenceMargin=e.referenceMargin||null,this.referenceWidth=e.referenceWidth||null,this.tiles=[],Array.isArray(e.tiles)&&e.tiles.forEach((e=>{this.tiles.push(new Se(e))}))}}const De={};function Pe(e,t){De[e]=t}function Ie(e){const t=De[null==e?void 0:e.controlType];return t?new t(e):null}function Re(e){const t=[];return e.forEach((e=>{const n=Ie(e);n&&t.push(n)})),t}class Ve{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class Ae extends Ve{constructor(e){super(e),this.inputLabel=e.inputLabel||"",this.readOnly=!0===e.readOnly,this.readOnlyBorderless=!0===e.readOnlyBorderless,this.hasAsAtDate=!1===e.hasAsAtDate||!0===e.hasAsAtDate?e.hasAsAtDate:null,this.staticAsAtDate=!0===e.staticAsAtDate,this.validationSchemaPath=(w.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>w.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class Le{constructor(e){this.border=e.border,this.background=e.background||null,this.control=Ie(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class Ue{constructor(e){this.label=e.label||"",this.value=e.value||"",this.icon=e.icon||"",this.accent=e.accent||""}}class je{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Le(e))})),this.add=!0===e.add,this.edit=!0===e.edit,this.addActions=[],Array.isArray(e.addActions)&&e.addActions.forEach((e=>{this.addActions.push(new Ue(e))}))}}class Be{constructor(e){this.id=e.id,this.tileType=e.tileType}}class $e extends Be{constructor(e){super(e),this.control=new Le(e.control)}}class ze extends Be{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Le(e))}))}}class He extends Be{constructor(e){super(e),w.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new je(e))):this.formGroups=[]}}Te("form-groups-tile",He);class Ge extends ze{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}Te("horizontal-tile",Ge);class We extends ze{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new Oe(n))}}}Te("selectable-states-tile",We);class qe extends Be{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Le(e))}))}}Te("simple-form-tile",qe);class Ke extends $e{constructor(e){super(e)}}Te("single-tile",Ke);class _e extends ze{constructor(e){super(e)}}Te("vertical-tile",_e);const Ye=(e,t,n)=>{s((()=>{const n=document.querySelector("#react-root");return null==n||n.addEventListener(e,t),()=>{null==n||n.removeEventListener(e,t)}}),null!=n?n:[t])},Xe=(e,t)=>{const n=document.querySelector("#react-root");null==n||n.dispatchEvent(new CustomEvent(e,{detail:null!=t?t:{}}))},Ze=({})=>{const{settings:t,handleUIReady:n}=fe(),[r,i]=a(null),[l,d]=a([]),[c,u]=a(!1);s((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{u(!0),w.isFunction(n)&&n()}),300)}),300)}),[]);const m=o((e=>{var t,n,o,r,i,a,s,c,u,m,p;if(!(null==l?void 0:l.length)||!(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.id))return;const h=l.find((t=>{var n,o;return(null===(n=t.tile)||void 0===n?void 0:n.id)===(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.id)}));if(!h)return;w.isNullOrUndefined(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.x)||(h.x=null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.x),w.isNullOrUndefined(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.y)||(h.y=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.y),w.isNullOrUndefined(null===(a=null==e?void 0:e.detail)||void 0===a?void 0:a.w)||(h.w=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.w),w.isNullOrUndefined(null===(c=null==e?void 0:e.detail)||void 0===c?void 0:c.h)||(h.h=null===(u=null==e?void 0:e.detail)||void 0===u?void 0:u.h),w.isNullOrUndefined(null===(m=null==e?void 0:e.detail)||void 0===m?void 0:m.visible)||(h.visible=null===(p=null==e?void 0:e.detail)||void 0===p?void 0:p.visible);const g=l.map((e=>new Se(e)));d(g)}),[l]);Ye("graphingGrid.updateTile",m),s((()=>{var e;t?(i(new Oe(t)),d(null===(e=t.tiles)||void 0===e?void 0:e.map((e=>new Se(e))))):i(null)}),[t]);const p=()=>(null==t?void 0:t.infoIconUrl)&&t.infoIconHref?e.createElement("a",{className:"information-anchor",href:t.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==t?void 0:t.title,src:null==t?void 0:t.infoIconUrl})):null;if(!r)return null;let h="graphing-grid-container";return c&&(h+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:h},w.isNullOrUndefined(null==t?void 0:t.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==t?void 0:t.title,p()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(Ce,{graphingTiles:l,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth})))},Je={};function Qe(e,t){e&&t&&(Je[e]=t)}const et=({graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:r})=>{var i;if(!(null===(i=null==o?void 0:o.control)||void 0===i?void 0:i.controlType))return null;const a=Je[o.control.controlType]||null;return a?e.createElement(a,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},r)):null},tt=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:r})=>{var i,a;let l="graphing-tile-controls-container";return(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)&&(l+=" "+(null===(a=null==t?void 0:t.tile)||void 0===a?void 0:a.tileType)),e.createElement("div",{className:l},null==o?void 0:o.map(((o,i)=>{var a,l;if(!o.control)return null;let s="graphing-tile-control-container";(null===(a=o.control)||void 0===a?void 0:a.controlType)&&(s+=" "+(null===(l=o.control)||void 0===l?void 0:l.controlType)),!1!==o.border&&(s+=" bordered");const d=`control_${n}_${i}`;return e.createElement("div",{className:s,key:d},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:r}))})))},nt=({className:t,context:n})=>e.createElement(ve.Provider,{value:n},e.createElement("div",{className:t},e.createElement(Ze,null))),ot=({open:t,actions:n,disabled:o,onClick:r})=>e.createElement(p,{ariaLabel:"Add a New Card",direction:"down",open:t,className:t?"add-card-open":void 0,onClick:r,icon:e.createElement(h,{sx:{display:"flex"}},e.createElement(g,{open:t,icon:e.createElement(pe,{icon:"add-icon",stroke:t?"#E24242":"#FFFFFF"})})),FabProps:{className:t?"add-card-open":void 0,variant:"extended",disabled:o,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:{background:"transparent",color:"inherit",width:"auto",height:"30px",whiteSpace:"nowrap",boxShadow:"none",textTransform:"inherit","&:hover":{background:"transparent",boxShadow:"none"},"&:active":{background:"transparent",boxShadow:"none"},"&:disabled":{background:"transparent !important"},"& > div":{display:"flex",flexDirection:"row",gap:"1rem",textTransform:"inherit",justifyContent:"center"},"& > div > .MuiTypography-root.MuiTypography-button":{textTransform:"inherit",fontFamily:"Poppins",fontStyle:"normal",fontWeight:400,fontSize:"14px"},"& > div > .MuiSpeedDialIcon-root":{display:"flex",width:"30px",height:"30px",alignItems:"center",justifyContent:"center",backgroundColor:"#541868",transition:"background-color 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",borderRadius:"15px",color:"#FFFFFF"},"& > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#541868"},"& > div > .MuiSpeedDialIcon-root > svg":{transform:"rotate(0deg)",transition:"transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},"&.add-card-open > div > .MuiSpeedDialIcon-root":{backgroundColor:"#FFFFFF",color:"#E24242"},"&.add-card-open > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#FFFFFF",color:"#E24242"},"&.add-card-open > div > .MuiSpeedDialIcon-root > svg":{transform:"rotate(45deg)"},"&:disabled > div > .MuiSpeedDialIcon-root":{backgroundColor:"#DCDCDC",color:"#FFFFFF"},"&:disabled > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#DCDCDC",color:"#FFFFFF"}}},sx:{position:"absolute",width:"30px",zIndex:1,"&.add-card-open":{zIndex:1050},"& > .MuiSpeedDial-actions":{alignSelf:"flex-end",marginRight:"-15px"},"& > .MuiSpeedDial-actions .MuiSpeedDialAction-staticTooltipLabel":{whiteSpace:"nowrap"}}},n),rt=({graphingTile:t,graphingTileIndex:r})=>{const i=null==t?void 0:t.tile;if(!i)return null;const d=fe();return e.createElement("div",{className:"form-groups-tile-component"},!w.isArray(i.formGroups)||i.formGroups.length<0?null:i.formGroups.map(((i,c)=>{const u=l(null),[m,p]=a("normal"),[g,f]=a("form-group-container");s((()=>{M()}),[g,m]);const[b,y]=a(0),[x,E]=a(!0);s((()=>{if(x){const e=u.current;w.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(e.scrollHeight)}),10)}else y(0)}),[x]);const M=e=>{if(x){const e=u.current;w.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(Math.max(e.clientHeight,e.scrollHeight))}),10)}else y(0)},C=o((e=>{""===e.value?(p("add"),E(!0)):(null==d?void 0:d.handleFormGroupAdd)&&w.isFunction(d.handleFormGroupAdd)&&d.handleFormGroupAdd(i,e)}),[i,null==d?void 0:d.handleFormGroupAdd]),k=n((()=>i.addActions&&i.addActions.length?i.addActions.map(((t,n)=>e.createElement(v,{key:n.toString(),icon:e.createElement(pe,{icon:t.icon,fill:t.accent,stroke:"#FFFFFF"}),tooltipTitle:e.createElement("span",null,t.label),tooltipOpen:!0,FabProps:{disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0},sx:{"& > .MuiSpeedDialAction-staticTooltipLabel":{background:"#ffffff",color:"#000000",textTransform:"inherit",fontFamily:"Poppins",fontStyle:"normal",fontWeight:400,fontSize:"12px",padding:"0.25rem 0.5rem",cursor:"pointer"},"& > .MuiSpeedDialAction-staticTooltipLabel#AddaNewCard-action-0-label":{marginRight:0},"& > .MuiFab-root":{backgroundColor:"transparent !important",color:"#ffffff",boxShadow:"none",width:"36px !important",height:"36px !important",margin:"0.375rem 1rem 0.375rem 0.25rem","&:hover":{backgroundColor:"transparent !important"},"&:active":{backgroundColor:"transparent !important",boxShadow:"none"},justifyContent:"flex-end !important"}},onClick:()=>C(t)}))):null),[i.addActions,C]),[T,F]=a(!1),N=o((e=>{e.stopPropagation(),F((e=>!e))}),[]),S=o((()=>!0!==i.add||w.isFunction(d.formGroupHasAddMode)&&!d.formGroupHasAddMode(i.id)?null:k?e.createElement(ot,{disabled:"add"==m,open:T,actions:k,onClick:N}):e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:D,disabled:"add"==m},e.createElement(pe,{icon:"add-icon",stroke:"#ffffff"}))),[m,d.formGroupHasAddMode,T,k,N]),O=o((()=>!0!==i.edit||w.isFunction(d.formGroupHasEditMode)&&!d.formGroupHasEditMode(i.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-edit-button",onClick:P,disabled:"add"==m},e.createElement(pe,{icon:"edit-icon",fill:"#ffffff"}))),[m,d.formGroupHasEditMode]),D=e=>{e.stopPropagation(),p("add"),E(!0)},P=e=>{e.stopPropagation(),(null==d?void 0:d.handleEdit)&&(null==d||d.handleEdit(i))},I=e=>oe(void 0,void 0,void 0,(function*(){w.isFunction(null==d?void 0:d.handleFormGroupCancel)&&(yield Promise.all([null==d?void 0:d.handleFormGroupCancel({formGroup:i})])),p("normal")})),[R,V]=a(!1),A=e=>oe(void 0,void 0,void 0,(function*(){if(w.isFunction(null==d?void 0:d.handleFormGroupSave))try{V(!0);const[e]=yield Promise.all([null==d?void 0:d.handleFormGroupSave({formGroup:i})]);if(!1===e)return}finally{V(!1)}p("normal")}));let L="form-group-container";return w.isFunction(d.isFormGroupVisible)&&(d.isFormGroupVisible(i.id)||(L+=" hidden")),L!==g&&f(L),e.createElement(H,{key:`${i.id}-{${c}}`,className:L,expanded:x,onChange:e=>{"add"!==m&&E((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(G,{className:"form-group-title",expandIcon:"add"!==m?e.createElement(q,null):null},e.createElement("span",{className:"form-group-title-text"},i.title),S(),O()),e.createElement("hr",null),e.createElement(W,{className:"form-group-components"},(()=>{if("add"===m){let t;return w.isFunction(d.renderFormGroup)&&(t=d.renderFormGroup(i,"add")),e.createElement(e.Fragment,null,t,e.createElement("hr",null),e.createElement("div",{className:"form-group-add-mode-buttons"},e.createElement("button",{className:"cancel-button",disabled:R,onClick:I},"Cancel"),e.createElement("button",{className:"save-button",disabled:R,onClick:A},"Create")))}{const n=i.controls;let o,a;if(w.isFunction(d.renderFormGroup)){if(o=d.renderFormGroup(i,"normal"),!w.isNullOrUndefined(o))return o;a=d.renderFormGroup(i,"footer")}return e.createElement(e.Fragment,null,e.createElement(tt,{graphingTile:t,graphingTileIndex:r,graphingTileControls:n,ControlProps:{onUIChange:M}}),a)}})()),k&&e.createElement(h,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:T?2:-1,borderRadius:"10px",transition:"opacity 225ms cubic-bezier(0.4, 0, 0.2, 1)",opacity:T?1:0},onClick:()=>F(!1)}))})))};ye("form-groups-tile",rt);const it=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const[r,i]=a(null),[l,d]=a(0),[c,u]=a(0),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a([]);s((()=>{let e=[];const t=Math.ceil(o.controls.length/o.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<o.controlsPerPage;e++){const r=n*o.controlsPerPage+e;if(r>=o.controls.length)break;t.controls.push(o.controls[r])}e.push(t)}d(t),u(0),p(null),g(null),f(null),y(e)}),o.controls);const x=e=>{let t=e-1;t<0&&(t=l-1),g(t)},E=e=>{e.stopPropagation(),x(c),f(null),p(null)},w=e=>{e.stopPropagation()},M=e=>{e.stopPropagation()},C=e=>{if(e.stopPropagation(),null!==r)return;const t=c;let n=c-1;n<0&&(n=l-1),p(t),u(n),g(null),f(t);const o=setTimeout((()=>{x(n),f(null),p(null),setTimeout((function(){i(null)}),300)}),300);i(o)},k=e=>{let t=e+1;t>=l&&(t=0),f(t)},T=e=>{e.stopPropagation(),g(null),k(c),p(null)},F=e=>{e.stopPropagation()},N=e=>{e.stopPropagation()},S=e=>{if(e.stopPropagation(),null!==r)return;const t=c;let n=c+1;n>=l&&(n=0),p(t),u(n),g(t),f(null);const o=setTimeout((()=>{g(null),k(n),p(null),setTimeout((function(){i(null)}),300)}),300);i(o)},O={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:O},e.createElement("div",{className:"horizontal-tile-pages-container"},b.map(((o,r)=>{let i="horizontal-tile-page-container";return r===c?i+=" active":r===h?i+=" navigating-from-left":r===v&&(i+=" navigating-from-right"),r===m&&(i+=" previous"),e.createElement("div",{key:`horizontal-tile-page-${r}`,className:i},e.createElement(tt,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:O}),l<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:E,onMouseLeave:w,onMouseDown:M,onClick:C},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.40991 10.643L2.82991 6.05298L7.40991 1.46298L5.99991 0.0529785L-8.80003e-05 6.05298L5.99991 12.053L7.40991 10.643Z",fill:"#828282"}))),e.createElement("button",{type:"button",className:"navigate-button navigate-right-button",onMouseEnter:T,onMouseLeave:F,onMouseDown:N,onClick:S},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.589843 1.46298L5.16984 6.05298L0.589844 10.643L1.99984 12.053L7.99984 6.05298L1.99984 0.0529785L0.589843 1.46298Z",fill:"#828282"}))))),l<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(l).keys()).map((t=>{let n="paginator-anchor";return t===c&&(n+=" active"),e.createElement("a",{key:`horizontal-tile-page-index-${t}`,className:n,onMouseEnter:e=>{e.stopPropagation(),t!==c&&(t<c?(g(t),f(null)):(g(null),f(t)),p(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===c)return;const n=c,o=t;p(n),u(o),n<o?g(n):f(n)}})}))))};ye("horizontal-tile",it);const at=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[o,r]=a(""),[i,l]=a(null),[d,c]=a([]),u=fe();s((()=>{const e=Object.keys(n.states);if(c(e.map((e=>{var t;return{label:null===(t=n.states[e])||void 0===t?void 0:t.title,value:e}}))),e&&e.length>0){const t=e[0];m(t)}else r(""),l(null)}),[n.states]);const m=e=>{r(e),l(n.states[e])};return e.createElement("div",{className:"selectable-states-tile-component"},e.createElement("div",{className:"selectable-states-tile-header"},e.createElement("div",{className:"selected-state-tile-title"},e.createElement("h6",null,null==i?void 0:i.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(ce,{options:d,label:"Select",value:o,handleChange:e=>{var t;m(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),(null==u?void 0:u.handleSelectableStatesTileChange)&&(null==u||u.handleSelectableStatesTileChange(e))}}))),e.createElement("div",{className:"selected-state-tile-container"},i?e.createElement(Ce,{tilePrefix:o,graphingTiles:i.tiles,responsive:i.responsive,columns:i.columns,containerPadding:i.containerPadding,referenceMargin:i.referenceMargin,referenceWidth:i.referenceWidth}):null))};ye("selectable-states-tile",at);const lt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=fe(),i=e=>{w.isFunction(r.handleUIChange)&&r.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!w.isArray(o.controls)||o.controls.length<0)return null;const r=o.controls;return e.createElement(tt,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r,ControlProps:{onUIChange:i}})})())};ye("simple-form-tile",lt);const st=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=[o.control],i={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:i},e.createElement(tt,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r}))};ye("single-tile",st);const dt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=o.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(tt,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r}))};function ct(e,t){const n=fe(),o=null==e?void 0:e.control,[r,i]=a(null);return s((()=>{if(!(o&&(n.data&&n.data[o.dataKey]||t)))return;const e=null!=t?t:n.data[o.dataKey];i(e)}),[o,t,n.data]),{context:n,settings:o,data:r}}ye("vertical-tile",dt);const ut={};function mt(e,t){ut[e]=t}function pt(e){const t=ut[e];return t?new t:null}function ht(e){const t=[];return e.forEach((e=>{const n=pt(e);n&&t.push(n)})),t}const gt=(e,t,n)=>!(!w.isNullOrUndefined(n)&&""!==(null==n?void 0:n.trim())&&"normal"!==n&&"hover"!==n&&(w.isNullOrUndefined(t)||""===(null==t?void 0:t.trim())))&&(!w.isNullOrUndefined(t)&&""!==(null==t?void 0:t.trim())||!w.isNullOrUndefined(e)&&"warning"!==(null==e?void 0:e.error_0)),vt=(e,t)=>{let n=!1,o=!1;return Object.entries(e).forEach((([e,t])=>{const r=null==t?void 0:t.error;n=n||gt(r),o=o||!0===(null==r?void 0:r.mandatory)})),w.isFunction(t)&&t(n,o),{hasErrors:n,hasMandatoryErrors:o}},ft=(e,t)=>oe(void 0,void 0,void 0,(function*(){var n;const o=(t||{})[e.key];if(!w.isArray(o))return;const r={count:0};return!0===(null===(n=null==e?void 0:e.originalEvent)||void 0===n?void 0:n.noValidate)||o.forEach(((t,n)=>{var o;const i=pt(null!==(o=null==e?void 0:e.validatorType)&&void 0!==o?o:t.type);if(w.isNullOrUndefined(i))return;e.validatorData&&(i.validatorData=e.validatorData);const a=i.validate(t,e.value);r.mandatory=!0===t.mandatory||"AsAtDate"===e.validatorType,r.errors=a,w.isArray(a)&&a.length>0&&a.forEach(((n,o)=>{r[`error_${o}`]=i.getErrorMessage(t,e.control,n),r.count+=1}))})),r})),bt=(e,t,n,o,r)=>oe(void 0,void 0,void 0,(function*(){var i;if(w.isNullOrUndefined(e)||w.isNullOrUndefined(t))return{hasErrors:!1,hasMandatoryErrors:!1};let a;w.isNullOrUndefined(n)?o((e=>(a=Object.assign({},e),e))):a=Object.assign({},n);const l=[];return null===(i=null==e?void 0:e.tiles)||void 0===i||i.forEach((e=>{var n,o,r,i,s;switch(null===(n=null==e?void 0:e.tile)||void 0===n?void 0:n.tileType){case"form-groups-tile":null===(r=null===(o=null==e?void 0:e.tile)||void 0===o?void 0:o.formGroups)||void 0===r||r.forEach((e=>{var n,o;(null===(n=null==e?void 0:e.controls)||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.controls)||void 0===o||o.forEach((e=>{var n,o;if(!(null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey)||(null==e?void 0:e.control.readOnly))return;const r=a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(r.readOnly||r.hidden)return;l.push(oe(void 0,void 0,void 0,(function*(){var n,o;const i=yield ft({originalEvent:null,control:null==e?void 0:e.control,key:null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey,value:null==r?void 0:r.value},t);!w.isNullOrUndefined(i)&&i.count>0&&(a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=i)})))})))}));break;case"simple-form-tile":null===(s=null===(i=null==e?void 0:e.tile)||void 0===i?void 0:i.controls)||void 0===s||s.forEach((e=>oe(void 0,void 0,void 0,(function*(){var n,o;if(!(null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey)||(null==e?void 0:e.control.readOnly))return;const r=a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(r.readOnly||r.hidden)return;l.push(oe(void 0,void 0,void 0,(function*(){var n,o;const i=yield ft({originalEvent:null,control:null==e?void 0:e.control,key:null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey,value:null==r?void 0:r.value},t);!w.isNullOrUndefined(i)&&i.count>0&&(a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=i)})))}))));break;default:return}})),yield Promise.all(l),o(a),vt(a,r)})),yt=()=>{const[e,t]=a(0),[n,r]=a({});return{updatingCount:e,updatingFlags:n,setUpdating:o((e=>{t((e=>e+1)),r((t=>Object.assign(Object.assign({},t),{[e]:!0})))}),[e,n]),unsetUpdating:o((e=>{t((e=>e-1)),r((t=>Object.assign(Object.assign({},t),{[e]:!1})))}),[e,n])}},xt=(e,t,n,r,i,l)=>{const d=fe(),[c,u]=a(t),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a(null),[x,E]=a(!1),w=o((()=>new Promise((t=>{if(x)return void t(x);const n={};Xe(`graphingForm.validateForm.${e}`,{callback:(e,o)=>{n.hasErrors=!0===(null==n?void 0:n.hasErrors)||e,n.hasMandatoryErrors=1==(null==n?void 0:n.hasMandatoryErrors)||o;const r=!n.hasErrors&&!n.hasMandatoryErrors;r||!0===i||E(!0),t(r)}})}))),[x,e]);s((()=>{if(!n)return;oe(void 0,void 0,void 0,(function*(){yield r(null,t,f,y,null!=l?l:()=>{},n),u(t);const e=t.tiles[0];p(e);const o={};e.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),g(o)}))}),[t,n]);const[M,C]=a(!1),[k,T]=a(!1),F=o(((e,t)=>{const n=!0===t;C(!0===e),T(n)}),[]),[N,S]=a(null),O=o((e=>oe(void 0,void 0,void 0,(function*(){var n,o;if(!t||!v||!N)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:r,hasMandatoryErrors:i}=yield bt(t,v,null,S,F);return(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.callback)&&(null===(o=null==e?void 0:e.detail)||void 0===o||o.callback(r,i)),{hasErrors:r,hasMandatoryErrors:i}}))),[t,v,N,F]);Ye(`graphingForm.validateForm.${e}`,O);const{updatingCount:D,updatingFlags:P,setUpdating:I,unsetUpdating:R}=yt();return{context:d,settings:c,graphingTile:m,graphingControls:h,inputSchemas:v,dropdownValues:b,data:N,setData:S,updatingCount:D,updatingFlags:P,setUpdating:I,unsetUpdating:R,hasErrors:M,hasMandatoryErrors:k,handleSetHasErrors:F,canSubmit:w}};class Et{constructor(){}getErrorMessage(e,t,n){if(w.isNullOrUndefined(n))return n;if(!w.isNullOrUndefined(null==t?void 0:t.validationErrorMessages)&&!w.isNullOrUndefined(t.validationErrorMessages[n])&&w.isString(t.validationErrorMessages[n])&&""!==t.validationErrorMessages[n].trim())return t.validationErrorMessages[n];switch(n){case"mandatory":return"This field is mandatory. Please ensure it is not empty or invalid";case"required":return"This field is required. Please ensure it is not empty or invalid";case"mbRequired":return"warning";case"enum":return w.isArray(null==e?void 0:e.enum)&&e.enum.length>0?`Value must be in this list: ${e.enum.filter((e=>!w.isNullOrUndefined(e)&&""!==e)).join(", ")}`:"Value must be in enum list";case"as-at-future":return"Your current value's as at date must not be in the future"}return n}validate(e,t){const n=this.validateInputValue(e,t);return!0!==(null==e?void 0:e.mbRequired)||this.validateMbRequired(e,t)||n.push("mbRequired"),n}validateInputValue(e,t){const n=[];return!0!==(null==e?void 0:e.mandatory)||this.validateMandatory(e,t)||n.push("mandatory"),!0!==(null==e?void 0:e.required)||this.validateRequired(e,t)||n.push("required"),w.isArray(null==e?void 0:e.enum)&&(null==e?void 0:e.enum.length)>0&&!this.validateEnum(null==e?void 0:e.enum,t)&&n.push("enum"),n}validateMandatory(e,t){return!w.isNullOrUndefined(t)}validateRequired(e,t){return this.validateMandatory(e,t)}validateMbRequired(e,t){return this.validateMandatory(e,t)}validateEnum(e,t){return!(w.isArray(e)&&0!==e.length&&!w.isNullOrUndefined(t))||e.includes(t)}}class wt extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&!!t.formatted}}mt("Address",wt);class Mt extends Et{validateInputValue(e,t){const n=super.validateInputValue(e,t);if(n.length>0)return n;if(M.isValid(t)){const e=new Date(t),o=M.todayUtc();e.getTime()>o.getTime()&&n.push("as-at-future")}return n}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&M.isValid(t)}}mt("AsAtDate",Mt);class Ct extends Et{validateInputValue(e,t){const n=super.validateInputValue(e,t);return t=C.parse(t),C.isValid(e.min)&&!this.validateMin(e.min,t)&&n.push("min"),C.isValid(e.max)&&!this.validateMax(e.max,t)&&n.push("max"),n}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}`;default:return super.getErrorMessage(e,t,n)}}validateMin(e,t){return!C.isValid(e)||!C.isValid(t)||t>=e}validateMax(e,t){return!C.isValid(e)||!C.isValid(t)||t<=e}}mt("Number",Ct);class kt extends Ct{validateInputValue(e,t){return super.validateInputValue(e,t)}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2)}`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2)}`;default:return super.getErrorMessage(e,t,n)}}}mt("Currency",kt);class Tt extends Et{getErrorMessage(e,t,n){var o,r,i,a;switch(n=super.getErrorMessage(e,t,n)){case"min":if(M.isValid(null===(o=this.validatorData)||void 0===o?void 0:o.min)){const e=M.parse(null===(r=this.validatorData)||void 0===r?void 0:r.min);return`Value cannot be before ${M.format(e,"DD/MM/yyyy")}`}break;case"max":if(M.isValid(null===(i=this.validatorData)||void 0===i?void 0:i.max)){const e=M.parse(null===(a=this.validatorData)||void 0===a?void 0:a.max);return`Value cannot be after ${M.format(e,"DD/MM/yyyy")}`}}return n}validateInputValue(e,t){var n,o,r,i;const a=super.validateInputValue(e,t);if(0===a.length&&M.isValid(t)){const e=M.parse(t);if(M.isValid(null===(n=this.validatorData)||void 0===n?void 0:n.min)){const t=M.parse(null===(o=this.validatorData)||void 0===o?void 0:o.min);(null==t?void 0:t.getTime())>(null==e?void 0:e.getTime())&&a.push("min")}if(M.isValid(null===(r=this.validatorData)||void 0===r?void 0:r.max)){const t=M.parse(null===(i=this.validatorData)||void 0===i?void 0:i.max);(null==t?void 0:t.getTime())<(null==e?void 0:e.getTime())&&a.push("max")}}return a}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&M.isValid(t)}}mt("Date",Tt);class Ft extends Et{validateInputValue(e,t){const n=super.validateInputValue(e,t);return!w.isNullOrUndefined(e.minLength)&&E.isValid(e.minLength)&&e.minLength>0&&!this.validateMinLength(e.minLength,t)&&n.push("minLength"),!w.isNullOrUndefined(e.maxLength)&&E.isValid(e.maxLength)&&e.maxLength>0&&!this.validateMaxLength(e.maxLength,t)&&n.push("maxLength"),!w.isNullOrUndefined(e.match)&&w.isString(e.match)&&e.match.length>0&&!this.validateMatch(e.match,t)&&n.push("match"),n}getErrorMessage(e,t,n){const o=super.getErrorMessage(e,t,n);switch(o){case"minLength":return`Data not saved. Minimum ${e.minLength} characters are required`;case"maxLength":return`Data not saved. Maximum ${e.maxLength} characters are allowed`;case"match":return"Data not saved. This field contains invalid characters";default:return o}}validateMinLength(e,t){return!(!(!E.isValid(e)||e<=0||w.isNullOrUndefined(t))&&w.isString(t))||t.length>=e}validateMaxLength(e,t){return!(!(!E.isValid(e)||e<=0||w.isNullOrUndefined(t))&&w.isString(t))||t.length<=e}validateMatch(e,t){if(w.isNullOrUndefined(e)||!w.isString(e)||""===e.trim())return!0;if(w.isNullOrUndefined(t)||!w.isString(t)||""===t.trim())return!0;const n=e.match(/(\/?)(.+)\1([a-z]*)/i),o=n[2],r=n[3];return new RegExp(o,r).test(t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(w.isString(t)&&t.length>0&&""!==t.trim())}}mt("String",Ft);class Nt extends Ft{validateInputValue(e,t){return super.validateInputValue(e,t)}}mt("Notes",Nt);class St extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}}mt("ObjectId",St);class Ot extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}}mt("[ObjectId]",Ot);class Dt extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){var n,o,r;if(!super.validateMandatory(e,t))return!1;switch(null==t?void 0:t.ownershipType){case"Sole":return 1===(null===(n=null==t?void 0:t.owners)||void 0===n?void 0:n.length);case"Joint":return 2===(null===(o=null==t?void 0:t.owners)||void 0===o?void 0:o.length);case"Other":return(null===(r=null==t?void 0:t.owners)||void 0===r?void 0:r.length)>=1}return!1}}mt("Ownership",Dt);class Pt extends Ct{validateInputValue(e,t){return super.validateInputValue(e,t)}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}%`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}%`;default:return super.getErrorMessage(e,t,n)}}}mt("Percentage",Pt);class It extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}}mt("SelectBoolean",It);class Rt extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(w.isString(t)&&t.length>0&&""!==t.trim()&&null!==E.parse(t))}}mt("SelectNumber",Rt);class Vt extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!w.isNullOrUndefined(t)&&""!==t.trim()&&this.validateEnum(e.enum,t)}}mt("Select",Vt);const At=(e,t,n)=>{Pe(e,t),Qe(e,n)},Lt=()=>{const e=jt.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(K.unmountComponentAtNode(e),e.remove())}),300))};let Ut=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,o)=>{let r,i;"function"==typeof t.onClose&&(r=t.onClose),t.onClose=e=>{r&&r(e),n({dismissed:!1,result:e}),t.showModal=!1,Lt()},"function"==typeof t.onDismiss&&(i=t.onClose),t.onDismiss=()=>{i&&i(),n({dismissed:!0}),t.showModal=!1,Lt()},t.showModal=!0;let a=e.createElement(ge,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));jt.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),K.render(a,this._container)}))}};const jt=[],Bt={},$t=N((e=>({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}}))),zt=e=>"number"==typeof e?e+"px":e,Ht=t=>{var n,o,r,i,l,d,c,u;const m=$t(),p={};t.fixedWidth&&(p.width=t.fixedWidth),t.fixedHeight&&(p.height=t.fixedHeight),t.fixedHeight&&(p.height=t.fixedHeight),(null===(n=t.margins)||void 0===n?void 0:n.left)&&(p.marginLeft=zt(null===(o=t.margins)||void 0===o?void 0:o.left)),(null===(r=t.margins)||void 0===r?void 0:r.right)&&(p.marginRight=zt(null===(i=t.margins)||void 0===i?void 0:i.right)),(null===(l=t.margins)||void 0===l?void 0:l.top)&&(p.marginTop=zt(null===(d=t.margins)||void 0===d?void 0:d.top)),(null===(c=t.margins)||void 0===c?void 0:c.bottom)&&(p.marginBottom=zt(null===(u=t.margins)||void 0===u?void 0:u.bottom));let g=m.paper+" moorr-modal-content-container";t.contentClassName&&(g+=" "+t.contentClassName);const[v,b]=a(!1),[y,x]=a(!1);s((()=>{x(!v&&!1!==t.showModal)}),[v,y,t.showModal]);const E=e=>{b(!0),(null==t?void 0:t.onDismiss)&&t.onDismiss(e)};let M=m.modal;switch(M+=" moorr-modal-container",t.effect){case"fade":M+=" moorr-fade-modal";break;case"slide":M+=" moorr-slide-modal"}return v&&(M+=" moorr-modal-closing"),e.createElement(V,{disableEnforceFocus:!0,className:M,open:y,onClose:E,closeAfterTransition:!0,BackdropComponent:A,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),w.isFunction(t.onBackdropClick)?t.onBackdropClick(e):E("backdrop")}}},(()=>{switch(t.effect){case"fade":default:return e.createElement(L,{in:y},e.createElement(h,{className:g,sx:e=>({transition:e.transitions.create(["width","height","margin"],{duration:300,easing:e.transitions.easing.easeOut}),transitionProperty:"width, height, margin"}),style:p},t.children));case"slide":return e.createElement(f,{in:y,direction:"left",timeout:300},e.createElement("div",{className:g},t.children))}})())},Gt=(t,n)=>{switch(t){default:case"info":case"warning":case"error":(t=>{_(t,{icon:e.createElement(Y,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(X,{sx:{color:"#EB5757"}})})})(n);break;case"success":(t=>{_(t,{icon:e.createElement(Z,{sx:{color:"#1B5E20"}}),style:{color:"#1B5E20",backgroundColor:"#E8F5E9",border:"2px solid #1B5E20",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(X,{sx:{color:"#1B5E20"}})})})(n)}},Wt=t=>e.createElement(Ht,{effect:"fade",contentClassName:`${t.className}-content-container`,fixedWidth:t.widthValue,fixedHeight:t.heightValue,margins:t.marginValues,showModal:t.showModal,onClose:t.onClose,onDismiss:t.onDismiss,onBackdropClick:t.onBackdropClick},e.createElement("div",{className:`${t.className} moorr-modal-container`},e.createElement("div",{className:"moorr-modal-header"},t.renderHeader),e.createElement("div",{className:"moorr-modal-body"},t.renderBody),!1===t.hasFooter?null:e.createElement("div",{className:"moorr-modal-footer"},e.createElement("div",{className:"left-buttons"},t.renderLeftButtons),e.createElement("div",{className:"status-message"},t.renderStatusMessage),e.createElement("div",{className:"right-buttons"},t.renderRightButtons)))),qt=t=>{const{className:n,onDismiss:r,showModal:i,onClose:a,icon:l,title:s,body:d,closeLabel:c}=t,u=o((()=>{a(!1)}),[a]);o((()=>{a(!0)}),[a]);const p=o((()=>w.isString(d)?e.createElement(m,{paragraph:!0},d):w.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(w.isString(t)||!w.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):w.isNullOrUndefined(d)?e.createElement(m,{paragraph:!0},"Please alert to continue."):d),[d]),g=o((()=>e.createElement(h,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},p())),[p]),v=o((()=>w.isString(s)||!w.isNullOrUndefined(s)?s:"Alert"),[s]),f=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=l?l:e.createElement(b,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},v()),e.createElement(y,{onClick:u,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"},"data-testid":"dismiss"},e.createElement(X,{sx:{fontSize:"1rem"}})))),[l,v,u]),x=o((()=>{const t=c||"Dismiss";return e.createElement(re,{handleClick:u,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[c,u]);return e.createElement(Wt,{className:"alert-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===i,onDismiss:r,onBackdropClick:u,renderHeader:f(),renderBody:g(),renderStatusMessage:x()})};class Kt extends Ut{constructor(e){super(e)}getComponent(){return qt}}Bt.alert=Kt;const _t=t=>{const{className:n,onDismiss:r,showModal:i,onClose:a,icon:l,title:s,body:d,cancelLabel:c,confirmLabel:u}=t,p=o((()=>{a(!1)}),[a]),g=o((()=>{a(!0)}),[a]),v=o((()=>w.isString(d)?e.createElement(m,{paragraph:!0},d):w.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(w.isString(t)||!w.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):w.isNullOrUndefined(d)?e.createElement(m,{paragraph:!0},"Please confirm to continue."):d),[d]),f=o((()=>e.createElement(h,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},v())),[v]),x=o((()=>w.isString(s)||!w.isNullOrUndefined(s)?s:"Confirm"),[s]),E=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=l?l:e.createElement(b,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},x()),e.createElement(y,{onClick:p,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"}},e.createElement(X,{sx:{fontSize:"1rem"},"data-testid":"dismiss"})))),[l,x,p]),M=o((()=>{const t=c||"Cancel";return e.createElement(ae,{handleClick:p,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[c,p]),C=o((()=>{const t=u||"Dismiss";return e.createElement(re,{handleClick:g,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[u,g]);return e.createElement(Wt,{className:"confirm-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===i,onDismiss:r,onBackdropClick:p,renderHeader:E(),renderBody:f(),renderLeftButtons:M(),renderRightButtons:C()})};class Yt extends Ut{constructor(e){super(e)}getComponent(){return _t}}Bt.confirm=Yt;const Xt=t=>{const{className:n,header:o,body:r,leftButtonLabel:i,rightButtonLabel:a,hiddenClose:l,width:s}=t,d=e=>{e.stopPropagation(),t.onDismiss()};return e.createElement(Wt,{className:"opti-info-modal"+(n?" "+n:""),widthValue:null!=s?s:"554px",showModal:!0===t.showModal,onDismiss:t.onDismiss,renderBody:e.createElement(h,{sx:{display:"flex",flexDirection:"row",position:"relative"}},e.createElement(h,{sx:{position:"absolute",right:"12px",top:"12px",cursor:"pointer"}},e.createElement("svg",{onClick:t.onDismiss,width:"20",height:"20",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.8564 6.35381L12.2707 10.9395L16.8976 15.5664L15.5609 16.903L10.9341 12.2762L6.36889 16.8414L5.13506 15.6075L9.70023 11.0424L5.07337 6.4155L6.41002 5.07885L11.0369 9.70571L15.6226 5.11998L16.8564 6.35381Z",fill:"#541868"}))),e.createElement(h,{sx:{width:"60px",background:"#541868",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px",flexShrink:0}}),e.createElement(h,{sx:{position:"absolute",top:"11.81px",left:"12px",borderRadius:"50% 50% 0% 50%",padding:"5px",background:"white"}},e.createElement("img",{style:{height:"50px",background:"#66E84B",borderRadius:"50% 50% 0% 50%",padding:"5px"},src:"/assets/img/opti/Opti-Blinked.gif"})),e.createElement(h,{sx:{padding:"1rem 1rem 1rem 1.5rem"}},e.createElement(h,{sx:{color:"#541868",fontSize:"16px",lineHeight:"22.4px",fontWeight:400}},o),e.createElement(h,{sx:{marginTop:"1rem"}},r),e.createElement(h,{className:"opti-info-modal-buttons",sx:{textAlign:"right",marginTop:"1rem"}},i&&e.createElement(x,{className:"opti-info-modal-button-left",style:{marginRight:"5px"},variant:"contained",color:"primary",onClick:()=>{},"data-testid":`${k.toKebabCase(i)}`},i),!l&&e.createElement(re,{label:"Close",handleClick:d,"data-testid":"close"}))))})};class Zt extends Ut{constructor(e){super(e)}getComponent(){return Xt}}Bt.optiInfo=Zt;const Jt=e=>{var t,n,o,r,i;const a=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!a||!Bt[a])return Promise.reject("invalid-modal");const l=new Bt[a]((null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.props)||{}).open();(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.then)&&l.then((t=>{var n;try{null===(n=null==e?void 0:e.detail)||void 0===n||n.then(t)}catch(e){console.error(e)}})),(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch)&&l.catch(null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.catch),l.finally((()=>{var t,n;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(n=null==e?void 0:e.detail)||void 0===n||n.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=l)};document&&(document.removeEventListener("openModal",Jt),document.addEventListener("openModal",Jt));const Qt=(e,t)=>{const[n,r]=a(null),i=l(null),d=o((e=>{if(!e)return;const n=Object.assign({},e.contentRect.toJSON());E.isValid(t)&&t>0?(clearTimeout(i.current),i.current=setTimeout((()=>{r(n)}),t)):r(n)}),[t]);return s((()=>{const t=e.current;let n;return t&&(n=new ResizeObserver((([e])=>d(e))),n.observe(t)),()=>{n&&t&&(n.unobserve(t),n.disconnect())}}),[e.current]),n},en=r({}),tn=()=>i(en),nn=()=>({context:tn()}),on=(e,t,n)=>{var r,i;const{context:l}=nn();s((()=>{var e,t;w.mutexRelease(null!==(t=null===(e=null==l?void 0:l.sectionContext)||void 0===e?void 0:e.updateSessionId)&&void 0!==t?t:"default")}),[null===(r=null==l?void 0:l.sectionContext)||void 0===r?void 0:r.updateSessionId]);const[d,c]=a(0),u=o((()=>{c((e=>e+1))}),[]),[m,p]=a(!1),[h,g]=a(!1),v=o(((e,t)=>{const n=!0===t;p(!0===e),g(n)}),[]),f=o((n=>oe(void 0,void 0,void 0,(function*(){if(w.isFunction(t)){const[e]=yield Promise.all([t(n)]);if(!e)return}return l.onMoveBack&&l.onMoveBack({section:e,data:n})}))),[h,t,l.onMoveBack]),[b,y]=a(!1),[x,E]=a(!1),[M,C]=a(null);s((()=>{x&&l.onMoveNext&&l.onMoveNext({section:e,data:M})}),[x,M]);const k=o((e=>oe(void 0,void 0,void 0,(function*(){var t,o;try{y(!0),yield w.delay(350),yield w.mutex(null!==(o=null===(t=null==l?void 0:l.sectionContext)||void 0===t?void 0:t.updateSessionId)&&void 0!==o?o:"default",(()=>oe(void 0,void 0,void 0,(function*(){if(yield w.delay(350),w.isFunction(n)){const[t]=yield Promise.all([n(e)]);if(!t)return}else if(m||h)return;E(!0),C(e)}))))}finally{y(!1)}}))),[null===(i=null==l?void 0:l.sectionContext)||void 0===i?void 0:i.updateSessionId,m,h,n]),{updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:S}=yt();return{context:l.sectionContext,sectionStep:d,nextSectionStep:u,hasErrors:m,hasMandatoryErrors:h,handleSetHasErrors:v,moveBack:f,moveNext:k,awaitingMoveNext:b,updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:S}},rn=(e,t,n)=>{const[r,i]=a(t),[l,d]=a(null),[c,u]=a(null),[m,p]=a(null),[h,g]=a(!1),v=o((()=>new Promise((t=>{if(h)return void t(h);const n={};Xe(`wizardSection.validateForm.${e}`,{callback:(e,o)=>{n.hasErrors=!0===(null==n?void 0:n.hasErrors)||e,n.hasMandatoryErrors=1==(null==n?void 0:n.hasMandatoryErrors)||o;const r=!n.hasErrors&&!n.hasMandatoryErrors;r||g(!0),t(r)}})}))),[h,e]),{context:f,sectionStep:b,nextSectionStep:y,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:S}=on(e,void 0,v);s((()=>{if(!(null==f?void 0:f.validationSchemas))return;oe(void 0,void 0,void 0,(function*(){yield n(null,t,p,(()=>{}),(()=>{}),f.validationSchemas),i(t);const e=t.tiles[0];d(e);const o={};e.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),u(o)}))}),[t,null==f?void 0:f.validationSchemas]);const[O,D]=a(null),P=o((e=>oe(void 0,void 0,void 0,(function*(){var n,o;if(!t||!m||!O)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:r,hasMandatoryErrors:i}=yield bt(t,m,null,D,T);return(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.callback)&&(null===(o=null==e?void 0:e.detail)||void 0===o||o.callback(r,i)),{hasErrors:r,hasMandatoryErrors:i}}))),[t,m,O,T]);return Ye(`wizardSection.validateForm.${e}`,P),{context:f,sectionStep:b,nextSectionStep:y,settings:r,graphingTile:l,graphingControls:c,inputSchemas:m,data:O,setData:D,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:S}},an=e=>{const[t,n]=a(e),[o,r]=a(null),[i,l]=a(null);return s((()=>{n(e);const t=e.tiles[0];r(t);const o={};t.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),l(o)}),[e]),{settings:t,graphingTile:o,graphingControls:i}},ln=t(((t,n)=>{var{stepIndex:o,sectionStep:r,onNextSectionStep:i,onStepIncrease:a,enterTimeout:l,onEntered:s,children:d}=t,c=ne(t,["stepIndex","sectionStep","onNextSectionStep","onStepIncrease","enterTimeout","onEntered","children"]);return e.createElement(Q,{in:r>=o,timeout:{enter:null!=l?l:600},mountOnEnter:!0,onEntered:()=>{i&&i(),s&&s()}},e.createElement(J,Object.assign({},c,{ref:n}),d))})),sn=t(((t,r)=>{var i,a,{section:l,children:d,animate:c,animateIn:m,animateOut:p,animateEasing:h,animateDuration:g,maxWidth:v,sx:f}=t,b=ne(t,["section","children","animate","animateIn","animateOut","animateEasing","animateDuration","maxWidth","sx"]);const y=u("(max-width: 700px)"),x=tn();s((()=>{x.setSectionMaxWidth(null!=v?v:0)}),[v]);const M=n((()=>{var e;let t={position:"absolute",height:"100%",top:0,overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"6px",height:"6px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#a98bb3",borderRadius:"6px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:"rgb(118, 70, 134)"},"&::-webkit-scrollbar-track":{background:"rgba(118, 70, 134, 0.15)",borderRadius:"6px"}};if(!y&&E.isValid(v)&&v>0&&!w.isNullOrUndefined(null===(e=x.containerRect)||void 0===e?void 0:e.width)&&x.containerRect.width>v){const e=Math.floor((x.containerRect.width-v)/2);t=Object.assign(Object.assign({},t),{left:e,width:`calc(100% - ${e}px)`})}else t=Object.assign(Object.assign({},t),{left:0,width:"100%",padding:y?"0 0.75rem":"0"});return t}),[y,v,null===(i=x.containerRect)||void 0===i?void 0:i.width]),C=n((()=>{var e;let t=Object.assign(Object.assign({},f),{width:"100%"});return E.isValid(v)&&v>0&&!w.isNullOrUndefined(null===(e=x.containerRect)||void 0===e?void 0:e.width)&&x.containerRect.width>v&&(t=Object.assign(Object.assign({},t),{maxWidth:v})),t}),[f,v,null===(a=x.containerRect)||void 0===a?void 0:a.width]),k=o((()=>e.createElement(J,Object.assign({},b,{ref:r,className:`wizard-section wizard-section-${l}`,sx:M}),e.createElement(J,{sx:C},d))),[l,M,C,d,b]),T=n((()=>{var e;return null!==(e=null!=c?c:x.animate)&&void 0!==e?e:"fade"}),[x.animate,c]),F=n((()=>({enter:!1!==m?null!=g?g:300:0,exit:!1!==p?null!=g?g:300:0})),[m,p,g]),N=n((()=>null!=h?h:"ease-in-out"),[]),S=o((()=>e.createElement(Q,{easing:N,timeout:F,in:x.section===l,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{e.style.opacity="0"},onEntering:e=>{e.style.opacity="1"},onEntered:e=>{e.style.opacity="",e.style.transition="",x.setSectionMaxWidth(null!=v?v:0)}},k())),[N,F,x.section,l,k]),O=n((()=>{switch(T){case"scroll-up":return"back"!==x.moveDirection?x.section===l?"up":"down":x.section===l?"down":"up";case"scroll-down":return"back"!==x.moveDirection?x.section===l?"down":"up":x.section===l?"up":"down";case"scroll-left":return"back"!==x.moveDirection?x.section===l?"left":"right":x.section===l?"right":"left";case"scroll-right":return"back"!==x.moveDirection?x.section===l?"right":"left":x.section===l?"left":"right"}}),[x.section,x.moveDirection,l,T]),D=o((()=>e.createElement(ee,{container:x.containerRef.current,direction:O,easing:N,timeout:F,in:x.section===l,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{var t,n,o,r;switch(O){case"up":e.style.transform=e.style.webkitTransform=`translateY(${null===(t=x.containerRect)||void 0===t?void 0:t.height}px)`;break;case"down":e.style.transform=e.style.webkitTransform=`translateY(-${null===(n=x.containerRect)||void 0===n?void 0:n.height}px)`;break;case"left":e.style.transform=e.style.webkitTransform=`translateX(${null===(o=x.containerRect)||void 0===o?void 0:o.width}px)`;break;case"right":e.style.transform=e.style.webkitTransform=`translateX(-${null===(r=x.containerRect)||void 0===r?void 0:r.height}px)`}},onEntering:e=>{switch(O){case"up":case"down":e.style.transform=e.style.webkitTransform="translateY(0)";break;case"left":case"right":e.style.transform=e.style.webkitTransform="translateX(0)"}},onEntered:e=>{e.style.transform="",e.style.webkitTransform="",e.style.transition="",x.setSectionMaxWidth(null!=v?v:0)}},k())),[N,F,x.section,l,O,x.containerRect,k]),P=o((()=>{switch(T){case"fade":return S();case"scroll-up":case"scroll-down":case"scroll-left":case"scroll-right":return D()}return x.section!==l?null:k()}),[x.section,l,T,S,D,k]);return e.createElement(e.Fragment,null,P())})),dn=t((({children:t,initialSection:r,animate:i,avatar:c,isAvatarVisible:u,sx:m,onMoveBack:p,onMoveNext:h,onSectionChange:g,sectionContext:v},f)=>{const b=l(null),y=Qt(b),[x,M]=a(r);s((()=>{r&&g&&g(r)}),[r]);const[C,k]=a(null),[T,F]=a(),N=l(null),S=Qt(N),O=o(((e,t)=>{e!==x&&(M(e),k(null!=t?t:null),g&&g(e))}),[x,g]),D=n((()=>({containerRef:b,containerRect:y,section:x,moveDirection:C,onMoveBack:p,onMoveNext:h,changeSection:O,setSectionMaxWidth:F,animate:i,sectionContext:v})),[y,x,C,p,h,O,i,v]);d(f,(()=>({section:x,context:D})),[x,D]);const P=n((()=>{if(w.isNullOrUndefined(y))return null;if(w.isNullOrUndefined(c)||w.isNullOrUndefined(S))return null;let e={display:"inline-block",position:"absolute"};return e=w.isFunction(u)&&!u(x)?Object.assign(Object.assign({},e),{opacity:0}):Object.assign(Object.assign({},e),{opacity:1}),E.isValid(T)&&T>0&&(e=Object.assign(Object.assign({},e),{left:Math.floor((y.width-T)/2)-S.width})),e}),[y,c,u,S,T]),I=o((()=>w.isNullOrUndefined(T)||0===T||w.isNullOrUndefined(P)?null:c),[T,c,P]);return e.createElement(J,{ref:b,sx:Object.assign({position:"relative"},m)},e.createElement(en.Provider,{value:D},e.createElement(J,{ref:N,sx:P},I()),t))}));export{wt as AddressValidator,Kt as AlertModal,Mt as AsAtDateValidator,te as Button,Yt as ConfirmModal,kt as CurrencyValidator,Tt as DateValidator,ce as Dropdown,Wt as FadeModal,Ue as FormGroupAddActionModel,je as FormGroupModel,rt as FormGroupsTile,He as FormGroupsTileModel,Ae as FormInputModel,ve as GraphingContext,et as GraphingControl,Ve as GraphingControlModel,Le as GraphingControlSettingsModel,Ze as GraphingGrid,nt as GraphingPage,Oe as GraphingSettingsModel,xe as GraphingTile,tt as GraphingTileControls,Be as GraphingTileModel,Se as GraphingTileSettingsModel,Ce as GraphingTiles,it as HorizontalTile,Ge as HorizontalTileModel,Ut as Modal,Ht as MoorrModal,ze as MultipleControlsTileModel,Nt as NotesValidator,Ct as NumberValidator,St as ObjectIdValidator,Ot as ObjectIdsValidator,Zt as OptiInfoModal,Dt as OwnershipValidator,Pt as PercentageValidator,re as PrimaryButton,ie as QtyButton,ae as SecondaryButton,It as SelectBooleanValidator,le as SelectButton,Rt as SelectNumberValidator,Vt as SelectValidator,at as SelectableStatesTile,We as SelectableStatesTileModel,lt as SimpleFormTile,qe as SimpleFormTileModel,$e as SingleControlTileModel,st as SingleTile,Ke as SingleTileModel,Ft as StringValidator,ge as StylesProvider,pe as SvgIcon,Et as Validator,dt as VerticalTile,_e as VerticalTileModel,dn as Wizard,sn as WizardSection,ln as WizardSectionStep,vt as checkDataForErrors,Ie as createGraphingControl,Re as createGraphingControls,Fe as createGraphingTile,Ne as createGraphingTiles,pt as createValidator,ht as createValidators,Xe as dispatchRootEvent,gt as hasInputError,Bt as modals,jt as modalsStack,Pe as registerGraphingControl,Qe as registerGraphingControlComponent,At as registerGraphingFrameworkComponent,Te as registerGraphingTile,ye as registerGraphingTileComponent,me as registerSvgIconComponent,mt as registerValidator,Gt as toastMessage,fe as useGraphingContext,xt as useGraphingForm,ct as useGraphingFramework,Qt as useResizeObserver,Ye as useRootEventListener,yt as useUpdateTracker,nn as useWizard,tn as useWizardContext,an as useWizardForm,rn as useWizardFormSection,on as useWizardSection,bt as validateData,ft as validateInput};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moorr-react-mui",
3
- "version": "0.3.29",
3
+ "version": "0.3.31",
4
4
  "description": "Moorr React MUI Common Library",
5
5
  "scripts": {
6
6
  "_clear": "rimraf index.* && rimraf typings/* && rimraf cjs/*",