@zealicsolutions/web-ui 1.1.13 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/_virtual/index3.js +1 -1
- package/dist/esm/_virtual/index4.js +1 -1
- package/dist/esm/molecules/Select/Select.js +1 -1
- package/dist/esm/molecules/Select/Select.js.map +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Accordion/Accordion.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Menu/Menu.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/MenuList/MenuList.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Select/SelectInput.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/SpeedDial/SpeedDial.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Tabs/Tabs.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
- package/dist/esm/node_modules/@mui/material/node_modules/react-is/index.js +1 -1
- package/dist/esm/node_modules/classnames/index.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/arrows.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/dots.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/inner-slider.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/track.js +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1028,7 +1028,7 @@
|
|
|
1028
1028
|
position: relative;
|
|
1029
1029
|
gap: ${({gap:e})=>e?"number"==typeof e?`${e}px`:e:"0"};
|
|
1030
1030
|
${({scrollable:e})=>e?"\n overflow-y: auto;\n overflow-x: hidden;\n min-height: 0; /* Important for flex children to respect overflow */\n ":""}
|
|
1031
|
-
`,lht=e=>{if("menu_item"===e.type){const t=e;if(!t.sx)return!1;const r=e=>!!e&&(Array.isArray(e)?e.some(r):"function"!=typeof e&&("object"==typeof e&&("absolute"===e.position||"fixed"===e.position)));return r(t.sx)}return!1},cht=({currentWebpageId:t,anchor:r="left",variant:o="persistent",open:n=!1,onClose:a,items:i=[],withButton:s=!0,buttonText:l="",buttonVariant:c="contained",buttonTextColor:u,buttonFontSize:d,buttonFontWeight:p,buttonFontFamily:h,buttonDisabled:f=!1,buttonGap:m=0,buttonStartIcon:y,buttonEndIcon:g,buttonBorderRadius:v="0px",buttonPaddingTop:x="0px",buttonPaddingRight:b="0px",buttonPaddingBottom:w="0px",buttonPaddingLeft:k="0px",buttonMarginTop:_="0px",buttonMarginRight:C="0px",buttonMarginBottom:M="0px",buttonMarginLeft:S="0px",buttonIconOnly:D,buttonElevation:O,buttonFillColor:P,buttonFillColorDisabled:E,buttonFillColorHover:j,buttonFillColorPressed:T,buttonBorderColor:N,buttonBorderColorDisabled:R,buttonBorderColorHover:F,buttonBorderColorPressed:I,buttonTextColorDisabled:A,buttonTextColorHover:z,buttonTextColorPressed:L,buttonColor:B="#1976d2",buttonDisabledColor:V,withCloseIcon:$=!0,closeIconColor:H=so.colors.gray2,closeIconName:q="x",closeIconSize:W=18,closeIconBackgroundColor:U="rgba(255, 255, 255, 0.9)",closeIconVisible:G=!1,closeIconTop:K="16px",closeIconLeft:Y="16px",closeIconBorderRadius:Z="50%",closeIconElevation:X=2,moleculeId:Q,configurationItemInfo:J,sx:ee,contentSx:te,scrollable:re=!1,paddingTop:oe,paddingRight:ne,paddingBottom:ae,paddingLeft:ie,height:se,width:le,mobileWidth:ce,backgroundColor:ue="#fff",gap:de="8px",marginTop:pe="0px",marginRight:he="0px",marginBottom:fe="0px",marginLeft:me="0px"})=>{const ye=Ye(),{isConfigurationMode:ge,selectedConfigurationItemId:ve,onConfigurationItemClicked:xe,onInternalNavigation:be}=IC(),{updateDrawer:we,drawerContainerRef:ke,headerHeight:_e,isMobile:Ce}=EC(),[Me,Se]=e.useState(n),[De]=(()=>{try{return Jpt()}catch{return[new URLSearchParams,()=>{}]}})(),Oe=e.useMemo(()=>{if(t)return t;const e=De.get(n9e),r=De.get(o9e);let o=null,n=null;if("undefined"!=typeof window)try{const e=new URLSearchParams(window.location.search);o=e.get(n9e),n=e.get(o9e)}catch(FJe){}return e||r||o||n||""},[t,De]);e.useEffect(()=>{Se(n)},[n]);const Pe=Boolean(ge&&(ve===Q||i.some(e=>e.id===ve))),Ee=()=>"permanent"===o||(ge?Pe:s?Me:n);e.useEffect(()=>{const e=Ee(),t="left"===r||"right"===r,n=Ce&&void 0!==ce?ce:le;let a=0;if(void 0!==n)if("number"==typeof n)a=n;else if("string"==typeof n){const e=parseFloat(n);Number.isNaN(e)||(a=e)}let i=0;if(t&&!Ce)switch(o){case"permanent":i=a;break;case"persistent":default:i=e?a:0;break;case"temporary":i=0}return we({isOpen:e,position:r,width:i}),()=>{we({isOpen:!1,width:0})}},[Me,n,Pe,ge,s,r,le,ce,Ce,o,we]);const je=()=>{"permanent"!==o&&Se(!0)},Te=(e,t)=>{"permanent"!==o&&(Se(!1),a?.(e,t))},Ne=e=>{const t=ve===e.id,r={entityId:e.id,entity:"molecule_item",entityType:e.type},o=ge?{onClick:e=>{e.stopPropagation(),xe?.(r,!1)},onDoubleClick:e=>{e.stopPropagation(),xe?.(r,!0)},"data-organism-id":e.id,css:hrt({theme:ye,selected:t})}:{};switch(e.type){case"menu_item":{const t=e;e.id;const r=(e=>{const t=e?.link;if(!t||!t.internalLink)return!1;const r=g9e(t.internalLink);return!(!r||!Oe)&&r===Oe})(t),n={backgroundColor:t.backgroundColor||"transparent",paddingTop:t.paddingTop||"8px",paddingRight:t.paddingRight||"16px",paddingBottom:t.paddingBottom||"8px",paddingLeft:t.paddingLeft||"16px",opacity:t.disabled?.6:1,pointerEvents:t.disabled?"none":"auto","&:hover":{backgroundColor:t.disabled?t.backgroundColor||"transparent":"rgba(0, 0, 0, 0.08)"}},a=t.sx?[n,t.sx]:n;return it(xx,{sx:a,selected:r,onClick:()=>{if(t?.link){d9e(t.link)?be?.({link:t.link?.internalLink||""}):c9e(t.link?.externalLink)}},disabled:t.disabled,...o,children:[t.startIcon&&at(jGe,{iconName:t.startIcon,color:t.textColor}),at(Pd,{sx:{ml:t.startIcon?1:0,mr:t.endIcon?1:0,color:t.textColor||"inherit",fontSize:t.fontSize||"inherit",fontWeight:t.fontWeight||"normal",fontFamily:t.fontFamily||"inherit",whiteSpace:t.wrap?"normal":"nowrap",width:"100%",textAlign:t.textAlign||"left"},children:t.text}),t.endIcon&&at(jGe,{iconName:t.endIcon,color:t.textColor})]},t.id)}case"divider_item":{const t=e;return at(Spt,{moleculeId:t.id,variant:t.variant,lineWeight:t.lineWeight,orientation:t.orientation,borderColor:t.borderColor,borderRadius:t.borderRadius,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft,configurationItemInfo:o},t.id)}case"text_item":{const t=e;return at(Ept,{id:t.id,text:t.text,align:t.align,color:t.color,wrap:t.wrap,variant:"string"==typeof t.variant&&["inherit","body1","body2","caption","button","overline","subtitle1","subtitle2","h1","h2","h3","h4","h5","h6"].includes(t.variant)?t.variant:void 0,fontSize:t.fontSize??"",fontWeight:["normal","bold"].includes(t.fontWeight)?t.fontWeight:void 0,fontFamily:t.fontFamily??"",marginTop:t.marginTop||"",marginRight:t.marginRight||"",marginBottom:t.marginBottom||"",marginLeft:t.marginLeft||"",paddingTop:t.paddingTop||"",paddingRight:t.paddingRight||"",paddingBottom:t.paddingBottom||"",paddingLeft:t.paddingLeft||"",configurationsItemInfo:o},t.id)}case"rich_text_item":{const t=e;return at(Ppt,{htmlElementId:t.id,text:t.text,isRichText:!0,marginTop:t.marginTop||"",marginRight:t.marginRight||"",marginBottom:t.marginBottom||"",marginLeft:t.marginLeft||"",paddingTop:t.paddingTop||"",paddingRight:t.paddingRight||"",paddingBottom:t.paddingBottom||"",paddingLeft:t.paddingLeft||"",configurationItemInfo:o},t.id)}case"image_item":{const t=e;return at(Dpt,{src:t.src,alt:t.alt||"Drawer image",height:t.height,width:t.width,raised:t.raised,borderRadius:t.borderRadius||"0",marginTop:t.marginTop||"0",marginRight:t.marginRight||"0",marginBottom:t.marginBottom||"0",marginLeft:t.marginLeft||"0",paddingTop:t.paddingTop||"0",paddingRight:t.paddingRight||"0",paddingBottom:t.paddingBottom||"0",paddingLeft:t.paddingLeft||"0",onClick:()=>{if(t?.link){d9e(t.link)?be?.({link:t.link?.internalLink||""}):c9e(t.link?.externalLink)}},moleculeId:t.id,configurationItemInfo:o},t.id)}default:return null}},Re=Ce&&void 0!==ce?ce:le,Fe=at(rht,{anchor:r,variant:o,open:Ee(),onClose:Te,paddingTop:oe,paddingRight:ne,paddingBottom:ae,paddingLeft:ie,height:se,width:Re,backgroundColor:ue,marginTop:`calc(${_e} + ${pe})`,marginRight:he,marginBottom:fe,marginLeft:me,container:ke,sx:ee,children:it(aht,{scrollable:re,sx:te,...J&&Object.keys(J).length?{...J,"data-testid":"drawer-content-config","aria-label":"drawer-content"}:{},children:[(Ee()||"permanent"===o)&&i.length>0?it(nt,{children:[at(sht,{gap:de,scrollable:re,children:i.filter(e=>!lht(e)).map(Ne)}),i.filter(e=>lht(e)).map(Ne)]}):null,!!$&&(!!G||Ee())&&at(iht,{top:K,left:Y,borderRadius:Z,elevation:X,backgroundColor:U,onClick:e=>{e.stopPropagation();Ee()?Te(e,"closeIconClicked"):je()},"data-testid":"close-icon",children:at(jGe,{"data-testid":"icon-renderer",iconName:q,size:W,color:H})})]})});return s&&"permanent"!==o?it(nt,{children:[at(pKe,{moleculeId:Q,gap:m,text:l,variant:c,textColor:u,fontSize:d,fontWeight:["normal","bold"].includes(p)?p:void 0,fontFamily:h,disabled:f,startIcon:y,endIcon:g,marginTop:_,marginRight:C,marginBottom:M,marginLeft:S,paddingTop:x,paddingRight:b,paddingBottom:w,paddingLeft:k,borderRadius:v,iconOnly:D,elevation:O,fillColor:P||B,fillColorDisabled:E||V,fillColorHover:j,fillColorPressed:T,borderColor:N,borderColorDisabled:R,borderColorHover:F,borderColorPressed:I,textColorDisabled:A,textColorHover:z,textColorPressed:L,externalOnClick:e=>Me?Te(e,"buttonClicked"):je(),configurationItemInfo:J}),at(nht,{children:Fe})]}):at(nht,{children:Fe})},uht=e.forwardRef((e,t)=>{const{inputRef:r,...o}=e;return at(aYe,{...o,ref:e=>{"function"==typeof r&&r(e?e.inputElement:null)},mask:gYe,guide:!0,placeholderChar:" "})}),dht=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0},pht=({masked:e,errorMsg:t,inputSx:r,labelSx:o,sx:n,variant:a="outlined",...i})=>{const s=e?{inputComponent:uht}:{};return at(iC,{...i,variant:a,error:!!t,helperText:t||null,type:"text",sx:{...n},slotProps:{input:{sx:{...r,...n},...s},inputLabel:{sx:{...o,...n}}}})},hht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="Email is required",validationErrorText:n="Invalid email address",text:a,placeholderText:i,masked:s=!1,multiLine:l=!1,backgroundColor:c,borderColor:u,color:d="inherit",fontSize:p="16px",fontFamily:h="inherit",fontWeight:f="normal",textAlign:m="left",marginLeft:y="0",marginTop:g="0",marginRight:v="0",marginBottom:x="0",paddingLeft:b="0",paddingTop:w="0",paddingRight:k="0",paddingBottom:_="0",width:C,height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P,sx:E,name:j,sourceDataModelField:T,configurationItemInfo:N,inputSize:R="medium",labelOffset:F,hideLabel:I=!1,variant:A="outlined"})=>{const z=Kt(),L=z?.control,B=!(!L||!j),V=wrt({name:j,sourceDataModelField:T,form:z,enabled:B});e.useState("");const[$,H]=e.useState(""),q={required:!!r&&o,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:n}},W=e.useMemo(()=>{if(I)return;if(void 0!==F)return F;const e=dht(w),t=dht(_);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=dht(M)||dht(S)||dht(D);if(!o&&!e&&!t)return;const n="number"==typeof p?1.5*p:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[M,S,D,F,R,p,w,_,I]),U=e.useMemo(()=>{if(I)return;const e="small"===R?-6:-9,t=dht(M)||dht(S)||dht(D);return!t||t>=36?e:-6},[M,S,D,R,I]);if(t){let e="";if(void 0!==V)e=String(V??"");else if(B){const t=AGe(z.watch(j),j,"value");e=t?String(t):""}const t=e||i||"-";return it("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...N,children:[a&&at(wg,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,marginLeft:0,marginBottom:"4px",...E},children:a}),at(Pd,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_,backgroundColor:c,border:`1px solid ${u||"#ccc"}`,borderRadius:"4px",minWidth:"120px",textAlign:m,...E},children:t})]})}const G={backgroundColor:c,color:d,fontSize:p,fontFamily:h,fontWeight:f,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},"& .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-input":{textAlign:m,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_}},K={color:d,"&.Mui-focused":{color:d},...I&&{display:"none"},...void 0!==W&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${W}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${U}px) scale(0.75)`}}},Y=l?3:1,Z={...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}};return at("div",B?{style:{marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},sx:{"& .MuiTextField-root":{width:C||"100%",height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...E},children:at(tr,{name:j,rules:q,control:L,defaultValue:"",render:({field:e,fieldState:t})=>at(pht,{masked:s,required:r,errorMsg:t.error?.message,inputSx:G,labelSx:K,sx:{...Z,...E},size:R,variant:A,label:I?void 0:a,placeholder:i,multiline:l,minRows:Y,value:AGe(e.value,j,"value")||"",onChange:e=>{zGe(z,j,e.target.value,"value")},...N||{}})})}:{style:{marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},sx:{"& .MuiTextField-root":{width:C||"100%",height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...E},children:at(pht,{masked:s,required:r,errorMsg:void 0,inputSx:G,labelSx:K,sx:{...Z,...E},size:R,variant:A,label:I?void 0:a,placeholder:i,multiline:l,minRows:Y,value:$,onChange:e=>H(e.target.value),...N||{}})})},fht=({src:t,text:r,type:o,link:n,sourceDataModelField:a,color:i=so.colors.deepBlue,disabled:s=!1,disabledColor:l,underline:c="hover",variant:u="body2",margin:d="0",padding:p="0",moleculeId:h,configurationItemInfo:f,marginTop:m="0",marginRight:y="0",marginBottom:g="0",marginLeft:v="0",paddingTop:x="0",paddingRight:b="0",paddingBottom:w="0",paddingLeft:k="0",fontFamily:_,fontWeight:C,fontSize:M,align:S,target:D,sx:O,borderColor:P,borderWidth:E,borderStyle:j,borderRadius:T,iconOnly:N,ariaLabel:R,iconName:F,iconSize:I,validationErrorText:A})=>{const{onStateChange:z}=YC(),{onInternalNavigation:L,isConfigurationMode:B,localStateObject:V}=IC();UC();const $=ht(),H=a?$Ge(a):r,q=n&&p9e(n),W=e.useMemo(()=>q?h9e(n,$?.rawItemDataByDmfId):null,[n,q,$?.rawItemDataByDmfId]),U=q&&!W,G=e.useMemo(()=>{if(W)return W.destination;const e=n?d9e(n):"internalLink"===o||"internal_link"===o,r=n?e?n.internalLink:n.externalLink:void 0;return t??r??void 0},[W,n,o,t]),K=e.useMemo(()=>W?!W.isExternal:!!n&&d9e(n),[W,n]),Y=e.useMemo(()=>D||(W?W.isExternal?"_blank":"_self":K?"_self":"_blank"),[D,W,K]),Z=s||U,X=Z?l||no(i):i,Q=B||Z?void 0:G,J=Boolean(F),ee="regular"===C?"normal":C,te=N?at(jGe,{iconName:F||"external-link",size:I??16}):it(nt,{children:[at("span",{children:String(H||"")}),J&&at(jGe,{iconName:F,size:I??16})]}),{onClick:re,onDoubleClick:oe,...ne}=f||{},ae=at(mv,{href:Q,component:"a",target:Y,onClick:e=>{z({id:h,type:"clicked"});if(!s&&!U&&!B)return W?(e.preventDefault(),void(W.isExternal?c9e(W.destination):L?.({link:W.destination,webpageAlias:W.webpageAlias,query:W.recordId?{rwoRecordId:W.recordId}:void 0}))):K&&G?(e.preventDefault(),void L?.({link:G})):void(!K&&G&&(e.preventDefault(),c9e(G)));e.preventDefault()},onClickCapture:re||void 0,onDoubleClickCapture:oe||void 0,"aria-label":N?R||String(H||"")||"link":void 0,sx:{color:X,textDecorationColor:X,margin:d,padding:p,marginTop:m,marginRight:y,marginBottom:g,marginLeft:v,paddingTop:x,paddingRight:b,paddingBottom:w,paddingLeft:k,fontFamily:_,fontWeight:ee,fontSize:M,textAlign:S,alignItems:"center",cursor:Z?"not-allowed":"pointer",borderColor:P,borderWidth:E,borderStyle:j,borderRadius:T,display:N||J?"inline-flex":void 0,gap:J&&!N?"4px":void 0,"& .MuiLink-root":{color:"inherit",textDecorationColor:"inherit"},"&:hover":{color:Z?X:no(X,.8),textDecorationColor:Z?X:no(X,.8)},"&:active":{color:Z?X:no(X,.6),textDecorationColor:Z?X:no(X,.6)},"&.Mui-disabled":{color:l||no(i),textDecorationColor:l||no(i),cursor:"not-allowed"},...O},align:S,variant:u,underline:c,...ne,children:te});return ae},mht=e=>({justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}),yht=({popover:t=!0,items:r,marginTop:o="0",marginRight:n="0",marginBottom:a="0",marginLeft:i="0",paddingTop:s="0",paddingRight:l="0",paddingBottom:c="0",paddingLeft:u="0",cornerRadius:d="4px",backgroundColor:p="#fff",width:h="100%",height:f="auto",borderColor:m="#ccc",borderWeight:y="1px",buttonText:g="Open Menu",buttonVariant:v="contained",buttonTextColor:x,buttonFontSize:b,buttonFontWeight:w,buttonFontFamily:k,buttonDisabled:_=!1,buttonGap:C=0,buttonStartIcon:M,buttonEndIcon:S,buttonCornerRadius:D="0",buttonMarginTop:O="0",buttonMarginRight:P="0",buttonMarginBottom:E="0",buttonMarginLeft:j="0",buttonPaddingTop:T="0",buttonPaddingRight:N="0",buttonPaddingBottom:R="0",buttonPaddingLeft:F="0",buttonIconOnly:I,buttonElevation:A,buttonFillColor:z,buttonFillColorDisabled:L,buttonFillColorHover:B,buttonFillColorPressed:V,buttonBorderColor:$,buttonBorderColorDisabled:H,buttonBorderColorHover:q,buttonBorderColorPressed:W,buttonTextColorDisabled:U,buttonTextColorHover:G,buttonTextColorPressed:K,buttonColor:Y="#1976d2",anchorOriginVertical:Z="bottom",anchorOriginHorizontal:X="left",transformOriginVertical:Q="top",transformOriginHorizontal:J="left",elevation:ee=3,sx:te,moleculeId:re,configurationItemInfo:oe})=>{const ne=Ye(),{isConfigurationMode:ae,selectedConfigurationItemId:ie,onConfigurationItemClicked:se,onInternalNavigation:le}=IC(),ce=ht?.(),[ue,de]=e.useState(null),[pe,he]=e.useState(!1),[fe]=(()=>{try{return Jpt()}catch{return[new URLSearchParams,()=>{}]}})(),me=e.useMemo(()=>{const e=fe.get(n9e),t=fe.get(o9e);let r=null,o=null;if("undefined"!=typeof window)try{const e=new URLSearchParams(window.location.search);r=e.get(n9e),o=e.get(o9e)}catch(FJe){}return e||t||r||o||""},[fe]),ye=e=>{const t=e?.link;if(!t||!t.internalLink)return!1;const r=g9e(t.internalLink);return!(!r||!me)&&r===me},ge=Boolean(ae&&(ie===re||r.some(e=>e.id===ie))),ve=()=>he(!0),xe=()=>he(!1),be={marginTop:o,marginRight:n,marginBottom:a,marginLeft:i,paddingTop:s,paddingRight:l,paddingBottom:c,paddingLeft:u,"& .MuiMenu-paper":{backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3]},"& .MuiMenu-list":{padding:0,width:h,height:f,overflow:"hidden"},"& .MuiMenuItem-root":{minHeight:"auto",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px"},"& .MuiListItemButton-root":{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px"},"& .MuiListItemText-primary":{fontSize:"14px",fontFamily:"inherit"},"& .MuiTypography-root":{fontSize:"14px",fontFamily:"inherit"},...t?{display:"inline-block",zIndex:ne?.zIndex?.drawer}:{width:h,height:f,backgroundColor:p,display:"block",overflow:"hidden",border:`${y} solid ${m}`,borderRadius:d},...te};return t?it(Zf,{children:[at(pKe,{ref:de,text:g,variant:v,moleculeId:re,textColor:x,fontSize:b,fontWeight:w,fontFamily:k,disabled:_,gap:C,startIcon:M,endIcon:S,onClick:ve,marginTop:O,marginRight:P,marginBottom:E,marginLeft:j,paddingTop:T,paddingRight:N,paddingBottom:R,paddingLeft:F,borderRadius:D,iconOnly:I,elevation:A,fillColor:z||Y,fillColorDisabled:L,fillColorHover:B,fillColorPressed:V,borderColor:$,borderColorDisabled:H,borderColorHover:q,borderColorPressed:W,textColorDisabled:U,textColorHover:G,textColorPressed:K,configurationItemInfo:oe}),at(fx,{open:ae?ge:pe,variant:"menu",anchorEl:ue,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:xe,anchorOrigin:{vertical:Z,horizontal:X},transformOrigin:{vertical:Q,horizontal:J},elevation:ee,slotProps:{paper:{sx:{backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3],"& .MuiMenu-list":be["& .MuiMenu-list"],"& .MuiMenuItem-root":be["& .MuiMenuItem-root"],"& .MuiListItemText-primary":be["& .MuiListItemText-primary"],"& .MuiTypography-root":be["& .MuiTypography-root"]}}},sx:{...be,"& .MuiMenu-paper":be["& .MuiMenu-paper"]},children:r.map(e=>{const t=ie===e.id,r=ye(e),o=e.link&&p9e(e.link)?h9e(e.link,ce?.rawItemDataByDmfId):null,n=e.link&&p9e(e.link)&&!o,a={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},i=ae?e=>{e.stopPropagation(),se?.(a,!1)}:void 0,s=ae?e=>{e.stopPropagation(),se?.(a,!0)}:void 0,l=ae?{onClick:i,onDoubleClick:s,"data-organism-id":e.id,css:hrt({theme:ne,selected:t})}:{};return it(xx,{sx:mht(e),selected:r,disabled:e.disabled||n,onClick:()=>{e?.link&&(o?o.isExternal?c9e(o.destination):le?.({link:o.destination,webpageAlias:o.webpageAlias,query:o.recordId?{rwoRecordId:o.recordId}:void 0}):d9e(e.link)?le?.({link:e.link?.internalLink||""}):c9e(e.link?.externalLink)),xe()},...l,children:[e.startIcon&&at(jGe,{iconName:e.startIcon,color:e.textColor}),at(Pd,{sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"},children:e.text}),e.endIcon&&at(jGe,{iconName:e.endIcon,color:e.textColor})]},e.id)})})]}):at(tu,{id:re,sx:{...be,backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3]},elevation:ee,...oe,children:at(wv,{disablePadding:!0,children:r.map(e=>{const t=ie===e.id,r=ye(e),o=e.link&&p9e(e.link)?h9e(e.link,ce?.rawItemDataByDmfId):null,n=e.link&&p9e(e.link)&&!o,a={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},i=ae?e=>{e.stopPropagation(),se?.(a,!1)}:void 0,s=ae?e=>{e.stopPropagation(),se?.(a,!0)}:void 0,l=ae?{onClick:i,onDoubleClick:s,"data-organism-id":e.id,css:hrt({theme:ne,selected:t})}:{};return it(Dv,{disabled:e.disabled||n,sx:mht(e),selected:r,onClick:()=>{e?.link&&(o?o.isExternal?c9e(o.destination):le?.({link:o.destination,webpageAlias:o.webpageAlias,query:o.recordId?{rwoRecordId:o.recordId}:void 0}):d9e(e.link)?le?.({link:e.link?.internalLink||""}):c9e(e.link?.externalLink))},...l,children:[e.startIcon&&at(jGe,{iconName:e.startIcon,color:e.textColor}),at(Wv,{primary:at(Pd,{sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"},children:e.text})}),e.endIcon&&at(jGe,{iconName:e.endIcon,color:e.textColor})]},e.id)})})})},ght=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0};const vht=({errorMsg:e,stepValue:t,minValue:r,allowNegative:o,inputSx:n,labelSx:a,variant:i="outlined",...s})=>at(iC,{...s,variant:i,type:"number",error:!!e,helperText:e||null,inputProps:{step:t,min:o?void 0:r},slotProps:{input:{sx:n},inputLabel:{sx:a}}}),xht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="This field is required",validationErrorText:n="Invalid numeric value",text:a,placeholderText:i,backgroundColor:s,borderColor:l,textColor:c="#000",fontSize:u,fontFamily:d,fontWeight:p,allowNegative:h=!1,numericPrecision:f="1",name:m,sourceDataModelField:y,marginLeft:g="0",marginTop:v="0",marginRight:x="0",marginBottom:b="0",paddingLeft:w="0",paddingTop:k="0",paddingRight:_="0",paddingBottom:C="0",width:M,height:S,configurationItemInfo:D,textAlign:O,minHeight:P,maxHeight:E,minWidth:j,maxWidth:T,sx:N,inputSize:R="medium",labelOffset:F,hideLabel:I=!1,variant:A="outlined"})=>{const z=Kt(),L=z?.control,B=!(!L||!m);IC(),UC();const V=wrt({name:m,sourceDataModelField:y,form:z,enabled:B}),[$,H]=e.useState(""),q=parseFloat(f),W=h?void 0:0,U={required:!!r&&o,pattern:{value:h?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:n}};h||(U.min={value:0,message:"Value cannot be less than zero"});const G=e.useMemo(()=>{if(I)return;if(void 0!==F)return F;const e=ght(k),t=ght(C);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=ght(S)||ght(P)||ght(E);if(!o&&!e&&!t)return;const n="number"==typeof u?1.5*u:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[S,P,E,F,R,u,k,C,I]),K=e.useMemo(()=>{if(I)return;const e="small"===R?-6:-9,t=ght(S)||ght(P)||ght(E);return!t||t>=36?e:-6},[S,P,E,R,I]);if(t){let e="";if(void 0!==V)e=String(V??"");else if(B){const t=AGe(z.watch(m),m,"value");e=t?String(t):""}const t=e?function(e,t,r){if(!e)return"";const o=parseFloat(e);if(Number.isNaN(o))return e;if(!r&&o<0)return"0";if(t){const e=(t.split(".")[1]||"").length;if(e>0)return o.toFixed(e)}return e}(e,f,h):i||"-";return it("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E}},sx:N,...D,children:[a&&at(wg,{sx:{fontSize:u,fontFamily:d,fontWeight:p,color:c,marginBottom:"4px"},children:a}),at(Pd,{sx:{fontSize:u,fontFamily:d,fontWeight:p,color:c,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,backgroundColor:s,border:`1px solid ${l||"#ccc"}`,borderRadius:"4px",minWidth:"60px"},children:t})]})}const Y={backgroundColor:s,color:c,fontSize:u,fontFamily:d,fontWeight:p,...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},"& .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"}},Z={color:c,"&.Mui-focused":{color:c},...I&&{display:"none"},...void 0!==G&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${G}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${K}px) scale(0.75)`}}},X={...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E}};return at(ag,B?{required:r,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,width:"fit-content",...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},...N},...D,children:at(tr,{name:m,rules:U,control:L,defaultValue:"",render:({field:e,fieldState:t})=>at(vht,{errorMsg:t.error?.message,label:I?void 0:a,placeholder:i,stepValue:q,minValue:W,allowNegative:h,inputSx:Y,labelSx:Z,sx:X,size:R,variant:A,value:AGe(e.value,m,"value")||"",onChange:e=>{zGe(z,m,e.target.value,"value")}})})}:{required:r,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,width:"fit-content",...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},...N},...D,children:at(vht,{errorMsg:void 0,label:I?void 0:a,placeholder:i,stepValue:q,minValue:W,allowNegative:h,inputSx:Y,labelSx:Z,sx:X,size:R,variant:A,value:$,onChange:e=>H(e.target.value)})})},bht=e=>{const t={text:e.label,validate:()=>!0},{rule:r}=e,o=wht(r);if(o||kht(r)){const e=((e,t)=>(r=0)=>e?r<=t:r>=t)(o,o?r.MAX:r.MIN);switch(r.type){case"COUNT":t.validate=t=>e(t?.length);break;case"NUMBER_COUNT":t.validate=t=>e(t?.replace(/\D/g,"").length);break;case"CAPITAL_COUNT":t.validate=t=>e((t?.match(/[A-Z]/g)||[]).length);break;case"SPECIAL_CHARACTERS_COUNT":t.validate=t=>e(t?.replace(/[a-z]|\d|\s/gi,"").length);break;case"LOWER_CASE_COUNT":t.validate=t=>e((t?.match(/[a-z]/g)||[]).length)}}return t},wht=e=>!!e?.MAX,kht=e=>!!e?.MIN,_ht=({gap:t="0",inputProps:r,validations:o,htmlElementId:n,validationState:a,overridesProperties:i,configurationItemInfo:s,width:l,height:c,minWidth:u,maxWidth:d,minHeight:p,maxHeight:h,marginLeft:f="0",marginTop:m="0",marginRight:y="0",marginBottom:g="0",sx:v,...x})=>{const{watch:b,formState:w,setError:k}=Kt()||{},{text:_,subText:C,placeholderText:M,subPlaceholderText:S,validationText:D}=i,O=o.map(bht),P="password",E=`reEnter${P}`,j=b?.(P),T=b?.(E);return e.useEffect(()=>{j!==T&&k(E,{type:"manual",message:"Passwords do not match"})},[j,T,k,E]),it(Zf,{id:n,sx:{width:"100%",display:"flex",flexDirection:"column",gap:t,marginLeft:f,marginTop:m,marginRight:y,marginBottom:g,...l&&{width:l},...c&&{height:c},...u&&{minWidth:u},...d&&{maxWidth:d},...p&&{minHeight:p},...h&&{maxHeight:h},...v},...s,...x,children:[at(Crt,{...r,inputType:"password",text:_?.text,name:P,placeholderText:M?.text}),at(Crt,{...r,inputType:"password",text:C?.text,name:E,placeholderText:S?.text}),at(XKe,{rules:O,value:j,label:D?.text,isSubmitted:w?.isDirty,validationState:a})]})},Cht=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],Mht=e.forwardRef((e,t)=>{const{inputRef:r,...o}=e;return at(aYe,{...o,ref:e=>{"function"==typeof r&&r(e?e.inputElement:null)},mask:Cht,guide:!0,placeholderChar:" "})}),Sht=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0};function Dht(e){const t=(e??"").replace(/\D+/g,"");if(!t)return"";let r="",o=0;return hYe.forEach(e=>{"string"==typeof e?r+=e:o<t.length?(r+=t[o],o+=1):r+="_"}),r}const Oht=({masked:e,errorMsg:t,inputSx:r,labelSx:o,variant:n="outlined",...a})=>at(iC,{...a,variant:n,error:!!t,helperText:t||null,slotProps:{input:{sx:r,...e?{inputComponent:Mht}:{}},inputLabel:{sx:o}}}),Pht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="Phone is required",validationErrorText:n="Invalid phone number",text:a,placeholderText:i,masked:s=!0,multiLine:l=!1,backgroundColor:c,borderColor:u,textColor:d="#000",fontSize:p,fontFamily:h,fontWeight:f,textAlign:m,marginLeft:y="0",marginTop:g="0",marginRight:v="0",marginBottom:x="0",paddingLeft:b="0",paddingTop:w="0",paddingRight:k="0",paddingBottom:_="0",width:C,height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P,name:E,sourceDataModelField:j,configurationItemInfo:T,sx:N,inputSize:R="medium",labelOffset:F,hideLabel:I=!1,variant:A="outlined"})=>{const z=Kt(),L=z?.control,B=!(!L||!E),V=wrt({name:E,sourceDataModelField:j,form:z,enabled:B}),[$,H]=e.useState(""),q={required:!!r&&o,pattern:{value:/^\d{10}$/,message:n}},W=e.useMemo(()=>{if(I)return;if(void 0!==F)return F;const e=Sht(w),t=Sht(_);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=Sht(M)||Sht(S)||Sht(D);if(!o&&!e&&!t)return;const n="number"==typeof p?1.5*p:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[M,S,D,F,R,p,w,_,I]),U=e.useMemo(()=>{if(I)return;const e="small"===R?-6:-9,t=Sht(M)||Sht(S)||Sht(D);return!t||t>=36?e:-6},[M,S,D,R,I]);if(t){let e="";if(void 0!==V)e=String(V??"");else if(B){const t=AGe(z.watch(E),E,"value");e=t?String(t):""}const t=(s?Dht(e):e)||i||"-";return it("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}},...T,children:[a&&at(wg,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,marginLeft:0,marginBottom:"4px",...N},children:a}),at(Pd,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_,backgroundColor:c,border:`1px solid ${u||"#ccc"}`,borderRadius:"4px",minWidth:"120px",...N},children:t})]})}const G={backgroundColor:c,color:d,fontSize:p,fontFamily:h,fontWeight:f,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},"& .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"}},K={color:d,"&.Mui-focused":{color:d},...I&&{display:"none"},...void 0!==W&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${W}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${U}px) scale(0.75)`}}},Y={marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,width:"fit-content",...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}};return at(ag,B?{required:r,sx:{...Y,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},...N},...T,children:at(tr,{name:E,rules:q,control:L,defaultValue:"",render:({field:e,fieldState:t})=>at(Oht,{masked:s,errorMsg:t.error?.message,inputSx:G,labelSx:K,size:R,variant:A,label:I?void 0:a,placeholder:i,value:AGe(e.value,E,"value")||"",onChange:e=>{const t=(e?.target?.value??"").toString().replace(/\D+/g,"");zGe(z,E,t,"value")}})})}:{required:r,sx:{...Y,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},...N},...T,children:at(Oht,{masked:s,errorMsg:void 0,inputSx:G,labelSx:K,size:R,variant:A,label:I?void 0:a,placeholder:i,value:$,onChange:e=>{const t=(e?.target?.value??"").toString();H(t.replace(/\D+/g,""))}})})},Eht=({text:t,name:r,isDisplayOnly:o=!1,required:n=!1,requiredErrorText:a="This field is required",validationErrorText:i="Invalid rating",placeholderText:s="",hoverFeedback:l=!1,sourceDataModelField:c,textAlign:u="left",color:d="black",textColor:p,selectColor:h,fontSize:f=14,fontFamily:m="Arial, sans-serif",fontWeight:y="normal",marginLeft:g="0",marginTop:v="0",marginRight:x="0",marginBottom:b="0",paddingLeft:w="0",paddingTop:k="0",paddingRight:_="0",paddingBottom:C="0",width:M,height:S,minHeight:D,maxHeight:O,minWidth:P,maxWidth:E,placement:j="right",configurationItemInfo:T={},disabled:N=!1,maxValue:R=5,ratingPrecision:F=.5,sx:I,...A})=>{const z=Kt(),L=z?.control,B=!!z&&!!L&&!!r;IC(),UC();const V=wrt({name:r,sourceDataModelField:c,form:z,enabled:B});!B||z.formState.errors;const[$,H]=e.useState(null),[q,W]=e.useState(-1),U=l&&-1!==q;if(o){let e=null;return void 0!==V&&(e=(e=>"number"!=typeof e||Number.isNaN(e)?"string"!=typeof e||Number.isNaN(Number(e))?null:Number(e):e)(V)),it(ag,{required:n,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,display:"inline-flex",...M&&{width:M},...S&&{height:S},...D&&{minHeight:D},...O&&{maxHeight:O},...P&&{minWidth:P},...E&&{maxWidth:E},...I},...T,children:[t&&at(Pd,{variant:"subtitle1",sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,marginBottom:"4px"},children:t}),at(xb,{value:e,max:R,precision:F,readOnly:!0,sx:{"& .MuiRating-iconEmpty":{color:d},"& .MuiRating-iconFilled":{color:h||d},...I},...A})]})}const G={required:!!n&&a,validate:e=>!n||null!==e&&0!==e||a};return it(ag,{required:n,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,display:"inline-flex",...M&&{width:M},...S&&{height:S},...D&&{minHeight:D},...O&&{maxHeight:O},...P&&{minWidth:P},...E&&{maxWidth:E},...I},...T,children:[t&&at(Pd,{variant:"subtitle1",sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,marginBottom:"4px"},children:t}),it(Zf,{sx:{display:"flex",alignItems:"center"},children:["left"===j&&at(Pd,{sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,minWidth:"2em"},children:U?q:B?AGe(z.getValues(r),r,"value")??V??"":$??V??""}),at(tr,{name:r,control:L,defaultValue:"number"==typeof V?V:null,rules:G,render:({field:e,fieldState:{error:t}})=>{const o=AGe(e.value,r,"value");return it(nt,{children:[at(xb,{value:o??V??0,max:R,precision:F,disabled:N,onChange:(e,t)=>{zGe(z,r,t,"value")},onChangeActive:l?(e,t)=>W(t??-1):void 0,sx:{"& .MuiRating-iconEmpty":{color:d},"& .MuiRating-iconFilled":{color:h||d},marginX:l?1:0,...I},...A}),t&&at(wg,{error:!0,sx:{marginTop:"4px"},children:"required"===t.type?a:i})]})}}),"right"===j&&at(Pd,{sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,minWidth:"2em"},children:U?q:B?AGe(z.getValues(r),r,"value")??V??"":$??V??""})]})]})},jht=["value","label","id","code"],Tht=e=>null!=e&&"object"==typeof e&&!Array.isArray(e),Nht=e=>{if("string"==typeof e||"number"==typeof e)return e;if(Tht(e)){if("value"in e&&("string"==typeof e.value||"number"==typeof e.value))return e.value;for(const t of jht){if("value"===t)continue;const r=e[t];if("string"==typeof r||"number"==typeof r)return r}}},Rht=(e,t)=>{if(null==t)return;const r=String(t);return e.find(e=>String(e.id)===r||(void 0!==e.value&&String(e.value)===r||void 0!==e.label&&String(e.label)===r))},Fht=({open:t,text:o,disabled:n,sx:a,placeholderText:i,required:s=!1,requiredErrorText:l="This field is required",isDisplayOnly:c=!1,displayText:u,visible:d=!0,fontSize:p,fontFamily:h,fontWeight:f,textColor:m,textAlign:y,borderColor:g,color:v,backgroundColor:x,marginLeft:b="0",marginTop:w="0",marginRight:k="0",marginBottom:_="0",paddingLeft:C,paddingTop:M,paddingRight:S,paddingBottom:D,width:O,height:P,minHeight:E,maxHeight:j,minWidth:T,maxWidth:N,configurationItemInfo:R={},name:F,sourceDataModelField:I,predefinedValue:A,hideWhenNoValue:z=!1,inputSize:L="medium",hideLabel:B=!1,variant:V="outlined",native:$=!1,options:H,publishToWebpageContext:q=!1,webpageContextKey:W,dataDrivenOptions:U})=>{const G="regular"===f?"normal":f,K=e=>""!==e&&null!=e,Y=U&&!U.isIgnored&&("variable"===U.nature&&Boolean(U.variableName)||"data_model"===U.nature&&Boolean(U.sourceDataModelFieldId)||!U.nature&&(Boolean(U.variableName)||Boolean(U.sourceDataModelFieldId))),Z=e.useMemo(()=>{if(!Y||!U)return;const e=U.nature?.toString().replace(/-/g,"_").toLowerCase()??"";return("variable"===e||!e&&U.variableName)&&U.variableName||U.sourceDataModelFieldId},[Y,U]),X=Z?VGe(Z):void 0,Q=e.useMemo(()=>{if(Y&&X){if(Array.isArray(X))return X.map(e=>{if("string"==typeof e||"number"==typeof e)return{id:e,value:String(e)};if(e&&"object"==typeof e){const t=e;return{id:t.id??t.value??t.code??t.label??"",value:t.value??t.label??t.code??String(t.id??""),label:t.label??t.value??t.code??String(t.id??"")}}return{id:"",value:""}}).filter(e=>""!==e.id&&""!==e.value);if(X&&"object"==typeof X){const e=X;return[{id:e.id??e.value??e.code??e.label??"",value:e.value??e.label??e.code??String(e.id??""),label:e.label??e.value??e.code??String(e.id??"")}].filter(e=>""!==e.id&&""!==e.value)}}},[Y,X]),J=Boolean(Q&&Q.length>0),ee=c||Y?void 0:I,{dataModelFieldOptions:te,isLoading:re}=(e=>{const{pickList:t}=dt(),{data:o=[],refetch:n,isLoading:a}=r.useQuery({queryKey:[WGe,e],queryFn:()=>t.get(e),select:e=>{const t=e?.data;return Array.isArray(t)?t:t&&Array.isArray(t.data)?t.data:[]},enabled:Boolean(e),refetchOnWindowFocus:!0,refetchOnMount:!0});return{dataModelFieldOptions:o,refetch:n,isLoading:a}})(ee),oe=H&&H.length>0?H:J?Q:te,ne=e.useMemo(()=>(oe||[]).map(e=>"string"==typeof e?{id:e,value:e}:e),[oe]),ae=ne.length>0||!re;let ie;try{ie=Kt()}catch(Fe){ie=null}const se=!!ie?.control&&!!F,[le,ce]=e.useState(""),[ue,de]=e.useState(!1);let pe={setLocalStateValue:null,isConfigurationMode:!1,selectedConfigurationItemId:null};try{pe=IC()}catch(Fe){}let he={stateConfig:null};try{he=UC()}catch(Fe){}let fe=null;try{fe=ht()}catch(Fe){}const me=KC();pe.isConfigurationMode&&pe.selectedConfigurationItemId;const ye=null!=A&&""!==A,ge=Boolean(n)||ye,ve=HGe(),xe=I?ve(I):void 0,be=fe?.itemDataByDmfId?.[F],we=Nht(be),ke=e.useMemo(()=>((e,t,r)=>{if(null!=e){if(Tht(e)){const o=e.id;if("string"==typeof o||"number"==typeof o){const r=Rht(t,o);return r?{...r,...e}:e}for(const n of["value","label","code"]){const o=e[n];if("string"==typeof o||"number"==typeof o){const e=Rht(t,o);if(e)return e;if(!r)return}}return}if("string"==typeof e||"number"==typeof e){const o=Rht(t,e);if(o)return o;if(!r)return;return{id:e}}}})(xe,ne,ae),[xe,ne,ae]),_e=wrt({name:F,sourceDataModelField:I,form:ie,fallbackKey:void 0,enabled:se&&!ye,mapValue:()=>ke}),Ce=Nht(xe)??("string"==typeof _e||"number"==typeof _e?_e:void 0);e.useEffect(()=>{ye&&null!=A&&(se?zGe(ie,F,A,"id",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}):ce(A))},[ye,A,se,ie,F]),e.useEffect(()=>{if(d)return;if(!se||!ie)return;if(ke&&!ye)return void zGe(ie,F,ke,"id",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1});const e=be??Ce;if(null!=e&&""!==e&&!ye){const t=Rht(ne,e);zGe(ie,F,t??{id:e},"id",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1})}},[d,ye,se,ie,F,be,Ce,ne,ke]);const Me=be??Ce;if(e.useEffect(()=>{q&&W&&me?.setDynamicContextValue&&void 0!==Me&&me.setDynamicContextValue(W,Me)},[q,W,Me,me]),!d)return null;if(c&&z&&!(be??Ce))return null;if(c){const e=u??(null!=we?String(we):void 0)??(null!=Ce?String(Ce):void 0)??(i||"-"),{css:t,...r}=R||{};return it("div",{css:t,style:{display:"inline-flex",flexDirection:"column",...K(w)&&{marginTop:w},...K(k)&&{marginRight:k},...K(_)&&{marginBottom:_},...K(b)&&{marginLeft:b},...K(O)?{width:O}:{width:"fit-content"},...K(P)&&{height:P},...K(E)&&{minHeight:E},...K(j)&&{maxHeight:j},...K(T)&&{minWidth:T},...K(N)&&{maxWidth:N}},...r,children:[o&&at(wg,{sx:{...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G},color:K(m)?m:"#000",marginLeft:0,marginBottom:"4px",...K(y)&&{textAlign:y}},children:o}),at(Pd,{sx:{...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G},...K(m)&&{color:m},...K(y)&&{textAlign:y},...K(C)&&{paddingLeft:C},...K(M)&&{paddingTop:M},...K(S)&&{paddingRight:S},...K(D)&&{paddingBottom:D},...K(x)&&{backgroundColor:x},border:`1px solid ${K(g)?g:"#ccc"}`,borderRadius:"4px"},children:e})]})}const Se="small"===L?40:56,De={position:"relative",display:K(O)?"block":"inline-block",...K(O)&&{width:O},...K(T)&&{minWidth:T},...K(N)&&{maxWidth:N},...K(b)&&{marginLeft:b},...K(w)&&{marginTop:w},...K(k)&&{marginRight:k},...K(_)&&{marginBottom:_}},Oe={width:"100%",...K(P)&&{height:P},...K(E)&&{minHeight:E},...K(j)&&{maxHeight:j},...!K(O)&&!K(T)&&{minWidth:"240px"},...a},Pe=K(m)?m:K(v)?v:void 0,Ee={..."small"===L&&!P&&{height:`${Se}px`},...K(x)&&{backgroundColor:x},...Pe&&{color:Pe},...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G},...K(g)&&{"& .MuiOutlinedInput-notchedOutline":{borderColor:g},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:g},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:g}},..."filled"===V&&K(g)&&{"&:before":{borderColor:g},"&:after":{borderColor:g},"&:hover:not(.Mui-disabled):before":{borderColor:g}},..."standard"===V&&K(g)&&{"&:before":{borderColor:g},"&:after":{borderColor:g},"&:hover:not(.Mui-disabled):before":{borderColor:g}},"& .MuiSelect-select":{...K(y)&&{textAlign:y},...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G},...K(M)&&{paddingTop:M},...K(D)&&{paddingBottom:D},...K(C)&&{paddingLeft:C},...K(S)&&{paddingRight:S}}},je={...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G}},Te=e=>{const t=((e,t)=>e.find(e=>String(e.id)===t))(ne,e),r=t??{id:e};ce(e),se&&zGe(ie,F,r),I&&pe?.setLocalStateValue&&pe.setLocalStateValue(I,r)},Ne=se?AGe(ie.watch(F),F,"id")||"":le,Re=se?ie.formState?.errors?.[F]:void 0;return at("div",{style:De,...R,onClick:e=>{pe?.isConfigurationMode&&R&&"onClick"in R&&(e.stopPropagation(),e.preventDefault(),R.onClick())},children:it(ag,{variant:V,size:L,sx:Oe,disabled:ge,required:s,error:!!Re,children:[!B&&at(Kg,{id:`${F}-label`,shrink:$?ue||!!Ne:void 0,sx:je,children:o}),at(Fb,{value:Ne,onChange:e=>{pe?.isConfigurationMode||Te(e.target.value)},onFocus:()=>de(!0),onBlur:()=>de(!1),...pe?.isConfigurationMode&&{open:!1},labelId:B?void 0:`${F}-label`,label:B?void 0:o,disabled:ge,native:$,sx:Ee,children:$?[at("option",{value:""},"__placeholder__"),...re?[at("option",{disabled:!0,children:"Loading..."},"__loading__")]:ne.map(e=>at("option",{value:e.id,children:e.value},e.id))]:re?it(xx,{disabled:!0,children:[at(od,{size:20,sx:{mr:1}}),"Loading..."]}):ne.map(e=>at(xx,{value:e.id,children:e.value},e.id))}),Re&&at(wg,{error:!0,children:Re?.message||l})]})})};const Iht=({text:e,name:t,isDisplayOnly:r=!1,required:o=!1,requiredErrorText:n="This field is required",validationErrorText:a="Invalid value",placeholderText:i="",startIcon:s,endIcon:l,borderColor:c,selectLineColor:u,lineWeight:d=1,orientation:p="horizontal",textColor:h,fontSize:f,fontFamily:m,fontWeight:y,valueFormat:g,valueDisplay:v="auto",iconSize:x,selectColor:b,iconColor:w,minValue:k=0,maxValue:_=100,step:C,labelPlacement:M="top",marginLeft:S="0",marginTop:D="0",marginRight:O="0",marginBottom:P="0",paddingLeft:E="0",paddingTop:j="0",paddingRight:T="0",paddingBottom:N="0",width:R,height:F,minHeight:I,maxHeight:A,minWidth:z,maxWidth:L,sx:B,configurationItemInfo:V,sourceDataModelField:$,disabled:H=!1,...q})=>{const W=Kt(),U=W?.control,G=!!U&&!!t&&!r;IC(),UC(),ht();const K=wrt({name:t,sourceDataModelField:$,form:W,enabled:G}),Y={required:!!o&&n,validate:e=>!o||null!=e||n},Z=e=>function(e,t){if(null==e)return"";switch(t){case"$0.00":return`$${e.toFixed(2)}`;case"$123":return`$${e}`;case"%0.00":return`${e.toFixed(2)}%`;case"%123":return`${e}%`;case"0.0":return e.toFixed(1);case"0.00":return e.toFixed(2);default:return e.toString()}}(e,g),X={width:"100%","& .MuiSlider-root":{width:"100%"},"& .MuiSlider-rail":{backgroundColor:c||"#ccc",..."vertical"===p?{width:`${d}px`}:{height:`${d}px`}},"& .MuiSlider-track":{backgroundColor:u||"#2196f3",border:`1px solid ${u||"#2196f3"}`,..."vertical"===p?{width:`${d}px`}:{height:`${d}px`}},"& .MuiSlider-thumb":{backgroundColor:b||"#2196f3",width:x||"16px",height:x||"16px",boxShadow:"none","&:focus, &:hover, &.Mui-active, &.Mui-focusVisible":{boxShadow:"none"}},"& .MuiSlider-valueLabel":{backgroundColor:b||"#2196f3",color:"#ffffff",borderRadius:"4px",fontSize:"12px",fontWeight:500},"& .MuiSlider-mark":{backgroundColor:c||"#ccc",width:"2px",height:"2px",borderRadius:"50%"},"& .MuiSlider-markActive":{backgroundColor:b||"#2196f3"},...B};if(r){let t=null;return void 0!==K&&(t=(e=>"number"!=typeof e||Number.isNaN(e)?"string"!=typeof e||Number.isNaN(Number(e))?null:Number(e):e)(K)),it(ag,{required:o,sx:{marginLeft:S,marginTop:D,marginRight:O,marginBottom:P,paddingLeft:E,paddingTop:j,paddingRight:T,paddingBottom:N,display:"inline-flex",...R&&{width:R},...F&&{height:F},...I&&{minHeight:I},...A&&{maxHeight:A},...z&&{minWidth:z},...L&&{maxWidth:L},...B},...V,children:[e&&at(Dg,{children:e}),it(Zf,{display:"flex",flexDirection:"top"===M?"column":"row",alignItems:"center",mt:"top"===M?1:0,children:[s&&at(Zf,{mr:"horizontal"===p?1:0,mb:"vertical"===p?1:0,children:at(jGe,{iconName:s,color:w})}),at(gw,{value:t??void 0,min:k,max:_,step:C,orientation:p,valueLabelDisplay:v,valueLabelFormat:Z,sx:X,disabled:!0,...q}),l&&at(Zf,{ml:"horizontal"===p?1:0,mt:"vertical"===p?1:0,children:at(jGe,{iconName:l,color:w})}),at(Pd,{sx:{ml:1,fontSize:f,fontFamily:m,fontWeight:y,color:h},children:t})]})]})}return it(ag,{required:o,sx:{marginLeft:S,marginTop:D,marginRight:O,marginBottom:P,paddingLeft:E,paddingTop:j,paddingRight:T,paddingBottom:N,display:"inline-flex",...R&&{width:R},...F&&{height:F},...I&&{minHeight:I},...A&&{maxHeight:A},...z&&{minWidth:z},...L&&{maxWidth:L},...B},...V,children:[e&&at(Dg,{children:e}),at(tr,{name:t||"",control:U,defaultValue:"number"==typeof K?K:k,rules:Y,render:({field:e,fieldState:r})=>{const o=AGe(e.value,t,"value");return it(nt,{children:[at(gw,{...e,value:o??k,min:k,max:_,step:C,orientation:p,valueLabelDisplay:v,valueLabelFormat:Z,sx:X,onChange:(e,r)=>{zGe(W,t,r,"value")},...q}),r.error&&at(wg,{error:!0,sx:{mt:1},children:"required"===r.error.type?n:a})]})}})]})},Aht=({direction:t="up",size:r="medium",ariaLabel:o="Speed Dial",openIconName:n="plus",closeIconName:a="x",openIconColor:i="#fff",closeIconColor:s="#fff",backgroundColor:l="#1976d2",items:c=[],configurationItemInfo:u={},tooltipOpen:d=!1,tooltipPlacement:p,showBackdrop:h=!1,openOnHover:f=!1,paddingTop:m,paddingRight:y,paddingBottom:g,paddingLeft:v,marginTop:x,marginRight:b,marginBottom:w,marginLeft:k,moleculeId:_,gap:C,sx:M,...S})=>{const D=Ye(),[O,P]=e.useState(!1),{isConfigurationMode:E,onConfigurationItemClicked:j,selectedConfigurationItemId:T,onInternalNavigation:N}=IC();e.useEffect(()=>{if(!O)return;const e=e=>{"Escape"!==e.key||E||P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[O,E]);const R=()=>P(!0),F=()=>P(!1);let I={};I=f&&!h?{onMouseEnter:R,onMouseLeave:F,onFocus:R,onBlur:F}:{onClick:e=>{P(e=>!e)}};const A={bgcolor:l,paddingTop:m,paddingRight:y,paddingBottom:g,paddingLeft:v,marginTop:x,marginRight:b,marginBottom:w,marginLeft:k},z=O||E&&(T===_||c.some(e=>e.id===T));return it("div",{role:"presentation",children:[h&&at(Lf,{open:O}),at(Ow,{ariaLabel:o,direction:t,icon:at(Qw,{icon:at(jGe,{iconName:n,color:i,size:24}),openIcon:at(jGe,{iconName:a,color:s,size:24})}),open:z,onOpen:f&&!h?R:void 0,onClose:f&&!h?F:void 0,FabProps:{color:"primary",sx:A,size:r,gap:C},slotProps:{fab:{"data-testid":"speed-dial-fab","aria-label":o}},sx:{"& .MuiSpeedDial-fab":{backgroundColor:l,...A},"& .MuiSpeedDial-actions":{gap:C||8},"& .MuiSpeedDialIcon-icon":{fontSize:"small"===r?"18px":"large"===r?"24px":"20px",color:"inherit"},"& .MuiSpeedDialIcon-openIcon":{fontSize:"small"===r?"18px":"large"===r?"24px":"20px",color:"inherit"},"& .MuiSpeedDialAction-fab":{backgroundColor:"#fff",color:"#757575","&:hover":{backgroundColor:"#f5f5f5"}},"& .MuiSpeedDialAction-staticTooltip":{backgroundColor:"rgba(97, 97, 97, 0.9)",color:"#fff",fontSize:"12px",padding:"4px 8px",borderRadius:"4px"},"& .MuiSpeedDialAction-staticTooltipLabel":{fontSize:"12px",fontWeight:500},...M},...I,...u,...S,children:c.map(e=>{const{text:t,link:o}=e.properties??{},{iconName:n="plus",disabled:a=!1,iconColor:i="#757575",tooltipText:s,backgroundColor:l="#fff"}=e.config?.props??{},c=String(t?.text||s||"Action"),u=E&&T===e.id,h={entityId:e.id,entity:"molecule_item",entityType:"speed_dial_action_item"},f=E?{onClick:e=>{e.stopPropagation(),j?.(h,!1)},onDoubleClick:e=>{e.stopPropagation(),j?.(h,!0)},"data-organism-id":e.id,css:hrt({theme:D,selected:u})}:{};return at(Uw,{icon:at(jGe,{iconName:n,color:i,size:24}),tooltipOpen:d,tooltipTitle:c,tooltipPlacement:p,FabProps:{sx:{color:i,backgroundColor:l},size:r,disabled:a,"aria-label":c,onClick:e=>{e.stopPropagation(),o?(d9e(o)?N?.({link:o.internalLink??""}):c9e(o.externalLink),P(!1)):P(!1)},...f}},e.id)})})]})},zht=({items:e,gap:t,stepGap:r,isMobile:o=!1,iconSize:n="24px",orientation:a="horizontal",activeStep:i=0,lineColor:s,lineWidth:l,lineRadius:c,marginTop:u="0",marginRight:d="0",marginBottom:p="0",marginLeft:h="0",paddingTop:f="0",paddingRight:m="0",paddingBottom:y="0",paddingLeft:g="0",borderRadius:v="0",configurationItemInfo:x,backgroundColor:b="transparent",sx:w,...k})=>{const _=Ye(),C=o?"vertical":a,{isConfigurationMode:M,onConfigurationItemClicked:S,selectedConfigurationItemId:D}=IC();return at(Vk,{sx:{gap:t,width:"100%",overflow:"hidden",marginTop:u,marginRight:d,marginBottom:p,marginLeft:h,paddingTop:f,paddingRight:m,paddingBottom:y,paddingLeft:g,borderRadius:v,backgroundColor:b,"& .MuiStep-root":{padding:"8px"},"& .MuiStepLabel-root":{gap:r,alignItems:"flex-start"},"& .MuiStepLabel-label":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"},"& .MuiStepConnector-root":{flex:"1 1 auto"},"& .MuiStepConnector-line":{borderColor:s,borderWidth:l,borderRadius:c},"& .MuiStepConnector-vertical":{width:n||"24px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"4px"},"& .MuiStepConnector-horizontal":{marginLeft:"8px",marginRight:"8px"},"& .MuiStepContent-root":{margin:0,padding:0,marginTop:"4px",borderLeft:"none"},"& .MuiTypography-root":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"},...w},activeStep:i,orientation:C,connector:at(jk,{sx:{[`&.${Dk.vertical}`]:{width:n||"24px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"4px"},[`&.${Dk.vertical} .${Dk.line}`]:{borderColor:s,borderWidth:l,borderRadius:c},[`&.${Dk.horizontal} .${Dk.line}`]:{borderColor:s,borderWidth:l,borderRadius:c}}}),...x,...k,children:e.map((e,t)=>{const o=D===e.id,a=t===i,s={entityId:e.id,entity:"molecule_item",entityType:"stepper_item"},l=M?{onClick:e=>{M&&(e.stopPropagation(),S?.(s,!1))},onDoubleClick:e=>{M&&(e.stopPropagation(),S?.(s,!0))},"data-organism-id":e.id,css:hrt({theme:_,selected:o})}:{},c=e.color||(a?"#000":"#555");return at(lk,{...l,children:it(Mk,{sx:{gap:r,"& .MuiStepLabel-iconContainer":{marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},"& .MuiStepLabel-labelContainer":{display:"flex",flexDirection:"column",alignItems:"flex-start"}},icon:e?.iconName?at(jGe,{size:n,color:e.iconColor||"#000",iconName:e.iconName,borderRadius:e?.iconBorderRadius||0,backgroundColor:e.iconBackgroundColor||"transparent"}):void 0,children:[at(Pd,{variant:"body1",sx:{padding:"4px",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",color:c,borderRadius:e.borderRadius||"0",display:"inline-block","&.MuiTypography-body1":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"}},children:e.title}),e.subText&&at(Ik,{sx:{margin:0,padding:0,marginTop:"4px",borderLeft:"none","& .MuiStepContent-root":{margin:0,padding:0,marginTop:"4px",borderLeft:"none"}},transitionDuration:{enter:400,exit:400},children:at(Pd,{variant:"body2",sx:{padding:"4px",fontSize:e.subTextFontSize||"inherit",fontWeight:e.subTextFontWeight||"normal",fontFamily:e.subTextFontFamily||"inherit",color:e.subTextColor||"#666",borderRadius:e.borderRadius||"0",display:"inline-block",..."horizontal"===C&&{maxWidth:"300px"},"&.MuiTypography-body2":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"}},children:e.subText})})]})},e.id)})})},Lht=gl(Yk)(({thumbColor:e="#ff0000",thumbCheckedColor:t="#00ff00",trackColor:r="#0000ff",disabledThumbColor:o="#9e9e9e",sx:n})=>({"& .MuiSwitch-thumb":{backgroundColor:e,width:20,height:20},"& .MuiSwitch-switchBase.Mui-checked .MuiSwitch-thumb":{backgroundColor:t},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"& .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"&.Mui-disabled .MuiSwitch-thumb":{backgroundColor:o},"&.Mui-disabled .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"& .MuiSwitch-switchBase":{padding:"9px","&.Mui-checked":{transform:"translateX(16px)"}},"& .MuiSwitch-colorPrimary":{"&.Mui-checked":{color:t}},"& .MuiSwitch-colorSecondary":{"&.Mui-checked":{color:t}},...n})),Bht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="This field is required",validationErrorText:n="Invalid value",text:a="",thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,labelPlacement:u="top",marginLeft:d="0",marginTop:p="0",marginRight:h="0",marginBottom:f="0",paddingLeft:m="0",paddingTop:y="0",paddingRight:g="0",paddingBottom:v="0",width:x,height:b,minHeight:w,maxHeight:k,minWidth:_,maxWidth:C,name:M,sourceDataModelField:S,disabled:D=!1,sx:O,configurationItemInfo:P,...E})=>{const j=Kt(),T=j?.control,N=!!T&&!!M,R={required:!!r&&o,validate:e=>!(r&&!e)||o};IC(),UC(),ht();const F=wrt({name:M,sourceDataModelField:S,form:j,enabled:N}),[I,A]=e.useState(!1);if(t){let e=!1;return void 0!==F?e="true"===String(F).toLowerCase()||!0===F:N&&(e=Boolean(AGe(j.watch(M),M,"value"))),it(ag,{required:r,sx:{marginLeft:d,marginTop:p,marginRight:h,marginBottom:f,paddingLeft:m,paddingTop:y,paddingRight:g,paddingBottom:v,display:"inline-flex",...x&&{width:x},...b&&{height:b},...w&&{minHeight:w},...k&&{maxHeight:k},..._&&{minWidth:_},...C&&{maxWidth:C},"& .MuiFormLabel-root":{fontSize:"14px",fontWeight:500,color:"#333",marginBottom:"8px"},"& .MuiSwitch-root":{marginTop:"8px"},"& .MuiSwitch-switchBase":{padding:"9px"},"& .MuiSwitch-thumb":{width:"18px",height:"18px",borderRadius:"9px"},"& .MuiSwitch-track":{borderRadius:"9px",height:"14px"},"& .MuiTypography-root":{marginLeft:"8px",fontSize:"14px",fontWeight:500,color:"#333"},...O},...P,children:[a&&at(Dg,{component:"legend",children:a}),it(Zf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:[at(Lht,{disabled:!0,checked:e,thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{pointerEvents:"none"}},...E}),at(Pd,{sx:{ml:1},children:e?"ON":"OFF"})]})]})}return it(ag,{required:r,sx:{marginLeft:d,marginTop:p,marginRight:h,marginBottom:f,paddingLeft:m,paddingTop:y,paddingRight:g,paddingBottom:v,display:"inline-flex",...x&&{width:x},...b&&{height:b},...w&&{minHeight:w},...k&&{maxHeight:k},..._&&{minWidth:_},...C&&{maxWidth:C},"& .MuiFormLabel-root":{fontSize:"14px",fontWeight:500,color:"#333",marginBottom:"8px"},"& .MuiSwitch-root":{marginTop:"8px"},"& .MuiSwitch-switchBase":{padding:"9px"},"& .MuiSwitch-thumb":{width:"18px",height:"18px",borderRadius:"9px"},"& .MuiSwitch-track":{borderRadius:"9px",height:"14px"},"& .MuiFormHelperText-root":{marginTop:"4px",fontSize:"12px",color:"#d32f2f"},...O},...P,children:[a&&at(Dg,{component:"legend",children:a}),N?at(tr,{name:M,rules:R,control:T,defaultValue:!1,render:({field:e,fieldState:t})=>{const r=Boolean(AGe(e.value,M,"value"));return it(nt,{children:[at(Zf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:at(Lht,{checked:r,disabled:D,onChange:(e,t)=>{zGe(j,M,t,"value")},thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)"}}},...E})}),t.error&&at(wg,{error:!0,sx:{marginTop:"4px"},children:"required"===t.error.type?o:n})]})}}):at(Zf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:at(Lht,{checked:I,disabled:D,onChange:(e,t)=>{A(t)},thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)"}}},...E})})]})},Vht=({items:t,onTabChange:r,activeTabKey:o,isMobile:n=!1,marginTop:a,marginRight:i,marginBottom:s,marginLeft:l,paddingTop:c,paddingRight:u,paddingBottom:d,paddingLeft:p,buttonPaddingTop:h,buttonPaddingRight:f,buttonPaddingBottom:m,buttonPaddingLeft:y,width:g,height:v,backgroundColor:x,borderRadius:b,elevation:w=1,gap:k,indicatorVisible:_=!0,indicatorColor:C,lineWidth:M="2px",orientation:S="horizontal",activeTextColor:D="#1976d2",inactiveTextColor:O="#000",fontSize:P,fontWeight:E,fontFamily:j,wrapText:T,textAlign:N,iconName:R,iconColor:F,iconSize:I,iconPlacement:A="left",hoverTextColor:z,itemBorder:L,itemBorderRadius:B,itemBackgroundColor:V,itemSelectedBackgroundColor:$,itemHoverBackgroundColor:H,selectedItemElevation:q=0,itemDisableRipple:W,configurationItemInfo:U,sx:G})=>{const K=Ye(),{isConfigurationMode:Y,onConfigurationItemClicked:Z,selectedConfigurationItemId:X}=IC(),[Q,J]=e.useState(null),ee=e=>J(e.currentTarget),te=()=>J(null),re={marginTop:a,marginRight:i,marginBottom:s,marginLeft:l,paddingTop:c,paddingRight:u,paddingBottom:d,paddingLeft:p,width:g,height:v,backgroundColor:x,borderRadius:b,display:"flex",overflow:"visible !important"},oe=e=>{const t=e?D:O,r=e&&$||V;return{color:t,fontSize:P,fontWeight:E,fontFamily:j,textAlign:N,whiteSpace:T?"normal":"nowrap",border:L,borderRadius:B,backgroundColor:r,boxShadow:e?K.shadows[q]:void 0,paddingTop:h,paddingRight:f,paddingBottom:m,paddingLeft:y,"&:hover":{color:z||t,backgroundColor:H||r}}},ne=e=>{r?.({newTabKey:e.tabKey,link:e.link})},ae=e=>{if(!Y)return{};const t=e.id===X,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:e=>{e.stopPropagation(),Z?.(r,!1)},onDoubleClick:e=>{e.stopPropagation(),Z?.(r,!0)},"data-organism-id":e.id,css:hrt({theme:K,selected:t})}},ie=e=>{const t=e.tabKey===o,r=oe(t);return it(xx,{onClick:()=>{ne(e),te()},sx:{...r,display:"flex",alignItems:"center"},...ae(e),children:[e.iconName&&at(jGe,{iconName:e.iconName,sx:{fontSize:P,color:t?D:O,mr:1}}),at(Zf,{component:"span",children:e.label})]},e.id)};if(n)return it(tu,{elevation:w,style:re,sx:G,...U,children:[at(cd,{onClick:ee,children:at(jGe,{size:I,color:F,iconName:R})}),at(fx,{anchorEl:Q,open:Boolean(Q),onClose:te,children:t.map(ie)})]});const se=t.findIndex(e=>e.tabKey===o);return at(tu,{elevation:w,style:re,sx:G,...U,children:at(tC,{value:se<0?0:se,onChange:(e,r)=>Y?null:ne(t[r]),orientation:S,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:k}},TabIndicatorProps:{style:_?{height:M,borderRadius:b,backgroundColor:C||D}:{display:"none"}},children:t.map(e=>{const t=e.tabKey===o,r={...oe(t),"&.Mui-selected":{color:t?D:O}};return at(e_,{label:e.label,disableRipple:W,sx:{...r,textTransform:"none"},onClick:()=>ne(e),iconPosition:"right"===A?"end":"start",icon:e.iconName?at(jGe,{iconName:e.iconName,sx:{fontSize:P,color:t?D:O}}):void 0,...ae(e)},e.id)})})})},$ht=e=>{if(!e)return null;if(e instanceof Date)return Not(e)?e:null;if("object"==typeof e&&null!==e&&"function"==typeof e.toDate){const t=e.toDate();return t instanceof Date&&Not(t)?t:null}if("string"==typeof e){const t=e.trim();if(!t)return null;const r=t.match(/(\d{1,2}:\d{2}(?::\d{2})?)/),o=r?r[1]:t,n=new Date,a=["HH:mm:ss","H:mm:ss","HH:mm","H:mm","hh:mm a","h:mm a","hh a","h a","HHmm","Hmm","HH","H"];for(const e of a){const t=Lnt(o,e,n);if(Not(t))return t}return null}return null},Hht=e=>{const t=$ht(e);return t?Lot(t,"HH:mm"):null},qht=({name:t,text:r,isDisplayOnly:o=!1,sourceDataModelField:n,configurationItemInfo:a={},placeholderText:i,displayFormat:s="HH:mm",required:l=!1,requiredErrorText:c="This field is required",validationErrorText:u,sx:d,width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,...v})=>{const x=Kt(),b=x?.control,w=!!b&&!!t;IC();const k=wrt({name:t,sourceDataModelField:n,form:x,enabled:w,mapValue:e=>Hht(e),skipIfNull:!0}),_=$ht(k);e.useRef();const[C,M]=e.useState(_);if(o){const e=void 0!==k?k:w?AGe(x.watch(t),t,"value"):void 0,o=$ht(e),n=o&&Not(o)?Lot(o,s):"";return it(Zf,{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiFormHelperText-root":{marginBottom:"4px"},"& .MuiTypography-root":{border:"1px solid #ced4da",borderRadius:"4px",padding:"8px",minWidth:"100px"},...d},children:[r&&at(wg,{children:r}),at(Pd,{children:n||i||"-"})]})}return at(Zf,w?{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiTimePicker-root":{width:"100%"},"& .MuiTextField-root":{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g},"& .MuiInputBase-root":{fontSize:"14px"},"& .MuiInputLabel-root":{fontSize:"14px"},"& .MuiFormHelperText-root":{fontSize:"12px"},"& .MuiSvgIcon-root":{fontSize:"20px"},...d},children:at(tr,{name:t,control:b,defaultValue:Hht(k)??null,rules:{required:!!l&&(c||"This field is required"),validate:e=>{if(null==e||""===e)return!0;const t=$ht(e);return t&&Not(t)||u||"Invalid time"}},render:({field:{value:e},fieldState:o})=>{const n=AGe(e,t,"value");return at(upt,{...v,enableAccessibleFieldDOMStructure:!1,value:$ht(n),onChange:e=>{const r=Hht(e);zGe(x,t,r,"value")},slots:{textField:iC},slotProps:{textField:{label:r,placeholder:i,error:!!o.error,helperText:o.error?.message,onMouseDown:e=>e.stopPropagation(),sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g}}}})}})}:{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiTimePicker-root":{width:"100%"},"& .MuiTextField-root":{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g},"& .MuiInputBase-root":{fontSize:"14px"},"& .MuiInputLabel-root":{fontSize:"14px"},"& .MuiFormHelperText-root":{fontSize:"12px"},"& .MuiSvgIcon-root":{fontSize:"20px"},...d},children:at(upt,{...v,enableAccessibleFieldDOMStructure:!1,value:C,onChange:e=>M($ht(e)),slots:{textField:iC},slotProps:{textField:{label:r,placeholder:i,onMouseDown:e=>e.stopPropagation(),sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g}}}})})},Wht=({src:t,poster:r,controls:o=!1,loop:n=!1,autoplay:a=!1,raised:i=!1,alt:s="",height:l="100%",width:c="100%",borderRadius:u="0",margin:d=0,padding:p=0,moleculeId:h,enableCoverImage:f,configurationItemInfo:m,marginTop:y="0px",marginRight:g="0px",marginBottom:v="0px",marginLeft:x="0px",paddingTop:b="0px",paddingRight:w="0px",paddingBottom:k="0px",paddingLeft:_="0px",sx:C,sourceDataModelField:M})=>{const[S,D]=e.useState(!1),O=M?$Ge(M):void 0,P=("string"==typeof O?O:void 0)||t,{onStateChange:E}=YC(),j=()=>{E({id:h,type:"started"})};return at(Uht,{id:h,raised:i,onClick:j,sx:{borderRadius:`${u}px`,margin:d,padding:p,marginTop:y,marginRight:g,marginBottom:v,marginLeft:x,paddingTop:b,paddingRight:w,paddingBottom:k,paddingLeft:_,"& .MuiCard-root":{display:"inline-block",overflow:"hidden"},"& .MuiCardMedia-root":{height:l,width:c,objectFit:"cover"},"& .MuiCardMedia-media":{height:"100%",width:"100%",objectFit:"cover"},...C},...m,children:S?at(Pd,{component:"div",sx:{height:l,width:c,display:"flex",justifyContent:"center",alignItems:"center",fontSize:"16px",color:"gray",textAlign:"center"},children:s||"Video unavailable"}):at(bm,{component:"video",src:P,poster:f?r:void 0,controls:o,loop:n,autoPlay:a,muted:a,"aria-label":s,sx:{height:l,width:c,objectFit:"cover","& .MuiCardMedia-media":{height:"100%",width:"100%",objectFit:"cover"}},onPlay:j,onEnded:()=>{E({id:h,type:"completed"})},onError:()=>{D(!0)}})})},Uht=To(fm)`
|
|
1031
|
+
`,lht=e=>{if("menu_item"===e.type){const t=e;if(!t.sx)return!1;const r=e=>!!e&&(Array.isArray(e)?e.some(r):"function"!=typeof e&&("object"==typeof e&&("absolute"===e.position||"fixed"===e.position)));return r(t.sx)}return!1},cht=({currentWebpageId:t,anchor:r="left",variant:o="persistent",open:n=!1,onClose:a,items:i=[],withButton:s=!0,buttonText:l="",buttonVariant:c="contained",buttonTextColor:u,buttonFontSize:d,buttonFontWeight:p,buttonFontFamily:h,buttonDisabled:f=!1,buttonGap:m=0,buttonStartIcon:y,buttonEndIcon:g,buttonBorderRadius:v="0px",buttonPaddingTop:x="0px",buttonPaddingRight:b="0px",buttonPaddingBottom:w="0px",buttonPaddingLeft:k="0px",buttonMarginTop:_="0px",buttonMarginRight:C="0px",buttonMarginBottom:M="0px",buttonMarginLeft:S="0px",buttonIconOnly:D,buttonElevation:O,buttonFillColor:P,buttonFillColorDisabled:E,buttonFillColorHover:j,buttonFillColorPressed:T,buttonBorderColor:N,buttonBorderColorDisabled:R,buttonBorderColorHover:F,buttonBorderColorPressed:I,buttonTextColorDisabled:A,buttonTextColorHover:z,buttonTextColorPressed:L,buttonColor:B="#1976d2",buttonDisabledColor:V,withCloseIcon:$=!0,closeIconColor:H=so.colors.gray2,closeIconName:q="x",closeIconSize:W=18,closeIconBackgroundColor:U="rgba(255, 255, 255, 0.9)",closeIconVisible:G=!1,closeIconTop:K="16px",closeIconLeft:Y="16px",closeIconBorderRadius:Z="50%",closeIconElevation:X=2,moleculeId:Q,configurationItemInfo:J,sx:ee,contentSx:te,scrollable:re=!1,paddingTop:oe,paddingRight:ne,paddingBottom:ae,paddingLeft:ie,height:se,width:le,mobileWidth:ce,backgroundColor:ue="#fff",gap:de="8px",marginTop:pe="0px",marginRight:he="0px",marginBottom:fe="0px",marginLeft:me="0px"})=>{const ye=Ye(),{isConfigurationMode:ge,selectedConfigurationItemId:ve,onConfigurationItemClicked:xe,onInternalNavigation:be}=IC(),{updateDrawer:we,drawerContainerRef:ke,headerHeight:_e,isMobile:Ce}=EC(),[Me,Se]=e.useState(n),[De]=(()=>{try{return Jpt()}catch{return[new URLSearchParams,()=>{}]}})(),Oe=e.useMemo(()=>{if(t)return t;const e=De.get(n9e),r=De.get(o9e);let o=null,n=null;if("undefined"!=typeof window)try{const e=new URLSearchParams(window.location.search);o=e.get(n9e),n=e.get(o9e)}catch(FJe){}return e||r||o||n||""},[t,De]);e.useEffect(()=>{Se(n)},[n]);const Pe=Boolean(ge&&(ve===Q||i.some(e=>e.id===ve))),Ee=()=>"permanent"===o||(ge?Pe:s?Me:n);e.useEffect(()=>{const e=Ee(),t="left"===r||"right"===r,n=Ce&&void 0!==ce?ce:le;let a=0;if(void 0!==n)if("number"==typeof n)a=n;else if("string"==typeof n){const e=parseFloat(n);Number.isNaN(e)||(a=e)}let i=0;if(t&&!Ce)switch(o){case"permanent":i=a;break;case"persistent":default:i=e?a:0;break;case"temporary":i=0}return we({isOpen:e,position:r,width:i}),()=>{we({isOpen:!1,width:0})}},[Me,n,Pe,ge,s,r,le,ce,Ce,o,we]);const je=()=>{"permanent"!==o&&Se(!0)},Te=(e,t)=>{"permanent"!==o&&(Se(!1),a?.(e,t))},Ne=e=>{const t=ve===e.id,r={entityId:e.id,entity:"molecule_item",entityType:e.type},o=ge?{onClick:e=>{e.stopPropagation(),xe?.(r,!1)},onDoubleClick:e=>{e.stopPropagation(),xe?.(r,!0)},"data-organism-id":e.id,css:hrt({theme:ye,selected:t})}:{};switch(e.type){case"menu_item":{const t=e;e.id;const r=(e=>{const t=e?.link;if(!t||!t.internalLink)return!1;const r=g9e(t.internalLink);return!(!r||!Oe)&&r===Oe})(t),n={backgroundColor:t.backgroundColor||"transparent",paddingTop:t.paddingTop||"8px",paddingRight:t.paddingRight||"16px",paddingBottom:t.paddingBottom||"8px",paddingLeft:t.paddingLeft||"16px",opacity:t.disabled?.6:1,pointerEvents:t.disabled?"none":"auto","&:hover":{backgroundColor:t.disabled?t.backgroundColor||"transparent":"rgba(0, 0, 0, 0.08)"}},a=t.sx?[n,t.sx]:n;return it(xx,{sx:a,selected:r,onClick:()=>{if(t?.link){d9e(t.link)?be?.({link:t.link?.internalLink||""}):c9e(t.link?.externalLink)}},disabled:t.disabled,...o,children:[t.startIcon&&at(jGe,{iconName:t.startIcon,color:t.textColor}),at(Pd,{sx:{ml:t.startIcon?1:0,mr:t.endIcon?1:0,color:t.textColor||"inherit",fontSize:t.fontSize||"inherit",fontWeight:t.fontWeight||"normal",fontFamily:t.fontFamily||"inherit",whiteSpace:t.wrap?"normal":"nowrap",width:"100%",textAlign:t.textAlign||"left"},children:t.text}),t.endIcon&&at(jGe,{iconName:t.endIcon,color:t.textColor})]},t.id)}case"divider_item":{const t=e;return at(Spt,{moleculeId:t.id,variant:t.variant,lineWeight:t.lineWeight,orientation:t.orientation,borderColor:t.borderColor,borderRadius:t.borderRadius,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft,configurationItemInfo:o},t.id)}case"text_item":{const t=e;return at(Ept,{id:t.id,text:t.text,align:t.align,color:t.color,wrap:t.wrap,variant:"string"==typeof t.variant&&["inherit","body1","body2","caption","button","overline","subtitle1","subtitle2","h1","h2","h3","h4","h5","h6"].includes(t.variant)?t.variant:void 0,fontSize:t.fontSize??"",fontWeight:["normal","bold"].includes(t.fontWeight)?t.fontWeight:void 0,fontFamily:t.fontFamily??"",marginTop:t.marginTop||"",marginRight:t.marginRight||"",marginBottom:t.marginBottom||"",marginLeft:t.marginLeft||"",paddingTop:t.paddingTop||"",paddingRight:t.paddingRight||"",paddingBottom:t.paddingBottom||"",paddingLeft:t.paddingLeft||"",configurationsItemInfo:o},t.id)}case"rich_text_item":{const t=e;return at(Ppt,{htmlElementId:t.id,text:t.text,isRichText:!0,marginTop:t.marginTop||"",marginRight:t.marginRight||"",marginBottom:t.marginBottom||"",marginLeft:t.marginLeft||"",paddingTop:t.paddingTop||"",paddingRight:t.paddingRight||"",paddingBottom:t.paddingBottom||"",paddingLeft:t.paddingLeft||"",configurationItemInfo:o},t.id)}case"image_item":{const t=e;return at(Dpt,{src:t.src,alt:t.alt||"Drawer image",height:t.height,width:t.width,raised:t.raised,borderRadius:t.borderRadius||"0",marginTop:t.marginTop||"0",marginRight:t.marginRight||"0",marginBottom:t.marginBottom||"0",marginLeft:t.marginLeft||"0",paddingTop:t.paddingTop||"0",paddingRight:t.paddingRight||"0",paddingBottom:t.paddingBottom||"0",paddingLeft:t.paddingLeft||"0",onClick:()=>{if(t?.link){d9e(t.link)?be?.({link:t.link?.internalLink||""}):c9e(t.link?.externalLink)}},moleculeId:t.id,configurationItemInfo:o},t.id)}default:return null}},Re=Ce&&void 0!==ce?ce:le,Fe=at(rht,{anchor:r,variant:o,open:Ee(),onClose:Te,paddingTop:oe,paddingRight:ne,paddingBottom:ae,paddingLeft:ie,height:se,width:Re,backgroundColor:ue,marginTop:`calc(${_e} + ${pe})`,marginRight:he,marginBottom:fe,marginLeft:me,container:ke,sx:ee,children:it(aht,{scrollable:re,sx:te,...J&&Object.keys(J).length?{...J,"data-testid":"drawer-content-config","aria-label":"drawer-content"}:{},children:[(Ee()||"permanent"===o)&&i.length>0?it(nt,{children:[at(sht,{gap:de,scrollable:re,children:i.filter(e=>!lht(e)).map(Ne)}),i.filter(e=>lht(e)).map(Ne)]}):null,!!$&&(!!G||Ee())&&at(iht,{top:K,left:Y,borderRadius:Z,elevation:X,backgroundColor:U,onClick:e=>{e.stopPropagation();Ee()?Te(e,"closeIconClicked"):je()},"data-testid":"close-icon",children:at(jGe,{"data-testid":"icon-renderer",iconName:q,size:W,color:H})})]})});return s&&"permanent"!==o?it(nt,{children:[at(pKe,{moleculeId:Q,gap:m,text:l,variant:c,textColor:u,fontSize:d,fontWeight:["normal","bold"].includes(p)?p:void 0,fontFamily:h,disabled:f,startIcon:y,endIcon:g,marginTop:_,marginRight:C,marginBottom:M,marginLeft:S,paddingTop:x,paddingRight:b,paddingBottom:w,paddingLeft:k,borderRadius:v,iconOnly:D,elevation:O,fillColor:P||B,fillColorDisabled:E||V,fillColorHover:j,fillColorPressed:T,borderColor:N,borderColorDisabled:R,borderColorHover:F,borderColorPressed:I,textColorDisabled:A,textColorHover:z,textColorPressed:L,externalOnClick:e=>Me?Te(e,"buttonClicked"):je(),configurationItemInfo:J}),at(nht,{children:Fe})]}):at(nht,{children:Fe})},uht=e.forwardRef((e,t)=>{const{inputRef:r,...o}=e;return at(aYe,{...o,ref:e=>{"function"==typeof r&&r(e?e.inputElement:null)},mask:gYe,guide:!0,placeholderChar:" "})}),dht=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0},pht=({masked:e,errorMsg:t,inputSx:r,labelSx:o,sx:n,variant:a="outlined",...i})=>{const s=e?{inputComponent:uht}:{};return at(iC,{...i,variant:a,error:!!t,helperText:t||null,type:"text",sx:{...n},slotProps:{input:{sx:{...r,...n},...s},inputLabel:{sx:{...o,...n}}}})},hht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="Email is required",validationErrorText:n="Invalid email address",text:a,placeholderText:i,masked:s=!1,multiLine:l=!1,backgroundColor:c,borderColor:u,color:d="inherit",fontSize:p="16px",fontFamily:h="inherit",fontWeight:f="normal",textAlign:m="left",marginLeft:y="0",marginTop:g="0",marginRight:v="0",marginBottom:x="0",paddingLeft:b="0",paddingTop:w="0",paddingRight:k="0",paddingBottom:_="0",width:C,height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P,sx:E,name:j,sourceDataModelField:T,configurationItemInfo:N,inputSize:R="medium",labelOffset:F,hideLabel:I=!1,variant:A="outlined"})=>{const z=Kt(),L=z?.control,B=!(!L||!j),V=wrt({name:j,sourceDataModelField:T,form:z,enabled:B});e.useState("");const[$,H]=e.useState(""),q={required:!!r&&o,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:n}},W=e.useMemo(()=>{if(I)return;if(void 0!==F)return F;const e=dht(w),t=dht(_);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=dht(M)||dht(S)||dht(D);if(!o&&!e&&!t)return;const n="number"==typeof p?1.5*p:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[M,S,D,F,R,p,w,_,I]),U=e.useMemo(()=>{if(I)return;const e="small"===R?-6:-9,t=dht(M)||dht(S)||dht(D);return!t||t>=36?e:-6},[M,S,D,R,I]);if(t){let e="";if(void 0!==V)e=String(V??"");else if(B){const t=AGe(z.watch(j),j,"value");e=t?String(t):""}const t=e||i||"-";return it("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...N,children:[a&&at(wg,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,marginLeft:0,marginBottom:"4px",...E},children:a}),at(Pd,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_,backgroundColor:c,border:`1px solid ${u||"#ccc"}`,borderRadius:"4px",minWidth:"120px",textAlign:m,...E},children:t})]})}const G={backgroundColor:c,color:d,fontSize:p,fontFamily:h,fontWeight:f,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},"& .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-input":{textAlign:m,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_}},K={color:d,"&.Mui-focused":{color:d},...I&&{display:"none"},...void 0!==W&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${W}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${U}px) scale(0.75)`}}},Y=l?3:1,Z={...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}};return at("div",B?{style:{marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},sx:{"& .MuiTextField-root":{width:C||"100%",height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...E},children:at(tr,{name:j,rules:q,control:L,defaultValue:"",render:({field:e,fieldState:t})=>at(pht,{masked:s,required:r,errorMsg:t.error?.message,inputSx:G,labelSx:K,sx:{...Z,...E},size:R,variant:A,label:I?void 0:a,placeholder:i,multiline:l,minRows:Y,value:AGe(e.value,j,"value")||"",onChange:e=>{zGe(z,j,e.target.value,"value")},...N||{}})})}:{style:{marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},sx:{"& .MuiTextField-root":{width:C||"100%",height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P},...E},children:at(pht,{masked:s,required:r,errorMsg:void 0,inputSx:G,labelSx:K,sx:{...Z,...E},size:R,variant:A,label:I?void 0:a,placeholder:i,multiline:l,minRows:Y,value:$,onChange:e=>H(e.target.value),...N||{}})})},fht=({src:t,text:r,type:o,link:n,sourceDataModelField:a,color:i=so.colors.deepBlue,disabled:s=!1,disabledColor:l,underline:c="hover",variant:u="body2",margin:d="0",padding:p="0",moleculeId:h,configurationItemInfo:f,marginTop:m="0",marginRight:y="0",marginBottom:g="0",marginLeft:v="0",paddingTop:x="0",paddingRight:b="0",paddingBottom:w="0",paddingLeft:k="0",fontFamily:_,fontWeight:C,fontSize:M,align:S,target:D,sx:O,borderColor:P,borderWidth:E,borderStyle:j,borderRadius:T,iconOnly:N,ariaLabel:R,iconName:F,iconSize:I,validationErrorText:A})=>{const{onStateChange:z}=YC(),{onInternalNavigation:L,isConfigurationMode:B,localStateObject:V}=IC();UC();const $=ht(),H=a?$Ge(a):r,q=n&&p9e(n),W=e.useMemo(()=>q?h9e(n,$?.rawItemDataByDmfId):null,[n,q,$?.rawItemDataByDmfId]),U=q&&!W,G=e.useMemo(()=>{if(W)return W.destination;const e=n?d9e(n):"internalLink"===o||"internal_link"===o,r=n?e?n.internalLink:n.externalLink:void 0;return t??r??void 0},[W,n,o,t]),K=e.useMemo(()=>W?!W.isExternal:!!n&&d9e(n),[W,n]),Y=e.useMemo(()=>D||(W?W.isExternal?"_blank":"_self":K?"_self":"_blank"),[D,W,K]),Z=s||U,X=Z?l||no(i):i,Q=B||Z?void 0:G,J=Boolean(F),ee="regular"===C?"normal":C,te=N?at(jGe,{iconName:F||"external-link",size:I??16}):it(nt,{children:[at("span",{children:String(H||"")}),J&&at(jGe,{iconName:F,size:I??16})]}),{onClick:re,onDoubleClick:oe,...ne}=f||{},ae=at(mv,{href:Q,component:"a",target:Y,onClick:e=>{z({id:h,type:"clicked"});if(!s&&!U&&!B)return W?(e.preventDefault(),void(W.isExternal?c9e(W.destination):L?.({link:W.destination,webpageAlias:W.webpageAlias,query:W.recordId?{rwoRecordId:W.recordId}:void 0}))):K&&G?(e.preventDefault(),void L?.({link:G})):void(!K&&G&&(e.preventDefault(),c9e(G)));e.preventDefault()},onClickCapture:re||void 0,onDoubleClickCapture:oe||void 0,"aria-label":N?R||String(H||"")||"link":void 0,sx:{color:X,textDecorationColor:X,margin:d,padding:p,marginTop:m,marginRight:y,marginBottom:g,marginLeft:v,paddingTop:x,paddingRight:b,paddingBottom:w,paddingLeft:k,fontFamily:_,fontWeight:ee,fontSize:M,textAlign:S,alignItems:"center",cursor:Z?"not-allowed":"pointer",borderColor:P,borderWidth:E,borderStyle:j,borderRadius:T,display:N||J?"inline-flex":void 0,gap:J&&!N?"4px":void 0,"& .MuiLink-root":{color:"inherit",textDecorationColor:"inherit"},"&:hover":{color:Z?X:no(X,.8),textDecorationColor:Z?X:no(X,.8)},"&:active":{color:Z?X:no(X,.6),textDecorationColor:Z?X:no(X,.6)},"&.Mui-disabled":{color:l||no(i),textDecorationColor:l||no(i),cursor:"not-allowed"},...O},align:S,variant:u,underline:c,...ne,children:te});return ae},mht=e=>({justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}),yht=({popover:t=!0,items:r,marginTop:o="0",marginRight:n="0",marginBottom:a="0",marginLeft:i="0",paddingTop:s="0",paddingRight:l="0",paddingBottom:c="0",paddingLeft:u="0",cornerRadius:d="4px",backgroundColor:p="#fff",width:h="100%",height:f="auto",borderColor:m="#ccc",borderWeight:y="1px",buttonText:g="Open Menu",buttonVariant:v="contained",buttonTextColor:x,buttonFontSize:b,buttonFontWeight:w,buttonFontFamily:k,buttonDisabled:_=!1,buttonGap:C=0,buttonStartIcon:M,buttonEndIcon:S,buttonCornerRadius:D="0",buttonMarginTop:O="0",buttonMarginRight:P="0",buttonMarginBottom:E="0",buttonMarginLeft:j="0",buttonPaddingTop:T="0",buttonPaddingRight:N="0",buttonPaddingBottom:R="0",buttonPaddingLeft:F="0",buttonIconOnly:I,buttonElevation:A,buttonFillColor:z,buttonFillColorDisabled:L,buttonFillColorHover:B,buttonFillColorPressed:V,buttonBorderColor:$,buttonBorderColorDisabled:H,buttonBorderColorHover:q,buttonBorderColorPressed:W,buttonTextColorDisabled:U,buttonTextColorHover:G,buttonTextColorPressed:K,buttonColor:Y="#1976d2",anchorOriginVertical:Z="bottom",anchorOriginHorizontal:X="left",transformOriginVertical:Q="top",transformOriginHorizontal:J="left",elevation:ee=3,sx:te,moleculeId:re,configurationItemInfo:oe})=>{const ne=Ye(),{isConfigurationMode:ae,selectedConfigurationItemId:ie,onConfigurationItemClicked:se,onInternalNavigation:le}=IC(),ce=ht?.(),[ue,de]=e.useState(null),[pe,he]=e.useState(!1),[fe]=(()=>{try{return Jpt()}catch{return[new URLSearchParams,()=>{}]}})(),me=e.useMemo(()=>{const e=fe.get(n9e),t=fe.get(o9e);let r=null,o=null;if("undefined"!=typeof window)try{const e=new URLSearchParams(window.location.search);r=e.get(n9e),o=e.get(o9e)}catch(FJe){}return e||t||r||o||""},[fe]),ye=e=>{const t=e?.link;if(!t||!t.internalLink)return!1;const r=g9e(t.internalLink);return!(!r||!me)&&r===me},ge=Boolean(ae&&(ie===re||r.some(e=>e.id===ie))),ve=()=>he(!0),xe=()=>he(!1),be={marginTop:o,marginRight:n,marginBottom:a,marginLeft:i,paddingTop:s,paddingRight:l,paddingBottom:c,paddingLeft:u,"& .MuiMenu-paper":{backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3]},"& .MuiMenu-list":{padding:0,width:h,height:f,overflow:"hidden"},"& .MuiMenuItem-root":{minHeight:"auto",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px"},"& .MuiListItemButton-root":{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px"},"& .MuiListItemText-primary":{fontSize:"14px",fontFamily:"inherit"},"& .MuiTypography-root":{fontSize:"14px",fontFamily:"inherit"},...t?{display:"inline-block",zIndex:ne?.zIndex?.drawer}:{width:h,height:f,backgroundColor:p,display:"block",overflow:"hidden",border:`${y} solid ${m}`,borderRadius:d},...te};return t?it(Zf,{children:[at(pKe,{ref:de,text:g,variant:v,moleculeId:re,textColor:x,fontSize:b,fontWeight:w,fontFamily:k,disabled:_,gap:C,startIcon:M,endIcon:S,onClick:ve,marginTop:O,marginRight:P,marginBottom:E,marginLeft:j,paddingTop:T,paddingRight:N,paddingBottom:R,paddingLeft:F,borderRadius:D,iconOnly:I,elevation:A,fillColor:z||Y,fillColorDisabled:L,fillColorHover:B,fillColorPressed:V,borderColor:$,borderColorDisabled:H,borderColorHover:q,borderColorPressed:W,textColorDisabled:U,textColorHover:G,textColorPressed:K,configurationItemInfo:oe}),at(fx,{open:ae?ge:pe,variant:"menu",anchorEl:ue,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:xe,anchorOrigin:{vertical:Z,horizontal:X},transformOrigin:{vertical:Q,horizontal:J},elevation:ee,slotProps:{paper:{sx:{backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3],"& .MuiMenu-list":be["& .MuiMenu-list"],"& .MuiMenuItem-root":be["& .MuiMenuItem-root"],"& .MuiListItemText-primary":be["& .MuiListItemText-primary"],"& .MuiTypography-root":be["& .MuiTypography-root"]}}},sx:{...be,"& .MuiMenu-paper":be["& .MuiMenu-paper"]},children:r.map(e=>{const t=ie===e.id,r=ye(e),o=e.link&&p9e(e.link)?h9e(e.link,ce?.rawItemDataByDmfId):null,n=e.link&&p9e(e.link)&&!o,a={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},i=ae?e=>{e.stopPropagation(),se?.(a,!1)}:void 0,s=ae?e=>{e.stopPropagation(),se?.(a,!0)}:void 0,l=ae?{onClick:i,onDoubleClick:s,"data-organism-id":e.id,css:hrt({theme:ne,selected:t})}:{};return it(xx,{sx:mht(e),selected:r,disabled:e.disabled||n,onClick:()=>{e?.link&&(o?o.isExternal?c9e(o.destination):le?.({link:o.destination,webpageAlias:o.webpageAlias,query:o.recordId?{rwoRecordId:o.recordId}:void 0}):d9e(e.link)?le?.({link:e.link?.internalLink||""}):c9e(e.link?.externalLink)),xe()},...l,children:[e.startIcon&&at(jGe,{iconName:e.startIcon,color:e.textColor}),at(Pd,{sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"},children:e.text}),e.endIcon&&at(jGe,{iconName:e.endIcon,color:e.textColor})]},e.id)})})]}):at(tu,{id:re,sx:{...be,backgroundColor:p,border:`${y} solid ${m}`,borderRadius:d,boxShadow:0===ee?"none":ne?.shadows?.[ee]||ne?.shadows?.[3]},elevation:ee,...oe,children:at(wv,{disablePadding:!0,children:r.map(e=>{const t=ie===e.id,r=ye(e),o=e.link&&p9e(e.link)?h9e(e.link,ce?.rawItemDataByDmfId):null,n=e.link&&p9e(e.link)&&!o,a={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},i=ae?e=>{e.stopPropagation(),se?.(a,!1)}:void 0,s=ae?e=>{e.stopPropagation(),se?.(a,!0)}:void 0,l=ae?{onClick:i,onDoubleClick:s,"data-organism-id":e.id,css:hrt({theme:ne,selected:t})}:{};return it(Dv,{disabled:e.disabled||n,sx:mht(e),selected:r,onClick:()=>{e?.link&&(o?o.isExternal?c9e(o.destination):le?.({link:o.destination,webpageAlias:o.webpageAlias,query:o.recordId?{rwoRecordId:o.recordId}:void 0}):d9e(e.link)?le?.({link:e.link?.internalLink||""}):c9e(e.link?.externalLink))},...l,children:[e.startIcon&&at(jGe,{iconName:e.startIcon,color:e.textColor}),at(Wv,{primary:at(Pd,{sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"},children:e.text})}),e.endIcon&&at(jGe,{iconName:e.endIcon,color:e.textColor})]},e.id)})})})},ght=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0};const vht=({errorMsg:e,stepValue:t,minValue:r,allowNegative:o,inputSx:n,labelSx:a,variant:i="outlined",...s})=>at(iC,{...s,variant:i,type:"number",error:!!e,helperText:e||null,inputProps:{step:t,min:o?void 0:r},slotProps:{input:{sx:n},inputLabel:{sx:a}}}),xht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="This field is required",validationErrorText:n="Invalid numeric value",text:a,placeholderText:i,backgroundColor:s,borderColor:l,textColor:c="#000",fontSize:u,fontFamily:d,fontWeight:p,allowNegative:h=!1,numericPrecision:f="1",name:m,sourceDataModelField:y,marginLeft:g="0",marginTop:v="0",marginRight:x="0",marginBottom:b="0",paddingLeft:w="0",paddingTop:k="0",paddingRight:_="0",paddingBottom:C="0",width:M,height:S,configurationItemInfo:D,textAlign:O,minHeight:P,maxHeight:E,minWidth:j,maxWidth:T,sx:N,inputSize:R="medium",labelOffset:F,hideLabel:I=!1,variant:A="outlined"})=>{const z=Kt(),L=z?.control,B=!(!L||!m);IC(),UC();const V=wrt({name:m,sourceDataModelField:y,form:z,enabled:B}),[$,H]=e.useState(""),q=parseFloat(f),W=h?void 0:0,U={required:!!r&&o,pattern:{value:h?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:n}};h||(U.min={value:0,message:"Value cannot be less than zero"});const G=e.useMemo(()=>{if(I)return;if(void 0!==F)return F;const e=ght(k),t=ght(C);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=ght(S)||ght(P)||ght(E);if(!o&&!e&&!t)return;const n="number"==typeof u?1.5*u:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[S,P,E,F,R,u,k,C,I]),K=e.useMemo(()=>{if(I)return;const e="small"===R?-6:-9,t=ght(S)||ght(P)||ght(E);return!t||t>=36?e:-6},[S,P,E,R,I]);if(t){let e="";if(void 0!==V)e=String(V??"");else if(B){const t=AGe(z.watch(m),m,"value");e=t?String(t):""}const t=e?function(e,t,r){if(!e)return"";const o=parseFloat(e);if(Number.isNaN(o))return e;if(!r&&o<0)return"0";if(t){const e=(t.split(".")[1]||"").length;if(e>0)return o.toFixed(e)}return e}(e,f,h):i||"-";return it("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E}},sx:N,...D,children:[a&&at(wg,{sx:{fontSize:u,fontFamily:d,fontWeight:p,color:c,marginBottom:"4px"},children:a}),at(Pd,{sx:{fontSize:u,fontFamily:d,fontWeight:p,color:c,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,backgroundColor:s,border:`1px solid ${l||"#ccc"}`,borderRadius:"4px",minWidth:"60px"},children:t})]})}const Y={backgroundColor:s,color:c,fontSize:u,fontFamily:d,fontWeight:p,...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},"& .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:l||"inherit"}},Z={color:c,"&.Mui-focused":{color:c},...I&&{display:"none"},...void 0!==G&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${G}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${K}px) scale(0.75)`}}},X={...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E}};return at(ag,B?{required:r,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,width:"fit-content",...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},...N},...D,children:at(tr,{name:m,rules:U,control:L,defaultValue:"",render:({field:e,fieldState:t})=>at(vht,{errorMsg:t.error?.message,label:I?void 0:a,placeholder:i,stepValue:q,minValue:W,allowNegative:h,inputSx:Y,labelSx:Z,sx:X,size:R,variant:A,value:AGe(e.value,m,"value")||"",onChange:e=>{zGe(z,m,e.target.value,"value")}})})}:{required:r,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,width:"fit-content",...M&&{width:M},...S&&{height:S},...j&&{minWidth:j},...T&&{maxWidth:T},...P&&{minHeight:P},...E&&{maxHeight:E},...N},...D,children:at(vht,{errorMsg:void 0,label:I?void 0:a,placeholder:i,stepValue:q,minValue:W,allowNegative:h,inputSx:Y,labelSx:Z,sx:X,size:R,variant:A,value:$,onChange:e=>H(e.target.value)})})},bht=e=>{const t={text:e.label,validate:()=>!0},{rule:r}=e,o=wht(r);if(o||kht(r)){const e=((e,t)=>(r=0)=>e?r<=t:r>=t)(o,o?r.MAX:r.MIN);switch(r.type){case"COUNT":t.validate=t=>e(t?.length);break;case"NUMBER_COUNT":t.validate=t=>e(t?.replace(/\D/g,"").length);break;case"CAPITAL_COUNT":t.validate=t=>e((t?.match(/[A-Z]/g)||[]).length);break;case"SPECIAL_CHARACTERS_COUNT":t.validate=t=>e(t?.replace(/[a-z]|\d|\s/gi,"").length);break;case"LOWER_CASE_COUNT":t.validate=t=>e((t?.match(/[a-z]/g)||[]).length)}}return t},wht=e=>!!e?.MAX,kht=e=>!!e?.MIN,_ht=({gap:t="0",inputProps:r,validations:o,htmlElementId:n,validationState:a,overridesProperties:i,configurationItemInfo:s,width:l,height:c,minWidth:u,maxWidth:d,minHeight:p,maxHeight:h,marginLeft:f="0",marginTop:m="0",marginRight:y="0",marginBottom:g="0",sx:v,...x})=>{const{watch:b,formState:w,setError:k}=Kt()||{},{text:_,subText:C,placeholderText:M,subPlaceholderText:S,validationText:D}=i,O=o.map(bht),P="password",E=`reEnter${P}`,j=b?.(P),T=b?.(E);return e.useEffect(()=>{j!==T&&k(E,{type:"manual",message:"Passwords do not match"})},[j,T,k,E]),it(Zf,{id:n,sx:{width:"100%",display:"flex",flexDirection:"column",gap:t,marginLeft:f,marginTop:m,marginRight:y,marginBottom:g,...l&&{width:l},...c&&{height:c},...u&&{minWidth:u},...d&&{maxWidth:d},...p&&{minHeight:p},...h&&{maxHeight:h},...v},...s,...x,children:[at(Crt,{...r,inputType:"password",text:_?.text,name:P,placeholderText:M?.text}),at(Crt,{...r,inputType:"password",text:C?.text,name:E,placeholderText:S?.text}),at(XKe,{rules:O,value:j,label:D?.text,isSubmitted:w?.isDirty,validationState:a})]})},Cht=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],Mht=e.forwardRef((e,t)=>{const{inputRef:r,...o}=e;return at(aYe,{...o,ref:e=>{"function"==typeof r&&r(e?e.inputElement:null)},mask:Cht,guide:!0,placeholderChar:" "})}),Sht=e=>{if(void 0===e)return;if("number"==typeof e)return e;const t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):void 0};function Dht(e){const t=(e??"").replace(/\D+/g,"");if(!t)return"";let r="",o=0;return hYe.forEach(e=>{"string"==typeof e?r+=e:o<t.length?(r+=t[o],o+=1):r+="_"}),r}const Oht=({masked:e,errorMsg:t,inputSx:r,labelSx:o,variant:n="outlined",...a})=>at(iC,{...a,variant:n,error:!!t,helperText:t||null,slotProps:{input:{sx:r,...e?{inputComponent:Mht}:{}},inputLabel:{sx:o}}}),Pht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="Phone is required",validationErrorText:n="Invalid phone number",text:a,placeholderText:i,masked:s=!0,multiLine:l=!1,backgroundColor:c,borderColor:u,textColor:d="#000",fontSize:p,fontFamily:h,fontWeight:f,textAlign:m,marginLeft:y="0",marginTop:g="0",marginRight:v="0",marginBottom:x="0",paddingLeft:b="0",paddingTop:w="0",paddingRight:k="0",paddingBottom:_="0",width:C,height:M,minHeight:S,maxHeight:D,minWidth:O,maxWidth:P,name:E,sourceDataModelField:j,configurationItemInfo:T,sx:N,inputSize:R="medium",labelOffset:F,hideLabel:I=!1,variant:A="outlined"})=>{const z=Kt(),L=z?.control,B=!(!L||!E),V=wrt({name:E,sourceDataModelField:j,form:z,enabled:B}),[$,H]=e.useState(""),q={required:!!r&&o,pattern:{value:/^\d{10}$/,message:n}},W=e.useMemo(()=>{if(I)return;if(void 0!==F)return F;const e=Sht(w),t=Sht(_);let r=0;r=void 0!==e&&void 0!==t?e+t:"small"===R?17:33;const o=Sht(M)||Sht(S)||Sht(D);if(!o&&!e&&!t)return;const n="number"==typeof p?1.5*p:23;let a;if(void 0!==o)a=Math.max(0,(o-n)/2);else{const t=("small"===R?40:56)-r;a=Math.max(0,(t-n)/2+(e||0))}return Math.round(a)},[M,S,D,F,R,p,w,_,I]),U=e.useMemo(()=>{if(I)return;const e="small"===R?-6:-9,t=Sht(M)||Sht(S)||Sht(D);return!t||t>=36?e:-6},[M,S,D,R,I]);if(t){let e="";if(void 0!==V)e=String(V??"");else if(B){const t=AGe(z.watch(E),E,"value");e=t?String(t):""}const t=(s?Dht(e):e)||i||"-";return it("div",{style:{display:"inline-flex",flexDirection:"column",marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}},...T,children:[a&&at(wg,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,marginLeft:0,marginBottom:"4px",...N},children:a}),at(Pd,{sx:{fontSize:p,fontFamily:h,fontWeight:f,color:d,paddingLeft:b,paddingTop:w,paddingRight:k,paddingBottom:_,backgroundColor:c,border:`1px solid ${u||"#ccc"}`,borderRadius:"4px",minWidth:"120px",...N},children:t})]})}const G={backgroundColor:c,color:d,fontSize:p,fontFamily:h,fontWeight:f,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},"& .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:u||"inherit"}},K={color:d,"&.Mui-focused":{color:d},...I&&{display:"none"},...void 0!==W&&{"&.MuiInputLabel-outlined:not(.MuiInputLabel-shrink)":{transform:`translate(14px, ${W}px) scale(1)`},"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:`translate(14px, ${U}px) scale(0.75)`}}},Y={marginLeft:y,marginTop:g,marginRight:v,marginBottom:x,width:"fit-content",...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D}};return at(ag,B?{required:r,sx:{...Y,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},...N},...T,children:at(tr,{name:E,rules:q,control:L,defaultValue:"",render:({field:e,fieldState:t})=>at(Oht,{masked:s,errorMsg:t.error?.message,inputSx:G,labelSx:K,size:R,variant:A,label:I?void 0:a,placeholder:i,value:AGe(e.value,E,"value")||"",onChange:e=>{const t=(e?.target?.value??"").toString().replace(/\D+/g,"");zGe(z,E,t,"value")}})})}:{required:r,sx:{...Y,...C&&{width:C},...M&&{height:M},...O&&{minWidth:O},...P&&{maxWidth:P},...S&&{minHeight:S},...D&&{maxHeight:D},...N},...T,children:at(Oht,{masked:s,errorMsg:void 0,inputSx:G,labelSx:K,size:R,variant:A,label:I?void 0:a,placeholder:i,value:$,onChange:e=>{const t=(e?.target?.value??"").toString();H(t.replace(/\D+/g,""))}})})},Eht=({text:t,name:r,isDisplayOnly:o=!1,required:n=!1,requiredErrorText:a="This field is required",validationErrorText:i="Invalid rating",placeholderText:s="",hoverFeedback:l=!1,sourceDataModelField:c,textAlign:u="left",color:d="black",textColor:p,selectColor:h,fontSize:f=14,fontFamily:m="Arial, sans-serif",fontWeight:y="normal",marginLeft:g="0",marginTop:v="0",marginRight:x="0",marginBottom:b="0",paddingLeft:w="0",paddingTop:k="0",paddingRight:_="0",paddingBottom:C="0",width:M,height:S,minHeight:D,maxHeight:O,minWidth:P,maxWidth:E,placement:j="right",configurationItemInfo:T={},disabled:N=!1,maxValue:R=5,ratingPrecision:F=.5,sx:I,...A})=>{const z=Kt(),L=z?.control,B=!!z&&!!L&&!!r;IC(),UC();const V=wrt({name:r,sourceDataModelField:c,form:z,enabled:B});!B||z.formState.errors;const[$,H]=e.useState(null),[q,W]=e.useState(-1),U=l&&-1!==q;if(o){let e=null;return void 0!==V&&(e=(e=>"number"!=typeof e||Number.isNaN(e)?"string"!=typeof e||Number.isNaN(Number(e))?null:Number(e):e)(V)),it(ag,{required:n,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,display:"inline-flex",...M&&{width:M},...S&&{height:S},...D&&{minHeight:D},...O&&{maxHeight:O},...P&&{minWidth:P},...E&&{maxWidth:E},...I},...T,children:[t&&at(Pd,{variant:"subtitle1",sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,marginBottom:"4px"},children:t}),at(xb,{value:e,max:R,precision:F,readOnly:!0,sx:{"& .MuiRating-iconEmpty":{color:d},"& .MuiRating-iconFilled":{color:h||d},...I},...A})]})}const G={required:!!n&&a,validate:e=>!n||null!==e&&0!==e||a};return it(ag,{required:n,sx:{marginLeft:g,marginTop:v,marginRight:x,marginBottom:b,paddingLeft:w,paddingTop:k,paddingRight:_,paddingBottom:C,display:"inline-flex",...M&&{width:M},...S&&{height:S},...D&&{minHeight:D},...O&&{maxHeight:O},...P&&{minWidth:P},...E&&{maxWidth:E},...I},...T,children:[t&&at(Pd,{variant:"subtitle1",sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,marginBottom:"4px"},children:t}),it(Zf,{sx:{display:"flex",alignItems:"center"},children:["left"===j&&at(Pd,{sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,minWidth:"2em"},children:U?q:B?AGe(z.getValues(r),r,"value")??V??"":$??V??""}),at(tr,{name:r,control:L,defaultValue:"number"==typeof V?V:null,rules:G,render:({field:e,fieldState:{error:t}})=>{const o=AGe(e.value,r,"value");return it(nt,{children:[at(xb,{value:o??V??0,max:R,precision:F,disabled:N,onChange:(e,t)=>{zGe(z,r,t,"value")},onChangeActive:l?(e,t)=>W(t??-1):void 0,sx:{"& .MuiRating-iconEmpty":{color:d},"& .MuiRating-iconFilled":{color:h||d},marginX:l?1:0,...I},...A}),t&&at(wg,{error:!0,sx:{marginTop:"4px"},children:"required"===t.type?a:i})]})}}),"right"===j&&at(Pd,{sx:{fontSize:f,fontFamily:m,fontWeight:y,color:p||d,minWidth:"2em"},children:U?q:B?AGe(z.getValues(r),r,"value")??V??"":$??V??""})]})]})},jht=["value","label","id","code"],Tht=e=>null!=e&&"object"==typeof e&&!Array.isArray(e),Nht=e=>{if("string"==typeof e||"number"==typeof e)return e;if(Tht(e)){if("value"in e&&("string"==typeof e.value||"number"==typeof e.value))return e.value;for(const t of jht){if("value"===t)continue;const r=e[t];if("string"==typeof r||"number"==typeof r)return r}}},Rht=(e,t)=>{if(null==t)return;const r=String(t);return e.find(e=>String(e.id)===r||(void 0!==e.value&&String(e.value)===r||void 0!==e.label&&String(e.label)===r))},Fht=({open:t,text:o,disabled:n,sx:a,placeholderText:i,required:s=!1,requiredErrorText:l="This field is required",isDisplayOnly:c=!1,displayText:u,visible:d=!0,fontSize:p,fontFamily:h,fontWeight:f,textColor:m,textAlign:y,borderColor:g,color:v,backgroundColor:x,marginLeft:b="0",marginTop:w="0",marginRight:k="0",marginBottom:_="0",paddingLeft:C,paddingTop:M,paddingRight:S,paddingBottom:D,width:O,height:P,minHeight:E,maxHeight:j,minWidth:T,maxWidth:N,configurationItemInfo:R={},name:F,sourceDataModelField:I,predefinedValue:A,hideWhenNoValue:z=!1,inputSize:L="medium",hideLabel:B=!1,variant:V="outlined",native:$=!1,options:H,publishToWebpageContext:q=!1,webpageContextKey:W,dataDrivenOptions:U})=>{const G="regular"===f?"normal":f,K=e=>""!==e&&null!=e,Y=U&&!U.isIgnored&&("variable"===U.nature&&Boolean(U.variableName)||"data_model"===U.nature&&Boolean(U.sourceDataModelFieldId)||!U.nature&&(Boolean(U.variableName)||Boolean(U.sourceDataModelFieldId))),Z=e.useMemo(()=>{if(!Y||!U)return;const e=U.nature?.toString().replace(/-/g,"_").toLowerCase()??"";return("variable"===e||!e&&U.variableName)&&U.variableName||U.sourceDataModelFieldId},[Y,U]),X=Z?VGe(Z):void 0,Q=e.useMemo(()=>{if(Y&&X){if(Array.isArray(X))return X.map(e=>{if("string"==typeof e||"number"==typeof e)return{id:e,value:String(e)};if(e&&"object"==typeof e){const t=e;return{id:t.id??t.value??t.code??t.label??"",value:t.value??t.label??t.code??String(t.id??""),label:t.label??t.value??t.code??String(t.id??"")}}return{id:"",value:""}}).filter(e=>""!==e.id&&""!==e.value);if(X&&"object"==typeof X){const e=X;return[{id:e.id??e.value??e.code??e.label??"",value:e.value??e.label??e.code??String(e.id??""),label:e.label??e.value??e.code??String(e.id??"")}].filter(e=>""!==e.id&&""!==e.value)}}},[Y,X]),J=Boolean(Q&&Q.length>0),ee=c||Y?void 0:I,{dataModelFieldOptions:te,isLoading:re}=(e=>{const{pickList:t}=dt(),{data:o=[],refetch:n,isLoading:a}=r.useQuery({queryKey:[WGe,e],queryFn:()=>t.get(e),select:e=>{const t=e?.data;return Array.isArray(t)?t:t&&Array.isArray(t.data)?t.data:[]},enabled:Boolean(e),refetchOnWindowFocus:!0,refetchOnMount:!0});return{dataModelFieldOptions:o,refetch:n,isLoading:a}})(ee),oe=H&&H.length>0?H:J?Q:te,ne=e.useMemo(()=>(oe||[]).map(e=>"string"==typeof e?{id:e,value:e}:e),[oe]);let ae;ne.length;try{ae=Kt()}catch(Ie){ae=null}const ie=!!ae?.control&&!!F,[se,le]=e.useState(""),[ce,ue]=e.useState(!1),de=e.useRef(!1),pe=e.useRef(void 0);e.useEffect(()=>{pe.current!==I&&(pe.current=I,de.current=!1)},[I]);let he={setLocalStateValue:null,isConfigurationMode:!1,selectedConfigurationItemId:null};try{he=IC()}catch(Ie){}let fe={stateConfig:null};try{fe=UC()}catch(Ie){}let me=null;try{me=ht()}catch(Ie){}const ye=KC();he.isConfigurationMode&&he.selectedConfigurationItemId;const ge=null!=A&&""!==A,ve=Boolean(n)||ge,xe=HGe(),be=I?xe(I):void 0,we=me?.itemDataByDmfId?.[F],ke=Nht(we),_e=e.useMemo(()=>{if(be){if(Tht(be)){const e=be.id;if("string"==typeof e||"number"==typeof e){const t=ne.length>0?Rht(ne,e):void 0;return t?{...t,...be}:be}for(const t of["value","label","code"]){const e=be[t];if("string"==typeof e||"number"==typeof e){const t=ne.length>0?Rht(ne,e):void 0;return t||be}}return be}if("string"==typeof be||"number"==typeof be){return(ne.length>0?Rht(ne,be):void 0)||{id:be}}}},[be,ne]),Ce=wrt({name:F,sourceDataModelField:I,form:ae,fallbackKey:void 0,enabled:ie&&!ge,mapValue:()=>_e}),Me=Nht(be)??("string"==typeof Ce||"number"==typeof Ce?Ce:void 0);e.useEffect(()=>{ge&&null!=A&&(ie?zGe(ae,F,A,"id",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}):le(A))},[ge,A,ie,ae,F]),e.useEffect(()=>{if(!ie||!ae)return;if(ge)return;if(!I)return;const e=ae.formState?.dirtyFields?.[F],t=ae.formState?.touchedFields?.[F];if(e||t)return void(de.current=!0);const r=AGe(ae.watch(F),F,"id");if(!de.current||!r){if(_e)return zGe(ae,F,_e,"id",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}),void(de.current=!0);if(be){let e;if(Tht(be)){const t=be.id;"string"!=typeof t&&"number"!=typeof t||(e=be)}else"string"!=typeof be&&"number"!=typeof be||(e={id:be});e&&(zGe(ae,F,e,"id",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}),de.current=!0)}}},[d,ge,ie,ae,F,I,be,_e]);const Se=we??Me;if(e.useEffect(()=>{q&&W&&ye?.setDynamicContextValue&&void 0!==Se&&ye.setDynamicContextValue(W,Se)},[q,W,Se,ye]),!d)return null;if(c&&z&&!(we??Me))return null;if(c){const e=u??(null!=ke?String(ke):void 0)??(null!=Me?String(Me):void 0)??(i||"-"),{css:t,...r}=R||{};return it("div",{css:t,style:{display:"inline-flex",flexDirection:"column",...K(w)&&{marginTop:w},...K(k)&&{marginRight:k},...K(_)&&{marginBottom:_},...K(b)&&{marginLeft:b},...K(O)?{width:O}:{width:"fit-content"},...K(P)&&{height:P},...K(E)&&{minHeight:E},...K(j)&&{maxHeight:j},...K(T)&&{minWidth:T},...K(N)&&{maxWidth:N}},...r,children:[o&&at(wg,{sx:{...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G},color:K(m)?m:"#000",marginLeft:0,marginBottom:"4px",...K(y)&&{textAlign:y}},children:o}),at(Pd,{sx:{...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G},...K(m)&&{color:m},...K(y)&&{textAlign:y},...K(C)&&{paddingLeft:C},...K(M)&&{paddingTop:M},...K(S)&&{paddingRight:S},...K(D)&&{paddingBottom:D},...K(x)&&{backgroundColor:x},border:`1px solid ${K(g)?g:"#ccc"}`,borderRadius:"4px"},children:e})]})}const De="small"===L?40:56,Oe={position:"relative",display:K(O)?"block":"inline-block",...K(O)&&{width:O},...K(T)&&{minWidth:T},...K(N)&&{maxWidth:N},...K(b)&&{marginLeft:b},...K(w)&&{marginTop:w},...K(k)&&{marginRight:k},...K(_)&&{marginBottom:_}},Pe={width:"100%",...K(P)&&{height:P},...K(E)&&{minHeight:E},...K(j)&&{maxHeight:j},...!K(O)&&!K(T)&&{minWidth:"240px"},...a},Ee=K(m)?m:K(v)?v:void 0,je={..."small"===L&&!P&&{height:`${De}px`},...K(x)&&{backgroundColor:x},...Ee&&{color:Ee},...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G},...K(g)&&{"& .MuiOutlinedInput-notchedOutline":{borderColor:g},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:g},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:g}},..."filled"===V&&K(g)&&{"&:before":{borderColor:g},"&:after":{borderColor:g},"&:hover:not(.Mui-disabled):before":{borderColor:g}},..."standard"===V&&K(g)&&{"&:before":{borderColor:g},"&:after":{borderColor:g},"&:hover:not(.Mui-disabled):before":{borderColor:g}},"& .MuiSelect-select":{...K(y)&&{textAlign:y},...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G},...K(M)&&{paddingTop:M},...K(D)&&{paddingBottom:D},...K(C)&&{paddingLeft:C},...K(S)&&{paddingRight:S}}},Te={...K(p)&&{fontSize:p},...K(h)&&{fontFamily:h},...G&&{fontWeight:G}},Ne=e=>{const t=((e,t)=>e.find(e=>String(e.id)===t))(ne,e),r=t??{id:e};le(e),ie&&zGe(ae,F,r),I&&he?.setLocalStateValue&&he.setLocalStateValue(I,r)},Re=ie?AGe(ae.watch(F),F,"id")||"":se,Fe=ie?ae.formState?.errors?.[F]:void 0;return at("div",{style:Oe,...R,onClick:e=>{he?.isConfigurationMode&&R&&"onClick"in R&&(e.stopPropagation(),e.preventDefault(),R.onClick())},children:it(ag,{variant:V,size:L,sx:Pe,disabled:ve,required:s,error:!!Fe,children:[!B&&at(Kg,{id:`${F}-label`,shrink:$?ce||!!Re:void 0,sx:Te,children:o}),at(Fb,{value:Re,onChange:e=>{he?.isConfigurationMode||Ne(e.target.value)},onFocus:()=>ue(!0),onBlur:()=>ue(!1),...he?.isConfigurationMode&&{open:!1},labelId:B?void 0:`${F}-label`,label:B?void 0:o,disabled:ve,native:$,sx:je,children:$?[at("option",{value:""},"__placeholder__"),...re?[at("option",{disabled:!0,children:"Loading..."},"__loading__")]:ne.map(e=>at("option",{value:e.id,children:e.value},e.id))]:re?it(xx,{disabled:!0,children:[at(od,{size:20,sx:{mr:1}}),"Loading..."]}):ne.map(e=>at(xx,{value:e.id,children:e.value},e.id))}),Fe&&at(wg,{error:!0,children:Fe?.message||l})]})})};const Iht=({text:e,name:t,isDisplayOnly:r=!1,required:o=!1,requiredErrorText:n="This field is required",validationErrorText:a="Invalid value",placeholderText:i="",startIcon:s,endIcon:l,borderColor:c,selectLineColor:u,lineWeight:d=1,orientation:p="horizontal",textColor:h,fontSize:f,fontFamily:m,fontWeight:y,valueFormat:g,valueDisplay:v="auto",iconSize:x,selectColor:b,iconColor:w,minValue:k=0,maxValue:_=100,step:C,labelPlacement:M="top",marginLeft:S="0",marginTop:D="0",marginRight:O="0",marginBottom:P="0",paddingLeft:E="0",paddingTop:j="0",paddingRight:T="0",paddingBottom:N="0",width:R,height:F,minHeight:I,maxHeight:A,minWidth:z,maxWidth:L,sx:B,configurationItemInfo:V,sourceDataModelField:$,disabled:H=!1,...q})=>{const W=Kt(),U=W?.control,G=!!U&&!!t&&!r;IC(),UC(),ht();const K=wrt({name:t,sourceDataModelField:$,form:W,enabled:G}),Y={required:!!o&&n,validate:e=>!o||null!=e||n},Z=e=>function(e,t){if(null==e)return"";switch(t){case"$0.00":return`$${e.toFixed(2)}`;case"$123":return`$${e}`;case"%0.00":return`${e.toFixed(2)}%`;case"%123":return`${e}%`;case"0.0":return e.toFixed(1);case"0.00":return e.toFixed(2);default:return e.toString()}}(e,g),X={width:"100%","& .MuiSlider-root":{width:"100%"},"& .MuiSlider-rail":{backgroundColor:c||"#ccc",..."vertical"===p?{width:`${d}px`}:{height:`${d}px`}},"& .MuiSlider-track":{backgroundColor:u||"#2196f3",border:`1px solid ${u||"#2196f3"}`,..."vertical"===p?{width:`${d}px`}:{height:`${d}px`}},"& .MuiSlider-thumb":{backgroundColor:b||"#2196f3",width:x||"16px",height:x||"16px",boxShadow:"none","&:focus, &:hover, &.Mui-active, &.Mui-focusVisible":{boxShadow:"none"}},"& .MuiSlider-valueLabel":{backgroundColor:b||"#2196f3",color:"#ffffff",borderRadius:"4px",fontSize:"12px",fontWeight:500},"& .MuiSlider-mark":{backgroundColor:c||"#ccc",width:"2px",height:"2px",borderRadius:"50%"},"& .MuiSlider-markActive":{backgroundColor:b||"#2196f3"},...B};if(r){let t=null;return void 0!==K&&(t=(e=>"number"!=typeof e||Number.isNaN(e)?"string"!=typeof e||Number.isNaN(Number(e))?null:Number(e):e)(K)),it(ag,{required:o,sx:{marginLeft:S,marginTop:D,marginRight:O,marginBottom:P,paddingLeft:E,paddingTop:j,paddingRight:T,paddingBottom:N,display:"inline-flex",...R&&{width:R},...F&&{height:F},...I&&{minHeight:I},...A&&{maxHeight:A},...z&&{minWidth:z},...L&&{maxWidth:L},...B},...V,children:[e&&at(Dg,{children:e}),it(Zf,{display:"flex",flexDirection:"top"===M?"column":"row",alignItems:"center",mt:"top"===M?1:0,children:[s&&at(Zf,{mr:"horizontal"===p?1:0,mb:"vertical"===p?1:0,children:at(jGe,{iconName:s,color:w})}),at(gw,{value:t??void 0,min:k,max:_,step:C,orientation:p,valueLabelDisplay:v,valueLabelFormat:Z,sx:X,disabled:!0,...q}),l&&at(Zf,{ml:"horizontal"===p?1:0,mt:"vertical"===p?1:0,children:at(jGe,{iconName:l,color:w})}),at(Pd,{sx:{ml:1,fontSize:f,fontFamily:m,fontWeight:y,color:h},children:t})]})]})}return it(ag,{required:o,sx:{marginLeft:S,marginTop:D,marginRight:O,marginBottom:P,paddingLeft:E,paddingTop:j,paddingRight:T,paddingBottom:N,display:"inline-flex",...R&&{width:R},...F&&{height:F},...I&&{minHeight:I},...A&&{maxHeight:A},...z&&{minWidth:z},...L&&{maxWidth:L},...B},...V,children:[e&&at(Dg,{children:e}),at(tr,{name:t||"",control:U,defaultValue:"number"==typeof K?K:k,rules:Y,render:({field:e,fieldState:r})=>{const o=AGe(e.value,t,"value");return it(nt,{children:[at(gw,{...e,value:o??k,min:k,max:_,step:C,orientation:p,valueLabelDisplay:v,valueLabelFormat:Z,sx:X,onChange:(e,r)=>{zGe(W,t,r,"value")},...q}),r.error&&at(wg,{error:!0,sx:{mt:1},children:"required"===r.error.type?n:a})]})}})]})},Aht=({direction:t="up",size:r="medium",ariaLabel:o="Speed Dial",openIconName:n="plus",closeIconName:a="x",openIconColor:i="#fff",closeIconColor:s="#fff",backgroundColor:l="#1976d2",items:c=[],configurationItemInfo:u={},tooltipOpen:d=!1,tooltipPlacement:p,showBackdrop:h=!1,openOnHover:f=!1,paddingTop:m,paddingRight:y,paddingBottom:g,paddingLeft:v,marginTop:x,marginRight:b,marginBottom:w,marginLeft:k,moleculeId:_,gap:C,sx:M,...S})=>{const D=Ye(),[O,P]=e.useState(!1),{isConfigurationMode:E,onConfigurationItemClicked:j,selectedConfigurationItemId:T,onInternalNavigation:N}=IC();e.useEffect(()=>{if(!O)return;const e=e=>{"Escape"!==e.key||E||P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[O,E]);const R=()=>P(!0),F=()=>P(!1);let I={};I=f&&!h?{onMouseEnter:R,onMouseLeave:F,onFocus:R,onBlur:F}:{onClick:e=>{P(e=>!e)}};const A={bgcolor:l,paddingTop:m,paddingRight:y,paddingBottom:g,paddingLeft:v,marginTop:x,marginRight:b,marginBottom:w,marginLeft:k},z=O||E&&(T===_||c.some(e=>e.id===T));return it("div",{role:"presentation",children:[h&&at(Lf,{open:O}),at(Ow,{ariaLabel:o,direction:t,icon:at(Qw,{icon:at(jGe,{iconName:n,color:i,size:24}),openIcon:at(jGe,{iconName:a,color:s,size:24})}),open:z,onOpen:f&&!h?R:void 0,onClose:f&&!h?F:void 0,FabProps:{color:"primary",sx:A,size:r,gap:C},slotProps:{fab:{"data-testid":"speed-dial-fab","aria-label":o}},sx:{"& .MuiSpeedDial-fab":{backgroundColor:l,...A},"& .MuiSpeedDial-actions":{gap:C||8},"& .MuiSpeedDialIcon-icon":{fontSize:"small"===r?"18px":"large"===r?"24px":"20px",color:"inherit"},"& .MuiSpeedDialIcon-openIcon":{fontSize:"small"===r?"18px":"large"===r?"24px":"20px",color:"inherit"},"& .MuiSpeedDialAction-fab":{backgroundColor:"#fff",color:"#757575","&:hover":{backgroundColor:"#f5f5f5"}},"& .MuiSpeedDialAction-staticTooltip":{backgroundColor:"rgba(97, 97, 97, 0.9)",color:"#fff",fontSize:"12px",padding:"4px 8px",borderRadius:"4px"},"& .MuiSpeedDialAction-staticTooltipLabel":{fontSize:"12px",fontWeight:500},...M},...I,...u,...S,children:c.map(e=>{const{text:t,link:o}=e.properties??{},{iconName:n="plus",disabled:a=!1,iconColor:i="#757575",tooltipText:s,backgroundColor:l="#fff"}=e.config?.props??{},c=String(t?.text||s||"Action"),u=E&&T===e.id,h={entityId:e.id,entity:"molecule_item",entityType:"speed_dial_action_item"},f=E?{onClick:e=>{e.stopPropagation(),j?.(h,!1)},onDoubleClick:e=>{e.stopPropagation(),j?.(h,!0)},"data-organism-id":e.id,css:hrt({theme:D,selected:u})}:{};return at(Uw,{icon:at(jGe,{iconName:n,color:i,size:24}),tooltipOpen:d,tooltipTitle:c,tooltipPlacement:p,FabProps:{sx:{color:i,backgroundColor:l},size:r,disabled:a,"aria-label":c,onClick:e=>{e.stopPropagation(),o?(d9e(o)?N?.({link:o.internalLink??""}):c9e(o.externalLink),P(!1)):P(!1)},...f}},e.id)})})]})},zht=({items:e,gap:t,stepGap:r,isMobile:o=!1,iconSize:n="24px",orientation:a="horizontal",activeStep:i=0,lineColor:s,lineWidth:l,lineRadius:c,marginTop:u="0",marginRight:d="0",marginBottom:p="0",marginLeft:h="0",paddingTop:f="0",paddingRight:m="0",paddingBottom:y="0",paddingLeft:g="0",borderRadius:v="0",configurationItemInfo:x,backgroundColor:b="transparent",sx:w,...k})=>{const _=Ye(),C=o?"vertical":a,{isConfigurationMode:M,onConfigurationItemClicked:S,selectedConfigurationItemId:D}=IC();return at(Vk,{sx:{gap:t,width:"100%",overflow:"hidden",marginTop:u,marginRight:d,marginBottom:p,marginLeft:h,paddingTop:f,paddingRight:m,paddingBottom:y,paddingLeft:g,borderRadius:v,backgroundColor:b,"& .MuiStep-root":{padding:"8px"},"& .MuiStepLabel-root":{gap:r,alignItems:"flex-start"},"& .MuiStepLabel-label":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"},"& .MuiStepConnector-root":{flex:"1 1 auto"},"& .MuiStepConnector-line":{borderColor:s,borderWidth:l,borderRadius:c},"& .MuiStepConnector-vertical":{width:n||"24px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"4px"},"& .MuiStepConnector-horizontal":{marginLeft:"8px",marginRight:"8px"},"& .MuiStepContent-root":{margin:0,padding:0,marginTop:"4px",borderLeft:"none"},"& .MuiTypography-root":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"},...w},activeStep:i,orientation:C,connector:at(jk,{sx:{[`&.${Dk.vertical}`]:{width:n||"24px",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:"4px"},[`&.${Dk.vertical} .${Dk.line}`]:{borderColor:s,borderWidth:l,borderRadius:c},[`&.${Dk.horizontal} .${Dk.line}`]:{borderColor:s,borderWidth:l,borderRadius:c}}}),...x,...k,children:e.map((e,t)=>{const o=D===e.id,a=t===i,s={entityId:e.id,entity:"molecule_item",entityType:"stepper_item"},l=M?{onClick:e=>{M&&(e.stopPropagation(),S?.(s,!1))},onDoubleClick:e=>{M&&(e.stopPropagation(),S?.(s,!0))},"data-organism-id":e.id,css:hrt({theme:_,selected:o})}:{},c=e.color||(a?"#000":"#555");return at(lk,{...l,children:it(Mk,{sx:{gap:r,"& .MuiStepLabel-iconContainer":{marginRight:"8px",display:"flex",alignItems:"center",justifyContent:"center"},"& .MuiStepLabel-labelContainer":{display:"flex",flexDirection:"column",alignItems:"flex-start"}},icon:e?.iconName?at(jGe,{size:n,color:e.iconColor||"#000",iconName:e.iconName,borderRadius:e?.iconBorderRadius||0,backgroundColor:e.iconBackgroundColor||"transparent"}):void 0,children:[at(Pd,{variant:"body1",sx:{padding:"4px",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",color:c,borderRadius:e.borderRadius||"0",display:"inline-block","&.MuiTypography-body1":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"}},children:e.title}),e.subText&&at(Ik,{sx:{margin:0,padding:0,marginTop:"4px",borderLeft:"none","& .MuiStepContent-root":{margin:0,padding:0,marginTop:"4px",borderLeft:"none"}},transitionDuration:{enter:400,exit:400},children:at(Pd,{variant:"body2",sx:{padding:"4px",fontSize:e.subTextFontSize||"inherit",fontWeight:e.subTextFontWeight||"normal",fontFamily:e.subTextFontFamily||"inherit",color:e.subTextColor||"#666",borderRadius:e.borderRadius||"0",display:"inline-block",..."horizontal"===C&&{maxWidth:"300px"},"&.MuiTypography-body2":{fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",color:"inherit"}},children:e.subText})})]})},e.id)})})},Lht=gl(Yk)(({thumbColor:e="#ff0000",thumbCheckedColor:t="#00ff00",trackColor:r="#0000ff",disabledThumbColor:o="#9e9e9e",sx:n})=>({"& .MuiSwitch-thumb":{backgroundColor:e,width:20,height:20},"& .MuiSwitch-switchBase.Mui-checked .MuiSwitch-thumb":{backgroundColor:t},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"& .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"&.Mui-disabled .MuiSwitch-thumb":{backgroundColor:o},"&.Mui-disabled .MuiSwitch-track":{backgroundColor:r,opacity:1,backgroundImage:"none"},"& .MuiSwitch-switchBase":{padding:"9px","&.Mui-checked":{transform:"translateX(16px)"}},"& .MuiSwitch-colorPrimary":{"&.Mui-checked":{color:t}},"& .MuiSwitch-colorSecondary":{"&.Mui-checked":{color:t}},...n})),Bht=({isDisplayOnly:t=!1,required:r=!1,requiredErrorText:o="This field is required",validationErrorText:n="Invalid value",text:a="",thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,labelPlacement:u="top",marginLeft:d="0",marginTop:p="0",marginRight:h="0",marginBottom:f="0",paddingLeft:m="0",paddingTop:y="0",paddingRight:g="0",paddingBottom:v="0",width:x,height:b,minHeight:w,maxHeight:k,minWidth:_,maxWidth:C,name:M,sourceDataModelField:S,disabled:D=!1,sx:O,configurationItemInfo:P,...E})=>{const j=Kt(),T=j?.control,N=!!T&&!!M,R={required:!!r&&o,validate:e=>!(r&&!e)||o};IC(),UC(),ht();const F=wrt({name:M,sourceDataModelField:S,form:j,enabled:N}),[I,A]=e.useState(!1);if(t){let e=!1;return void 0!==F?e="true"===String(F).toLowerCase()||!0===F:N&&(e=Boolean(AGe(j.watch(M),M,"value"))),it(ag,{required:r,sx:{marginLeft:d,marginTop:p,marginRight:h,marginBottom:f,paddingLeft:m,paddingTop:y,paddingRight:g,paddingBottom:v,display:"inline-flex",...x&&{width:x},...b&&{height:b},...w&&{minHeight:w},...k&&{maxHeight:k},..._&&{minWidth:_},...C&&{maxWidth:C},"& .MuiFormLabel-root":{fontSize:"14px",fontWeight:500,color:"#333",marginBottom:"8px"},"& .MuiSwitch-root":{marginTop:"8px"},"& .MuiSwitch-switchBase":{padding:"9px"},"& .MuiSwitch-thumb":{width:"18px",height:"18px",borderRadius:"9px"},"& .MuiSwitch-track":{borderRadius:"9px",height:"14px"},"& .MuiTypography-root":{marginLeft:"8px",fontSize:"14px",fontWeight:500,color:"#333"},...O},...P,children:[a&&at(Dg,{component:"legend",children:a}),it(Zf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:[at(Lht,{disabled:!0,checked:e,thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{pointerEvents:"none"}},...E}),at(Pd,{sx:{ml:1},children:e?"ON":"OFF"})]})]})}return it(ag,{required:r,sx:{marginLeft:d,marginTop:p,marginRight:h,marginBottom:f,paddingLeft:m,paddingTop:y,paddingRight:g,paddingBottom:v,display:"inline-flex",...x&&{width:x},...b&&{height:b},...w&&{minHeight:w},...k&&{maxHeight:k},..._&&{minWidth:_},...C&&{maxWidth:C},"& .MuiFormLabel-root":{fontSize:"14px",fontWeight:500,color:"#333",marginBottom:"8px"},"& .MuiSwitch-root":{marginTop:"8px"},"& .MuiSwitch-switchBase":{padding:"9px"},"& .MuiSwitch-thumb":{width:"18px",height:"18px",borderRadius:"9px"},"& .MuiSwitch-track":{borderRadius:"9px",height:"14px"},"& .MuiFormHelperText-root":{marginTop:"4px",fontSize:"12px",color:"#d32f2f"},...O},...P,children:[a&&at(Dg,{component:"legend",children:a}),N?at(tr,{name:M,rules:R,control:T,defaultValue:!1,render:({field:e,fieldState:t})=>{const r=Boolean(AGe(e.value,M,"value"));return it(nt,{children:[at(Zf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:at(Lht,{checked:r,disabled:D,onChange:(e,t)=>{zGe(j,M,t,"value")},thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)"}}},...E})}),t.error&&at(wg,{error:!0,sx:{marginTop:"4px"},children:"required"===t.error.type?o:n})]})}}):at(Zf,{display:"flex",alignItems:"center",mt:"top"===u?1:0,children:at(Lht,{checked:I,disabled:D,onChange:(e,t)=>{A(t)},thumbColor:i,thumbCheckedColor:s,trackColor:l,disabledThumbColor:c,sx:{"& .MuiSwitch-switchBase":{"&:hover":{backgroundColor:"rgba(25, 118, 210, 0.04)"}}},...E})})]})},Vht=({items:t,onTabChange:r,activeTabKey:o,isMobile:n=!1,marginTop:a,marginRight:i,marginBottom:s,marginLeft:l,paddingTop:c,paddingRight:u,paddingBottom:d,paddingLeft:p,buttonPaddingTop:h,buttonPaddingRight:f,buttonPaddingBottom:m,buttonPaddingLeft:y,width:g,height:v,backgroundColor:x,borderRadius:b,elevation:w=1,gap:k,indicatorVisible:_=!0,indicatorColor:C,lineWidth:M="2px",orientation:S="horizontal",activeTextColor:D="#1976d2",inactiveTextColor:O="#000",fontSize:P,fontWeight:E,fontFamily:j,wrapText:T,textAlign:N,iconName:R,iconColor:F,iconSize:I,iconPlacement:A="left",hoverTextColor:z,itemBorder:L,itemBorderRadius:B,itemBackgroundColor:V,itemSelectedBackgroundColor:$,itemHoverBackgroundColor:H,selectedItemElevation:q=0,itemDisableRipple:W,configurationItemInfo:U,sx:G})=>{const K=Ye(),{isConfigurationMode:Y,onConfigurationItemClicked:Z,selectedConfigurationItemId:X}=IC(),[Q,J]=e.useState(null),ee=e=>J(e.currentTarget),te=()=>J(null),re={marginTop:a,marginRight:i,marginBottom:s,marginLeft:l,paddingTop:c,paddingRight:u,paddingBottom:d,paddingLeft:p,width:g,height:v,backgroundColor:x,borderRadius:b,display:"flex",overflow:"visible !important"},oe=e=>{const t=e?D:O,r=e&&$||V;return{color:t,fontSize:P,fontWeight:E,fontFamily:j,textAlign:N,whiteSpace:T?"normal":"nowrap",border:L,borderRadius:B,backgroundColor:r,boxShadow:e?K.shadows[q]:void 0,paddingTop:h,paddingRight:f,paddingBottom:m,paddingLeft:y,"&:hover":{color:z||t,backgroundColor:H||r}}},ne=e=>{r?.({newTabKey:e.tabKey,link:e.link})},ae=e=>{if(!Y)return{};const t=e.id===X,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:e=>{e.stopPropagation(),Z?.(r,!1)},onDoubleClick:e=>{e.stopPropagation(),Z?.(r,!0)},"data-organism-id":e.id,css:hrt({theme:K,selected:t})}},ie=e=>{const t=e.tabKey===o,r=oe(t);return it(xx,{onClick:()=>{ne(e),te()},sx:{...r,display:"flex",alignItems:"center"},...ae(e),children:[e.iconName&&at(jGe,{iconName:e.iconName,sx:{fontSize:P,color:t?D:O,mr:1}}),at(Zf,{component:"span",children:e.label})]},e.id)};if(n)return it(tu,{elevation:w,style:re,sx:G,...U,children:[at(cd,{onClick:ee,children:at(jGe,{size:I,color:F,iconName:R})}),at(fx,{anchorEl:Q,open:Boolean(Q),onClose:te,children:t.map(ie)})]});const se=t.findIndex(e=>e.tabKey===o);return at(tu,{elevation:w,style:re,sx:G,...U,children:at(tC,{value:se<0?0:se,onChange:(e,r)=>Y?null:ne(t[r]),orientation:S,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:k}},TabIndicatorProps:{style:_?{height:M,borderRadius:b,backgroundColor:C||D}:{display:"none"}},children:t.map(e=>{const t=e.tabKey===o,r={...oe(t),"&.Mui-selected":{color:t?D:O}};return at(e_,{label:e.label,disableRipple:W,sx:{...r,textTransform:"none"},onClick:()=>ne(e),iconPosition:"right"===A?"end":"start",icon:e.iconName?at(jGe,{iconName:e.iconName,sx:{fontSize:P,color:t?D:O}}):void 0,...ae(e)},e.id)})})})},$ht=e=>{if(!e)return null;if(e instanceof Date)return Not(e)?e:null;if("object"==typeof e&&null!==e&&"function"==typeof e.toDate){const t=e.toDate();return t instanceof Date&&Not(t)?t:null}if("string"==typeof e){const t=e.trim();if(!t)return null;const r=t.match(/(\d{1,2}:\d{2}(?::\d{2})?)/),o=r?r[1]:t,n=new Date,a=["HH:mm:ss","H:mm:ss","HH:mm","H:mm","hh:mm a","h:mm a","hh a","h a","HHmm","Hmm","HH","H"];for(const e of a){const t=Lnt(o,e,n);if(Not(t))return t}return null}return null},Hht=e=>{const t=$ht(e);return t?Lot(t,"HH:mm"):null},qht=({name:t,text:r,isDisplayOnly:o=!1,sourceDataModelField:n,configurationItemInfo:a={},placeholderText:i,displayFormat:s="HH:mm",required:l=!1,requiredErrorText:c="This field is required",validationErrorText:u,sx:d,width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,...v})=>{const x=Kt(),b=x?.control,w=!!b&&!!t;IC();const k=wrt({name:t,sourceDataModelField:n,form:x,enabled:w,mapValue:e=>Hht(e),skipIfNull:!0}),_=$ht(k);e.useRef();const[C,M]=e.useState(_);if(o){const e=void 0!==k?k:w?AGe(x.watch(t),t,"value"):void 0,o=$ht(e),n=o&&Not(o)?Lot(o,s):"";return it(Zf,{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiFormHelperText-root":{marginBottom:"4px"},"& .MuiTypography-root":{border:"1px solid #ced4da",borderRadius:"4px",padding:"8px",minWidth:"100px"},...d},children:[r&&at(wg,{children:r}),at(Pd,{children:n||i||"-"})]})}return at(Zf,w?{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiTimePicker-root":{width:"100%"},"& .MuiTextField-root":{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g},"& .MuiInputBase-root":{fontSize:"14px"},"& .MuiInputLabel-root":{fontSize:"14px"},"& .MuiFormHelperText-root":{fontSize:"12px"},"& .MuiSvgIcon-root":{fontSize:"20px"},...d},children:at(tr,{name:t,control:b,defaultValue:Hht(k)??null,rules:{required:!!l&&(c||"This field is required"),validate:e=>{if(null==e||""===e)return!0;const t=$ht(e);return t&&Not(t)||u||"Invalid time"}},render:({field:{value:e},fieldState:o})=>{const n=AGe(e,t,"value");return at(upt,{...v,enableAccessibleFieldDOMStructure:!1,value:$ht(n),onChange:e=>{const r=Hht(e);zGe(x,t,r,"value")},slots:{textField:iC},slotProps:{textField:{label:r,placeholder:i,error:!!o.error,helperText:o.error?.message,onMouseDown:e=>e.stopPropagation(),sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g}}}})}})}:{...a,sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g,"& .MuiTimePicker-root":{width:"100%"},"& .MuiTextField-root":{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g},"& .MuiInputBase-root":{fontSize:"14px"},"& .MuiInputLabel-root":{fontSize:"14px"},"& .MuiFormHelperText-root":{fontSize:"12px"},"& .MuiSvgIcon-root":{fontSize:"20px"},...d},children:at(upt,{...v,enableAccessibleFieldDOMStructure:!1,value:C,onChange:e=>M($ht(e)),slots:{textField:iC},slotProps:{textField:{label:r,placeholder:i,onMouseDown:e=>e.stopPropagation(),sx:{width:p,height:h,minWidth:f,maxWidth:m,minHeight:y,maxHeight:g}}}})})},Wht=({src:t,poster:r,controls:o=!1,loop:n=!1,autoplay:a=!1,raised:i=!1,alt:s="",height:l="100%",width:c="100%",borderRadius:u="0",margin:d=0,padding:p=0,moleculeId:h,enableCoverImage:f,configurationItemInfo:m,marginTop:y="0px",marginRight:g="0px",marginBottom:v="0px",marginLeft:x="0px",paddingTop:b="0px",paddingRight:w="0px",paddingBottom:k="0px",paddingLeft:_="0px",sx:C,sourceDataModelField:M})=>{const[S,D]=e.useState(!1),O=M?$Ge(M):void 0,P=("string"==typeof O?O:void 0)||t,{onStateChange:E}=YC(),j=()=>{E({id:h,type:"started"})};return at(Uht,{id:h,raised:i,onClick:j,sx:{borderRadius:`${u}px`,margin:d,padding:p,marginTop:y,marginRight:g,marginBottom:v,marginLeft:x,paddingTop:b,paddingRight:w,paddingBottom:k,paddingLeft:_,"& .MuiCard-root":{display:"inline-block",overflow:"hidden"},"& .MuiCardMedia-root":{height:l,width:c,objectFit:"cover"},"& .MuiCardMedia-media":{height:"100%",width:"100%",objectFit:"cover"},...C},...m,children:S?at(Pd,{component:"div",sx:{height:l,width:c,display:"flex",justifyContent:"center",alignItems:"center",fontSize:"16px",color:"gray",textAlign:"center"},children:s||"Video unavailable"}):at(bm,{component:"video",src:P,poster:f?r:void 0,controls:o,loop:n,autoPlay:a,muted:a,"aria-label":s,sx:{height:l,width:c,objectFit:"cover","& .MuiCardMedia-media":{height:"100%",width:"100%",objectFit:"cover"}},onPlay:j,onEnded:()=>{E({id:h,type:"completed"})},onError:()=>{D(!0)}})})},Uht=To(fm)`
|
|
1032
1032
|
display: inline-block;
|
|
1033
1033
|
overflow: hidden;
|
|
1034
1034
|
`,Ght=({width:e="100%",height:t,fontSize:r="16px",marginLeft:o="0",marginTop:n="0",marginRight:a="0",marginBottom:i="0",sx:s})=>at(Hb,{variant:"text",animation:"wave",sx:{width:e,height:t||("number"==typeof r?1.5*r+"px":"24px"),marginLeft:o,marginTop:n,marginRight:a,marginBottom:i,...s}}),Kht=Ght,Yht=({text:e,width:t,height:r,fontSize:o="16px",borderColor:n="#ccc",backgroundColor:a,marginLeft:i="0",marginTop:s="0",marginRight:l="0",marginBottom:c="0",paddingLeft:u,paddingTop:d,paddingRight:p,paddingBottom:h,sx:f})=>it(Zf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:i,marginTop:s,marginRight:l,marginBottom:c,width:t||"fit-content",...f},children:[e&&at(Hb,{variant:"text",animation:"wave",sx:{width:"60px",height:"14px",marginBottom:"4px"}}),at(Hb,{variant:"rounded",animation:"wave",sx:{width:t||"150px",height:(()=>{if(r)return r;const e="number"==typeof o?o:parseInt(o,10);return Number.isNaN(e)?"32px":`${Math.round(1.2*e+16)}px`})(),borderRadius:"4px",backgroundColor:a,border:`1px solid ${n}`}})]}),Zht=Yht,Xht=Yht,Qht=Yht,Jht=Yht,eft=({text:e,width:t,height:r,borderColor:o="#ccc",backgroundColor:n,marginLeft:a="0",marginTop:i="0",marginRight:s="0",marginBottom:l="0",paddingLeft:c,paddingTop:u,paddingRight:d,paddingBottom:p,sx:h})=>it(Zf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:a,marginTop:i,marginRight:s,marginBottom:l,width:t||"fit-content",...h},children:[e&&at(Hb,{variant:"text",animation:"wave",sx:{width:"80px",height:"14px",marginBottom:"4px"}}),at(Hb,{variant:"rounded",animation:"wave",sx:{width:t||"180px",height:r||"32px",borderRadius:"4px",backgroundColor:n,border:`1px solid ${o}`}})]}),tft=({text:e,maxValue:t=5,marginLeft:r="0",marginTop:o="0",marginRight:n="0",marginBottom:a="0",sx:i})=>it(Zf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:r,marginTop:o,marginRight:n,marginBottom:a,...i},children:[e&&at(Hb,{variant:"text",animation:"wave",sx:{width:"80px",height:"20px",marginBottom:"4px"}}),at(Zf,{sx:{display:"flex",gap:"4px"},children:Array.from({length:t}).map((e,t)=>at(Hb,{variant:"circular",animation:"wave",sx:{width:"24px",height:"24px"}},t))})]}),rft=({text:e,marginLeft:t="0",marginTop:r="0",marginRight:o="0",marginBottom:n="0",sx:a})=>it(Zf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:t,marginTop:r,marginRight:o,marginBottom:n,...a},children:[e&&at(Hb,{variant:"text",animation:"wave",sx:{width:"60px",height:"16px",marginBottom:"8px"}}),it(Zf,{sx:{display:"flex",alignItems:"center",gap:"8px"},children:[at(Hb,{variant:"rounded",animation:"wave",sx:{width:"42px",height:"26px",borderRadius:"13px"}}),at(Hb,{variant:"text",animation:"wave",sx:{width:"30px",height:"16px"}})]})]}),oft=({text:e,width:t,orientation:r="horizontal",marginLeft:o="0",marginTop:n="0",marginRight:a="0",marginBottom:i="0",sx:s})=>it(Zf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:o,marginTop:n,marginRight:a,marginBottom:i,width:t||"200px",...s},children:[e&&at(Hb,{variant:"text",animation:"wave",sx:{width:"60px",height:"16px",marginBottom:"8px"}}),it(Zf,{sx:{display:"flex",alignItems:"center",flexDirection:"vertical"===r?"column":"row",gap:"8px"},children:[at(Hb,{variant:"rounded",animation:"wave",sx:{width:"horizontal"===r?"100%":"4px",height:"horizontal"===r?"4px":"100px",borderRadius:"2px"}}),at(Hb,{variant:"text",animation:"wave",sx:{width:"24px",height:"16px"}})]})]}),nft=({text:e,width:t,height:r,borderColor:o="#ced4da",backgroundColor:n,marginLeft:a="0",marginTop:i="0",marginRight:s="0",marginBottom:l="0",sx:c})=>it(Zf,{sx:{display:"inline-flex",flexDirection:"column",marginLeft:a,marginTop:i,marginRight:s,marginBottom:l,width:t||"fit-content",...c},children:[e&&at(Hb,{variant:"text",animation:"wave",sx:{width:"60px",height:"14px",marginBottom:"4px"}}),at(Hb,{variant:"rounded",animation:"wave",sx:{width:t||"120px",height:r||"32px",borderRadius:"4px",backgroundColor:n,border:`1px solid ${o}`}})]}),aft=({text:e,width:t,height:r,borderColor:o="#ced4da",marginLeft:n="0",marginTop:a="0",marginRight:i="0",marginBottom:s="0",sx:l})=>it(Zf,{sx:{marginLeft:n,marginTop:a,marginRight:i,marginBottom:s,width:t||"fit-content",...l},children:[e&&at(Hb,{variant:"text",animation:"wave",sx:{width:"60px",height:"14px",marginBottom:"4px"}}),at(Hb,{variant:"rounded",animation:"wave",sx:{width:t||"100px",height:r||"32px",borderRadius:"4px",border:`1px solid ${o}`}})]}),ift=({width:e,height:t,marginLeft:r="0",marginTop:o="0",marginRight:n="0",marginBottom:a="0",sx:i})=>it(Zf,{sx:{marginLeft:r,marginTop:o,marginRight:n,marginBottom:a,width:e||"320px",...i},children:[at(Hb,{variant:"rectangular",animation:"wave",sx:{width:"100%",height:"48px",borderRadius:"8px 8px 0 0",marginBottom:"8px"}}),at(Zf,{sx:{display:"flex",justifyContent:"space-between",marginBottom:"8px"},children:Array.from({length:7}).map((e,t)=>at(Hb,{variant:"circular",animation:"wave",sx:{width:"32px",height:"24px"}},t))}),Array.from({length:6}).map((e,t)=>at(Zf,{sx:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:Array.from({length:7}).map((e,t)=>at(Hb,{variant:"circular",animation:"wave",sx:{width:"32px",height:"32px"}},t))},t))]}),sft=({text:e,subText:t,width:r,height:o,backgroundColor:n,marginLeft:a="0",marginTop:i="0",marginRight:s="0",marginBottom:l="0",sx:c})=>at(Hb,{variant:"rounded",animation:"wave",sx:{width:r||"100%",height:o||(e&&t?"72px":"48px"),borderRadius:"4px",marginLeft:a,marginTop:i,marginRight:s,marginBottom:l,backgroundColor:n,...c}}),lft=({size:e=24,marginLeft:t="0",marginTop:r="0",marginRight:o="0",marginBottom:n="0",sx:a})=>it(Zf,{sx:{position:"relative",display:"inline-flex",marginLeft:t,marginTop:r,marginRight:o,marginBottom:n,...a},children:[at(Hb,{variant:"circular",animation:"wave",sx:{width:e,height:e}}),at(Hb,{variant:"circular",animation:"wave",sx:{position:"absolute",top:-4,right:-4,width:16,height:16}})]}),cft=({size:e="medium",width:t,backgroundColor:r,marginLeft:o="0",marginTop:n="0",marginRight:a="0",marginBottom:i="0",sx:s})=>at(Hb,{variant:"rounded",animation:"wave",sx:{width:t||("small"===e?"60px":"80px"),height:"small"===e?"24px":"32px",borderRadius:"16px",marginLeft:o,marginTop:n,marginRight:a,marginBottom:i,backgroundColor:r,...s}}),uft=({width:e,fontSize:t="14px",marginLeft:r="0",marginTop:o="0",marginRight:n="0",marginBottom:a="0",sx:i})=>at(Hb,{variant:"text",animation:"wave",sx:{width:e||"100px",height:"number"==typeof t?1.2*t+"px":"18px",marginLeft:r,marginTop:o,marginRight:n,marginBottom:a,...i}}),dft=({size:e=40,marginLeft:t="0",marginTop:r="0",marginRight:o="0",marginBottom:n="0",sx:a})=>at(Hb,{variant:"circular",animation:"wave",sx:{width:e,height:e,marginLeft:t,marginTop:r,marginRight:o,marginBottom:n,...a}}),pft=["simple_text","text","basic_text_display_field","email_display_field","phone_number_display_field","numeric_display_field","currency_display_field","select_display_field","rating_display_field","switch_display_field","slider_display_field","date_display_field","time_picker_display","date_calendar_display","alert","badge","chip","link","avatar"],hft=e=>pft.includes(e),fft=({type:e,props:t={}})=>{const r={width:t.width,height:t.height,marginLeft:t.marginLeft||"0",marginTop:t.marginTop||"0",marginRight:t.marginRight||"0",marginBottom:t.marginBottom||"0",sx:t.sx};switch(e){case"simple_text":case"text":return at(Ght,{...r,fontSize:t.fontSize});case"basic_text_display_field":return at(Yht,{...r,text:t.text,fontSize:t.fontSize,borderColor:t.borderColor,backgroundColor:t.backgroundColor,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom});case"email_display_field":return at(Zht,{...r,text:t.text,borderColor:t.borderColor});case"phone_number_display_field":return at(Xht,{...r,text:t.text,borderColor:t.borderColor});case"numeric_display_field":return at(Qht,{...r,text:t.text,borderColor:t.borderColor});case"currency_display_field":return at(Jht,{...r,text:t.text,borderColor:t.borderColor});case"select_display_field":return at(eft,{...r,text:t.text,borderColor:t.borderColor});case"rating_display_field":return at(tft,{...r,text:t.text,maxValue:t.maxValue});case"switch_display_field":return at(rft,{...r,text:t.text});case"slider_display_field":return at(oft,{...r,text:t.text,orientation:t.orientation});case"date_display_field":return at(nft,{...r,text:t.text,borderColor:t.borderColor});case"time_picker_display":return at(aft,{...r,text:t.text,borderColor:t.borderColor});case"date_calendar_display":return at(ift,{...r});case"alert":return at(sft,{...r,text:t.text,subText:t.subText,backgroundColor:t.backgroundColor});case"badge":return at(lft,{...r,size:t.size});case"chip":return at(cft,{...r,size:t.size,backgroundColor:t.backgroundColor});case"link":return at(uft,{...r,fontSize:t.fontSize});case"avatar":return at(dft,{...r,size:t.size});default:return at(Hb,{variant:"rounded",animation:"wave",sx:{width:r.width||"100%",height:r.height||"40px",marginLeft:r.marginLeft,marginTop:r.marginTop,marginRight:r.marginRight,marginBottom:r.marginBottom,...r.sx}})}},mft=({children:e,additionalInfo:t})=>{try{return at(nt,{children:e})}catch(r){return console.error(`Render error in SafeRender - ${t} :`,r),at("div",{style:{color:"red",padding:24},children:"Render Error"})}};function yft(e,t,r,o){const n={...e};return 0===r.length?{...e,...t}:(t&&o&&r.forEach(e=>{void 0!==t[e]&&(n[e]=t[e])}),n)}function gft(e,t,r=!1){return t&&r?xn(e,t):e}const vft=({id:t,type:r,name:o,form:n,config:a,formData:i,isMobile:s,children:l,tabsProps:c,properties:u,moleculeLibraryId:d,organismLibraryMoleculeId:p,parentStyleVariantConfig:h,parentContainerWithVariantsId:f,parentContainerActiveVariant:m})=>{const y=Ye(),g=PC("xs"),v=s||g,{formId:x,isPreview:b=!1,validations:w,submitHandler:k,isConfigurationMode:_,onConfigurationItemClicked:C,selectedConfigurationItemId:M,currentStyleProperties:S,currentContentProperties:D,onInternalNavigation:O,organismMetadata:P,organismInfo:E,localState:j}=IC(),{stateConfig:T}=UC(),N=KC(),R=T,F=ht(),I=F?.isLoading??N?.isSingleRecordLoading??!1,A=m??F.activeVariant,z=e.useMemo(()=>((e,t)=>{if(!e)return{};if(t){const r=e[t];if(r&&"object"==typeof r&&"props"in r){const e=r.props;if(e&&"object"==typeof e)return e}}return e.props||{}})(a,A??null),[a,A]),L=u?.dataCapture,B=a?.props?.dataCaptureName||L?.dataCaptureName||L?.variableName||t,V=e.useMemo(()=>{return x&&F?.nestedPathSegments?.length?(e=F.nestedPathSegments,t=B,e&&0!==e.length?[...e.map(e=>void 0!==e.index?`${e.dmfId}.${e.index}`:e.dmfId),t].filter(Boolean).join("."):t):B;var e,t},[x,F?.nestedPathSegments,B]),$=u?.dataCapture,H=$?.nature?.toString().replace(/-/g,"_").toLowerCase()??"",q="variable"===H&&$?.variableName||$?.sourceDataModelFieldId,W=$?.predefinedValue,U=!$?.isIgnored&&("variable"===H&&Boolean($?.variableName)||"data_model"===H&&Boolean($?.sourceDataModelFieldId)),G=e=>{if(!e||e.isIgnored)return;return"variable"===(e.nature?.toString().replace(/-/g,"_").toLowerCase()??"")?e.variableName||e.sourceDataModelFieldId||void 0:e.sourceDataModelFieldId||void 0},K=M===t,{isStateDisabled:Y,isStateVisible:Z}=(({stateListenerId:e})=>{const{localStateObject:t}=IC(),{stateConfig:r}=UC(),o=t||r;let n=!0,a=!1;if(!e)return{isStateDisabled:a,isStateVisible:n};const i=o?.[e]||{},{visible:s=!0,disabled:l=!1}=i||{};return e in o&&(n=Boolean(s),a=Boolean(l)),{isStateDisabled:a,isStateVisible:n,stateValue:i}})({stateListenerId:t}),X=e.useMemo(()=>({entityType:r,entity:"molecule",entityName:o,entityId:t,organismType:E?.type,organismSubtype:E?.subtype,organismLibraryMoleculeId:p,libraryEntityId:d,activeStyleVariant:A,parentReplicatorWithVariants:f||F.containerId||null,parentStyleVariantConfig:h||void 0}),[r,o,t,p,d,A,F.containerId,f,h]),Q=e.useCallback(e=>{e?.stopPropagation(),C(X,!1)},[C,X]),J=e.useCallback(e=>{e?.stopPropagation(),C(X,!0)},[C,X]),ee=_?{onClick:Q,onDoubleClick:J,"data-configuration-id":t,css:hrt({theme:y,selected:K})}:{},te=_||Y;if(!Z)return null;if(I&&(hft(r)||U)){const e={width:z.width,height:z.height,marginLeft:z.marginLeft||"0",marginTop:z.marginTop||"0",marginRight:z.marginRight||"0",marginBottom:z.marginBottom||"0",paddingLeft:z.paddingLeft,paddingTop:z.paddingTop,paddingRight:z.paddingRight,paddingBottom:z.paddingBottom,fontSize:z.fontSize,borderColor:z.borderColor,backgroundColor:z.backgroundColor,size:z.size,text:u?.text?.text,subText:u?.subText?.text,maxValue:z.maxValue,orientation:z.orientation,sx:z.sx};return at(fft,{type:r,props:e})}return(()=>{switch(r){case"simple_text":{const e={text:u?.text},r=["text"],{text:o}=yft(e,D,r,K),n=gft(z,S,K);return at(Ept,{...n,text:o?.text||"",htmlElementId:t,configurationsItemInfo:ee})}case"text":{const e={text:u?.text},r=Object.keys(e),{text:o}=yft(e,D,r,K),n=gft(z,S,K);return at(Ppt,{...o,...n,htmlElementId:t,configurationItemInfo:ee})}case"consent":{const e=yft(u,D,[],K),r=gft(z,S,K)||{};return at(Prt,{...r,htmlElementId:t,properties:e,configurationItemInfo:ee})}case"signup_password_fields":{const e={text:u?.text,subText:u?.subText,placeholderText:u?.placeholderText,subPlaceholderText:u?.subPlaceholderText,validationText:u?.validationText},r=Object.keys(e),o=yft(e,D,r,K),{state:n,gap:i,...s}=gft(a?.props,S,K);return at(_ht,{gap:i,inputProps:s,validations:w||[],htmlElementId:t,validationState:n,overridesProperties:o,configurationItemInfo:ee})}case"stepper":{const e=gft(z,S,K),r=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{},a={title:r?.title,subText:r?.subText},i=Object.keys(a),{title:s,subText:l}=yft(a,D,i,t);return{...n,...gft(o?.props,S,t),title:s?.text||"",subText:l?.text||""}});return at(zht,{...e,items:r||[],isMobile:v,moleculeId:t,configurationItemInfo:ee})}case"checklist":{const e=gft(z,S,K)||{},r=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{};switch(e.type){case"checklist_item":{const a={label:r?.label,objectState:r?.objectState},i=Object.keys(a),s=yft(a,D,i,t),l=gft(o?.props,S,t)||{},c=s.label?.text||"",u=!!s.objectState?.pmiObjectId;return{...n,...l,type:"checklist_item",label:c,textColor:l.textColor||"#000",fontSize:l.fontSize||"14px",fontFamily:l.fontFamily||"inherit",fontWeight:l.fontWeight||"normal",textAlign:l.textAlign||"left",isSystemDriven:u,disabled:u,interacted:R?.[e.id]?.interacted||"unchecked"}}case"divider_item":{const e=gft(o?.props,S,t)||{};return{...n,...e,type:"divider_item"}}case"text_item":{const e={text:r?.text},a=Object.keys(e),i=yft(e,D,a,t),s=gft(o?.props,S,t)||{},l=i.text?.text||"";return{...n,...s,type:"text_item",text:l}}case"rich_text_item":{const e={text:r?.text},a=Object.keys(e),i=yft(e,D,a,t),s=gft(o?.props,S,t)||{},l=i.text?.text||f5e;return{...n,...s,type:"rich_text_item",text:l}}default:return{...n,type:e.type}}});return at(Drt,{...e,items:r||[],moleculeId:t,configurationItemInfo:ee})}case"accordion":{const e=gft(z,S,K),r=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{},a={text:r?.text,subText:r?.subText,bodyText:r?.bodyText},i=Object.keys(a),{text:s,subText:l,bodyText:c}=yft(a,D,i,t);return{...n,...gft(o?.props,S,t),text:s?.text||"",subText:l?.text||"",bodyText:c?.text||""}});return at(mrt,{...e,items:r||[],moleculeId:t,configurationItemInfo:ee})}case"menu":{const e={text:u?.text,disabled:u?.disabled},r=Object.keys(e),{text:o,disabled:n}=yft(e,D,r,K),a=gft(z,S,K),i=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{},a={disabled:r&&"disabled"in r?r.disabled:void 0,text:r&&"text"in r?r.text:void 0,link:r&&"link"in r?r.link:void 0},i=Object.keys(a),{text:s,disabled:l,link:c}=yft(a,D,i,t),u=gft(o?.props,S,t);return{...n,...u,disabled:R?.[e.id]?R?.[e.id]?.disabled:l?.value||u?.disabled||!1,text:s?.text||"Menu Item",link:c}});return at(yht,{...a,items:i||[],moleculeId:t,buttonText:o?.text||"Open Menu",configurationItemInfo:ee,buttonDisabled:R?.[t]?R?.[t]?.disabled:n?.value||a?.disabled||!1})}case"tabs":{const e=gft(z,S,K),r=l?.map(e=>{const t=M===e.id,{properties:r,config:o}=e||{},n={label:r?.label,link:r?.link},a=Object.keys(n),{label:i,link:s}=yft(n,D,a,t);return{...gft(o?.props,S,t),id:e.id,tabKey:d9e(s)?a9e(e9e,s?.internalLink):void 0,label:i?.text||"",link:s}}),o=c?.tabs.map(e=>{const{text:t,...r}=e;return{...r,label:t||""}}),n=Boolean(e?.isTabsSystemDerived),a=n?o:r,i=c?.activeTabKey||a?.[0]?.tabKey||"";return at(Vht,{...e,items:a||[],isMobile:v,moleculeId:t,activeTabKey:i,configurationItemInfo:ee,onTabChange:_?void 0:({newTabKey:e,link:t})=>{n?c?.onTabChange?.(e):d9e(t)?O?.({link:t?.internalLink||""}):c9e(t?.externalLink)}})}case"divider":{const e=gft(z,S,K);return at(Spt,{moleculeId:t,configurationItemInfo:ee,...e})}case"link":{const e={text:u?.text,link:u?.link},r=Object.keys(e),{text:o,link:n}=yft(e,D,r,K),a=n,i=gft(z,S,K);return at(fht,{moleculeId:t,...i,link:a,type:a?.type,src:te?void 0:m9e(a,b)||"",text:o?.text||"",disabled:i?.disabled||Y,configurationItemInfo:ee})}case"data_driven_link":{const e={text:u?.text},r=Object.keys(e),{text:o}=yft(e,D,r,K),n=gft(z,S,K);return at(fht,{moleculeId:t,...n,text:o?.text||"",sourceDataModelField:q,disabled:n?.disabled||Y,configurationItemInfo:ee})}case"video":{const e={video:u?.video,coverImage:u?.coverImage,dataCapture:u?.dataCapture},r=Object.keys(e),{video:o,coverImage:n,dataCapture:a}=yft(e,D,r,K),i=gft(z,S,K),s=G(a);return at(Wht,{...i,moleculeId:t,poster:n?.imageFile?.url,src:o?.videoSource??o?.videoFile?.url??"",sourceDataModelField:s,configurationItemInfo:ee})}case"badge":{const e={text:u?.text,dataCapture:u?.dataCapture},t=Object.keys(e),{dataCapture:r}=yft(e,D,t,K),o=gft(z,S,K),n=G(r);return at(vrt,{sourceDataModelField:n,...o,configurationItemInfo:ee})}case"alert":{const e={text:u?.text,subText:u?.subText},t=Object.keys(e),{text:r,subText:o}=yft(e,D,t,K),n=gft(z,S,K);return at(yrt,{text:r?.text||"",subText:o?.text||"",...n,configurationItemInfo:ee})}case"chip":{const e={text:u?.text,dataCapture:u?.dataCapture},t=Object.keys(e),{text:r,dataCapture:o}=yft(e,D,t,K),n=gft(z,S,K),a=G(o);return at(Ort,{text:r?.text||"",sourceDataModelField:a,...n,configurationItemInfo:ee})}case"email_display_field":case"email_input_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=yft(e,D,t,K),l=gft(z,S,K);return at(hht,{name:V,text:o?.text||"",placeholderText:n?.text||"",sourceDataModelField:q,required:a?.value,isDisplayOnly:"email_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,...l,configurationItemInfo:ee})}case"phone_number_display_field":case"phone_number_input_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=yft(e,D,t,K),l=gft(z,S,K);return at(Pht,{name:V,text:o?.text||"",required:a?.value,requiredErrorText:i?.text,validationErrorText:s?.text,placeholderText:n?.text||"",sourceDataModelField:q,isDisplayOnly:"phone_number_display_field"===r,...l,configurationItemInfo:ee})}case"numeric_display_field":case"numeric_input_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=yft(e,D,t,K),l=gft(z,S,K);return at(xht,{name:V,text:o?.text||"",required:a?.value,isDisplayOnly:"numeric_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,placeholderText:n?.text||"",sourceDataModelField:q,...l,configurationItemInfo:ee})}case"currency_display_field":case"currency_input_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=yft(e,D,t,K),l=gft(z,S,K);return at(Nrt,{name:V,text:o?.text||"",required:a?.value,isDisplayOnly:"currency_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,placeholderText:n?.text||"",sourceDataModelField:q,...l,configurationItemInfo:ee})}case"basic_text_display_field":case"basic_text_field":{const e={text:u?.text,placeholderText:u?.placeholderText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,placeholderText:n,required:a,requiredErrorText:i,validationErrorText:s}=yft(e,D,t,K),l=gft(z,S,K);return at(Crt,{name:V,text:o?.text||"",required:a?.value,isDisplayOnly:"basic_text_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,placeholderText:n?.text||"",sourceDataModelField:q,...l,configurationItemInfo:ee})}case"rating_display_field":case"rating":{const e={text:u?.text,dataCapture:u?.dataCapture,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,required:n,requiredErrorText:a,validationErrorText:i}=yft(e,D,t,K),s=gft(z,S,K);return at(Eht,{name:V,text:o?.text||"",required:n?.value,requiredErrorText:a?.text,validationErrorText:i?.text,sourceDataModelField:q,isDisplayOnly:"rating_display_field"===r,...s,configurationItemInfo:ee})}case"switch_display_field":case"switch":{const e={text:u?.text,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},o=Object.keys(e),{text:n,required:a,requiredErrorText:i,validationErrorText:s}=yft(e,D,o,K),l=gft(z,S,K);return at(Bht,{name:V,moleculeId:t,text:n?.text||"",required:a?.value,isDisplayOnly:"switch_display_field"===r,requiredErrorText:i?.text,validationErrorText:s?.text,sourceDataModelField:q,...l,configurationItemInfo:ee})}case"slider_display_field":case"slider":{const e={text:u?.text,required:u?.required,placeholderText:u?.placeholderText,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{text:o,required:n,requiredErrorText:a,validationErrorText:i,placeholderText:s}=yft(e,D,t,K),l=gft(z,S,K);return at(Iht,{name:V,text:o?.text||"",required:n?.value,isDisplayOnly:"slider_display_field"===r,requiredErrorText:a?.text,validationErrorText:i?.text,placeholderText:s?.text,sourceDataModelField:q,...l,configurationItemInfo:ee})}case"date_display_field":case"date_picker":{const e={text:u?.text,required:u?.required,placeholderText:u?.placeholderText,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},o=Object.keys(e),{text:n,required:a,placeholderText:i,requiredErrorText:s,validationErrorText:l}=yft(e,D,o,K),c=gft(z,S,K);return at(Gat,{dateAdapter:Unt,children:at(Mpt,{moleculeId:t,name:V,text:n?.text||"",required:a?.value,placeholderText:i?.text||"",isDisplayOnly:"date_display_field"===r,requiredErrorText:s?.text,validationErrorText:l?.text,sourceDataModelField:q,...c,configurationItemInfo:ee})})}case"time_picker_display":case"time_picker":{const e={text:u?.text,placeholderText:u?.placeholderText,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText,required:u?.required},t=Object.keys(e),{text:o,placeholderText:n,requiredErrorText:a,validationErrorText:i,required:s}=yft(e,D,t,K),l=gft(z,S,K);return at(Gat,{dateAdapter:Unt,children:at(qht,{...l,name:V,text:o?.text||"",placeholderText:n?.text||"",required:s?.value,requiredErrorText:a?.text,validationErrorText:i?.text,isDisplayOnly:"time_picker_display"===r,sourceDataModelField:q,configurationItemInfo:ee})})}case"select_display_field":case"select":{const e={text:u?.text,required:u?.required,placeholderText:u?.placeholderText,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText,dataDrivenOptions:u?.dataDrivenOptions},t=Object.keys(e),{text:o,required:n,placeholderText:a,requiredErrorText:i,validationErrorText:s,dataDrivenOptions:l}=yft(e,D,t,K),c=gft(z,S,K),d="select_display_field"===r;return at(Fht,{name:V,text:o?.text||"",required:n?.value,isDisplayOnly:d,predefinedValue:W,placeholderText:a?.text||"",requiredErrorText:i?.text,validationErrorText:s?.text,sourceDataModelField:q,dataDrivenOptions:l,...c,configurationItemInfo:ee})}case"image":{const e={image:u?.image,link:u?.link,dataCapture:u?.dataCapture},r=Object.keys(e),{image:o,link:n,dataCapture:a}=yft(e,D,r,K),i=gft(z,S,K),s=G(a);return at(Dpt,{...i,src:o?.imageSource||o?.imageFile?.url||o?.imageFile?.id||"",sourceDataModelField:s,onClick:n?()=>d9e(n)?O?.({link:n?.internalLink||""}):c9e(n?.externalLink):void 0,moleculeId:t,configurationItemInfo:ee,properties:{image:o,link:n}})}case"button":{const e={text:u?.text,action:u?.action},r=Object.keys(e),{text:o,action:n}=yft(e,D,r,K),a=gft(z,S,K);return at(pKe,{moleculeId:t,text:o?.text||"",sourceDataModelField:q,...a,disabled:a?.disabled||Y,configurationItemInfo:ee,properties:{text:o,action:n}})}case"avatar":{const e=gft(z,S,K);return at(grt,{...e,sourceDataModelField:q,configurationItemInfo:ee})}case"drawer":{const e={text:u?.text,disabled:u?.disabled},r=Object.keys(e),{text:o,disabled:n}=yft(e,D,r,K),a=gft(z,S,K),i=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{};let a={},i=[];switch(e.type){case"menu_item":{const e=r;a={disabled:e?.disabled,text:e?.text,link:e?.link},i=Object.keys(a);break}case"text_item":{const e=r;a={text:e?.text},i=Object.keys(a);break}case"rich_text_item":{const e=r;a={text:e?.text},i=Object.keys(a);break}case"image_item":{const e=r;a={image:e?.image,alt:e?.alt,link:e?.link},i=Object.keys(a);break}default:a={},i=[]}const s=yft(a,D,i,t),l=gft(o?.props,S,t),c={...n,...l};switch(e.type){case"menu_item":return{...c,disabled:R?.[e.id]?R?.[e.id]?.disabled:s?.disabled?.value||l?.disabled||!1,text:s?.text?.text||"Menu Item",link:s?.link,sx:l?.sx||c.sx};case"text_item":return{...c,text:s?.text?.text||""};case"rich_text_item":return{...c,text:s?.text?.text||f5e};case"image_item":{const e=s?.image?.imageSource||s?.image?.imageFile?.url||"";return{...c,src:e,alt:s?.alt?.text||"Drawer image",link:s?.link}}default:return c}});return at(cht,{...a,items:i||[],moleculeId:t,buttonText:o?.text||a?.buttonText,buttonDisabled:R?.[t]?R?.[t]?.disabled:n?.value||a?.disabled||!1,configurationItemInfo:ee})}case"speed_dial":{const e=gft(z,S,K),r=l?.map(e=>{const t=M===e.id,{properties:r,config:o,...n}=e||{},a={link:r?.link,text:r?.text},i=Object.keys(a),s=yft(a,D,i,t),l=gft(o?.props,S,t);return{...n,config:{props:{...o?.props,...l,tooltipText:l?.tooltipText||""}},properties:{link:s?.link||r?.link,text:s?.text||r?.text}}});return at(Aht,{...e,items:r||[],moleculeId:t,configurationItemInfo:ee})}case"checkbox":case"checkbox_display":{const e={label:u?.label,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},o=Object.keys(e),{label:n,required:a,requiredErrorText:i,validationErrorText:s}=yft(e,D,o,K),l=gft(z,S,K);return at(Srt,{name:V,moleculeId:t,label:n?.text||"",required:a?.value,requiredErrorText:i?.text,validationErrorText:s?.text,sourceDataModelField:q,isDisplayOnly:"checkbox_display"===r,...l,configurationItemInfo:ee})}case"binary_radio_buttons":case"binary_radio_buttons_display":{const e={confirmText:u?.confirmText,rejectText:u?.rejectText,required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},o=Object.keys(e),{confirmText:n,rejectText:a,required:i,requiredErrorText:s,validationErrorText:l}=yft(e,D,o,K),c=gft(z,S,K);return at(Mrt,{name:V,moleculeId:t,confirmText:n?.text||"Yes",rejectText:a?.text||"No",required:i?.value,requiredErrorText:s?.text,validationErrorText:l?.text,sourceDataModelField:q,isDisplayOnly:"binary_radio_buttons_display"===r,...c,configurationItemInfo:ee})}case"date_calendar":case"date_calendar_display":{const e={required:u?.required,requiredErrorText:u?.requiredErrorText,validationErrorText:u?.validationErrorText},t=Object.keys(e),{required:o,requiredErrorText:n,validationErrorText:a}=yft(e,D,t,K),i=gft(z,S,K);return at(nlt,{...i,name:V,required:o?.value,requiredErrorText:n?.text,validationErrorText:a?.text,isDisplayOnly:"date_calendar_display"===r,sourceDataModelField:q,configurationItemInfo:ee})}default:return at(nt,{children:"There is no such type of molecule yet."})}})()},xft=({nestedPathSegments:t})=>{const{localStateObject:r}=IC(),o=ht();return e.useMemo(()=>{if(o?.itemDataByDmfId)return o.itemDataByDmfId;const e=(e=>{if(null!=e){if("object"==typeof e&&!Array.isArray(e)&&"viewType"in e&&"data"in e){const t=e.data;if(null==t)return;return t}return e}})(r);return void 0!==e?0===t.length||Array.isArray(e)?e:qGe(e,t):void 0},[o?.itemDataByDmfId,r,t])},bft=e=>"container"===e.instance&&"empty_state"===e.type,wft=e=>{if("container"!==e.instance)return;const t=e;return t.targetRwoId||t.config?.props?.targetRwoId},kft=(e,t)=>{if(!e)return!0;if(Array.isArray(e))return 0===e.length;return(e=>null==e||Array.isArray(e)&&0===e.length||"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length)(e[t])},_ft=e.memo(({item:t,tabsProps:r,formData:o,setFormData:n,isMobile:a,parentId:i,nestedPathSegments:s=[],parentStyleVariantConfig:l,parentContainerWithVariantsId:c,parentContainerActiveVariant:u})=>{const d=Kt(),{organismMetadata:p}=IC(),h="items"in t?t.items:void 0,f=(({items:t})=>{const{stateConfig:r}=UC(),{localStateObject:o}=IC(),n=o||r;return e.useMemo(()=>t&&0!==t.length?t.filter(e=>{const t=e.config?.props?.visible??!0,r=n?.[e.id]?.visible??!0;return t&&r}):[],[t,n])})({items:h}),{filteredItems:m}=(({containerItems:t,visibleItems:r,nestedPathSegments:o})=>{const{isLoadingData:n,isEmptyDataState:a,forceEmptyStatePreview:i,previewingEmptyStates:s,isConfigurationMode:l}=IC(),c=xft({nestedPathSegments:o});return e.useMemo(()=>{if(!t||0===t.length)return{filteredItems:r,showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1};const e=t.filter(bft);if(0===e.length)return{filteredItems:r,showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1};const o=s&&s.length>0;if(l&&!i&&!o)return{filteredItems:r,showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1};if(n&&!i&&!o)return{filteredItems:r.filter(e=>!bft(e)),showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1};const u=new Set;let d=!1;return e.forEach(e=>{const t=wft(e);i||(t?s?.includes(t):s?.includes("__organism__"))?t?u.add(t):d=!0:l||(t?kft(c,t)&&u.add(t):a&&(d=!0))}),d||0!==u.size?{filteredItems:r.filter(e=>{if(bft(e)){const t=wft(e);return t?u.has(t):d}return!1}),showingEmptyStateForFields:u,showOrganismLevelEmptyState:d}:{filteredItems:r.filter(e=>!bft(e)),showingEmptyStateForFields:new Set,showOrganismLevelEmptyState:!1}},[t,r,c,n,a,i,s,l])})({containerItems:h,visibleItems:f,nestedPathSegments:s});if("molecule"===t.instance)return at(mft,{additionalInfo:`molecule: ${t.id}`,children:at(vft,{...t,form:d,isMobile:a,formData:o,parentId:i,tabsProps:r,setFormData:n,metadata:{...t.metadata,stateListenerId:p?.stateListenerId||t.id},parentStyleVariantConfig:l,parentContainerWithVariantsId:c,parentContainerActiveVariant:u})});const y=!(!h||!h.length),g="form"===t.type&&t.config.props?.activeChildrenIds||[];return y?g.length?at(mft,{additionalInfo:`form: ${t.id}`,children:at(Nft,{item:t,activeChildrenIds:g,formData:o,setFormData:n,isMobile:a})}):at(mft,{additionalInfo:`container: ${t.id}`,children:at(jft,{...t,isMobile:a,nestedPathSegments:s,parentStyleVariantConfig:l,parentContainerWithVariantsId:c,parentContainerActiveVariant:u,config:t.config?{...t.config,props:t.config.props||{},wide:t.config.wide||{},compact:t.config.compact||{}}:{props:{},wide:{},compact:{}},children:m?.map(e=>at(_ft,{item:e,parentId:e.id,formData:o,setFormData:n,isMobile:a,tabsProps:r,nestedPathSegments:s},e.id))})}):null}),Cft=({order:t=0,id:r,formStepStyles:o,containerProps:n={hasOwnButton:!1}})=>{const a=Kt(),[i,s]=e.useState({}),{formId:l,submitHandler:c,isFormInEditMode:u,organismMetadata:d,organismInfo:p}=IC(),{groupStepItemsByStepContainer:h}=IC();Object.keys(d?.popupPayload??{})[0];const{currentStep:f,canGoToNextStep:m,canGoToPrevStep:y,goToNextStep:g,goToPrevStep:v,reset:x,setStep:b}=eo(),w=h(),{submitForm:k}=KGe(),{forms:_}=dt(),C=t+1,M=w.get(r)||[];return f!==C?null:at("div",{style:o,children:it(nt,{children:[M.map(e=>at(_ft,{item:e,setFormData:s,formData:i},e.id)),(!n?.hasOwnButton||d?.isFormInsidePopUp)&&u&&it("div",{style:{display:"flex",gap:"16px"},children:[at(pKe,{text:y?"Back":"Cancel",variant:"outlined",onClick:()=>{y?v():(x(),b(1))}}),at(pKe,{text:m?"Next":"Submit",variant:"contained",onClick:async()=>{const e=await a.trigger();if(!e)return void K6e({message:"Please fill all required fields",type:"error"});if(m)return void g();const t=a?.getValues?.()||{};if(e&&l){const e={formId:l,data:t,pmiObjectId:p?.pmiObjectId};c?await c(e):_?.submit&&await k(e)}}})]})]})})},Mft=e=>Object.entries(e).reduce((e,[t,r])=>(e[t]=(e=>e&&"object"==typeof e&&"value"in e&&!Array.isArray(e)?e.value:e)(r),e),{}),Sft=(e,t)=>{if(!e?.enabled)return null;const r="data_model"===(e.nature||(e.sourceDataModelFieldId?"data_model":"variable"))?e.sourceDataModelFieldId:e.variableName;if(!r)return null;if(!t)return null;const o=t[r];if(null==o)return null;let n=null;if("string"==typeof o)n=o;else if("object"==typeof o&&null!==o){const e=o;void 0!==e.id&&null!==e.id&&"string"==typeof e.id?n=e.id:void 0!==e.value&&null!==e.value&&(n=String(e.value))}return n},Dft=(e,t,r)=>{if(!e)return{};if(t){const o=e[t];if(o&&"object"==typeof o&&r in o){const e=o[r];if(e&&"object"==typeof e){const{containerStyle:t}=e;return t&&"object"==typeof t?t:e}}}const o=e[r];if(o&&"object"==typeof o){const{containerStyle:e}=o;return e&&"object"==typeof e?e:o}return{}},Oft=e.memo(({containerId:t,targetRwoId:r,sourceDataPointerId:o,nestedPathSegments:n=[],children:a,properties:i,config:s,renderWrapper:l})=>{const{formId:c}=IC(),u=KC(),d=ht(),p=BC(),h=HGe(),f=o&&u?.queryResults?u.queryResults[o]?.isLoading??u.isSingleRecordLoading??!1:u?.isSingleRecordLoading??!1,m=i?.styleVariantConfig||s?.styleVariantConfig,y=e.useMemo(()=>{if(!m)return"";return"data_model"===(m.nature||(m.sourceDataModelFieldId?"data_model":"variable"))?m.sourceDataModelFieldId||"":m.variableName||""},[m]),g=y?VGe(y):void 0;if(Boolean(c&&p)&&p){const{fieldArrayMethods:{fields:e}}=p;return at(nt,{children:e.map((e,o)=>{const i=[...n,{dmfId:r||"default",index:o}],s=e;let c=s;"variable"===(m?.nature||(m?.sourceDataModelFieldId?"data_model":"variable"))&&y&&void 0!==g&&(c={...s,[y]:g});const u=Sft(m,c),d={containerId:t||`replicator-${r||"default"}-${o}`,nestedPathSegments:i,itemIndex:o,itemDataByDmfId:s,rawItemDataByDmfId:s,activeVariant:u,isLoading:f},p=l?l(o,a,u):a;return at("div",{"data-replicator-instance":`${r||"default"}-${o}`,children:at(ft,{value:d,children:p})},e.id)})})}if(f)return at(nt,{children:Array.from({length:3}).map((e,o)=>{const i=[...n,{dmfId:r||"default",index:o}];return at(ft,{value:{containerId:t||`replicator-${r||"default"}-${o}`,nestedPathSegments:i,itemIndex:o,itemDataByDmfId:{},rawItemDataByDmfId:{},activeVariant:null,isLoading:f},children:l?l(o,a,null):a},`${r||"default"}-loading-${o}`)})});const v=o?h(o):void 0,x=o?v??{}:{},b=qGe(x,n),w=o?b||x:d?.itemDataByDmfId?d.itemDataByDmfId:b,k=r?w?.[r]:w;if(!k||"object"!=typeof k){const e=r?[...n,{dmfId:r}]:n;return at(ft,{value:{containerId:t||`replicator-${r||"default"}`,nestedPathSegments:e,itemDataByDmfId:{},activeVariant:null,isLoading:!1},children:l?l(void 0,a,null):a})}if(Array.isArray(k))return at(nt,{children:k.map((e,o)=>{const i=[...n,{dmfId:r||"default",index:o}],s=Mft(e);let c=e;"variable"===(m?.nature||(m?.sourceDataModelFieldId?"data_model":"variable"))&&y&&void 0!==g&&(c={...c,[y]:g});const u=Sft(m,c);return at(ft,{value:{containerId:t||`replicator-${r||"default"}-${o}`,nestedPathSegments:i,itemIndex:o,itemDataByDmfId:s,rawItemDataByDmfId:e,activeVariant:u,isLoading:f},children:l?l(o,a,u):a},`${r||"default"}-${o}`)})});const _=r?[...n,{dmfId:r}]:n,C=Mft(k);let M=k;"variable"===(m?.nature||(m?.sourceDataModelFieldId?"data_model":"variable"))&&y&&void 0!==g&&(M={...M,[y]:g});const S=Sft(m,M);return at(ft,{value:{containerId:t||`replicator-${r||"default"}`,nestedPathSegments:_,itemDataByDmfId:C,rawItemDataByDmfId:k,activeVariant:S,isLoading:f},children:l?l(void 0,a,S):a})}),Pft=({targetRwoId:t,nestedPathSegments:r=[],minInstances:o=1,maxInstances:n=50,children:a})=>{const i=Kt(),{control:s,getValues:c}=i||{},u=HC(),{prefillData:d}=IC(),p=e.useRef(!1),h=r.map(e=>void 0!==e.index?`${e.dmfId}.${e.index}`:e.dmfId).filter(Boolean).join(".");const f=h?`${h}.${t}`:t,m=function(e){const t=Kt(),{control:r=t.control,name:o,keyName:n="id",shouldUnregister:a,rules:i}=e,[s,c]=l.default.useState(r._getFieldArray(o)),u=l.default.useRef(r._getFieldArray(o).map(Vr)),d=l.default.useRef(s),p=l.default.useRef(o),h=l.default.useRef(!1);p.current=o,d.current=s,r._names.array.add(o),i&&r.register(o,i),Xt(()=>r._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===p.current||!t){const t=Pt(e,p.current);Array.isArray(t)&&(c(t),u.current=t.map(Vr))}}}).unsubscribe,[r]);const f=l.default.useCallback(e=>{h.current=!0,r._setFieldArray(o,e)},[r,o]);return l.default.useEffect(()=>{if(r._state.action=!1,jr(o,r._names)&&r._subjects.state.next({...r._formState}),h.current&&(!Or(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!Or(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([o]).then(e=>{const t=Pt(e.errors,o),n=Pt(r._formState.errors,o);(n?!t&&n.type||t&&(n.type!==t.type||n.message!==t.message):t&&t.type)&&(t?jt(r._formState.errors,o,t):fr(r._formState.errors,o),r._subjects.state.next({errors:r._formState.errors}))});else{const e=Pt(r._fields,o);!e||!e._f||Or(r._options.reValidateMode).isOnSubmit&&Or(r._options.mode).isOnSubmit||zr(e,r._names.disabled,r._formValues,r._options.criteriaMode===Lt,r._options.shouldUseNativeValidation,!0).then(e=>!sr(e)&&r._subjects.state.next({errors:Rr(r._formState.errors,e,o)}))}r._subjects.state.next({name:o,values:Ct(r._formValues)}),r._names.focus&&Tr(r._fields,(e,t)=>{if(r._names.focus&&t.startsWith(r._names.focus)&&e.focus)return e.focus(),1}),r._names.focus="",r._setValid(),h.current=!1},[s,o,r]),l.default.useEffect(()=>(!Pt(r._formValues,o)&&r._setFieldArray(o),()=>{r._options.shouldUnregister||a?r.unregister(o):((e,t)=>{const o=Pt(r._fields,e);o&&o._f&&(o._f.mount=t)})(o,!1)}),[o,r,n,a]),{swap:l.default.useCallback((e,t)=>{const n=r._getFieldArray(o);Yr(n,e,t),Yr(u.current,e,t),f(n),c(n),r._setFieldArray(o,n,Yr,{argA:e,argB:t},!1)},[f,o,r]),move:l.default.useCallback((e,t)=>{const n=r._getFieldArray(o);Ur(n,e,t),Ur(u.current,e,t),f(n),c(n),r._setFieldArray(o,n,Ur,{argA:e,argB:t},!1)},[f,o,r]),prepend:l.default.useCallback((e,t)=>{const n=or(Ct(e)),a=Gr(r._getFieldArray(o),n);r._names.focus=$r(o,0,t),u.current=Gr(u.current,n.map(Vr)),f(a),c(a),r._setFieldArray(o,a,Gr,{argA:qr(e)})},[f,o,r]),append:l.default.useCallback((e,t)=>{const n=or(Ct(e)),a=Hr(r._getFieldArray(o),n);r._names.focus=$r(o,a.length-1,t),u.current=Hr(u.current,n.map(Vr)),f(a),c(a),r._setFieldArray(o,a,Hr,{argA:qr(e)})},[f,o,r]),remove:l.default.useCallback(e=>{const t=Kr(r._getFieldArray(o),e);u.current=Kr(u.current,e),f(t),c(t),!Array.isArray(Pt(r._fields,o))&&jt(r._fields,o,void 0),r._setFieldArray(o,t,Kr,{argA:e})},[f,o,r]),insert:l.default.useCallback((e,t,n)=>{const a=or(Ct(t)),i=Wr(r._getFieldArray(o),e,a);r._names.focus=$r(o,e,n),u.current=Wr(u.current,e,a.map(Vr)),f(i),c(i),r._setFieldArray(o,i,Wr,{argA:e,argB:qr(t)})},[f,o,r]),update:l.default.useCallback((e,t)=>{const n=Ct(t),a=Zr(r._getFieldArray(o),e,n);u.current=[...a].map((t,r)=>t&&r!==e?u.current[r]:Vr()),f(a),c([...a]),r._setFieldArray(o,a,Zr,{argA:e,argB:n},!0,!1)},[f,o,r]),replace:l.default.useCallback(e=>{const t=or(Ct(e));u.current=t.map(Vr),f([...t]),c([...t]),r._setFieldArray(o,[...t],e=>e,{},!0,!1)},[f,o,r]),fields:l.default.useMemo(()=>s.map((e,t)=>({...e,[n]:u.current[t]||Vr()})),[s,n])}}({control:s,name:f}),{fields:y,append:g,replace:v}=m,x=d?.[t],b=Array.isArray(x)&&x.length>0;return e.useEffect(()=>{if(p.current)return;p.current=!0;const e=c?.(f),t=Array.isArray(e)&&e.length>0;if(!(b||t||y.length>0)&&o>0){Array.from({length:o},()=>({})).forEach(e=>{g(e,{shouldFocus:!1})})}},[]),e.useEffect(()=>{b&&y.length!==x.length&&v(x)},[b,x,y.length,v]),e.useEffect(()=>{if(u)return u.register({targetRwoId:t,fieldArrayName:f,fieldArrayMethods:m,minInstances:o,maxInstances:n}),()=>{u.unregister(t)}},[u,t,f,m,o,n]),at(VC,{targetRwoId:t,fieldArrayName:f,fieldArrayMethods:m,minInstances:o,maxInstances:n,children:a})},Eft={dots:!0,infinite:!1,autoplay:!1,autoplaySpeed:5e3,arrows:!0,slidesToShow:1,slidesToScroll:1,adaptiveHeight:!0,swipeToSlide:!0},jft=e.memo(({id:t,type:r,name:o,config:n,children:a,metadata:i,isMobile:s,properties:l,nestedPathSegments:c=[],targetRwoId:u,sourceDataPointerId:d,parentStyleVariantConfig:p,parentContainerWithVariantsId:h,parentContainerActiveVariant:f})=>{const m=Ye(),{props:y,wide:g,compact:v}=n||{},x=u||y?.targetRwoId,b=d||y?.sourceDataPointerId,{isConfigurationMode:w,onConfigurationItemClicked:k,selectedConfigurationItemId:_,currentStyleProperties:C,currentContentProperties:M,formId:S,localState:D,organismInfo:O}=IC(),P=ht(),{activeVariant:E,containerId:j}=P,T=Kt(),N=Boolean(S&&T),R=e.useMemo(()=>{if("replicator"===r)return;const e=l?.styleVariantConfig,t=e&&"object"==typeof e&&"data"in e?e.data:e;if(!t?.enabled)return;return("data_model"===(t.nature||(t.sourceDataModelFieldId?"data_model":"variable"))?Boolean(t.sourceDataModelFieldId):Boolean(t.variableName))?t:void 0},[r,l]),F=e.useMemo(()=>{if(!R)return"";return"data_model"===(R.nature||(R.sourceDataModelFieldId?"data_model":"variable"))?R.sourceDataModelFieldId||"":R.variableName||""},[R]),I=e.useMemo(()=>{if(!F)return"";if(!N)return"";return"data_model"!==(R?.nature||(R?.sourceDataModelFieldId?"data_model":"variable"))?"":(e=P.nestedPathSegments||c,t=F,e&&0!==e.length?[...e.map(e=>void 0!==e.index?`${e.dmfId}.${e.index}`:e.dmfId),t].filter(Boolean).join("."):t);var e,t},[F,R?.nature,R?.sourceDataModelFieldId,N,P.nestedPathSegments,c]);I&&T?.watch?.(I);const A=VGe(F),z=e.useMemo(()=>{if(!F||!R)return null;if(null!=A){let e=null;if("string"==typeof A||"number"==typeof A)e={id:String(A),value:A};else if(A&&"object"==typeof A){const t=A,r=t.value??null,o=void 0!==t.id&&null!==t.id?String(t.id):null!==r?String(r):null;null!==o&&(e={id:o,value:r})}if(!e)return null;const t=Sft(R,{[F]:e});if(t)return t}return null},[R,F,A]),L=p,B=z??(f??E??null),V=(R&&R.enabled?t:h)||j||null,$=e.useMemo(()=>{const r=R&&R.enabled,o=r?R:L,n=B,i=(r?t:h)||t;return void 0!==o||null!==n||void 0!==h?e.Children.map(a,t=>e.isValidElement(t)?e.cloneElement(t,{...t.props,parentStyleVariantConfig:o,parentContainerWithVariantsId:i,parentContainerActiveVariant:n}):t):a},[a,R,B,L,t,h]),H=_===t,q=H?{backgroundImage:M?.backgroundImage??l?.backgroundImage??{imageFile:{url:""}}}:l,{containerProps:W={},containerStyle:U={}}=g||{};let G={...U};const{containerProps:K={},containerStyle:Y={}}=v||{};let Z={...Y};C&&H&&(Z={...Y,...C},G={...U,...C});const X=PC("xs"),Q=s??X;let J=Q?Z:G;if(B&&n){const e=Dft(n,B,Q?"compact":"wide");Object.keys(e).length>0&&(J={...J,...e})}const ee=Q?K:W,te={...y,...ee,enableBackgroundImage:J?.enableBackgroundImage},re=e.useMemo(()=>({entityId:t,entityType:r,entityName:o,entity:"container",organismType:O?.type,organismSubtype:O?.subtype,libraryEntityId:i?.containerLibraryId||void 0,activeStyleVariant:B,parentReplicatorWithVariants:V,parentStyleVariantConfig:R&&R.enabled?R:L}),[r,o,t,i,B,V,R,L]),oe=w?{onClick:e=>{e&&e.stopPropagation(),k(re,!1)},onDoubleClick:e=>{e?.stopPropagation(),k(re,!0)}}:{},ne=`${t}.${Q?"mobile":"desktop"}`,ae=_o`
|