@ansible/ansible-ui-framework 2.4.658 → 2.4.660

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -45764,19 +45764,7 @@ function gAe(e) {
45764
45764
  }
45765
45765
  function AEe(e) {
45766
45766
  const [t] = Dt();
45767
- return /* @__PURE__ */ p.jsx(QO, { message: t.errorText, children: /* @__PURE__ */ p.jsx(
45768
- "div",
45769
- {
45770
- style: {
45771
- display: "flex",
45772
- flexDirection: "column",
45773
- height: "100%",
45774
- maxHeight: "100%",
45775
- backgroundColor: "var(--pf-v5-global--BackgroundColor--100)"
45776
- },
45777
- children: e.children
45778
- }
45779
- ) });
45767
+ return /* @__PURE__ */ p.jsx(QO, { message: t.errorText, children: /* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexDirection: "column", height: "100%", maxHeight: "100%" }, children: e.children }) });
45780
45768
  }
45781
45769
  function EEe(e) {
45782
45770
  const t = pn("sm"), n = pn("md");
package/index.umd.cjs CHANGED
@@ -523,7 +523,7 @@ ${e.value}
523
523
  margin-right: auto;
524
524
  }
525
525
  `;function W5e(e){const{t}=st(),{handleCopy:n,handleDownload:r,handleUpload:i,allowCopy:a,allowDownload:o,allowUpload:l,toggleLanguages:s,setLanguage:c,selectedLanguage:u,errors:f,name:d}=e,h=[];a&&h.push(p.jsx(T.Tooltip,{content:t("Copy"),children:p.jsx(Kh,{id:"copy-button","data-cy":"copy-button","aria-label":t("Copy to clipboard"),icon:p.jsx(Ce.CopyIcon,{}),type:"button",onClick:()=>n()},"copy-button")},"copy-file")),l&&h.push(p.jsx(T.Tooltip,{content:t("Upload"),children:p.jsx(Kh,{id:"upload-button","data-cy":"upload-button","aria-label":t("Upload from file"),icon:p.jsx(Ce.UploadIcon,{}),type:"button",onClick:()=>i()},"upload-button")},"upload-file")),o&&h.push(p.jsx(T.Tooltip,{content:t("Download"),children:p.jsx(Kh,{id:"download-button","data-cy":"download-button","aria-label":t("Download file"),icon:p.jsx(Ce.DownloadIcon,{}),type:"button",onClick:()=>r()},"download-button")},"download-file"));const m=(s==null?void 0:s.map(g=>p.jsx(Kh,{id:`toggle-${g}`,"data-cy":`toggle-${g}`,"aria-label":t("Toggle to {{language}}",{language:g}),isSelected:u===g,isDisabled:!!f[d],text:g,type:"button",onChange:()=>c(g)},g)))||[];return p.jsxs(T.Flex,{justifyContent:{default:"justifyContentSpaceBetween"},children:[p.jsx(T.FlexItem,{children:p.jsx(T.ToggleGroup,{isCompact:!0,children:h})}),p.jsx(T.FlexItem,{align:{default:"alignRight"},children:p.jsx(T.ToggleGroup,{isCompact:!0,children:m})})]})}function V5e(e){const{t}=st(),{allowCopy:n=!0,allowDownload:r=!0,allowUpload:i=!0,defaultExpanded:a,isExpandable:o,isReadOnly:l,isRequired:s,label:c,name:u,toggleLanguages:f,validate:d,...h}=e,{formState:{isSubmitting:m,isValidating:g,errors:y},setError:_,clearErrors:b,getValues:S,control:C,setValue:w}=Bi(),[E,A]=x.useState("yaml"),[k,D]=x.useState(!a),L=x.useRef(null),P=Hm(),{writeToClipboard:I}=D1(),$=e.id??u.split(".").join("-");x.useEffect(()=>{y[u]||b(u)},[y,u,b]);const j=x.useCallback(X=>{const V=S(u);if(!(X!=="json"&&X!=="yaml"||!V)){if(r5e(V))return X==="json"?w(u,V):w(u,d3(V));if(n5e(V))return X==="json"?w(u,V):w(u,d3(JSON.stringify(V)));X==="json"?w(u,t5e(V)):w(u,V)}},[S,u,w]),z=x.useCallback(X=>{try{j(X),A(X)}catch(V){V instanceof Error?_(u,{message:V.message}):_(u,{message:t("Invalid syntax")})}},[j,u,_,t]),Q=x.useCallback(()=>{I(S(u))},[S,u,I]),Z=x.useCallback(()=>{L.current&&L.current.click()},[]),K=x.useCallback(()=>{i5e(u||"codeEditorData",S(u));const V={variant:"success",title:t("File downloaded")};P.addAlert(V)},[P,S,u,t]),J=x.useCallback(X=>{const V=X[0],H=new FileReader;H.onload=()=>{const q=H.result;if(typeof q=="string"){w(u,q);const Y={variant:"success",title:t("File uploaded")};P.addAlert(Y)}},H.onerror=()=>{const q={variant:"danger",title:t("Failed to upload file"),children:t("Unable to upload")};P.addAlert(q)},H.readAsText(V)},[w,u,t,P]),W=lP({onDrop:J,multiple:!1});return p.jsx(vl,{name:u,control:C,shouldUnregister:!0,render:({field:{name:X,onChange:V,value:H},fieldState:{error:q}})=>{var se;const Y=[...new Set((se=q==null?void 0:q.message)==null?void 0:se.split(`
526
- `))],R=H!=null&&H!=="";return p.jsx(vi,{fieldId:$,...h,icon:o?p.jsx(Ce.AngleRightIcon,{"data-cy":"expandable",style:{transform:k?"rotate(0deg)":"rotate(90deg)",transition:"transform"},onClick:()=>D(ne=>!ne),"aria-label":t("Expand or collapse extra variables")}):void 0,label:e.label,helperTextInvalid:!(d&&g)&&Y,children:(!o||!k)&&p.jsxs(p.Fragment,{children:[p.jsx(W5e,{allowCopy:n,allowDownload:r,allowUpload:i,errors:y,handleCopy:()=>Q(),handleDownload:K,handleUpload:Z,name:X,selectedLanguage:E,setLanguage:z,toggleLanguages:f},"actions-row"),e.allowUpload?p.jsxs("div",{id:"code-editor-dropzone",...W.getRootProps({disabled:R}),style:{width:"100%",height:"100%"},children:[p.jsx("input",{id:"code-editor-dropzone-input",...W.getInputProps(),ref:L}),p.jsx(x3,{setError:_,clearErrors:b,id:$,"data-cy":$,name:X,language:E,value:H,onChange:V,isReadOnly:l||m,invalid:!(d&&g)&&(q==null?void 0:q.message)!==void 0})]}):p.jsx(x3,{setError:_,clearErrors:b,id:$,"data-cy":$,name:X,language:E,value:H,onChange:V,isReadOnly:l||m,invalid:!(d&&g)&&(q==null?void 0:q.message)!==void 0})]})})},rules:{required:typeof c=="string"&&s===!0?{value:!0,message:`${pr(c.toLocaleLowerCase())} is required.`}:void 0,validate:e.validate}})}function H5e(e){const{name:t,label:n,labelHelpTitle:r,labelHelp:i,additionalControls:a,placeholderText:o,options:l,footer:s,helperText:c,isDisabled:u,isReadOnly:f,isRequired:d,validate:h,fieldNameToResetOnFieldChange:m}=e,g=Ta(e),{control:y,formState:{isSubmitting:_,isValidating:b},resetField:S}=Bi(),[C,w]=x.useState(!1),E=x.useCallback(()=>w(!C),[C]),[A]=Ot();return p.jsx(vl,{name:t,control:y,shouldUnregister:!0,render:({field:{onChange:k,value:D},fieldState:{error:L}})=>{D===""&&l.length===1&&d&&k(l[0].value);const P=(j,z)=>{var Q;k((Q=l.find(Z=>Z.label===z.toString()))==null?void 0:Q.value),m&&S(m),w(!1)},I=L!=null&&L.message?h&&b?A.validating:L==null?void 0:L.message:void 0,$=l.find(j=>j.value===D);return p.jsx(vi,{fieldId:g,label:n,labelHelpTitle:r,labelHelp:i,additionalControls:a,helperText:c,helperTextInvalid:I,isRequired:d,children:p.jsx(Ca,{id:g,placeholderText:o,variant:"single","aria-describedby":`${g}-form-group`,selections:$==null?void 0:$.label,onSelect:P,isOpen:C,onToggle:E,onClear:d?void 0:()=>{k(null),w(!1)},maxHeight:280,validated:I?"error":void 0,isDisabled:u||f||_,hasPlaceholderStyle:!0,footer:s,ouiaId:"menu-select","data-cy":g,children:l.map(j=>{const z=gi(j);return p.jsx(Vr,{id:z,value:j.label,label:j.label,description:j.description,"data-cy":z,children:j.label},j.label)})})})},rules:{required:typeof n=="string"&&d===!0?{value:!0,message:`${pr(n.toLocaleLowerCase())} is required.`}:void 0,validate:h}})}function U5e(e){const{name:t,helperText:n,validate:r,additionalControls:i,label:a,labelHelp:o,labelHelpTitle:l}=e,{control:s,formState:{isSubmitting:c,isValidating:u}}=Bi(),f=Ta(e);return p.jsx(vl,{name:t,control:s,shouldUnregister:!0,render:({field:{onChange:d,value:h},fieldState:{error:m}})=>{const g=r&&u||m==null?void 0:m.message;return p.jsx(vi,{fieldId:f,"data-cy":f+"-form-group",label:a,labelHelpTitle:l,labelHelp:o,helperText:n,helperTextInvalid:g,additionalControls:i,children:p.jsx(T.Switch,{"data-cy":f+"-toggle",isChecked:h,onChange:y=>d(y),isDisabled:c})})}})}function G5e(e){const{type:t,name:n,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,placeholder:l,button:s,helperText:c,isDisabled:u,isReadOnly:f,isRequired:d,validate:h,minLength:m,maxLength:g,min:y,max:_,pattern:b,selectTitle:S,selectOpen:C,selectValue:w,autoFocus:E,autoComplete:A}=e,k=Ta(e),{control:D,setValue:L,formState:{isSubmitting:P,isValidating:I}}=Bi(),[$,j]=x.useState(!1),[z]=Ot();return p.jsx(vl,{name:n,control:D,shouldUnregister:!0,render:({field:{onChange:Q,value:Z,name:K},fieldState:{error:J}})=>{const W=J!=null&&J.message?h&&I?z.validating:J==null?void 0:J.message:void 0;function X(V){Q(V.trimStart())}return p.jsx(vi,{fieldId:k,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,helperText:c,helperTextInvalid:W,isRequired:d,children:p.jsxs(T.InputGroup,{children:[p.jsx(T.InputGroupItem,{isFill:!0,children:p.jsx(T.TextArea,{id:k,placeholder:l,onChange:(V,H)=>X(H),value:Z??"","aria-describedby":k?`${k}-form-group`:void 0,validated:W?"error":void 0,type:t==="password"?$?"text":"password":t,readOnlyVariant:f?"default":void 0,isDisabled:u,autoFocus:E,autoComplete:A||"off","data-cy":k})}),t==="password"&&p.jsx(T.Button,{variant:"control",onClick:()=>j(!$),isDisabled:u||f,children:$?p.jsx(Ce.EyeIcon,{}):p.jsx(Ce.EyeSlashIcon,{})}),S&&p.jsx(T.Button,{ouiaId:`lookup-${K}-button`,variant:"control",onClick:()=>C==null?void 0:C(V=>{if(w){const H=w(V);L(K,H,{shouldValidate:!0})}},S),"aria-label":"Options menu",isDisabled:u||P,children:p.jsx(Ce.SearchIcon,{})}),s&&s]})})},rules:{required:typeof r=="string"&&d===!0?{value:!0,message:`${pr(r.toLocaleLowerCase())} is required.`}:void 0,validate:h,minLength:typeof r=="string"&&typeof m=="number"?{value:m,message:`${pr(r.toLocaleLowerCase())} must be at least ${m} characters.`}:m,maxLength:typeof r=="string"&&typeof g=="number"?{value:g,message:`${pr(r.toLocaleLowerCase())} cannot be greater than ${g} characters.`}:g,min:typeof r=="string"&&(typeof y=="number"||typeof y=="string")?{value:y,message:`${pr(r.toLocaleLowerCase())} must be less than ${y}.`}:m,max:typeof r=="string"&&(typeof _=="number"||typeof _=="string")?{value:_,message:`${pr(r.toLocaleLowerCase())} cannot be greater than ${_}.`}:m,pattern:b}})}function q5e(e){const{type:t,name:n,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,placeholder:l,button:s,helperText:c,isDisabled:u,isReadOnly:f,isRequired:d,validate:h,minLength:m,maxLength:g,min:y,max:_,pattern:b,selectTitle:S,selectOpen:C,selectValue:w,autoFocus:E,autoComplete:A}=e,k=Ta(e),{control:D,setValue:L,formState:{isSubmitting:P,isValidating:I}}=Bi(),[$,j]=x.useState(!1),[z]=Ot();return p.jsx(vl,{name:n,control:D,shouldUnregister:!0,render:({field:{onChange:Q,value:Z,name:K},fieldState:{error:J}})=>{const W=J!=null&&J.message?h&&I?z.validating:J==null?void 0:J.message:void 0;function X(V){Q(V.trimStart())}return p.jsx(vi,{fieldId:k,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,helperText:c,helperTextInvalid:W,isRequired:d,children:p.jsxs(T.InputGroup,{children:[p.jsx(T.InputGroupItem,{isFill:!0,children:p.jsx(T.TextInput,{id:k,placeholder:l,onChange:(V,H)=>X(H),value:Z??"","aria-describedby":k?`${k}-form-group`:void 0,validated:W?"error":void 0,type:t==="password"?$?"text":"password":t,readOnlyVariant:f?"default":void 0,isDisabled:u,autoFocus:E,autoComplete:A||"off","data-cy":k})}),t==="password"&&p.jsx(T.Button,{variant:"control",onClick:()=>j(!$),isDisabled:u||f,children:$?p.jsx(Ce.EyeIcon,{}):p.jsx(Ce.EyeSlashIcon,{})}),S&&p.jsx(T.Button,{ouiaId:`lookup-${K}-button`,variant:"control",onClick:()=>C==null?void 0:C(V=>{if(w){const H=w(V);L(K,H,{shouldValidate:!0})}},S),"aria-label":"Options menu",isDisabled:u||P,children:p.jsx(Ce.SearchIcon,{"data-cy":"lookup-button"})}),s&&s]})})},rules:{required:typeof r=="string"&&d===!0?{value:!0,message:`${pr(r.toLocaleLowerCase())} is required.`}:void 0,validate:h,minLength:typeof r=="string"&&typeof m=="number"?{value:m,message:`${pr(r.toLocaleLowerCase())} must be at least ${m} characters.`}:m,maxLength:typeof r=="string"&&typeof g=="number"?{value:g,message:`${pr(r.toLocaleLowerCase())} cannot be greater than ${g} characters.`}:g,min:typeof r=="string"&&(typeof y=="number"||typeof y=="string")?{value:y,message:`${pr(r.toLocaleLowerCase())} must be less than ${y}.`}:m,max:typeof r=="string"&&(typeof _=="number"||typeof _=="string")?{value:_,message:`${pr(r.toLocaleLowerCase())} cannot be greater than ${_}.`}:m,pattern:b}})}const zOe="",zb=x.createContext({isOpen:!1,setState:()=>({})});function Xh(){return x.useContext(zb)}function S3(e){const t=tn("xl"),[n,r]=x.useState(()=>t),i=x.useCallback(a=>{a.isOpen!==void 0&&r(a.isOpen)},[]);return x.useEffect(()=>i({isOpen:t}),[t,i]),p.jsx(zb.Provider,{value:{isOpen:n,setState:i},children:e.children})}function w3(){const e=At.useNavigate(),t=tn("xl"),n=Xh();return x.useCallback(i=>{e(i),t||n.setState({isOpen:!n.isOpen})},[e,t,n])}function C3(e){return p.jsx(p1,{children:p.jsx(P1,{children:p.jsx(k1,{children:p.jsx(T1,{children:p.jsx(S3,{children:e.children})})})})})}function Y5e(e){const t=At.useNavigate();return e.breadcrumbs?p.jsx(T.Breadcrumb,{style:e.style,children:e.breadcrumbs.map((n,r)=>n.label?p.jsx(T.BreadcrumbItem,{"data-cy":n.label,id:n.id,component:n.component,isActive:n.to===void 0,children:n.to?p.jsx("a",{href:n.to,"data-cy":n.label,onClick:i=>{i.preventDefault(),n.to&&t(n.to)},children:n.label}):n.label},n.id??n.label??r):p.jsx(x.Fragment,{},r))}):p.jsx(x.Fragment,{})}function O3(e){const{breadcrumbs:t,title:n,description:r,controls:i,headerActions:a,footer:o}=e,l=tn("lg"),s=tn("xl"),c=tn("md"),[u]=Ot();return p.jsx(T.PageSection,{variant:T.PageSectionVariants.light,className:"bg-lighten border-bottom",style:{paddingTop:s?16:12,paddingBottom:s?16:12},children:p.jsxs(T.Stack,{hasGutter:!0,children:[p.jsxs(T.Flex,{flexWrap:{default:"nowrap"},alignItems:{default:"alignItemsStretch"},children:[p.jsxs(T.FlexItem,{grow:{default:"grow"},children:[t&&p.jsx(Y5e,{breadcrumbs:t,style:{paddingBottom:l?6:4}}),n?e.titleHelp?p.jsx(T.Popover,{headerContent:e.titleHelpTitle,bodyContent:p.jsxs(T.Stack,{hasGutter:!0,children:[typeof e.titleHelp=="string"?p.jsx(T.StackItem,{children:e.titleHelp}):e.titleHelp.map((f,d)=>p.jsx(T.StackItem,{children:f},d)),e.titleDocLink&&p.jsx(T.StackItem,{children:p.jsx(T.Button,{icon:p.jsx(Ce.ExternalLinkAltIcon,{}),variant:"link",onClick:()=>window.open(e.titleDocLink,"_blank"),isInline:!0,children:u.documentation})})]}),position:"bottom-start",children:p.jsxs(T.Title,{"data-cy":"page-title",headingLevel:"h1",children:[n,p.jsx(T.Button,{variant:"link",style:{padding:0,marginTop:1,marginLeft:8,verticalAlign:"top"},children:p.jsx(Ce.OutlinedQuestionCircleIcon,{})})]})}):p.jsx(T.Title,{"data-cy":"page-title",headingLevel:"h1",children:n}):p.jsx(T.Title,{headingLevel:"h1",children:p.jsx(T.Skeleton,{width:"160px"})}),c&&r&&p.jsx("div",{"data-cy":"app-description",style:{paddingTop:s?4:2,opacity:.8},children:typeof r=="string"?p.jsx(T.Truncate,{content:r}):p.jsx(T.Stack,{children:r.map(f=>p.jsx(T.StackItem,{children:f},f))})})]}),n&&(a||i)&&p.jsxs(T.Flex,{"data-cy":"manage-view",direction:{default:"column"},spaceItems:{default:"spaceItemsSm",xl:"spaceItemsMd"},justifyContent:{default:"justifyContentCenter"},children:[i&&p.jsx(T.FlexItem,{grow:{default:"grow"},children:i}),a&&p.jsx(T.FlexItem,{children:a})]})]}),o]})})}function K5e(e){const[t]=Ot();return p.jsx(E1,{message:t.errorText,children:p.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%",backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:e.children})})}function X5e(e){const t=tn("sm"),n=tn("md");return p.jsxs(T.Masthead,{display:{default:"inline"},style:{borderBottom:"1px solid #fff4",paddingRight:0},children:[p.jsx(T3,{}),t&&p.jsx(T.MastheadMain,{children:p.jsx(T.MastheadBrand,{component:"a",children:e.icon})}),p.jsx(T.MastheadContent,{style:{marginLeft:0,minHeight:0},children:p.jsx(T.Toolbar,{id:"toolbar","data-cy":"toolbar",inset:{default:"insetNone"},style:{padding:0},children:p.jsxs(T.ToolbarContent,{children:[n&&p.jsx(T.ToolbarItem,{children:p.jsxs(T.Stack,{style:{color:"white",cursor:"default",marginTop:-2,marginBottom:-2},children:[e.brand&&p.jsx(T.Text,{style:{marginTop:-6},children:p.jsx(T.Truncate,{content:e.brand,style:{minWidth:0}})}),p.jsx(T.Title,{headingLevel:"h1",style:{lineHeight:1},children:p.jsx(T.Truncate,{content:e.title,style:{minWidth:0}})})]})}),e.children]})})})]})}function T3(){const e=Xh();return p.jsx(T.MastheadToggle,{onClick:()=>e.setState({isOpen:!e.isOpen}),children:p.jsx(T.PageToggleButton,{"data-cy":"nav-toggle",variant:"plain","aria-label":"Global navigation",children:p.jsx(Ce.BarsIcon,{})})})}function Z5e(e){return p.jsx(T.NotificationBadge,{"data-cy":"notification-badge",variant:e.count===0?"read":"unread",count:e.count,onClick:()=>e.onClick()})}function J5e(){const{t:e}=st(),t=j1(e);return p.jsx(T.Button,{"data-cy":"settings-icon",icon:p.jsx(Ce.CogIcon,{}),variant:T.ButtonVariant.plain,onClick:t})}function Q5e(){const[e,t]=x.useContext(Yi);return e.activeTheme==="dark"?p.jsx(T.Button,{"data-cy":"settings-icon",variant:"plain",onClick:()=>t({...e,theme:"light"}),children:p.jsx(Ce.MoonIcon,{})}):p.jsx(T.Button,{"data-cy":"theme-icon",variant:"plain",onClick:()=>t({...e,theme:"dark"}),children:p.jsx(Ce.SunIcon,{})})}const BOe="";function E3(e){const{navigation:t}=e,n=Xh();return p.jsx(p.Fragment,{children:p.jsx(T.PageSidebar,{isSidebarOpen:n.isOpen,className:"bg-lighten",children:p.jsx(T.PageSidebarBody,{children:p.jsx(T.Nav,{"data-cy":"page-navigation",className:"side-nav",children:p.jsx(T.NavList,{children:p.jsx(Zh,{baseRoute:"",items:t})})})})})})}function Zh(e){return p.jsx(p.Fragment,{children:e.items.map((t,n)=>p.jsx(exe,{item:t,baseRoute:e.baseRoute},n))})}function exe(e){var c;const{item:t}=e,[n,r]=x.useState(()=>localStorage.getItem((t.id??t.label)+"-expanded")!=="false"),i=u=>{r(u),localStorage.setItem((t.id??t.label)+"-expanded",u?"true":"false")};let a;if("id"in e.item)a=e.item.id;else if("children"in e.item){const u=e.item.children.find(f=>f.path==="");u&&"id"in u&&(a=u.id)}const o=w3();let l=e.baseRoute+"/"+t.path;if(l=l.replace("//","/"),t.path==="/"&&"children"in t)return p.jsx(Zh,{items:t.children,baseRoute:""});const s="children"in t&&((c=t.children)==null?void 0:c.find(u=>u.label));if(!s&&"label"in t){const u=location.pathname.startsWith(l);return p.jsx(T.NavItem,{id:a,href:l,isActive:u,className:u?"bg-lighten":void 0,onClick:()=>o(l),"data-cy":a,children:t.label})}return!s||t.label===void 0?null:t.label?p.jsx(T.NavExpandable,{title:t.label,isActive:location.pathname.startsWith(l),isExpanded:n,onExpand:(u,f)=>i(f),children:p.jsx(Zh,{items:t.children,baseRoute:l})}):p.jsx(Zh,{items:t.children,baseRoute:l})}const A3=x.createContext({});function txe(){return x.useContext(A3)}function nxe(e){const t=x.useMemo(()=>k3("",e.navigation),[e.navigation]);return p.jsx(A3.Provider,{value:t,children:e.children})}function k3(e,t){const n={};return t.forEach(r=>{const i=(e+"/"+r.path).replace("//","/");"id"in r&&typeof r.id=="string"&&(n[r.id]=i),"children"in r&&Object.assign(n,k3(i,r.children))}),n}function rxe(e){const{navigation:t,basename:n,masthead:r}=e,i=x.useMemo(()=>[{path:"",element:p.jsx(C3,{children:p.jsx(At.Outlet,{})}),children:[{path:"login",element:e.login},{path:"",element:e.root??p.jsx(p.Fragment,{}),children:[{path:"",element:p.jsx(T.Page,{header:r,sidebar:p.jsx(E3,{navigation:t}),children:p.jsx(At.Outlet,{})}),children:t}]},{path:"*",element:p.jsx(e6,{})}]}],[r,t,e.login,e.root]),a=x.useMemo(()=>At.createBrowserRouter(i,{basename:n}),[n,i]);return p.jsx(nxe,{navigation:t,children:p.jsx(At.RouterProvider,{router:a})})}function ixe(e){return e.replace(/^\//,"")}function P3(e,t){for(const n of e){if("id"in n&&n.id===t)return n;if("children"in n){const r=P3(n.children,t);if(r)return r}}}function j3(e,t){for(let n=0;n<e.length;n++){const r=e[n];if("id"in r&&r.id===t)return e.splice(n,1),r;if("children"in r){const i=j3(r.children,t);if(i)return i}}}function $3(e,t,n){for(const r of e)if("id"in r&&r.id===t){const i=r;"children"in r||(i.children=[]),i.children.push(n);return}else"children"in r&&$3(r.children,t,n)}function D3(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r+1,0,n);return}else"children"in i&&D3(i.children,t,n)}}function M3(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r,0,n);return}else"children"in i&&M3(i.children,t,n)}}function I3(){const e=txe();return x.useCallback((t,n)=>{let r=e[t]??"";const i=n==null?void 0:n.params,a=n==null?void 0:n.query;return r?(i&&(r=Object.keys(i).reduce((o,l)=>{let s=i[l];return s===void 0?o:(s=encodeURIComponent(s.toString()),o.replace(`:${l}`,s))},r)),a&&(r=`${r}?${Object.keys(a).map(o=>{let l=a[o];return l===void 0?"":(l=encodeURIComponent(l.toString()),`${o}=${l}`)}).join("&").replace("/&&/g","&")}`)):console.error(`Page id ${t} not found`),r},[e])}function axe(){const e=At.useNavigate(),t=I3();return(n,r)=>{const i=t(n,r);i&&e(i)}}function L3(e){const{loading:t}=e,[n,r]=x.useState((e==null?void 0:e.initialTabIndex)??0),i=x.useCallback((s,c)=>r(c),[r]),a=x.Children.toArray(e.children),o=a.map((s,c)=>{if(x.isValidElement(s)&&s.type===Bb){const u=s.props.label;return p.jsx(T.Tab,{title:u||p.jsx(T.Skeleton,{width:"60px"}),eventKey:c},u??c)}return s}),l=a[n];return t?p.jsx(L3,{children:p.jsx(Bb,{children:p.jsx(T.PageSection,{variant:"light",children:p.jsx(T.Skeleton,{})})})}):p.jsxs(p.Fragment,{children:[p.jsx(T.Tabs,{activeKey:n,onSelect:i,inset:{default:"insetSm"},isBox:!0,style:{backgroundColor:"var(--pf-v5-c-tabs__link--BackgroundColor)"},children:o}),l]})}function Bb(e){return p.jsx(p.Fragment,{children:e.children})}const WOe="",F3=x.createContext({});function Fc(){return x.useContext(F3)}function oxe(e){const[t,n]=x.useState(!1),[r,i]=x.useState(null),[a,o]=x.useState({}),[l,s]=x.useState(e.defaultValue??{}),[c,u]=x.useState({}),f=x.useMemo(()=>{function d(h,m){return h.hidden&&h.hidden(m)?null:h}return e.steps.filter(h=>d(h,a))},[e.steps,a]);return x.useEffect(()=>{!r&&f.length>0&&i(f[0])},[r,f]),p.jsx(F3.Provider,{value:{wizardData:a,setWizardData:o,stepData:l,setStepData:s,steps:f,activeStep:r,setActiveStep:i,stepError:c,setStepError:u,isToggleExpanded:t,setToggleExpanded:n},children:e.children})}function N3(e){const{t}=st(),{activeStep:n,steps:r}=Fc(),i=(n==null?void 0:n.id)===r[r.length-1].id,a=t(i?"Finish":"Next"),o=(n==null?void 0:n.id)===r[0].id,l=o?"pf-v5-c-button pf-m-disabled":"pf-v5-c-button pf-m-secondary";return p.jsxs("footer",{className:"pf-v5-c-wizard__footer border-top bg-lighten","data-cy":"wizard-footer",children:[n!==null&&"inputs"in n?p.jsx(mb,{style:{minWidth:10},children:a}):p.jsx("button",{"data-cy":"wizard-next",className:"pf-v5-c-button pf-m-primary",type:"submit",onClick:e.onNext,children:a}),p.jsx("button",{type:"button","data-cy":"wizard-back",className:l,disabled:o,onClick:e.onBack,children:t("Back")}),p.jsx("div",{"data-cy":"wizard-cancel",className:"pf-v5-c-wizard__footer-cancel",children:p.jsx("button",{className:"pf-v5-c-button pf-m-link",type:"button",onClick:e.onCancel,children:t("Cancel")})})]})}function lxe(e){const t=At.useNavigate(),{onSubmit:n,onCancel:r,errorAdapter:i}=e,{activeStep:a,steps:o,stepData:l,wizardData:s,setWizardData:c,setStepData:u,setActiveStep:f}=Fc(),d=x.useCallback(()=>{r?r():t(-1)},[t,r]),h=x.useCallback(g=>{if(a!==null){if((a==null?void 0:a.id)===o[o.length-1].id)return n(s);const _=o.findIndex(S=>S.id===(a==null?void 0:a.id)),b=o[_+1];c(S=>({...S,...g})),u(S=>({...S,[a==null?void 0:a.id]:g})),f(b)}return Promise.resolve()},[a,s,n,o,c,u,f]),m=x.useCallback(()=>{const g=o.findIndex(_=>_.id===(a==null?void 0:a.id)),y=o[g-1];f(y)},[a,o,f]);return p.jsx(p.Fragment,{children:a!==null&&("inputs"in a?p.jsxs(z6,{onSubmit:h,footer:p.jsx(N3,{onBack:m,onCancel:d}),defaultValue:l[a.id],errorAdapter:i,children:[p.jsx(sxe,{}),a.inputs]},a.id):p.jsxs("div",{"data-cy":`wizard-section-${a.id}`,style:{display:"flex",flexDirection:"column",height:"100%"},children:[p.jsx(T.PageSection,{variant:"light",isFilled:!0,hasOverflowScroll:!0,children:a==null?void 0:a.element}),p.jsx(N3,{onNext:()=>void h({}),onBack:m,onCancel:d})]}))})}function sxe(){const{activeStep:e,setStepError:t}=Fc(),{errors:n}=qy(),r=JSON.stringify(n);return x.useEffect(()=>{Object.keys(n).length===0?t({}):e&&t({[e.id]:n})},[n,e,t,r]),null}function cxe(){const{activeStep:e,steps:t,isToggleExpanded:n,setActiveStep:r,stepError:i}=Fc(),a=n?"pf-v5-c-wizard__nav pf-m-expanded":"pf-v5-c-wizard__nav bg-lighten",o=l=>{const s=t[l];s&&r(s)};if(e)return p.jsx("nav",{className:a,"aria-label":"Steps","data-cy":"wizard-nav",children:p.jsx("ol",{className:"pf-v5-c-wizard__nav-list",children:t.map((l,s)=>{const c=t.findIndex(d=>d.id===e.id),u=s>c,f="pf-v5-c-wizard__nav-link"+(e.id===l.id?" pf-m-current":"")+(u?" pf-m-disabled":"");return p.jsx("li",{className:"pf-v5-c-wizard__nav-item","data-cy":`wizard-nav-item-${l.id}`,children:p.jsxs("button",{className:f,onClick:()=>o(s),disabled:u,children:[" ",l.label,i[l.id]&&e.id===l.id&&p.jsx("span",{style:{marginLeft:"8px"},children:p.jsx(Ce.ExclamationCircleIcon,{color:"#C9190B"})})]})},l.id)})})})}function uxe(){const{t:e}=st(),{activeStep:t,isToggleExpanded:n,setToggleExpanded:r}=Fc(),i=x.useCallback(()=>r(a=>!a),[r]);return p.jsxs("button",{onClick:i,className:ae(ts.wizardToggle,n&&"pf-m-expanded"),"aria-label":e("Wizard toggle"),"aria-expanded":n,"data-cy":"wizard-toggle",children:[p.jsx("span",{className:ae(ts.wizardToggleList),children:p.jsxs("span",{className:ae(ts.wizardToggleListItem),children:[p.jsx("span",{className:ae(ts.wizardToggleNum),children:1})," ",t==null?void 0:t.label]})}),p.jsx("span",{className:ae(ts.wizardToggleIcon),children:p.jsx(Ce.CaretDownIcon,{"aria-hidden":"true"})})]})}function fxe(e){return p.jsx(oxe,{steps:e.steps,defaultValue:e.defaultValue,children:p.jsxs("div",{className:"pf-v5-c-wizard","data-cy":"wizard",style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%",overflow:"hidden"},children:[p.jsx(uxe,{}),p.jsxs("div",{className:"pf-v5-c-wizard__outer-wrap",style:{display:"flex",flexDirection:"column",overflow:"hidden",minHeight:0},children:[p.jsx(cxe,{}),p.jsx(lxe,{errorAdapter:e.errorAdapter,onCancel:e.onCancel,onSubmit:e.onSubmit})]})]})})}function dxe(){return p.jsx(T.PageSection,{isFilled:!0,variant:"light",children:p.jsx(T.Bullseye,{children:p.jsx(T.Spinner,{})})})}function hxe(e){return p.jsxs(x.Fragment,{children:[p.jsx(O3,{breadcrumbs:e.breadcrumbs?[{label:p.jsx(T.Skeleton,{width:"150px"})}]:void 0,title:p.jsx(T.Skeleton,{width:"200px"})}),e.tabs&&p.jsx(T.PageSection,{variant:"light",style:{paddingTop:8,paddingBottom:8},children:p.jsx(T.Skeleton,{width:"150px"})}),p.jsx(T.Divider,{}),p.jsx(dxe,{})]})}const mxe=x7`
526
+ `))],R=H!=null&&H!=="";return p.jsx(vi,{fieldId:$,...h,icon:o?p.jsx(Ce.AngleRightIcon,{"data-cy":"expandable",style:{transform:k?"rotate(0deg)":"rotate(90deg)",transition:"transform"},onClick:()=>D(ne=>!ne),"aria-label":t("Expand or collapse extra variables")}):void 0,label:e.label,helperTextInvalid:!(d&&g)&&Y,children:(!o||!k)&&p.jsxs(p.Fragment,{children:[p.jsx(W5e,{allowCopy:n,allowDownload:r,allowUpload:i,errors:y,handleCopy:()=>Q(),handleDownload:K,handleUpload:Z,name:X,selectedLanguage:E,setLanguage:z,toggleLanguages:f},"actions-row"),e.allowUpload?p.jsxs("div",{id:"code-editor-dropzone",...W.getRootProps({disabled:R}),style:{width:"100%",height:"100%"},children:[p.jsx("input",{id:"code-editor-dropzone-input",...W.getInputProps(),ref:L}),p.jsx(x3,{setError:_,clearErrors:b,id:$,"data-cy":$,name:X,language:E,value:H,onChange:V,isReadOnly:l||m,invalid:!(d&&g)&&(q==null?void 0:q.message)!==void 0})]}):p.jsx(x3,{setError:_,clearErrors:b,id:$,"data-cy":$,name:X,language:E,value:H,onChange:V,isReadOnly:l||m,invalid:!(d&&g)&&(q==null?void 0:q.message)!==void 0})]})})},rules:{required:typeof c=="string"&&s===!0?{value:!0,message:`${pr(c.toLocaleLowerCase())} is required.`}:void 0,validate:e.validate}})}function H5e(e){const{name:t,label:n,labelHelpTitle:r,labelHelp:i,additionalControls:a,placeholderText:o,options:l,footer:s,helperText:c,isDisabled:u,isReadOnly:f,isRequired:d,validate:h,fieldNameToResetOnFieldChange:m}=e,g=Ta(e),{control:y,formState:{isSubmitting:_,isValidating:b},resetField:S}=Bi(),[C,w]=x.useState(!1),E=x.useCallback(()=>w(!C),[C]),[A]=Ot();return p.jsx(vl,{name:t,control:y,shouldUnregister:!0,render:({field:{onChange:k,value:D},fieldState:{error:L}})=>{D===""&&l.length===1&&d&&k(l[0].value);const P=(j,z)=>{var Q;k((Q=l.find(Z=>Z.label===z.toString()))==null?void 0:Q.value),m&&S(m),w(!1)},I=L!=null&&L.message?h&&b?A.validating:L==null?void 0:L.message:void 0,$=l.find(j=>j.value===D);return p.jsx(vi,{fieldId:g,label:n,labelHelpTitle:r,labelHelp:i,additionalControls:a,helperText:c,helperTextInvalid:I,isRequired:d,children:p.jsx(Ca,{id:g,placeholderText:o,variant:"single","aria-describedby":`${g}-form-group`,selections:$==null?void 0:$.label,onSelect:P,isOpen:C,onToggle:E,onClear:d?void 0:()=>{k(null),w(!1)},maxHeight:280,validated:I?"error":void 0,isDisabled:u||f||_,hasPlaceholderStyle:!0,footer:s,ouiaId:"menu-select","data-cy":g,children:l.map(j=>{const z=gi(j);return p.jsx(Vr,{id:z,value:j.label,label:j.label,description:j.description,"data-cy":z,children:j.label},j.label)})})})},rules:{required:typeof n=="string"&&d===!0?{value:!0,message:`${pr(n.toLocaleLowerCase())} is required.`}:void 0,validate:h}})}function U5e(e){const{name:t,helperText:n,validate:r,additionalControls:i,label:a,labelHelp:o,labelHelpTitle:l}=e,{control:s,formState:{isSubmitting:c,isValidating:u}}=Bi(),f=Ta(e);return p.jsx(vl,{name:t,control:s,shouldUnregister:!0,render:({field:{onChange:d,value:h},fieldState:{error:m}})=>{const g=r&&u||m==null?void 0:m.message;return p.jsx(vi,{fieldId:f,"data-cy":f+"-form-group",label:a,labelHelpTitle:l,labelHelp:o,helperText:n,helperTextInvalid:g,additionalControls:i,children:p.jsx(T.Switch,{"data-cy":f+"-toggle",isChecked:h,onChange:y=>d(y),isDisabled:c})})}})}function G5e(e){const{type:t,name:n,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,placeholder:l,button:s,helperText:c,isDisabled:u,isReadOnly:f,isRequired:d,validate:h,minLength:m,maxLength:g,min:y,max:_,pattern:b,selectTitle:S,selectOpen:C,selectValue:w,autoFocus:E,autoComplete:A}=e,k=Ta(e),{control:D,setValue:L,formState:{isSubmitting:P,isValidating:I}}=Bi(),[$,j]=x.useState(!1),[z]=Ot();return p.jsx(vl,{name:n,control:D,shouldUnregister:!0,render:({field:{onChange:Q,value:Z,name:K},fieldState:{error:J}})=>{const W=J!=null&&J.message?h&&I?z.validating:J==null?void 0:J.message:void 0;function X(V){Q(V.trimStart())}return p.jsx(vi,{fieldId:k,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,helperText:c,helperTextInvalid:W,isRequired:d,children:p.jsxs(T.InputGroup,{children:[p.jsx(T.InputGroupItem,{isFill:!0,children:p.jsx(T.TextArea,{id:k,placeholder:l,onChange:(V,H)=>X(H),value:Z??"","aria-describedby":k?`${k}-form-group`:void 0,validated:W?"error":void 0,type:t==="password"?$?"text":"password":t,readOnlyVariant:f?"default":void 0,isDisabled:u,autoFocus:E,autoComplete:A||"off","data-cy":k})}),t==="password"&&p.jsx(T.Button,{variant:"control",onClick:()=>j(!$),isDisabled:u||f,children:$?p.jsx(Ce.EyeIcon,{}):p.jsx(Ce.EyeSlashIcon,{})}),S&&p.jsx(T.Button,{ouiaId:`lookup-${K}-button`,variant:"control",onClick:()=>C==null?void 0:C(V=>{if(w){const H=w(V);L(K,H,{shouldValidate:!0})}},S),"aria-label":"Options menu",isDisabled:u||P,children:p.jsx(Ce.SearchIcon,{})}),s&&s]})})},rules:{required:typeof r=="string"&&d===!0?{value:!0,message:`${pr(r.toLocaleLowerCase())} is required.`}:void 0,validate:h,minLength:typeof r=="string"&&typeof m=="number"?{value:m,message:`${pr(r.toLocaleLowerCase())} must be at least ${m} characters.`}:m,maxLength:typeof r=="string"&&typeof g=="number"?{value:g,message:`${pr(r.toLocaleLowerCase())} cannot be greater than ${g} characters.`}:g,min:typeof r=="string"&&(typeof y=="number"||typeof y=="string")?{value:y,message:`${pr(r.toLocaleLowerCase())} must be less than ${y}.`}:m,max:typeof r=="string"&&(typeof _=="number"||typeof _=="string")?{value:_,message:`${pr(r.toLocaleLowerCase())} cannot be greater than ${_}.`}:m,pattern:b}})}function q5e(e){const{type:t,name:n,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,placeholder:l,button:s,helperText:c,isDisabled:u,isReadOnly:f,isRequired:d,validate:h,minLength:m,maxLength:g,min:y,max:_,pattern:b,selectTitle:S,selectOpen:C,selectValue:w,autoFocus:E,autoComplete:A}=e,k=Ta(e),{control:D,setValue:L,formState:{isSubmitting:P,isValidating:I}}=Bi(),[$,j]=x.useState(!1),[z]=Ot();return p.jsx(vl,{name:n,control:D,shouldUnregister:!0,render:({field:{onChange:Q,value:Z,name:K},fieldState:{error:J}})=>{const W=J!=null&&J.message?h&&I?z.validating:J==null?void 0:J.message:void 0;function X(V){Q(V.trimStart())}return p.jsx(vi,{fieldId:k,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,helperText:c,helperTextInvalid:W,isRequired:d,children:p.jsxs(T.InputGroup,{children:[p.jsx(T.InputGroupItem,{isFill:!0,children:p.jsx(T.TextInput,{id:k,placeholder:l,onChange:(V,H)=>X(H),value:Z??"","aria-describedby":k?`${k}-form-group`:void 0,validated:W?"error":void 0,type:t==="password"?$?"text":"password":t,readOnlyVariant:f?"default":void 0,isDisabled:u,autoFocus:E,autoComplete:A||"off","data-cy":k})}),t==="password"&&p.jsx(T.Button,{variant:"control",onClick:()=>j(!$),isDisabled:u||f,children:$?p.jsx(Ce.EyeIcon,{}):p.jsx(Ce.EyeSlashIcon,{})}),S&&p.jsx(T.Button,{ouiaId:`lookup-${K}-button`,variant:"control",onClick:()=>C==null?void 0:C(V=>{if(w){const H=w(V);L(K,H,{shouldValidate:!0})}},S),"aria-label":"Options menu",isDisabled:u||P,children:p.jsx(Ce.SearchIcon,{"data-cy":"lookup-button"})}),s&&s]})})},rules:{required:typeof r=="string"&&d===!0?{value:!0,message:`${pr(r.toLocaleLowerCase())} is required.`}:void 0,validate:h,minLength:typeof r=="string"&&typeof m=="number"?{value:m,message:`${pr(r.toLocaleLowerCase())} must be at least ${m} characters.`}:m,maxLength:typeof r=="string"&&typeof g=="number"?{value:g,message:`${pr(r.toLocaleLowerCase())} cannot be greater than ${g} characters.`}:g,min:typeof r=="string"&&(typeof y=="number"||typeof y=="string")?{value:y,message:`${pr(r.toLocaleLowerCase())} must be less than ${y}.`}:m,max:typeof r=="string"&&(typeof _=="number"||typeof _=="string")?{value:_,message:`${pr(r.toLocaleLowerCase())} cannot be greater than ${_}.`}:m,pattern:b}})}const zOe="",zb=x.createContext({isOpen:!1,setState:()=>({})});function Xh(){return x.useContext(zb)}function S3(e){const t=tn("xl"),[n,r]=x.useState(()=>t),i=x.useCallback(a=>{a.isOpen!==void 0&&r(a.isOpen)},[]);return x.useEffect(()=>i({isOpen:t}),[t,i]),p.jsx(zb.Provider,{value:{isOpen:n,setState:i},children:e.children})}function w3(){const e=At.useNavigate(),t=tn("xl"),n=Xh();return x.useCallback(i=>{e(i),t||n.setState({isOpen:!n.isOpen})},[e,t,n])}function C3(e){return p.jsx(p1,{children:p.jsx(P1,{children:p.jsx(k1,{children:p.jsx(T1,{children:p.jsx(S3,{children:e.children})})})})})}function Y5e(e){const t=At.useNavigate();return e.breadcrumbs?p.jsx(T.Breadcrumb,{style:e.style,children:e.breadcrumbs.map((n,r)=>n.label?p.jsx(T.BreadcrumbItem,{"data-cy":n.label,id:n.id,component:n.component,isActive:n.to===void 0,children:n.to?p.jsx("a",{href:n.to,"data-cy":n.label,onClick:i=>{i.preventDefault(),n.to&&t(n.to)},children:n.label}):n.label},n.id??n.label??r):p.jsx(x.Fragment,{},r))}):p.jsx(x.Fragment,{})}function O3(e){const{breadcrumbs:t,title:n,description:r,controls:i,headerActions:a,footer:o}=e,l=tn("lg"),s=tn("xl"),c=tn("md"),[u]=Ot();return p.jsx(T.PageSection,{variant:T.PageSectionVariants.light,className:"bg-lighten border-bottom",style:{paddingTop:s?16:12,paddingBottom:s?16:12},children:p.jsxs(T.Stack,{hasGutter:!0,children:[p.jsxs(T.Flex,{flexWrap:{default:"nowrap"},alignItems:{default:"alignItemsStretch"},children:[p.jsxs(T.FlexItem,{grow:{default:"grow"},children:[t&&p.jsx(Y5e,{breadcrumbs:t,style:{paddingBottom:l?6:4}}),n?e.titleHelp?p.jsx(T.Popover,{headerContent:e.titleHelpTitle,bodyContent:p.jsxs(T.Stack,{hasGutter:!0,children:[typeof e.titleHelp=="string"?p.jsx(T.StackItem,{children:e.titleHelp}):e.titleHelp.map((f,d)=>p.jsx(T.StackItem,{children:f},d)),e.titleDocLink&&p.jsx(T.StackItem,{children:p.jsx(T.Button,{icon:p.jsx(Ce.ExternalLinkAltIcon,{}),variant:"link",onClick:()=>window.open(e.titleDocLink,"_blank"),isInline:!0,children:u.documentation})})]}),position:"bottom-start",children:p.jsxs(T.Title,{"data-cy":"page-title",headingLevel:"h1",children:[n,p.jsx(T.Button,{variant:"link",style:{padding:0,marginTop:1,marginLeft:8,verticalAlign:"top"},children:p.jsx(Ce.OutlinedQuestionCircleIcon,{})})]})}):p.jsx(T.Title,{"data-cy":"page-title",headingLevel:"h1",children:n}):p.jsx(T.Title,{headingLevel:"h1",children:p.jsx(T.Skeleton,{width:"160px"})}),c&&r&&p.jsx("div",{"data-cy":"app-description",style:{paddingTop:s?4:2,opacity:.8},children:typeof r=="string"?p.jsx(T.Truncate,{content:r}):p.jsx(T.Stack,{children:r.map(f=>p.jsx(T.StackItem,{children:f},f))})})]}),n&&(a||i)&&p.jsxs(T.Flex,{"data-cy":"manage-view",direction:{default:"column"},spaceItems:{default:"spaceItemsSm",xl:"spaceItemsMd"},justifyContent:{default:"justifyContentCenter"},children:[i&&p.jsx(T.FlexItem,{grow:{default:"grow"},children:i}),a&&p.jsx(T.FlexItem,{children:a})]})]}),o]})})}function K5e(e){const[t]=Ot();return p.jsx(E1,{message:t.errorText,children:p.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%"},children:e.children})})}function X5e(e){const t=tn("sm"),n=tn("md");return p.jsxs(T.Masthead,{display:{default:"inline"},style:{borderBottom:"1px solid #fff4",paddingRight:0},children:[p.jsx(T3,{}),t&&p.jsx(T.MastheadMain,{children:p.jsx(T.MastheadBrand,{component:"a",children:e.icon})}),p.jsx(T.MastheadContent,{style:{marginLeft:0,minHeight:0},children:p.jsx(T.Toolbar,{id:"toolbar","data-cy":"toolbar",inset:{default:"insetNone"},style:{padding:0},children:p.jsxs(T.ToolbarContent,{children:[n&&p.jsx(T.ToolbarItem,{children:p.jsxs(T.Stack,{style:{color:"white",cursor:"default",marginTop:-2,marginBottom:-2},children:[e.brand&&p.jsx(T.Text,{style:{marginTop:-6},children:p.jsx(T.Truncate,{content:e.brand,style:{minWidth:0}})}),p.jsx(T.Title,{headingLevel:"h1",style:{lineHeight:1},children:p.jsx(T.Truncate,{content:e.title,style:{minWidth:0}})})]})}),e.children]})})})]})}function T3(){const e=Xh();return p.jsx(T.MastheadToggle,{onClick:()=>e.setState({isOpen:!e.isOpen}),children:p.jsx(T.PageToggleButton,{"data-cy":"nav-toggle",variant:"plain","aria-label":"Global navigation",children:p.jsx(Ce.BarsIcon,{})})})}function Z5e(e){return p.jsx(T.NotificationBadge,{"data-cy":"notification-badge",variant:e.count===0?"read":"unread",count:e.count,onClick:()=>e.onClick()})}function J5e(){const{t:e}=st(),t=j1(e);return p.jsx(T.Button,{"data-cy":"settings-icon",icon:p.jsx(Ce.CogIcon,{}),variant:T.ButtonVariant.plain,onClick:t})}function Q5e(){const[e,t]=x.useContext(Yi);return e.activeTheme==="dark"?p.jsx(T.Button,{"data-cy":"settings-icon",variant:"plain",onClick:()=>t({...e,theme:"light"}),children:p.jsx(Ce.MoonIcon,{})}):p.jsx(T.Button,{"data-cy":"theme-icon",variant:"plain",onClick:()=>t({...e,theme:"dark"}),children:p.jsx(Ce.SunIcon,{})})}const BOe="";function E3(e){const{navigation:t}=e,n=Xh();return p.jsx(p.Fragment,{children:p.jsx(T.PageSidebar,{isSidebarOpen:n.isOpen,className:"bg-lighten",children:p.jsx(T.PageSidebarBody,{children:p.jsx(T.Nav,{"data-cy":"page-navigation",className:"side-nav",children:p.jsx(T.NavList,{children:p.jsx(Zh,{baseRoute:"",items:t})})})})})})}function Zh(e){return p.jsx(p.Fragment,{children:e.items.map((t,n)=>p.jsx(exe,{item:t,baseRoute:e.baseRoute},n))})}function exe(e){var c;const{item:t}=e,[n,r]=x.useState(()=>localStorage.getItem((t.id??t.label)+"-expanded")!=="false"),i=u=>{r(u),localStorage.setItem((t.id??t.label)+"-expanded",u?"true":"false")};let a;if("id"in e.item)a=e.item.id;else if("children"in e.item){const u=e.item.children.find(f=>f.path==="");u&&"id"in u&&(a=u.id)}const o=w3();let l=e.baseRoute+"/"+t.path;if(l=l.replace("//","/"),t.path==="/"&&"children"in t)return p.jsx(Zh,{items:t.children,baseRoute:""});const s="children"in t&&((c=t.children)==null?void 0:c.find(u=>u.label));if(!s&&"label"in t){const u=location.pathname.startsWith(l);return p.jsx(T.NavItem,{id:a,href:l,isActive:u,className:u?"bg-lighten":void 0,onClick:()=>o(l),"data-cy":a,children:t.label})}return!s||t.label===void 0?null:t.label?p.jsx(T.NavExpandable,{title:t.label,isActive:location.pathname.startsWith(l),isExpanded:n,onExpand:(u,f)=>i(f),children:p.jsx(Zh,{items:t.children,baseRoute:l})}):p.jsx(Zh,{items:t.children,baseRoute:l})}const A3=x.createContext({});function txe(){return x.useContext(A3)}function nxe(e){const t=x.useMemo(()=>k3("",e.navigation),[e.navigation]);return p.jsx(A3.Provider,{value:t,children:e.children})}function k3(e,t){const n={};return t.forEach(r=>{const i=(e+"/"+r.path).replace("//","/");"id"in r&&typeof r.id=="string"&&(n[r.id]=i),"children"in r&&Object.assign(n,k3(i,r.children))}),n}function rxe(e){const{navigation:t,basename:n,masthead:r}=e,i=x.useMemo(()=>[{path:"",element:p.jsx(C3,{children:p.jsx(At.Outlet,{})}),children:[{path:"login",element:e.login},{path:"",element:e.root??p.jsx(p.Fragment,{}),children:[{path:"",element:p.jsx(T.Page,{header:r,sidebar:p.jsx(E3,{navigation:t}),children:p.jsx(At.Outlet,{})}),children:t}]},{path:"*",element:p.jsx(e6,{})}]}],[r,t,e.login,e.root]),a=x.useMemo(()=>At.createBrowserRouter(i,{basename:n}),[n,i]);return p.jsx(nxe,{navigation:t,children:p.jsx(At.RouterProvider,{router:a})})}function ixe(e){return e.replace(/^\//,"")}function P3(e,t){for(const n of e){if("id"in n&&n.id===t)return n;if("children"in n){const r=P3(n.children,t);if(r)return r}}}function j3(e,t){for(let n=0;n<e.length;n++){const r=e[n];if("id"in r&&r.id===t)return e.splice(n,1),r;if("children"in r){const i=j3(r.children,t);if(i)return i}}}function $3(e,t,n){for(const r of e)if("id"in r&&r.id===t){const i=r;"children"in r||(i.children=[]),i.children.push(n);return}else"children"in r&&$3(r.children,t,n)}function D3(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r+1,0,n);return}else"children"in i&&D3(i.children,t,n)}}function M3(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r,0,n);return}else"children"in i&&M3(i.children,t,n)}}function I3(){const e=txe();return x.useCallback((t,n)=>{let r=e[t]??"";const i=n==null?void 0:n.params,a=n==null?void 0:n.query;return r?(i&&(r=Object.keys(i).reduce((o,l)=>{let s=i[l];return s===void 0?o:(s=encodeURIComponent(s.toString()),o.replace(`:${l}`,s))},r)),a&&(r=`${r}?${Object.keys(a).map(o=>{let l=a[o];return l===void 0?"":(l=encodeURIComponent(l.toString()),`${o}=${l}`)}).join("&").replace("/&&/g","&")}`)):console.error(`Page id ${t} not found`),r},[e])}function axe(){const e=At.useNavigate(),t=I3();return(n,r)=>{const i=t(n,r);i&&e(i)}}function L3(e){const{loading:t}=e,[n,r]=x.useState((e==null?void 0:e.initialTabIndex)??0),i=x.useCallback((s,c)=>r(c),[r]),a=x.Children.toArray(e.children),o=a.map((s,c)=>{if(x.isValidElement(s)&&s.type===Bb){const u=s.props.label;return p.jsx(T.Tab,{title:u||p.jsx(T.Skeleton,{width:"60px"}),eventKey:c},u??c)}return s}),l=a[n];return t?p.jsx(L3,{children:p.jsx(Bb,{children:p.jsx(T.PageSection,{variant:"light",children:p.jsx(T.Skeleton,{})})})}):p.jsxs(p.Fragment,{children:[p.jsx(T.Tabs,{activeKey:n,onSelect:i,inset:{default:"insetSm"},isBox:!0,style:{backgroundColor:"var(--pf-v5-c-tabs__link--BackgroundColor)"},children:o}),l]})}function Bb(e){return p.jsx(p.Fragment,{children:e.children})}const WOe="",F3=x.createContext({});function Fc(){return x.useContext(F3)}function oxe(e){const[t,n]=x.useState(!1),[r,i]=x.useState(null),[a,o]=x.useState({}),[l,s]=x.useState(e.defaultValue??{}),[c,u]=x.useState({}),f=x.useMemo(()=>{function d(h,m){return h.hidden&&h.hidden(m)?null:h}return e.steps.filter(h=>d(h,a))},[e.steps,a]);return x.useEffect(()=>{!r&&f.length>0&&i(f[0])},[r,f]),p.jsx(F3.Provider,{value:{wizardData:a,setWizardData:o,stepData:l,setStepData:s,steps:f,activeStep:r,setActiveStep:i,stepError:c,setStepError:u,isToggleExpanded:t,setToggleExpanded:n},children:e.children})}function N3(e){const{t}=st(),{activeStep:n,steps:r}=Fc(),i=(n==null?void 0:n.id)===r[r.length-1].id,a=t(i?"Finish":"Next"),o=(n==null?void 0:n.id)===r[0].id,l=o?"pf-v5-c-button pf-m-disabled":"pf-v5-c-button pf-m-secondary";return p.jsxs("footer",{className:"pf-v5-c-wizard__footer border-top bg-lighten","data-cy":"wizard-footer",children:[n!==null&&"inputs"in n?p.jsx(mb,{style:{minWidth:10},children:a}):p.jsx("button",{"data-cy":"wizard-next",className:"pf-v5-c-button pf-m-primary",type:"submit",onClick:e.onNext,children:a}),p.jsx("button",{type:"button","data-cy":"wizard-back",className:l,disabled:o,onClick:e.onBack,children:t("Back")}),p.jsx("div",{"data-cy":"wizard-cancel",className:"pf-v5-c-wizard__footer-cancel",children:p.jsx("button",{className:"pf-v5-c-button pf-m-link",type:"button",onClick:e.onCancel,children:t("Cancel")})})]})}function lxe(e){const t=At.useNavigate(),{onSubmit:n,onCancel:r,errorAdapter:i}=e,{activeStep:a,steps:o,stepData:l,wizardData:s,setWizardData:c,setStepData:u,setActiveStep:f}=Fc(),d=x.useCallback(()=>{r?r():t(-1)},[t,r]),h=x.useCallback(g=>{if(a!==null){if((a==null?void 0:a.id)===o[o.length-1].id)return n(s);const _=o.findIndex(S=>S.id===(a==null?void 0:a.id)),b=o[_+1];c(S=>({...S,...g})),u(S=>({...S,[a==null?void 0:a.id]:g})),f(b)}return Promise.resolve()},[a,s,n,o,c,u,f]),m=x.useCallback(()=>{const g=o.findIndex(_=>_.id===(a==null?void 0:a.id)),y=o[g-1];f(y)},[a,o,f]);return p.jsx(p.Fragment,{children:a!==null&&("inputs"in a?p.jsxs(z6,{onSubmit:h,footer:p.jsx(N3,{onBack:m,onCancel:d}),defaultValue:l[a.id],errorAdapter:i,children:[p.jsx(sxe,{}),a.inputs]},a.id):p.jsxs("div",{"data-cy":`wizard-section-${a.id}`,style:{display:"flex",flexDirection:"column",height:"100%"},children:[p.jsx(T.PageSection,{variant:"light",isFilled:!0,hasOverflowScroll:!0,children:a==null?void 0:a.element}),p.jsx(N3,{onNext:()=>void h({}),onBack:m,onCancel:d})]}))})}function sxe(){const{activeStep:e,setStepError:t}=Fc(),{errors:n}=qy(),r=JSON.stringify(n);return x.useEffect(()=>{Object.keys(n).length===0?t({}):e&&t({[e.id]:n})},[n,e,t,r]),null}function cxe(){const{activeStep:e,steps:t,isToggleExpanded:n,setActiveStep:r,stepError:i}=Fc(),a=n?"pf-v5-c-wizard__nav pf-m-expanded":"pf-v5-c-wizard__nav bg-lighten",o=l=>{const s=t[l];s&&r(s)};if(e)return p.jsx("nav",{className:a,"aria-label":"Steps","data-cy":"wizard-nav",children:p.jsx("ol",{className:"pf-v5-c-wizard__nav-list",children:t.map((l,s)=>{const c=t.findIndex(d=>d.id===e.id),u=s>c,f="pf-v5-c-wizard__nav-link"+(e.id===l.id?" pf-m-current":"")+(u?" pf-m-disabled":"");return p.jsx("li",{className:"pf-v5-c-wizard__nav-item","data-cy":`wizard-nav-item-${l.id}`,children:p.jsxs("button",{className:f,onClick:()=>o(s),disabled:u,children:[" ",l.label,i[l.id]&&e.id===l.id&&p.jsx("span",{style:{marginLeft:"8px"},children:p.jsx(Ce.ExclamationCircleIcon,{color:"#C9190B"})})]})},l.id)})})})}function uxe(){const{t:e}=st(),{activeStep:t,isToggleExpanded:n,setToggleExpanded:r}=Fc(),i=x.useCallback(()=>r(a=>!a),[r]);return p.jsxs("button",{onClick:i,className:ae(ts.wizardToggle,n&&"pf-m-expanded"),"aria-label":e("Wizard toggle"),"aria-expanded":n,"data-cy":"wizard-toggle",children:[p.jsx("span",{className:ae(ts.wizardToggleList),children:p.jsxs("span",{className:ae(ts.wizardToggleListItem),children:[p.jsx("span",{className:ae(ts.wizardToggleNum),children:1})," ",t==null?void 0:t.label]})}),p.jsx("span",{className:ae(ts.wizardToggleIcon),children:p.jsx(Ce.CaretDownIcon,{"aria-hidden":"true"})})]})}function fxe(e){return p.jsx(oxe,{steps:e.steps,defaultValue:e.defaultValue,children:p.jsxs("div",{className:"pf-v5-c-wizard","data-cy":"wizard",style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%",overflow:"hidden"},children:[p.jsx(uxe,{}),p.jsxs("div",{className:"pf-v5-c-wizard__outer-wrap",style:{display:"flex",flexDirection:"column",overflow:"hidden",minHeight:0},children:[p.jsx(cxe,{}),p.jsx(lxe,{errorAdapter:e.errorAdapter,onCancel:e.onCancel,onSubmit:e.onSubmit})]})]})})}function dxe(){return p.jsx(T.PageSection,{isFilled:!0,variant:"light",children:p.jsx(T.Bullseye,{children:p.jsx(T.Spinner,{})})})}function hxe(e){return p.jsxs(x.Fragment,{children:[p.jsx(O3,{breadcrumbs:e.breadcrumbs?[{label:p.jsx(T.Skeleton,{width:"150px"})}]:void 0,title:p.jsx(T.Skeleton,{width:"200px"})}),e.tabs&&p.jsx(T.PageSection,{variant:"light",style:{paddingTop:8,paddingBottom:8},children:p.jsx(T.Skeleton,{width:"150px"})}),p.jsx(T.Divider,{}),p.jsx(dxe,{})]})}const mxe=x7`
527
527
  from {
528
528
  transform: rotate(0);
529
529
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ansible/ansible-ui-framework",
3
3
  "description": "A framework for building applications using PatternFly.",
4
- "version": "2.4.658",
4
+ "version": "2.4.660",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",