@ansible/ansible-ui-framework 2.4.539 → 2.4.541

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -45791,7 +45791,7 @@ function tAe(e) {
45791
45791
  }
45792
45792
  function nAe(e) {
45793
45793
  const { navigation: t } = e, n = A1();
45794
- return /* @__PURE__ */ v.jsx(v.Fragment, { children: /* @__PURE__ */ v.jsx(yj, { isSidebarOpen: n.isOpen, className: "bg-lighten-2", children: /* @__PURE__ */ v.jsx(bj, { children: /* @__PURE__ */ v.jsx(_j, { "data-cy": "page-navigation", className: "side-nav", children: /* @__PURE__ */ v.jsx(xj, { children: /* @__PURE__ */ v.jsx(xf, { baseRoute: "", items: t }) }) }) }) }) });
45794
+ return /* @__PURE__ */ v.jsx(v.Fragment, { children: /* @__PURE__ */ v.jsx(yj, { isSidebarOpen: n.isOpen, className: "bg-lighten", children: /* @__PURE__ */ v.jsx(bj, { children: /* @__PURE__ */ v.jsx(_j, { "data-cy": "page-navigation", className: "side-nav", children: /* @__PURE__ */ v.jsx(xj, { children: /* @__PURE__ */ v.jsx(xf, { baseRoute: "", items: t }) }) }) }) }) });
45795
45795
  }
45796
45796
  function xf(e) {
45797
45797
  return /* @__PURE__ */ v.jsx(v.Fragment, { children: e.items.map((t, n) => /* @__PURE__ */ v.jsx(rAe, { item: t, baseRoute: e.baseRoute }, n)) });
@@ -45823,7 +45823,7 @@ function rAe(e) {
45823
45823
  id: a,
45824
45824
  href: l,
45825
45825
  isActive: u,
45826
- className: u ? "bg-lighten-2" : void 0,
45826
+ className: u ? "bg-lighten" : void 0,
45827
45827
  onClick: () => o(l),
45828
45828
  "data-cy": a,
45829
45829
  children: t.label
@@ -45940,17 +45940,20 @@ function uAe(e, t, n) {
45940
45940
  }
45941
45941
  function fAe() {
45942
45942
  const e = iAe();
45943
- return (t, n) => {
45944
- let r = e[t] ?? "";
45945
- const i = n == null ? void 0 : n.params, a = n == null ? void 0 : n.query;
45946
- return r ? (i && (r = Object.keys(i).reduce((o, l) => {
45947
- let s = i[l];
45948
- return s === void 0 ? o : (s = encodeURIComponent(s.toString()), o.replace(`:${l}`, s));
45949
- }, r)), a && (r = `${r}?${Object.keys(a).map((o) => {
45950
- let l = a[o];
45951
- return l === void 0 ? "" : (l = encodeURIComponent(l.toString()), `${o}=${l}`);
45952
- }).join("&").replace("/&&/g", "&")}`)) : console.error(`Page id ${t} not found`), r;
45953
- };
45943
+ return pe(
45944
+ (t, n) => {
45945
+ let r = e[t] ?? "";
45946
+ const i = n == null ? void 0 : n.params, a = n == null ? void 0 : n.query;
45947
+ return r ? (i && (r = Object.keys(i).reduce((o, l) => {
45948
+ let s = i[l];
45949
+ return s === void 0 ? o : (s = encodeURIComponent(s.toString()), o.replace(`:${l}`, s));
45950
+ }, r)), a && (r = `${r}?${Object.keys(a).map((o) => {
45951
+ let l = a[o];
45952
+ return l === void 0 ? "" : (l = encodeURIComponent(l.toString()), `${o}=${l}`);
45953
+ }).join("&").replace("/&&/g", "&")}`)) : console.error(`Page id ${t} not found`), r;
45954
+ },
45955
+ [e]
45956
+ );
45954
45957
  }
45955
45958
  function mEe() {
45956
45959
  const e = El(), t = fAe();
package/index.umd.cjs CHANGED
@@ -517,7 +517,7 @@ ${s}${p}`:`
517
517
  `))&&(f=!0),h.push(C),d=h.length}let m;const{start:p,end:y}=r;if(h.length===0)m=p+y;else if(f||(f=h.reduce((b,S)=>b+S.length+2,2)>zh.maxFlowStringSingleLineLength),f){m=p;for(const _ of h)m+=_?`
518
518
  ${l}${o}${_}`:`
519
519
  `;m+=`
520
- ${o}${y}`}else m=`${p}${s}${h.join(" ")}${s}${y}`;return e&&(m+=lo(m,o,c(e)),a&&a()),m}function qh({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Lc(t(r),e);n.push(a.trimStart())}}function so(e,t){const n=Yt(t)?t.value:t;for(const r of e)if(an(r)&&(r.key===t||r.key===n||Yt(r.key)&&r.key.value===n))return r}class Tl extends zh{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(ao,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=new this(t),l=(s,c)=>{if(typeof a=="function")c=a.call(n,s,c);else if(Array.isArray(a)&&!a.includes(s))return;(c!==void 0||i)&&o.items.push(Db(s,c,r))};if(n instanceof Map)for(const[s,c]of n)l(s,c);else if(n&&typeof n=="object")for(const s of Object.keys(n))l(s,n[s]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let r;an(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Wi(t,t==null?void 0:t.value):r=new Wi(t.key,t.value);const i=so(this.items,r.key),a=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Yt(i.value)&&i3(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const l=this.items.findIndex(s=>a(r,s)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=so(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=so(this.items,t),i=r==null?void 0:r.value;return(!n&&Yt(i)?i.value:i)??void 0}has(t){return!!so(this.items,t)}set(t,n){this.add(new Wi(t,n),!0)}toJSON(t,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const a of this.items)c3(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!an(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),u3(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}class f3 extends zh{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(jc,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Yh(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Yh(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Yt(i)?i.value:i}has(t){const n=Yh(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Yh(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Yt(i)&&i3(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let i=0;for(const a of this.items)r.push($r(a,String(i++),n));return r}toString(t,n,r){return t?u3(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof i=="function"){const s=n instanceof Set?l:String(o++);l=i.call(n,s,l)}a.items.push(Rh(l,void 0,r))}}return a}}function Yh(e){let t=Yt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}function $xe(e,t,n){const{replacer:r}=n,i=new f3(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let l,s;if(Array.isArray(o))if(o.length===2)l=o[0],s=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)l=c[0],s=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(Db(l,s,n))}return i}class Mb extends f3{constructor(){super(),this.add=Tl.prototype.add.bind(this),this.delete=Tl.prototype.delete.bind(this),this.get=Tl.prototype.get.bind(this),this.has=Tl.prototype.has.bind(this),this.set=Tl.prototype.set.bind(this),this.tag=Mb.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let a,o;if(an(i)?(a=$r(i.key,"",n),o=$r(i.value,a,n)):a=$r(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=$xe(t,n,r),a=new this;return a.items=i.items,a}}Mb.tag="tag:yaml.org,2002:omap";class Ib extends Tl{constructor(t){super(t),this.tag=Ib.tag}add(t){let n;an(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Wi(t.key,null):n=new Wi(t,null),so(this.items,n.key)||this.items.push(n)}get(t,n){const r=so(this.items,t);return!n&&an(r)?Yt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=so(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Wi(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push(Db(o,null,r));return a}}Ib.tag="tag:yaml.org,2002:set";class Lb extends Error{constructor(t,n,r,i,a){super(t),Object.setPrototypeOf(this,Lb.prototype),this.name="RequestError",this.details=n,this.statusCode=r,this.body=i,this.json=a}}function Fxe(e){return e instanceof Lb}const Nxe=e=>{const t=[],n=[];if(Fxe(e)){const r=e.json;for(const i in r){const a=r[i];if(i==="non_field_errors"&&Array.isArray(a))a.forEach(o=>{typeof o=="string"&&t.push({message:o})});else if(Array.isArray(a)){const o=a[0];typeof o=="string"&&n.push({name:i,message:o})}}}else e instanceof Error&&t.push({message:e.message});return{genericErrors:t,fieldErrors:n}};function d3(e){const{errorAdapter:t=Nxe}=e,n=x6({defaultValues:e.defaultValue??{}}),[r]=Ot(),{handleSubmit:i,setError:a}=n,[o,l]=x.useState(null),s=Tn("md"),[c]=x.useContext(wo),u=e.isVertical?!1:c.formLayout==="horizontal",f=m=>{const{genericErrors:p,fieldErrors:y}=t(m);p.length>0?l(p.map(_=>_.message)):l(null),y.length>0&&y.forEach(_=>{a(_.name,{message:typeof _.message=="string"?_.message:void 0})})};let d=e.children;return e.disableGrid!==!0&&(d=v.jsx(h3,{isVertical:e.isVertical,singleColumn:e.singleColumn,children:e.children})),v.jsx(Hve,{...n,children:v.jsxs(T.Form,{onSubmit:i(async(m,p)=>{var _,b;l(null);let y=!1;p!==void 0&&((_=p==null?void 0:p.nativeEvent)!=null&&_.submitter)&&(y=((b=p.nativeEvent.submitter)==null?void 0:b.innerHTML)===e.additionalActionText);try{await e.onSubmit(m,S=>l(S),a,y?n:void 0)}catch(S){f(S)}}),isHorizontal:u,autoComplete:"off",style:{display:"flex",flexDirection:"column",flexGrow:1,height:"100%",maxHeight:"100%",overflow:"hidden",gap:0},children:[o&&v.jsx(dxe,{error:o,isMd:s,onCancel:e.onCancel}),v.jsx(Zi,{children:v.jsx(T.PageSection,{variant:"light",isFilled:!0,isWidthLimited:!0,padding:{default:e.disablePadding?"noPadding":"padding"},children:d})}),e.footer?e.footer:v.jsx(T.PageSection,{variant:"light",isFilled:!1,children:v.jsxs(T.ActionGroup,{children:[v.jsx($b,{children:e.submitText}),e.additionalActionText?v.jsx(T.Button,{"aria-label":e.additionalActionText,type:"submit",variant:"secondary",children:e.additionalActionText}):null,e.onCancel&&v.jsx(m3,{onCancel:e.onCancel,children:e.cancelText??r.cancelText})]})})]})})}function h3(e){const[t]=x.useContext(wo),n=e.isVertical?!1:t.formLayout==="horizontal",r=e.singleColumn?!1:t.formColumns==="multiple",i=12,a=r?n?12:6:12,o=r?6:12,l=r?6:12,s=r?4:12;return v.jsx(T.Grid,{hasGutter:!0,span:12,sm:i,md:a,lg:o,xl:l,xl2:s,children:e.children})}function $b(e){const{isSubmitting:t,errors:n}=Uy(),{clearErrors:r}=x6(),{t:i}=xt(),a=n&&Object.keys(n).length>0;return v.jsx(T.Tooltip,{content:i("Please fix errors"),trigger:a?void 0:"manual",children:v.jsx(T.Button,{onClick:()=>{a&&r()},"data-cy":"Submit",type:"submit",isDisabled:t,isLoading:t,isDanger:a,variant:a?"secondary":void 0,style:e.style,children:e.children})})}function m3(e){return v.jsx(T.Button,{"data-cy":"Cancel",type:"button",variant:"link",onClick:e.onCancel,children:e.children})}const jOe="",Fb=x.createContext({isOpen:!1,setState:()=>({})});function Kh(){return x.useContext(Fb)}function p3(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]),v.jsx(Fb.Provider,{value:{isOpen:n,setState:i},children:e.children})}function g3(){const e=Xt.useNavigate(),t=Tn("xl"),n=Kh();return x.useCallback(i=>{e(i),t||n.setState({isOpen:!n.isOpen})},[e,t,n])}function v3(e){return v.jsx(d5,{children:v.jsx(E5,{children:v.jsx(_5,{children:v.jsx(v5,{children:v.jsx(p3,{children:e.children})})})})})}function Rxe(e){const t=Xt.useNavigate();return e.breadcrumbs?v.jsx(T.Breadcrumb,{style:e.style,children:e.breadcrumbs.map((n,r)=>n.label?v.jsx(T.BreadcrumbItem,{"data-cy":n.label,id:n.id,component:n.component,isActive:n.to===void 0,children:n.to?v.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):v.jsx(x.Fragment,{},r))}):v.jsx(x.Fragment,{})}function y3(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 v.jsx(T.PageSection,{variant:T.PageSectionVariants.light,className:"bg-lighten border-bottom",style:{paddingTop:s?16:12,paddingBottom:s?16:12},children:v.jsxs(T.Stack,{hasGutter:!0,children:[v.jsxs(T.Flex,{flexWrap:{default:"nowrap"},alignItems:{default:"alignItemsStretch"},children:[v.jsxs(T.FlexItem,{grow:{default:"grow"},children:[t&&v.jsx(Rxe,{breadcrumbs:t,style:{paddingBottom:l?6:4}}),n?e.titleHelp?v.jsx(T.Popover,{headerContent:e.titleHelpTitle,bodyContent:v.jsxs(T.Stack,{hasGutter:!0,children:[typeof e.titleHelp=="string"?v.jsx(T.StackItem,{children:e.titleHelp}):e.titleHelp.map((f,d)=>v.jsx(T.StackItem,{children:f},d)),e.titleDocLink&&v.jsx(T.StackItem,{children:v.jsx(T.Button,{icon:v.jsx(Ae.ExternalLinkAltIcon,{}),variant:"link",onClick:()=>window.open(e.titleDocLink,"_blank"),isInline:!0,children:u.documentation})})]}),position:"bottom-start",children:v.jsxs(T.Title,{"data-cy":"page-title",headingLevel:"h1",children:[n,v.jsx(T.Button,{variant:"link",style:{padding:0,marginTop:1,marginLeft:8,verticalAlign:"top"},children:v.jsx(Ae.OutlinedQuestionCircleIcon,{})})]})}):v.jsx(T.Title,{"data-cy":"page-title",headingLevel:"h1",children:n}):v.jsx(T.Title,{headingLevel:"h1",children:v.jsx(T.Skeleton,{width:"160px"})}),c&&r&&v.jsx(T.Text,{"data-cy":"app-description",component:"p",style:{paddingTop:s?4:2,opacity:.8},children:typeof r=="string"?v.jsx(T.Truncate,{content:r}):v.jsx(T.Stack,{children:r.map(f=>v.jsx(T.StackItem,{children:f},f))})})]}),n&&(a||i)&&v.jsxs(T.Flex,{"data-cy":"manage-view",direction:{default:"column"},spaceItems:{default:"spaceItemsSm",xl:"spaceItemsMd"},justifyContent:{default:"justifyContentCenter"},children:[i&&v.jsx(T.FlexItem,{grow:{default:"grow"},children:i}),a&&v.jsx(T.FlexItem,{children:a})]})]}),o]})})}function b3(e){const[t]=Ot();return v.jsx(y5,{message:t.errorText,children:v.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%",backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:e.children})})}function zxe(e){const t=Tn("sm");return v.jsxs(T.Masthead,{display:{default:"inline"},style:{borderBottom:"1px solid #fff4"},children:[v.jsx(_3,{}),v.jsx(T.MastheadMain,{children:v.jsx(T.MastheadBrand,{component:"a",children:e.icon})}),v.jsx(T.MastheadContent,{style:{marginLeft:0},children:v.jsx(T.Toolbar,{id:"toolbar","data-cy":"toolbar",inset:{default:"insetNone"},children:v.jsxs(T.ToolbarContent,{children:[t&&v.jsx(T.ToolbarItem,{children:v.jsxs(T.Stack,{style:{color:"white",cursor:"default",marginTop:-2,marginBottom:-2},children:[e.brand&&v.jsx(T.Text,{style:{marginTop:-6},children:v.jsx(T.Truncate,{content:e.brand,style:{minWidth:0}})}),v.jsx(T.Title,{headingLevel:"h1",style:{lineHeight:1},children:v.jsx(T.Truncate,{content:e.title,style:{minWidth:0}})})]})}),e.children]})})})]})}function _3(){const e=Kh();return v.jsx(T.MastheadToggle,{onClick:()=>e.setState({isOpen:!e.isOpen}),children:v.jsx(T.PageToggleButton,{"data-cy":"nav-toggle",variant:"plain","aria-label":"Global navigation",children:v.jsx(Ae.BarsIcon,{})})})}function Bxe(e){const{t}=xt(),n=Xt.useNavigate(),{dashboardUrl:r}=e;return React.createElement(T.EmptyState,{isFullHeight:!0},React.createElement(T.EmptyStateHeader,{titleText:React.createElement(React.Fragment,null,t("Page not found")),icon:React.createElement(T.EmptyStateIcon,{icon:Ae.ExclamationCircleIcon}),headingLevel:"h2"}),React.createElement(T.EmptyStateBody,null,t("We could not find that page.")),React.createElement(T.EmptyStateFooter,null,React.createElement(T.EmptyStateActions,null,React.createElement(T.Stack,{hasGutter:!0},React.createElement(T.Button,{onClick:()=>n(-1)},t("Return to previous page")),React.createElement(T.Button,{component:i=>React.createElement(Xt.Link,{to:r,...i})},t("Return to dashboard"))))))}const DOe="";function x3(e){const{navigation:t}=e,n=Kh();return v.jsx(v.Fragment,{children:v.jsx(T.PageSidebar,{isSidebarOpen:n.isOpen,className:"bg-lighten-2",children:v.jsx(T.PageSidebarBody,{children:v.jsx(T.Nav,{"data-cy":"page-navigation",className:"side-nav",children:v.jsx(T.NavList,{children:v.jsx(Xh,{baseRoute:"",items:t})})})})})})}function Xh(e){return v.jsx(v.Fragment,{children:e.items.map((t,n)=>v.jsx(Wxe,{item:t,baseRoute:e.baseRoute},n))})}function Wxe(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=g3();let l=e.baseRoute+"/"+t.path;if(l=l.replace("//","/"),t.path==="/"&&"children"in t)return v.jsx(Xh,{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 v.jsx(T.NavItem,{id:a,href:l,isActive:u,className:u?"bg-lighten-2":void 0,onClick:()=>o(l),"data-cy":a,children:t.label})}return!s||t.label===void 0?null:t.label?v.jsx(T.NavExpandable,{title:t.label,isActive:location.pathname.startsWith(l),isExpanded:n,onExpand:(u,f)=>i(f),children:v.jsx(Xh,{items:t.children,baseRoute:l})}):v.jsx(Xh,{items:t.children,baseRoute:l})}const S3=x.createContext({});function Vxe(){return x.useContext(S3)}function Hxe(e){const t=x.useMemo(()=>w3("",e.navigation),[e.navigation]);return v.jsx(S3.Provider,{value:t,children:e.children})}function w3(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,w3(i,r.children))}),n}function Uxe(e){const{navigation:t,basename:n,masthead:r}=e,i=x.useMemo(()=>[{path:"",element:v.jsx(v3,{children:v.jsx(Xt.Outlet,{})}),children:[{path:"login",element:e.login},{path:"",element:e.root??v.jsx(v.Fragment,{}),children:[{path:"",element:v.jsx(T.Page,{header:r,sidebar:v.jsx(x3,{navigation:t}),children:v.jsx(b3,{children:v.jsx(Xt.Outlet,{})})}),children:t}]},{path:"*",element:v.jsx(Bxe,{})}]}],[r,t,e.login,e.root]),a=x.useMemo(()=>Xt.createBrowserRouter(i,{basename:n}),[n,i]);return v.jsx(Hxe,{navigation:t,children:v.jsx(Xt.RouterProvider,{router:a})})}function Gxe(e){return e.replace(/^\//,"")}function C3(e,t){for(const n of e){if("id"in n&&n.id===t)return n;if("children"in n){const r=C3(n.children,t);if(r)return r}}}function O3(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=O3(r.children,t);if(i)return i}}}function T3(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&&T3(r.children,t,n)}function E3(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&&E3(i.children,t,n)}}function A3(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&&A3(i.children,t,n)}}function k3(){const e=Vxe();return(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}}function qxe(){const e=Xt.useNavigate(),t=k3();return(n,r)=>{const i=t(n,r);i&&e(i)}}function P3(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===Nb){const u=s.props.label;return v.jsx(T.Tab,{title:u||v.jsx(T.Skeleton,{width:"60px"}),eventKey:c},u??c)}return s}),l=a[n];return t?v.jsx(P3,{children:v.jsx(Nb,{children:v.jsx(T.PageSection,{variant:"light",children:v.jsx(T.Skeleton,{})})})}):v.jsxs(v.Fragment,{children:[v.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 Nb(e){return v.jsx(v.Fragment,{children:e.children})}const MOe="",j3=x.createContext({});function Fc(){return x.useContext(j3)}function Yxe(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]),v.jsx(j3.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 D3(e){const{t}=xt(),{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 v.jsxs("footer",{className:"pf-v5-c-wizard__footer border-top bg-lighten","data-cy":"wizard-footer",children:[n!==null&&"inputs"in n?v.jsx($b,{style:{minWidth:10},children:a}):v.jsx("button",{"data-cy":"wizard-next",className:"pf-v5-c-button pf-m-primary",type:"submit",onClick:e.onNext,children:a}),v.jsx("button",{type:"button","data-cy":"wizard-back",className:l,disabled:o,onClick:e.onBack,children:t("Back")}),v.jsx("div",{"data-cy":"wizard-cancel",className:"pf-v5-c-wizard__footer-cancel",children:v.jsx("button",{className:"pf-v5-c-button pf-m-link",type:"button",onClick:e.onCancel,children:t("Cancel")})})]})}function Kxe(e){const t=Xt.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(p=>{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,...p})),u(S=>({...S,[a==null?void 0:a.id]:p})),f(b)}return Promise.resolve()},[a,s,n,o,c,u,f]),m=x.useCallback(()=>{const p=o.findIndex(_=>_.id===(a==null?void 0:a.id)),y=o[p-1];f(y)},[a,o,f]);return v.jsx(v.Fragment,{children:a!==null&&("inputs"in a?v.jsxs(d3,{onSubmit:h,footer:v.jsx(D3,{onBack:m,onCancel:d}),disableBody:!0,defaultValue:l[a.id],errorAdapter:i,children:[v.jsx(Xxe,{}),a.inputs]},a.id):v.jsxs("div",{"data-cy":`wizard-section-${a.id}`,style:{display:"flex",flexDirection:"column",height:"100%"},children:[v.jsx(T.PageSection,{variant:"light",isFilled:!0,hasOverflowScroll:!0,children:a==null?void 0:a.element}),v.jsx(D3,{onNext:()=>void h({}),onBack:m,onCancel:d})]}))})}function Xxe(){const{activeStep:e,setStepError:t}=Fc(),{errors:n}=Uy(),r=JSON.stringify(n);return x.useEffect(()=>{Object.keys(n).length===0?t({}):e&&t({[e.id]:n})},[n,e,t,r]),null}function Zxe(){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 v.jsx("nav",{className:a,"aria-label":"Steps","data-cy":"wizard-nav",children:v.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 v.jsx("li",{className:"pf-v5-c-wizard__nav-item","data-cy":`wizard-nav-item-${l.id}`,children:v.jsxs("button",{className:f,onClick:()=>o(s),disabled:u,children:[" ",l.label,i[l.id]&&e.id===l.id&&v.jsx("span",{style:{marginLeft:"8px"},children:v.jsx(Ae.ExclamationCircleIcon,{color:"#C9190B"})})]})},l.id)})})})}function Jxe(){const{t:e}=xt(),{activeStep:t,isToggleExpanded:n,setToggleExpanded:r}=Fc(),i=x.useCallback(()=>r(a=>!a),[r]);return v.jsxs("button",{onClick:i,className:ae(es.wizardToggle,n&&"pf-m-expanded"),"aria-label":e("Wizard toggle"),"aria-expanded":n,"data-cy":"wizard-toggle",children:[v.jsx("span",{className:ae(es.wizardToggleList),children:v.jsxs("span",{className:ae(es.wizardToggleListItem),children:[v.jsx("span",{className:ae(es.wizardToggleNum),children:1})," ",t==null?void 0:t.label]})}),v.jsx("span",{className:ae(es.wizardToggleIcon),children:v.jsx(Ae.CaretDownIcon,{"aria-hidden":"true"})})]})}function Qxe(e){return v.jsx(Yxe,{steps:e.steps,defaultValue:e.defaultValue,children:v.jsxs("div",{className:"pf-v5-c-wizard","data-cy":"wizard",style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%",overflow:"hidden"},children:[v.jsx(Jxe,{}),v.jsxs("div",{className:"pf-v5-c-wizard__outer-wrap",style:{display:"flex",flexDirection:"column",overflow:"hidden",minHeight:0},children:[v.jsx(Zxe,{}),v.jsx(Kxe,{errorAdapter:e.errorAdapter,onCancel:e.onCancel,onSubmit:e.onSubmit})]})]})})}function e1e(){return v.jsx(T.PageSection,{isFilled:!0,variant:"light",children:v.jsx(T.Bullseye,{children:v.jsx(T.Spinner,{})})})}function t1e(e){return v.jsxs(x.Fragment,{children:[v.jsx(y3,{breadcrumbs:e.breadcrumbs?[{label:v.jsx(T.Skeleton,{width:"150px"})}]:void 0,title:v.jsx(T.Skeleton,{width:"200px"})}),e.tabs&&v.jsx(T.PageSection,{variant:"light",style:{paddingTop:8,paddingBottom:8},children:v.jsx(T.Skeleton,{width:"150px"})}),v.jsx(T.Divider,{}),v.jsx(e1e,{})]})}const n1e=pD`
520
+ ${o}${y}`}else m=`${p}${s}${h.join(" ")}${s}${y}`;return e&&(m+=lo(m,o,c(e)),a&&a()),m}function qh({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Lc(t(r),e);n.push(a.trimStart())}}function so(e,t){const n=Yt(t)?t.value:t;for(const r of e)if(an(r)&&(r.key===t||r.key===n||Yt(r.key)&&r.key.value===n))return r}class Tl extends zh{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(ao,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=new this(t),l=(s,c)=>{if(typeof a=="function")c=a.call(n,s,c);else if(Array.isArray(a)&&!a.includes(s))return;(c!==void 0||i)&&o.items.push(Db(s,c,r))};if(n instanceof Map)for(const[s,c]of n)l(s,c);else if(n&&typeof n=="object")for(const s of Object.keys(n))l(s,n[s]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let r;an(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Wi(t,t==null?void 0:t.value):r=new Wi(t.key,t.value);const i=so(this.items,r.key),a=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Yt(i.value)&&i3(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const l=this.items.findIndex(s=>a(r,s)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=so(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=so(this.items,t),i=r==null?void 0:r.value;return(!n&&Yt(i)?i.value:i)??void 0}has(t){return!!so(this.items,t)}set(t,n){this.add(new Wi(t,n),!0)}toJSON(t,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const a of this.items)c3(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!an(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),u3(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}class f3 extends zh{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(jc,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Yh(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Yh(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Yt(i)?i.value:i}has(t){const n=Yh(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Yh(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Yt(i)&&i3(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let i=0;for(const a of this.items)r.push($r(a,String(i++),n));return r}toString(t,n,r){return t?u3(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof i=="function"){const s=n instanceof Set?l:String(o++);l=i.call(n,s,l)}a.items.push(Rh(l,void 0,r))}}return a}}function Yh(e){let t=Yt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}function $xe(e,t,n){const{replacer:r}=n,i=new f3(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let l,s;if(Array.isArray(o))if(o.length===2)l=o[0],s=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)l=c[0],s=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(Db(l,s,n))}return i}class Mb extends f3{constructor(){super(),this.add=Tl.prototype.add.bind(this),this.delete=Tl.prototype.delete.bind(this),this.get=Tl.prototype.get.bind(this),this.has=Tl.prototype.has.bind(this),this.set=Tl.prototype.set.bind(this),this.tag=Mb.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let a,o;if(an(i)?(a=$r(i.key,"",n),o=$r(i.value,a,n)):a=$r(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=$xe(t,n,r),a=new this;return a.items=i.items,a}}Mb.tag="tag:yaml.org,2002:omap";class Ib extends Tl{constructor(t){super(t),this.tag=Ib.tag}add(t){let n;an(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Wi(t.key,null):n=new Wi(t,null),so(this.items,n.key)||this.items.push(n)}get(t,n){const r=so(this.items,t);return!n&&an(r)?Yt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=so(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Wi(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push(Db(o,null,r));return a}}Ib.tag="tag:yaml.org,2002:set";class Lb extends Error{constructor(t,n,r,i,a){super(t),Object.setPrototypeOf(this,Lb.prototype),this.name="RequestError",this.details=n,this.statusCode=r,this.body=i,this.json=a}}function Fxe(e){return e instanceof Lb}const Nxe=e=>{const t=[],n=[];if(Fxe(e)){const r=e.json;for(const i in r){const a=r[i];if(i==="non_field_errors"&&Array.isArray(a))a.forEach(o=>{typeof o=="string"&&t.push({message:o})});else if(Array.isArray(a)){const o=a[0];typeof o=="string"&&n.push({name:i,message:o})}}}else e instanceof Error&&t.push({message:e.message});return{genericErrors:t,fieldErrors:n}};function d3(e){const{errorAdapter:t=Nxe}=e,n=x6({defaultValues:e.defaultValue??{}}),[r]=Ot(),{handleSubmit:i,setError:a}=n,[o,l]=x.useState(null),s=Tn("md"),[c]=x.useContext(wo),u=e.isVertical?!1:c.formLayout==="horizontal",f=m=>{const{genericErrors:p,fieldErrors:y}=t(m);p.length>0?l(p.map(_=>_.message)):l(null),y.length>0&&y.forEach(_=>{a(_.name,{message:typeof _.message=="string"?_.message:void 0})})};let d=e.children;return e.disableGrid!==!0&&(d=v.jsx(h3,{isVertical:e.isVertical,singleColumn:e.singleColumn,children:e.children})),v.jsx(Hve,{...n,children:v.jsxs(T.Form,{onSubmit:i(async(m,p)=>{var _,b;l(null);let y=!1;p!==void 0&&((_=p==null?void 0:p.nativeEvent)!=null&&_.submitter)&&(y=((b=p.nativeEvent.submitter)==null?void 0:b.innerHTML)===e.additionalActionText);try{await e.onSubmit(m,S=>l(S),a,y?n:void 0)}catch(S){f(S)}}),isHorizontal:u,autoComplete:"off",style:{display:"flex",flexDirection:"column",flexGrow:1,height:"100%",maxHeight:"100%",overflow:"hidden",gap:0},children:[o&&v.jsx(dxe,{error:o,isMd:s,onCancel:e.onCancel}),v.jsx(Zi,{children:v.jsx(T.PageSection,{variant:"light",isFilled:!0,isWidthLimited:!0,padding:{default:e.disablePadding?"noPadding":"padding"},children:d})}),e.footer?e.footer:v.jsx(T.PageSection,{variant:"light",isFilled:!1,children:v.jsxs(T.ActionGroup,{children:[v.jsx($b,{children:e.submitText}),e.additionalActionText?v.jsx(T.Button,{"aria-label":e.additionalActionText,type:"submit",variant:"secondary",children:e.additionalActionText}):null,e.onCancel&&v.jsx(m3,{onCancel:e.onCancel,children:e.cancelText??r.cancelText})]})})]})})}function h3(e){const[t]=x.useContext(wo),n=e.isVertical?!1:t.formLayout==="horizontal",r=e.singleColumn?!1:t.formColumns==="multiple",i=12,a=r?n?12:6:12,o=r?6:12,l=r?6:12,s=r?4:12;return v.jsx(T.Grid,{hasGutter:!0,span:12,sm:i,md:a,lg:o,xl:l,xl2:s,children:e.children})}function $b(e){const{isSubmitting:t,errors:n}=Uy(),{clearErrors:r}=x6(),{t:i}=xt(),a=n&&Object.keys(n).length>0;return v.jsx(T.Tooltip,{content:i("Please fix errors"),trigger:a?void 0:"manual",children:v.jsx(T.Button,{onClick:()=>{a&&r()},"data-cy":"Submit",type:"submit",isDisabled:t,isLoading:t,isDanger:a,variant:a?"secondary":void 0,style:e.style,children:e.children})})}function m3(e){return v.jsx(T.Button,{"data-cy":"Cancel",type:"button",variant:"link",onClick:e.onCancel,children:e.children})}const jOe="",Fb=x.createContext({isOpen:!1,setState:()=>({})});function Kh(){return x.useContext(Fb)}function p3(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]),v.jsx(Fb.Provider,{value:{isOpen:n,setState:i},children:e.children})}function g3(){const e=Xt.useNavigate(),t=Tn("xl"),n=Kh();return x.useCallback(i=>{e(i),t||n.setState({isOpen:!n.isOpen})},[e,t,n])}function v3(e){return v.jsx(d5,{children:v.jsx(E5,{children:v.jsx(_5,{children:v.jsx(v5,{children:v.jsx(p3,{children:e.children})})})})})}function Rxe(e){const t=Xt.useNavigate();return e.breadcrumbs?v.jsx(T.Breadcrumb,{style:e.style,children:e.breadcrumbs.map((n,r)=>n.label?v.jsx(T.BreadcrumbItem,{"data-cy":n.label,id:n.id,component:n.component,isActive:n.to===void 0,children:n.to?v.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):v.jsx(x.Fragment,{},r))}):v.jsx(x.Fragment,{})}function y3(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 v.jsx(T.PageSection,{variant:T.PageSectionVariants.light,className:"bg-lighten border-bottom",style:{paddingTop:s?16:12,paddingBottom:s?16:12},children:v.jsxs(T.Stack,{hasGutter:!0,children:[v.jsxs(T.Flex,{flexWrap:{default:"nowrap"},alignItems:{default:"alignItemsStretch"},children:[v.jsxs(T.FlexItem,{grow:{default:"grow"},children:[t&&v.jsx(Rxe,{breadcrumbs:t,style:{paddingBottom:l?6:4}}),n?e.titleHelp?v.jsx(T.Popover,{headerContent:e.titleHelpTitle,bodyContent:v.jsxs(T.Stack,{hasGutter:!0,children:[typeof e.titleHelp=="string"?v.jsx(T.StackItem,{children:e.titleHelp}):e.titleHelp.map((f,d)=>v.jsx(T.StackItem,{children:f},d)),e.titleDocLink&&v.jsx(T.StackItem,{children:v.jsx(T.Button,{icon:v.jsx(Ae.ExternalLinkAltIcon,{}),variant:"link",onClick:()=>window.open(e.titleDocLink,"_blank"),isInline:!0,children:u.documentation})})]}),position:"bottom-start",children:v.jsxs(T.Title,{"data-cy":"page-title",headingLevel:"h1",children:[n,v.jsx(T.Button,{variant:"link",style:{padding:0,marginTop:1,marginLeft:8,verticalAlign:"top"},children:v.jsx(Ae.OutlinedQuestionCircleIcon,{})})]})}):v.jsx(T.Title,{"data-cy":"page-title",headingLevel:"h1",children:n}):v.jsx(T.Title,{headingLevel:"h1",children:v.jsx(T.Skeleton,{width:"160px"})}),c&&r&&v.jsx(T.Text,{"data-cy":"app-description",component:"p",style:{paddingTop:s?4:2,opacity:.8},children:typeof r=="string"?v.jsx(T.Truncate,{content:r}):v.jsx(T.Stack,{children:r.map(f=>v.jsx(T.StackItem,{children:f},f))})})]}),n&&(a||i)&&v.jsxs(T.Flex,{"data-cy":"manage-view",direction:{default:"column"},spaceItems:{default:"spaceItemsSm",xl:"spaceItemsMd"},justifyContent:{default:"justifyContentCenter"},children:[i&&v.jsx(T.FlexItem,{grow:{default:"grow"},children:i}),a&&v.jsx(T.FlexItem,{children:a})]})]}),o]})})}function b3(e){const[t]=Ot();return v.jsx(y5,{message:t.errorText,children:v.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%",backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:e.children})})}function zxe(e){const t=Tn("sm");return v.jsxs(T.Masthead,{display:{default:"inline"},style:{borderBottom:"1px solid #fff4"},children:[v.jsx(_3,{}),v.jsx(T.MastheadMain,{children:v.jsx(T.MastheadBrand,{component:"a",children:e.icon})}),v.jsx(T.MastheadContent,{style:{marginLeft:0},children:v.jsx(T.Toolbar,{id:"toolbar","data-cy":"toolbar",inset:{default:"insetNone"},children:v.jsxs(T.ToolbarContent,{children:[t&&v.jsx(T.ToolbarItem,{children:v.jsxs(T.Stack,{style:{color:"white",cursor:"default",marginTop:-2,marginBottom:-2},children:[e.brand&&v.jsx(T.Text,{style:{marginTop:-6},children:v.jsx(T.Truncate,{content:e.brand,style:{minWidth:0}})}),v.jsx(T.Title,{headingLevel:"h1",style:{lineHeight:1},children:v.jsx(T.Truncate,{content:e.title,style:{minWidth:0}})})]})}),e.children]})})})]})}function _3(){const e=Kh();return v.jsx(T.MastheadToggle,{onClick:()=>e.setState({isOpen:!e.isOpen}),children:v.jsx(T.PageToggleButton,{"data-cy":"nav-toggle",variant:"plain","aria-label":"Global navigation",children:v.jsx(Ae.BarsIcon,{})})})}function Bxe(e){const{t}=xt(),n=Xt.useNavigate(),{dashboardUrl:r}=e;return React.createElement(T.EmptyState,{isFullHeight:!0},React.createElement(T.EmptyStateHeader,{titleText:React.createElement(React.Fragment,null,t("Page not found")),icon:React.createElement(T.EmptyStateIcon,{icon:Ae.ExclamationCircleIcon}),headingLevel:"h2"}),React.createElement(T.EmptyStateBody,null,t("We could not find that page.")),React.createElement(T.EmptyStateFooter,null,React.createElement(T.EmptyStateActions,null,React.createElement(T.Stack,{hasGutter:!0},React.createElement(T.Button,{onClick:()=>n(-1)},t("Return to previous page")),React.createElement(T.Button,{component:i=>React.createElement(Xt.Link,{to:r,...i})},t("Return to dashboard"))))))}const DOe="";function x3(e){const{navigation:t}=e,n=Kh();return v.jsx(v.Fragment,{children:v.jsx(T.PageSidebar,{isSidebarOpen:n.isOpen,className:"bg-lighten",children:v.jsx(T.PageSidebarBody,{children:v.jsx(T.Nav,{"data-cy":"page-navigation",className:"side-nav",children:v.jsx(T.NavList,{children:v.jsx(Xh,{baseRoute:"",items:t})})})})})})}function Xh(e){return v.jsx(v.Fragment,{children:e.items.map((t,n)=>v.jsx(Wxe,{item:t,baseRoute:e.baseRoute},n))})}function Wxe(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=g3();let l=e.baseRoute+"/"+t.path;if(l=l.replace("//","/"),t.path==="/"&&"children"in t)return v.jsx(Xh,{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 v.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?v.jsx(T.NavExpandable,{title:t.label,isActive:location.pathname.startsWith(l),isExpanded:n,onExpand:(u,f)=>i(f),children:v.jsx(Xh,{items:t.children,baseRoute:l})}):v.jsx(Xh,{items:t.children,baseRoute:l})}const S3=x.createContext({});function Vxe(){return x.useContext(S3)}function Hxe(e){const t=x.useMemo(()=>w3("",e.navigation),[e.navigation]);return v.jsx(S3.Provider,{value:t,children:e.children})}function w3(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,w3(i,r.children))}),n}function Uxe(e){const{navigation:t,basename:n,masthead:r}=e,i=x.useMemo(()=>[{path:"",element:v.jsx(v3,{children:v.jsx(Xt.Outlet,{})}),children:[{path:"login",element:e.login},{path:"",element:e.root??v.jsx(v.Fragment,{}),children:[{path:"",element:v.jsx(T.Page,{header:r,sidebar:v.jsx(x3,{navigation:t}),children:v.jsx(b3,{children:v.jsx(Xt.Outlet,{})})}),children:t}]},{path:"*",element:v.jsx(Bxe,{})}]}],[r,t,e.login,e.root]),a=x.useMemo(()=>Xt.createBrowserRouter(i,{basename:n}),[n,i]);return v.jsx(Hxe,{navigation:t,children:v.jsx(Xt.RouterProvider,{router:a})})}function Gxe(e){return e.replace(/^\//,"")}function C3(e,t){for(const n of e){if("id"in n&&n.id===t)return n;if("children"in n){const r=C3(n.children,t);if(r)return r}}}function O3(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=O3(r.children,t);if(i)return i}}}function T3(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&&T3(r.children,t,n)}function E3(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&&E3(i.children,t,n)}}function A3(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&&A3(i.children,t,n)}}function k3(){const e=Vxe();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 qxe(){const e=Xt.useNavigate(),t=k3();return(n,r)=>{const i=t(n,r);i&&e(i)}}function P3(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===Nb){const u=s.props.label;return v.jsx(T.Tab,{title:u||v.jsx(T.Skeleton,{width:"60px"}),eventKey:c},u??c)}return s}),l=a[n];return t?v.jsx(P3,{children:v.jsx(Nb,{children:v.jsx(T.PageSection,{variant:"light",children:v.jsx(T.Skeleton,{})})})}):v.jsxs(v.Fragment,{children:[v.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 Nb(e){return v.jsx(v.Fragment,{children:e.children})}const MOe="",j3=x.createContext({});function Fc(){return x.useContext(j3)}function Yxe(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]),v.jsx(j3.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 D3(e){const{t}=xt(),{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 v.jsxs("footer",{className:"pf-v5-c-wizard__footer border-top bg-lighten","data-cy":"wizard-footer",children:[n!==null&&"inputs"in n?v.jsx($b,{style:{minWidth:10},children:a}):v.jsx("button",{"data-cy":"wizard-next",className:"pf-v5-c-button pf-m-primary",type:"submit",onClick:e.onNext,children:a}),v.jsx("button",{type:"button","data-cy":"wizard-back",className:l,disabled:o,onClick:e.onBack,children:t("Back")}),v.jsx("div",{"data-cy":"wizard-cancel",className:"pf-v5-c-wizard__footer-cancel",children:v.jsx("button",{className:"pf-v5-c-button pf-m-link",type:"button",onClick:e.onCancel,children:t("Cancel")})})]})}function Kxe(e){const t=Xt.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(p=>{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,...p})),u(S=>({...S,[a==null?void 0:a.id]:p})),f(b)}return Promise.resolve()},[a,s,n,o,c,u,f]),m=x.useCallback(()=>{const p=o.findIndex(_=>_.id===(a==null?void 0:a.id)),y=o[p-1];f(y)},[a,o,f]);return v.jsx(v.Fragment,{children:a!==null&&("inputs"in a?v.jsxs(d3,{onSubmit:h,footer:v.jsx(D3,{onBack:m,onCancel:d}),disableBody:!0,defaultValue:l[a.id],errorAdapter:i,children:[v.jsx(Xxe,{}),a.inputs]},a.id):v.jsxs("div",{"data-cy":`wizard-section-${a.id}`,style:{display:"flex",flexDirection:"column",height:"100%"},children:[v.jsx(T.PageSection,{variant:"light",isFilled:!0,hasOverflowScroll:!0,children:a==null?void 0:a.element}),v.jsx(D3,{onNext:()=>void h({}),onBack:m,onCancel:d})]}))})}function Xxe(){const{activeStep:e,setStepError:t}=Fc(),{errors:n}=Uy(),r=JSON.stringify(n);return x.useEffect(()=>{Object.keys(n).length===0?t({}):e&&t({[e.id]:n})},[n,e,t,r]),null}function Zxe(){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 v.jsx("nav",{className:a,"aria-label":"Steps","data-cy":"wizard-nav",children:v.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 v.jsx("li",{className:"pf-v5-c-wizard__nav-item","data-cy":`wizard-nav-item-${l.id}`,children:v.jsxs("button",{className:f,onClick:()=>o(s),disabled:u,children:[" ",l.label,i[l.id]&&e.id===l.id&&v.jsx("span",{style:{marginLeft:"8px"},children:v.jsx(Ae.ExclamationCircleIcon,{color:"#C9190B"})})]})},l.id)})})})}function Jxe(){const{t:e}=xt(),{activeStep:t,isToggleExpanded:n,setToggleExpanded:r}=Fc(),i=x.useCallback(()=>r(a=>!a),[r]);return v.jsxs("button",{onClick:i,className:ae(es.wizardToggle,n&&"pf-m-expanded"),"aria-label":e("Wizard toggle"),"aria-expanded":n,"data-cy":"wizard-toggle",children:[v.jsx("span",{className:ae(es.wizardToggleList),children:v.jsxs("span",{className:ae(es.wizardToggleListItem),children:[v.jsx("span",{className:ae(es.wizardToggleNum),children:1})," ",t==null?void 0:t.label]})}),v.jsx("span",{className:ae(es.wizardToggleIcon),children:v.jsx(Ae.CaretDownIcon,{"aria-hidden":"true"})})]})}function Qxe(e){return v.jsx(Yxe,{steps:e.steps,defaultValue:e.defaultValue,children:v.jsxs("div",{className:"pf-v5-c-wizard","data-cy":"wizard",style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%",overflow:"hidden"},children:[v.jsx(Jxe,{}),v.jsxs("div",{className:"pf-v5-c-wizard__outer-wrap",style:{display:"flex",flexDirection:"column",overflow:"hidden",minHeight:0},children:[v.jsx(Zxe,{}),v.jsx(Kxe,{errorAdapter:e.errorAdapter,onCancel:e.onCancel,onSubmit:e.onSubmit})]})]})})}function e1e(){return v.jsx(T.PageSection,{isFilled:!0,variant:"light",children:v.jsx(T.Bullseye,{children:v.jsx(T.Spinner,{})})})}function t1e(e){return v.jsxs(x.Fragment,{children:[v.jsx(y3,{breadcrumbs:e.breadcrumbs?[{label:v.jsx(T.Skeleton,{width:"150px"})}]:void 0,title:v.jsx(T.Skeleton,{width:"200px"})}),e.tabs&&v.jsx(T.PageSection,{variant:"light",style:{paddingTop:8,paddingBottom:8},children:v.jsx(T.Skeleton,{width:"150px"})}),v.jsx(T.Divider,{}),v.jsx(e1e,{})]})}const n1e=pD`
521
521
  from {
522
522
  transform: rotate(0);
523
523
  }
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.539",
4
+ "version": "2.4.541",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",