@ansible/ansible-ui-framework 2.4.1901 → 2.4.1903

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,7 +40,8 @@ export type PageTableProps<T extends object> = {
40
40
  error?: Error;
41
41
  emptyStateTitle: string;
42
42
  emptyStateDescription?: string | null;
43
- emptyStateIcon?: React.ComponentType<any>;
43
+ emptyStateIcon?: React.ComponentClass;
44
+ emptyStateNoDataIcon?: React.ComponentClass;
44
45
  emptyStateActions?: IPageAction<T>[];
45
46
  emptyStateButtonIcon?: React.ReactNode;
46
47
  emptyStateButtonText?: string | null;
@@ -1,7 +1,8 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ReactElement, ReactNode, ComponentClass } from 'react';
2
2
  export declare function EmptyStateNoData(props: {
3
3
  button?: ReactElement;
4
4
  title: string;
5
5
  description: ReactNode;
6
6
  variant?: 'xs' | 'sm' | 'lg' | 'xl' | 'full' | undefined;
7
+ icon?: ComponentClass;
7
8
  }): import("react/jsx-runtime").JSX.Element;
package/index.js CHANGED
@@ -36640,11 +36640,11 @@ function Q1e(e) {
36640
36640
  ] });
36641
36641
  }
36642
36642
  function exe(e) {
36643
- const { button: t, description: n, title: r, variant: i } = e;
36643
+ const { button: t, description: n, title: r, variant: i, icon: a } = e;
36644
36644
  return /* @__PURE__ */ g.jsx(
36645
36645
  Q1e,
36646
36646
  {
36647
- icon: t ? N7 : F7,
36647
+ icon: a ?? (t ? N7 : F7),
36648
36648
  title: r,
36649
36649
  description: n,
36650
36650
  button: t,
@@ -38028,6 +38028,7 @@ function ng(e) {
38028
38028
  {
38029
38029
  title: e.emptyStateTitle,
38030
38030
  description: e.emptyStateDescription,
38031
+ icon: e.emptyStateNoDataIcon,
38031
38032
  button: e.emptyStateButtonClick && /* @__PURE__ */ g.jsx(
38032
38033
  Te,
38033
38034
  {
@@ -38221,7 +38222,7 @@ function XS(e) {
38221
38222
  Us,
38222
38223
  {
38223
38224
  titleText: /* @__PURE__ */ g.jsx(g.Fragment, { children: b.noResultsFound }),
38224
- icon: /* @__PURE__ */ g.jsx(Wc, { icon: ny }),
38225
+ icon: /* @__PURE__ */ g.jsx(Wc, { icon: e.emptyStateIcon ?? ny }),
38225
38226
  headingLevel: "h2"
38226
38227
  }
38227
38228
  ),
package/index.umd.cjs CHANGED
@@ -405,7 +405,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
405
405
  row-gap: 16px;
406
406
  justify-content: end;
407
407
  }
408
- `;function ZA(e){const{itemCount:t,page:n,perPage:r,setPage:i,setPerPage:a,toolbarFilters:o,selectedItems:s,filterState:l,setFilterState:c,openColumnModal:u,sort:f,setSort:d,sortDirection:h,setSortDirection:p,sortOptions:g,clearAllFilters:v,perPageOptions:y}=e,x=b.useCallback(()=>{v?v():c&&c({})},[c,v]),_=rn("md"),S=rn("xxl"),{viewType:w,setViewType:O}=e;let{toolbarActions:T}=e;T=T??[];const[k,$]=b.useState(""),M=b.useCallback((B,R)=>i?i(R):null,[i]),A=b.useCallback((B,R)=>a?a(R):null,[a]),j=o!==void 0,P=T!==void 0&&T.length>0,D=e.showSelect===!0||s!==void 0&&T&&T.find(B=>"selection"in B&&B.selection===qe.Multiple);return D||j||P?t===void 0?m.jsx(E.Toolbar,{className:"page-table-toolbar border-bottom",style:{paddingBottom:_?void 0:8,paddingTop:_?void 0:8},children:m.jsx(XA,{children:m.jsx(E.ToolbarItem,{style:{width:"100%"},children:m.jsx(E.Skeleton,{height:"36px"})})})}):m.jsx(HA.Provider,{value:{activeGroup:k,setActiveGroup:$},children:m.jsx(E.Toolbar,{ouiaId:"page-toolbar",clearAllFilters:x,className:"page-table-toolbar border-bottom",style:{paddingBottom:_?void 0:8,paddingTop:_?void 0:8},inset:{default:"insetMd",sm:"insetMd",md:"insetMd",lg:"insetMd",xl:"insetLg","2xl":"insetLg"},children:m.jsxs(XA,{style:{paddingRight:S?12:4},children:[D&&m.jsx(E.ToolbarGroup,{children:m.jsx(E.ToolbarItem,{variant:"bulk-select",children:m.jsx(NA,{...e})})}),l&&c&&m.jsx(YA,{toolbarFilters:o,filterState:l,setFilterState:c,limitFiltersToOneOrOperation:e.limitFiltersToOneOrOperation}),e.toolbarContent,m.jsx(E.ToolbarGroup,{variant:"button-group",children:m.jsx(zr,{actions:T,selectedItems:s,wrapper:E.ToolbarItem})}),m.jsxs(z0e,{children:[m.jsx(N0e,{sort:f,setSort:d,sortDirection:h,setSortDirection:p,sortOptions:g}),w&&O&&m.jsx(B0e,{disableTableView:e.disableTableView,disableListView:e.disableListView,disableCardView:e.disableCardView,viewType:w,setViewType:O,openColumnModal:u}),!e.disablePagination&&!e.autoHidePagination&&S&&m.jsx(E.ToolbarItem,{visibility:{default:"hidden","2xl":"visible"},style:{marginLeft:24,alignSelf:"center"},children:m.jsx(E.Pagination,{variant:E.PaginationVariant.top,isCompact:!0,itemCount:t,perPage:r,page:n,onSetPage:M,onPerPageSelect:A,perPageOptions:y,style:{marginTop:-8,marginBottom:-8}})})]})]})})}):m.jsx(b.Fragment,{})}function W0e(e){const{t}=Ie(),n=t("Something went wrong"),r=t("Please refresh the page by using the button below."),i=t("Refresh"),{titleProp:a,message:o}=e;return m.jsxs(E.EmptyState,{isFullHeight:!0,children:[m.jsx(E.EmptyStateHeader,{titleText:m.jsx(m.Fragment,{children:a||n}),icon:m.jsx(E.EmptyStateIcon,{icon:ve.ExclamationCircleIcon,color:"var(--pf-v5-global--danger-color--100)"}),headingLevel:"h2"}),m.jsx(E.EmptyStateBody,{children:o}),m.jsxs(E.EmptyStateFooter,{children:[m.jsx(E.EmptyStateBody,{children:r}),m.jsx(E.Button,{variant:"primary",onClick:()=>window.location.reload(),children:i})]})]})}function V0e(e){const{title:t,description:n,icon:r,button:i,footNote:a,image:o,variant:s,style:l}=e;return m.jsxs(E.EmptyState,{variant:s||E.EmptyStateVariant.full,style:l,isFullHeight:!0,children:[r&&m.jsx(E.EmptyStateIcon,{icon:r}),m.jsx(E.EmptyStateHeader,{titleText:m.jsx(m.Fragment,{children:t}),headingLevel:"h4","data-cy":"empty-state-title"}),m.jsx(E.EmptyStateBody,{"data-cy":e.description,children:n}),m.jsxs(E.EmptyStateFooter,{children:[i&&m.jsx(E.EmptyStateActions,{children:i}),o&&m.jsxs(m.Fragment,{children:[" ",m.jsx("br",{})," ",m.jsx(E.EmptyStateBody,{children:o})]}),a&&m.jsx(E.EmptyStateBody,{children:a})]})]})}function U0e(e){const{button:t,description:n,title:r,variant:i}=e;return m.jsx(V0e,{icon:t?ve.PlusCircleIcon:ve.CubesIcon,title:r,description:n,button:t,variant:i})}const JA=b.createContext({dialogs:[],clearDialogs:()=>{},pushDialog:e=>{},popDialog:()=>{}});function QA(e){const[t,n]=b.useState([]),r=b.useCallback(()=>n(s=>s.length?[]:s),[n]),i=b.useCallback(s=>n(l=>[...l,s]),[n]),a=b.useCallback(()=>n(s=>s.slice(0,-1)),[n]),o=b.useMemo(()=>({dialogs:t,clearDialogs:r,pushDialog:i,popDialog:a}),[r,t,a,i]);return m.jsxs(JA.Provider,{value:o,children:[t.length>0&&t[t.length-1],e.children]})}function e6(){return b.useContext(JA)}function Fi(){const{dialogs:e,clearDialogs:t,pushDialog:n}=e6(),r=b.useMemo(()=>e.length>0?e[e.length-1]:void 0,[e]),i=b.useCallback(a=>{t(),a!==void 0&&n(a)},[t,n]);return b.useMemo(()=>[r,i],[r,i])}function H0e(e,t,n){const{selectedItems:r,selectItem:i,unselectItem:a,isSelected:o,selectItems:s,unselectAll:l,allSelected:c}=Zy(e,t),{sorted:u,sort:f,setSort:d}=Jy(e),{filtered:h,setFilterFn:p}=Qy(u,t),{searched:g,search:v,setSearch:y,setSearchFn:x}=G0e(h,t,n==null?void 0:n.search),{paged:_,page:S,setPage:w,perPage:O,setPerPage:T}=Sc(g),k=b.useCallback(()=>s(_),[_,s]),$=b.useCallback(()=>s(g),[g,s]);return b.useMemo(()=>({allSelected:c,filtered:h,isSelected:o,page:S,paged:_,perPage:O,search:v,searched:g,selectAll:$,selectItem:i,selectPage:k,selectedItems:r,setFilterFn:p,setPage:w,setPerPage:T,setSearch:y,setSearchFn:x,setSort:d,sort:f,sorted:u,unselectAll:l,unselectItem:a}),[c,h,o,S,_,O,v,g,$,i,k,r,p,w,T,y,x,d,f,u,l,a])}function Zy(e,t,n){const[r,i]=b.useState(()=>n?n.reduce((g,v)=>(g[`item-${t(v)}`]=v,g),{}):{});b.useEffect(()=>{i(g=>{let v=!1;return e.forEach(y=>{const x=`item-${t(y)}`;g[x]&&g[x]!==y&&(v=!0,g[x]=y)}),v?{...g}:g})},[e,t]);const a=b.useCallback(g=>{i(v=>{const y=`item-${t(g)}`;return v[y]!==g&&(v={...v},v[y]=g),v})},[t]),o=b.useCallback(g=>{i(v=>{const y=`item-${t(g)}`;return v[y]&&(v={...v},delete v[y]),v})},[t]),s=b.useCallback(g=>{const v=`item-${t(g)}`;return r[v]!==void 0},[t,r]),l=b.useCallback(g=>{i(v=>{v={...v};for(const y of g){const x=`item-${t(y)}`;v[x]=y}return v})},[t]),c=b.useRef(e);b.useEffect(()=>{c.current=e},[e]);const u=b.useCallback(()=>l(c.current),[l]),f=b.useCallback(g=>{for(const v of g)o(v)},[o]),d=b.useCallback(()=>{i(g=>Object.keys(g).length>0?{}:g)},[]),h=b.useMemo(()=>Object.values(r),[r]),p=b.useMemo(()=>h.length===e.length,[e.length,h.length]);return b.useMemo(()=>({selectedItems:h,selectItem:a,unselectItem:o,isSelected:s,selectItems:l,selectAll:u,unselectAll:d,allSelected:p,keyFn:t,unselectItems:f}),[p,s,t,u,a,l,h,d,o,f])}function t6(e,t){const[n,r]=b.useState({});b.useEffect(()=>{r(h=>{let p=!1;const g=e?e.reduce((x,_)=>{const S=t(_);return x[S]=_,h[S]&&h[S]!==_&&(p=!0,h[S]=_),x},{}):{},v={};for(const x in h)g[x]||(v[x]=!0);const y=Object.keys(v);if(y.length){p=!0;for(const x of y)delete h[x]}return p?{...h}:h})},[e,t]);const i=b.useCallback(h=>{r(p=>{const g=t(h);return p[g]!==h&&(p={...p},p[g]=h),p})},[t]),a=b.useCallback(h=>{r(p=>{const g=t(h);return p[g]&&(p={...p},delete p[g]),p})},[t]),o=b.useCallback(h=>{for(const p of h)a(p)},[a]),s=b.useCallback(h=>{const p=t(h);return n[p]!==void 0},[t,n]),l=b.useCallback(h=>{r(p=>{p={...p};for(const g of h){const v=t(g);p[v]=g}return p})},[t]),c=b.useCallback(()=>{l(e??[])},[e,l]),u=b.useCallback(()=>{r(h=>Object.keys(h).length>0?{}:h)},[]),f=b.useMemo(()=>Object.values(n),[n]),d=b.useMemo(()=>f.length===(e==null?void 0:e.length),[e,f.length]);return b.useMemo(()=>({selectedItems:f,selectItem:i,unselectItem:a,isSelected:s,selectItems:l,selectAll:c,unselectAll:u,allSelected:d,keyFn:t,unselectItems:o}),[d,s,t,c,i,l,f,u,a,o])}function Jy(e){const[t,n]=b.useState(),{direction:r,sortFn:i}=t??{},a=b.useMemo(()=>e?i?r==="asc"?[...e.sort(i)]:[...e.sort(i).reverse()]:e:[],[r,e,i]);return b.useMemo(()=>({sorted:a,sort:t,setSort:n}),[t,a])}function Qy(e,t){const n=b.useRef({map:{}}),[r,i]=b.useState(),a=b.useCallback(c=>i(()=>c),[]),[o,s]=b.useState([]);b.useEffect(()=>{n.current.map={}},[r]);const l=b.useCallback(c=>{const u=t(c);let f=n.current.map[u];return f?f.item!==c&&(f.item=c,f.passes=r?r(c):!0):(f={item:c,passes:r?r(c):!0},n.current.map[u]=f),f.passes},[r,t]);return b.useEffect(()=>{s(r?e.filter(l):e)},[e,r,l]),b.useMemo(function(){return{filtered:o,setFilterFn:a}},[o,a])}function G0e(e,t,n){const r=b.useRef({map:{}}),[i,a]=b.useState(),o=b.useCallback(h=>a(()=>h),[]),[s,l]=b.useState([]),[c,u]=b.useState(n??""),f=b.useCallback(Ky(h=>u(h),200),[]);b.useEffect(()=>{r.current.map={}},[c,i]);const d=b.useCallback(h=>{const p=t(h);let g=r.current.map[p];return g?g.item!==h&&(g.item=h,g.score=i?i(h,c):0):(g={item:h,score:i?i(h,c):0},r.current.map[p]=g),g},[t,i,c]);return b.useEffect(()=>{l(i&&c?e.map(d).filter(h=>h.score<.5).sort((h,p)=>h.score-p.score).map(h=>h.item):e)},[c,e,i,d]),b.useMemo(function(){return{searched:s,search:c,setSearch:f,setSearchFn:o}},[s,c,f,o])}function Sc(e){const[t,n]=b.useState([]),[r,i]=b.useState(1),[a,o]=b.useState(10);return b.useEffect(()=>{n(s=>{const l=e.slice((r-1)*a,r*a);if(s.length!==l.length)return l;let c=0;for(const u of l)if(s[c++]!==u)return l;return s})},[r,a,e]),b.useEffect(()=>{r>Math.ceil(e.length/a)&&i(1)},[r,a,e.length]),b.useMemo(()=>({paged:t,page:r,setPage:i,perPage:a,setPerPage:o}),[r,t,a])}const eb={button:"pf-v5-c-button",check:"pf-v5-c-check",checkInput:"pf-v5-c-check__input",dirRtl:"pf-v5-m-dir-rtl",modifiers:{hidden:"pf-m-hidden",hiddenOnSm:"pf-m-hidden-on-sm",visibleOnSm:"pf-m-visible-on-sm",hiddenOnMd:"pf-m-hidden-on-md",visibleOnMd:"pf-m-visible-on-md",hiddenOnLg:"pf-m-hidden-on-lg",visibleOnLg:"pf-m-visible-on-lg",hiddenOnXl:"pf-m-hidden-on-xl",visibleOnXl:"pf-m-visible-on-xl",hiddenOn_2xl:"pf-m-hidden-on-2xl",visibleOn_2xl:"pf-m-visible-on-2xl",fixed:"pf-m-fixed",stickyHeader:"pf-m-sticky-header",nestedColumnHeader:"pf-m-nested-column-header",borderRow:"pf-m-border-row",striped:"pf-m-striped",expandable:"pf-m-expandable",stripedEven:"pf-m-striped-even",ghostRow:"pf-m-ghost-row",center:"pf-m-center",help:"pf-m-help",favorite:"pf-m-favorite",borderRight:"pf-m-border-right",borderLeft:"pf-m-border-left",expanded:"pf-m-expanded",truncate:"pf-m-truncate",wrap:"pf-m-wrap",nowrap:"pf-m-nowrap",fitContent:"pf-m-fit-content",breakWord:"pf-m-break-word",noBorderRows:"pf-m-no-border-rows",clickable:"pf-m-clickable",selected:"pf-m-selected",firstCellOffsetReset:"pf-m-first-cell-offset-reset",dragOver:"pf-m-drag-over",standalone:"pf-m-standalone",favorited:"pf-m-favorited",noPadding:"pf-m-no-padding",compact:"pf-m-compact",width_10:"pf-m-width-10",width_15:"pf-m-width-15",width_20:"pf-m-width-20",width_25:"pf-m-width-25",width_30:"pf-m-width-30",width_35:"pf-m-width-35",width_40:"pf-m-width-40",width_45:"pf-m-width-45",width_50:"pf-m-width-50",width_60:"pf-m-width-60",width_70:"pf-m-width-70",width_80:"pf-m-width-80",width_90:"pf-m-width-90",width_100:"pf-m-width-100"},table:"pf-v5-c-table",tableAction:"pf-v5-c-table__action",tableButton:"pf-v5-c-table__button",tableButtonContent:"pf-v5-c-table__button-content",tableCaption:"pf-v5-c-table__caption",tableCheck:"pf-v5-c-table__check",tableColumnHelp:"pf-v5-c-table__column-help",tableColumnHelpAction:"pf-v5-c-table__column-help-action",tableCompoundExpansionToggle:"pf-v5-c-table__compound-expansion-toggle",tableControlRow:"pf-v5-c-table__control-row",tableDraggable:"pf-v5-c-table__draggable",tableExpandableRow:"pf-v5-c-table__expandable-row",tableExpandableRowContent:"pf-v5-c-table__expandable-row-content",tableFavorite:"pf-v5-c-table__favorite",tableIcon:"pf-v5-c-table__icon",tableIconInline:"pf-v5-c-table__icon-inline",tableInlineEditAction:"pf-v5-c-table__inline-edit-action",tableSort:"pf-v5-c-table__sort",tableSortIndicator:"pf-v5-c-table__sort-indicator",tableSubhead:"pf-v5-c-table__subhead",tableTbody:"pf-v5-c-table__tbody",tableTd:"pf-v5-c-table__td",tableText:"pf-v5-c-table__text",tableTh:"pf-v5-c-table__th",tableThead:"pf-v5-c-table__thead",tableToggle:"pf-v5-c-table__toggle",tableToggleIcon:"pf-v5-c-table__toggle-icon",tableTr:"pf-v5-c-table__tr",themeDark:"pf-v5-theme-dark"};function q0e(e){const{t}=Ie(),{columns:n,keyFn:r,items:i,setItems:a,isSelected:o,selectItem:s,unselectItem:l,allSelected:c,selectAll:u,unselectAll:f,hideColumnHeaders:d,isSelectableWithCheckbox:h}=e,[p,g]=b.useState(null),[v,y]=b.useState(null),[x,_]=b.useState(!1),S=b.useRef(null),w=D=>{if(S.current){const I=S.current.getBoundingClientRect();return D.clientX>I.x&&D.clientX<I.x+I.width&&D.clientY>I.y&&D.clientY<I.y+I.height}return!1},O=D=>{w(D)||T()},T=()=>{S.current&&Array.from(S.current.children).forEach(D=>{D.classList.remove(eb.modifiers.ghostRow),D.setAttribute("aria-pressed","false")}),y(null),g(null),_(!1)},k=D=>{D.preventDefault();const I=D.target.closest("tr");if(!I||!(S.current&&S.current.contains(I))||I.id===v)return null;{const B=I.id,R=Array.from(S.current.children).findIndex(V=>V.id===B);if(R!==p&&v){const V=$([...i],v,R);a(V)}}return null},$=(D,I,B)=>{const R=D.findIndex(W=>r(W)===I);if(R===B)return D;const V=D.splice(R,1);return D.splice(B,0,V[0]),D},M=D=>{w(D)||g(null)},A=D=>{const I=D.target;I.classList.remove(eb.modifiers.ghostRow),I.setAttribute("aria-pressed","false"),y(null),g(null),_(!1)},j=D=>{if(S.current){D.dataTransfer.effectAllowed="move";const I=D.currentTarget.id,B=Array.from(S.current.children).findIndex(R=>R.id===D.currentTarget.id);D.currentTarget.setAttribute("aria-pressed","true"),y(I),g(B)}},P=b.useCallback(D=>{const I=i.findIndex(R=>r(R)===r(D)),B=[...i];B[I]=D,a(B)},[i,a,r]);return m.jsxs(Le.Table,{"aria-label":t("Table with draggable rows"),className:x?eb.modifiers.dragOver:"",variant:"compact",gridBreakPoint:"",children:[!d&&m.jsx(Le.Thead,{children:m.jsxs(Le.Tr,{children:[m.jsx(Le.Th,{}),h&&m.jsx(Le.Th,{select:{onSelect:(D,I)=>{I?u():f()},isSelected:c}}),n.map((D,I)=>m.jsx(Le.Th,{children:D.header},I))]})}),m.jsx(Le.Tbody,{ref:S,onDragOver:k,onDragLeave:M,children:i.map((D,I)=>{const B=r(D);return m.jsxs(Le.Tr,{id:B.toString(),draggable:!0,onDrop:O,onDragEnd:A,onDragStart:j,children:[m.jsx(Le.Td,{draggableRow:{id:`draggable-row-${B.toString()}`}}),h&&m.jsx(Le.Td,{select:{rowIndex:I,variant:"checkbox",onSelect:(R,V)=>{V?s(D):l(D)},isSelected:o(D)}}),n.map(R=>m.jsx(Le.Td,{children:R.cell(D,P)},R.header))]},B)})})]})}function Y0e(e){const[t,n]=Fi(),[r]=b.useState(()=>e.keyFn),[i]=b.useState(()=>e.saveFn),[a]=b.useState(()=>e.loadFn),[o,s]=b.useState(()=>{try{const d=localStorage.getItem(e.id);if(typeof d=="string"){const h=JSON.parse(d);if(Array.isArray(h)&&h.every(p=>typeof p=="object")&&h.every(p=>"key"in p&&"enabled"in p))return h}}catch{}}),l=b.useMemo(()=>o?e.items.map(d=>{if(a){const h=o.find(p=>p.key===r(d));h&&h.state&&a(d,h.state)}return d}).sort((d,h)=>{const p=o.findIndex(v=>v.key===r(d)),g=o.findIndex(v=>v.key===r(h));return p===-1&&g===-1?0:p===-1?1:g===-1?-1:p-g}):e.items,[o,r,a,e.items]),c=b.useMemo(()=>o?l.filter(d=>{const h=o.find(p=>p.key===r(d));return h?h.enabled:!0}):l,[l,o,r]),u=b.useCallback((d,h)=>{const p=d.map(g=>({key:r(g),enabled:h.includes(g),state:i?i(g):void 0}));s(p),localStorage.setItem(e.id,JSON.stringify(p)),e.onSubmit&&e.onSubmit(d)},[r,e,i]);return{openManageItems:()=>n(m.jsx(K0e,{...e,keyFn:r,items:l,defaultSelectedItems:c,onApplyChanges:u})),managedItems:c}}function K0e(e){const{t}=Ie(),{title:n,description:r,columns:i,onApplyChanges:a}=e,[o]=b.useState(()=>e.keyFn),[s,l]=Fi(),c=()=>l(void 0),[u,f]=b.useState(()=>e.items),{selectedItems:d,isSelected:h,selectItem:p,unselectItem:g,allSelected:v,selectAll:y,unselectAll:x}=Zy(u,o,e.defaultSelectedItems),_=()=>{a(u,d),l(void 0)};return m.jsxs(E.Modal,{title:n,"aria-label":n,ouiaId:n,description:m.jsx("div",{style:{marginBottom:16},children:r}),variant:e.variant??E.ModalVariant.medium,isOpen:!0,onClose:c,actions:[m.jsx(E.Button,{variant:"primary",onClick:_,children:t`Apply`},"apply"),m.jsx(E.Button,{variant:"link",onClick:c,children:t`Cancel`},"cancel")],hasNoBodyWrapper:!0,children:[m.jsx(E.Divider,{}),m.jsx(E.ModalBoxBody,{style:{padding:0},children:m.jsx(q0e,{keyFn:o,items:u,setItems:f,columns:i,isSelected:h,selectItem:p,unselectItem:g,allSelected:v,selectAll:y,unselectAll:x,hideColumnHeaders:e.hideColumnHeaders,isSelectableWithCheckbox:e.hideSelection!==!0})}),m.jsx(E.Divider,{})]})}function X0e(e,t,n,r,i){const{t:a}=Ie(),o=b.useMemo(()=>{const f=[{header:a("Name"),cell:d=>d.header}];return n||f.push({header:a("Table"),cell:(d,h)=>m.jsx(Ni,{value:d.table??"",onSelect:p=>{switch(p){case"":h({...d,table:void 0});break;case va.description:case va.expanded:case va.hidden:h({...d,table:p});break}},placeholder:a("Column"),options:[{value:"",label:a("Column"),description:a("Show the column in the table.")},{value:va.description,label:a("Description"),description:a("Show the column when the item is expanded as a full width description.")},{value:va.expanded,label:a("Expanded"),description:a("Show the column when the item is expanded as a detail.")},{value:va.hidden,label:a("Hidden"),description:a("Hide the column.")}],isRequired:!0})}),r||f.push({header:a("List"),cell:(d,h)=>m.jsx(Ni,{value:d.list??"",onSelect:p=>{switch(p){case"":h({...d,list:void 0});break;case"name":case"subtitle":case"description":case"primary":case"secondary":case"hidden":h({...d,list:p});break}},options:[{value:"name",label:a("Name"),description:a("Show the column as the name of the list item.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the list.")},{value:"description",label:a("Description"),description:a("Show the column as the list item description.")},{value:"primary",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"secondary",label:a("Right side"),description:a("Show the column on the right side of the list.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the list.")}],placeholder:a("Left side"),isRequired:!0})}),i||f.push({header:a("Card"),cell:(d,h)=>m.jsx(Ni,{value:d.card??"",onSelect:p=>{switch(p){case"":h({...d,card:void 0});break;case"name":case"subtitle":case"description":case"hidden":h({...d,card:p});break}},placeholder:a("Detail"),options:[{value:"name",label:a("Name"),description:a("Show the column as the name on the card.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the card.")},{value:"description",label:a("Description"),description:a("Show the column as the card description.")},{value:"",label:a("Detail"),description:a("Show the column one of the details on the card.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the card.")}],isRequired:!0})}),f},[i,r,n,a]),s=b.useCallback((f,d)=>{typeof d=="object"&&d!==null&&("table"in d&&typeof d.table=="string"?f.table=d.table:f.table=void 0,"list"in d&&typeof d.list=="string"?f.list=d.list:f.list=void 0,"card"in d&&typeof d.card=="string"?f.card=d.card:f.card=void 0)},[]),l=b.useCallback(f=>{const{table:d,list:h,card:p}=f;return{table:d,list:h,card:p}},[]),{openManageItems:c,managedItems:u}=Y0e({id:e,title:a("Manage Columns"),description:a("Manage the order, placement, and format of columns."),items:t,keyFn:f=>f.id??f.header,columns:o,loadFn:s,saveFn:l,hideSelection:!0});return{openColumnManagement:c,managedColumns:u}}function Z0e(){return m.jsx(Le.Table,{gridBreakPoint:"",className:"page-table",children:m.jsx(Le.Tbody,{children:new Array(10).fill(0).map((e,t)=>m.jsx(Le.Tr,{children:m.jsx(Le.Td,{children:m.jsx(E.Skeleton,{height:"27px"})})},t))})})}function J0e(e){const{setPage:t,setPerPage:n}=e,r=b.useCallback((o,s)=>t(s),[t]),i=b.useCallback((o,s)=>n(s),[n]),a=!rn("md");return m.jsx(E.Pagination,{"data-cy":"pagination",variant:E.PaginationVariant.bottom,itemCount:e.itemCount,page:e.page,perPage:e.perPage,onSetPage:r,onPerPageSelect:i,perPageOptions:e.perPageOptions,style:{...e.style,boxShadow:"none",zIndex:400,paddingTop:a?4:6,paddingBottom:a?4:6},className:"border-top bg-lighten"})}function Q0e(e){const t=e.size??350,n=b.useRef(null),[r,i]=b.useState("1fr"),a=b.useCallback(s=>{let l=Math.min(e.maxColumns??12,Math.max(Math.floor(s/t),1));l<1&&(l=1),i(()=>new Array(l).fill("1fr").join(" "))},[e.maxColumns,t]);return Yo(n,s=>a(s.contentRect.width)),b.useLayoutEffect(()=>{var s;a(((s=n.current)==null?void 0:s.clientWidth)??0)},[a]),m.jsx("div",{ref:n,style:{display:"grid",gridAutoRows:"1fr",gridTemplateColumns:r,gap:16},children:e.children})}const n6=Pe.small`
408
+ `;function ZA(e){const{itemCount:t,page:n,perPage:r,setPage:i,setPerPage:a,toolbarFilters:o,selectedItems:s,filterState:l,setFilterState:c,openColumnModal:u,sort:f,setSort:d,sortDirection:h,setSortDirection:p,sortOptions:g,clearAllFilters:v,perPageOptions:y}=e,x=b.useCallback(()=>{v?v():c&&c({})},[c,v]),_=rn("md"),S=rn("xxl"),{viewType:w,setViewType:O}=e;let{toolbarActions:T}=e;T=T??[];const[k,$]=b.useState(""),M=b.useCallback((B,R)=>i?i(R):null,[i]),A=b.useCallback((B,R)=>a?a(R):null,[a]),j=o!==void 0,P=T!==void 0&&T.length>0,D=e.showSelect===!0||s!==void 0&&T&&T.find(B=>"selection"in B&&B.selection===qe.Multiple);return D||j||P?t===void 0?m.jsx(E.Toolbar,{className:"page-table-toolbar border-bottom",style:{paddingBottom:_?void 0:8,paddingTop:_?void 0:8},children:m.jsx(XA,{children:m.jsx(E.ToolbarItem,{style:{width:"100%"},children:m.jsx(E.Skeleton,{height:"36px"})})})}):m.jsx(HA.Provider,{value:{activeGroup:k,setActiveGroup:$},children:m.jsx(E.Toolbar,{ouiaId:"page-toolbar",clearAllFilters:x,className:"page-table-toolbar border-bottom",style:{paddingBottom:_?void 0:8,paddingTop:_?void 0:8},inset:{default:"insetMd",sm:"insetMd",md:"insetMd",lg:"insetMd",xl:"insetLg","2xl":"insetLg"},children:m.jsxs(XA,{style:{paddingRight:S?12:4},children:[D&&m.jsx(E.ToolbarGroup,{children:m.jsx(E.ToolbarItem,{variant:"bulk-select",children:m.jsx(NA,{...e})})}),l&&c&&m.jsx(YA,{toolbarFilters:o,filterState:l,setFilterState:c,limitFiltersToOneOrOperation:e.limitFiltersToOneOrOperation}),e.toolbarContent,m.jsx(E.ToolbarGroup,{variant:"button-group",children:m.jsx(zr,{actions:T,selectedItems:s,wrapper:E.ToolbarItem})}),m.jsxs(z0e,{children:[m.jsx(N0e,{sort:f,setSort:d,sortDirection:h,setSortDirection:p,sortOptions:g}),w&&O&&m.jsx(B0e,{disableTableView:e.disableTableView,disableListView:e.disableListView,disableCardView:e.disableCardView,viewType:w,setViewType:O,openColumnModal:u}),!e.disablePagination&&!e.autoHidePagination&&S&&m.jsx(E.ToolbarItem,{visibility:{default:"hidden","2xl":"visible"},style:{marginLeft:24,alignSelf:"center"},children:m.jsx(E.Pagination,{variant:E.PaginationVariant.top,isCompact:!0,itemCount:t,perPage:r,page:n,onSetPage:M,onPerPageSelect:A,perPageOptions:y,style:{marginTop:-8,marginBottom:-8}})})]})]})})}):m.jsx(b.Fragment,{})}function W0e(e){const{t}=Ie(),n=t("Something went wrong"),r=t("Please refresh the page by using the button below."),i=t("Refresh"),{titleProp:a,message:o}=e;return m.jsxs(E.EmptyState,{isFullHeight:!0,children:[m.jsx(E.EmptyStateHeader,{titleText:m.jsx(m.Fragment,{children:a||n}),icon:m.jsx(E.EmptyStateIcon,{icon:ve.ExclamationCircleIcon,color:"var(--pf-v5-global--danger-color--100)"}),headingLevel:"h2"}),m.jsx(E.EmptyStateBody,{children:o}),m.jsxs(E.EmptyStateFooter,{children:[m.jsx(E.EmptyStateBody,{children:r}),m.jsx(E.Button,{variant:"primary",onClick:()=>window.location.reload(),children:i})]})]})}function V0e(e){const{title:t,description:n,icon:r,button:i,footNote:a,image:o,variant:s,style:l}=e;return m.jsxs(E.EmptyState,{variant:s||E.EmptyStateVariant.full,style:l,isFullHeight:!0,children:[r&&m.jsx(E.EmptyStateIcon,{icon:r}),m.jsx(E.EmptyStateHeader,{titleText:m.jsx(m.Fragment,{children:t}),headingLevel:"h4","data-cy":"empty-state-title"}),m.jsx(E.EmptyStateBody,{"data-cy":e.description,children:n}),m.jsxs(E.EmptyStateFooter,{children:[i&&m.jsx(E.EmptyStateActions,{children:i}),o&&m.jsxs(m.Fragment,{children:[" ",m.jsx("br",{})," ",m.jsx(E.EmptyStateBody,{children:o})]}),a&&m.jsx(E.EmptyStateBody,{children:a})]})]})}function U0e(e){const{button:t,description:n,title:r,variant:i,icon:a}=e;return m.jsx(V0e,{icon:a??(t?ve.PlusCircleIcon:ve.CubesIcon),title:r,description:n,button:t,variant:i})}const JA=b.createContext({dialogs:[],clearDialogs:()=>{},pushDialog:e=>{},popDialog:()=>{}});function QA(e){const[t,n]=b.useState([]),r=b.useCallback(()=>n(s=>s.length?[]:s),[n]),i=b.useCallback(s=>n(l=>[...l,s]),[n]),a=b.useCallback(()=>n(s=>s.slice(0,-1)),[n]),o=b.useMemo(()=>({dialogs:t,clearDialogs:r,pushDialog:i,popDialog:a}),[r,t,a,i]);return m.jsxs(JA.Provider,{value:o,children:[t.length>0&&t[t.length-1],e.children]})}function e6(){return b.useContext(JA)}function Fi(){const{dialogs:e,clearDialogs:t,pushDialog:n}=e6(),r=b.useMemo(()=>e.length>0?e[e.length-1]:void 0,[e]),i=b.useCallback(a=>{t(),a!==void 0&&n(a)},[t,n]);return b.useMemo(()=>[r,i],[r,i])}function H0e(e,t,n){const{selectedItems:r,selectItem:i,unselectItem:a,isSelected:o,selectItems:s,unselectAll:l,allSelected:c}=Zy(e,t),{sorted:u,sort:f,setSort:d}=Jy(e),{filtered:h,setFilterFn:p}=Qy(u,t),{searched:g,search:v,setSearch:y,setSearchFn:x}=G0e(h,t,n==null?void 0:n.search),{paged:_,page:S,setPage:w,perPage:O,setPerPage:T}=Sc(g),k=b.useCallback(()=>s(_),[_,s]),$=b.useCallback(()=>s(g),[g,s]);return b.useMemo(()=>({allSelected:c,filtered:h,isSelected:o,page:S,paged:_,perPage:O,search:v,searched:g,selectAll:$,selectItem:i,selectPage:k,selectedItems:r,setFilterFn:p,setPage:w,setPerPage:T,setSearch:y,setSearchFn:x,setSort:d,sort:f,sorted:u,unselectAll:l,unselectItem:a}),[c,h,o,S,_,O,v,g,$,i,k,r,p,w,T,y,x,d,f,u,l,a])}function Zy(e,t,n){const[r,i]=b.useState(()=>n?n.reduce((g,v)=>(g[`item-${t(v)}`]=v,g),{}):{});b.useEffect(()=>{i(g=>{let v=!1;return e.forEach(y=>{const x=`item-${t(y)}`;g[x]&&g[x]!==y&&(v=!0,g[x]=y)}),v?{...g}:g})},[e,t]);const a=b.useCallback(g=>{i(v=>{const y=`item-${t(g)}`;return v[y]!==g&&(v={...v},v[y]=g),v})},[t]),o=b.useCallback(g=>{i(v=>{const y=`item-${t(g)}`;return v[y]&&(v={...v},delete v[y]),v})},[t]),s=b.useCallback(g=>{const v=`item-${t(g)}`;return r[v]!==void 0},[t,r]),l=b.useCallback(g=>{i(v=>{v={...v};for(const y of g){const x=`item-${t(y)}`;v[x]=y}return v})},[t]),c=b.useRef(e);b.useEffect(()=>{c.current=e},[e]);const u=b.useCallback(()=>l(c.current),[l]),f=b.useCallback(g=>{for(const v of g)o(v)},[o]),d=b.useCallback(()=>{i(g=>Object.keys(g).length>0?{}:g)},[]),h=b.useMemo(()=>Object.values(r),[r]),p=b.useMemo(()=>h.length===e.length,[e.length,h.length]);return b.useMemo(()=>({selectedItems:h,selectItem:a,unselectItem:o,isSelected:s,selectItems:l,selectAll:u,unselectAll:d,allSelected:p,keyFn:t,unselectItems:f}),[p,s,t,u,a,l,h,d,o,f])}function t6(e,t){const[n,r]=b.useState({});b.useEffect(()=>{r(h=>{let p=!1;const g=e?e.reduce((x,_)=>{const S=t(_);return x[S]=_,h[S]&&h[S]!==_&&(p=!0,h[S]=_),x},{}):{},v={};for(const x in h)g[x]||(v[x]=!0);const y=Object.keys(v);if(y.length){p=!0;for(const x of y)delete h[x]}return p?{...h}:h})},[e,t]);const i=b.useCallback(h=>{r(p=>{const g=t(h);return p[g]!==h&&(p={...p},p[g]=h),p})},[t]),a=b.useCallback(h=>{r(p=>{const g=t(h);return p[g]&&(p={...p},delete p[g]),p})},[t]),o=b.useCallback(h=>{for(const p of h)a(p)},[a]),s=b.useCallback(h=>{const p=t(h);return n[p]!==void 0},[t,n]),l=b.useCallback(h=>{r(p=>{p={...p};for(const g of h){const v=t(g);p[v]=g}return p})},[t]),c=b.useCallback(()=>{l(e??[])},[e,l]),u=b.useCallback(()=>{r(h=>Object.keys(h).length>0?{}:h)},[]),f=b.useMemo(()=>Object.values(n),[n]),d=b.useMemo(()=>f.length===(e==null?void 0:e.length),[e,f.length]);return b.useMemo(()=>({selectedItems:f,selectItem:i,unselectItem:a,isSelected:s,selectItems:l,selectAll:c,unselectAll:u,allSelected:d,keyFn:t,unselectItems:o}),[d,s,t,c,i,l,f,u,a,o])}function Jy(e){const[t,n]=b.useState(),{direction:r,sortFn:i}=t??{},a=b.useMemo(()=>e?i?r==="asc"?[...e.sort(i)]:[...e.sort(i).reverse()]:e:[],[r,e,i]);return b.useMemo(()=>({sorted:a,sort:t,setSort:n}),[t,a])}function Qy(e,t){const n=b.useRef({map:{}}),[r,i]=b.useState(),a=b.useCallback(c=>i(()=>c),[]),[o,s]=b.useState([]);b.useEffect(()=>{n.current.map={}},[r]);const l=b.useCallback(c=>{const u=t(c);let f=n.current.map[u];return f?f.item!==c&&(f.item=c,f.passes=r?r(c):!0):(f={item:c,passes:r?r(c):!0},n.current.map[u]=f),f.passes},[r,t]);return b.useEffect(()=>{s(r?e.filter(l):e)},[e,r,l]),b.useMemo(function(){return{filtered:o,setFilterFn:a}},[o,a])}function G0e(e,t,n){const r=b.useRef({map:{}}),[i,a]=b.useState(),o=b.useCallback(h=>a(()=>h),[]),[s,l]=b.useState([]),[c,u]=b.useState(n??""),f=b.useCallback(Ky(h=>u(h),200),[]);b.useEffect(()=>{r.current.map={}},[c,i]);const d=b.useCallback(h=>{const p=t(h);let g=r.current.map[p];return g?g.item!==h&&(g.item=h,g.score=i?i(h,c):0):(g={item:h,score:i?i(h,c):0},r.current.map[p]=g),g},[t,i,c]);return b.useEffect(()=>{l(i&&c?e.map(d).filter(h=>h.score<.5).sort((h,p)=>h.score-p.score).map(h=>h.item):e)},[c,e,i,d]),b.useMemo(function(){return{searched:s,search:c,setSearch:f,setSearchFn:o}},[s,c,f,o])}function Sc(e){const[t,n]=b.useState([]),[r,i]=b.useState(1),[a,o]=b.useState(10);return b.useEffect(()=>{n(s=>{const l=e.slice((r-1)*a,r*a);if(s.length!==l.length)return l;let c=0;for(const u of l)if(s[c++]!==u)return l;return s})},[r,a,e]),b.useEffect(()=>{r>Math.ceil(e.length/a)&&i(1)},[r,a,e.length]),b.useMemo(()=>({paged:t,page:r,setPage:i,perPage:a,setPerPage:o}),[r,t,a])}const eb={button:"pf-v5-c-button",check:"pf-v5-c-check",checkInput:"pf-v5-c-check__input",dirRtl:"pf-v5-m-dir-rtl",modifiers:{hidden:"pf-m-hidden",hiddenOnSm:"pf-m-hidden-on-sm",visibleOnSm:"pf-m-visible-on-sm",hiddenOnMd:"pf-m-hidden-on-md",visibleOnMd:"pf-m-visible-on-md",hiddenOnLg:"pf-m-hidden-on-lg",visibleOnLg:"pf-m-visible-on-lg",hiddenOnXl:"pf-m-hidden-on-xl",visibleOnXl:"pf-m-visible-on-xl",hiddenOn_2xl:"pf-m-hidden-on-2xl",visibleOn_2xl:"pf-m-visible-on-2xl",fixed:"pf-m-fixed",stickyHeader:"pf-m-sticky-header",nestedColumnHeader:"pf-m-nested-column-header",borderRow:"pf-m-border-row",striped:"pf-m-striped",expandable:"pf-m-expandable",stripedEven:"pf-m-striped-even",ghostRow:"pf-m-ghost-row",center:"pf-m-center",help:"pf-m-help",favorite:"pf-m-favorite",borderRight:"pf-m-border-right",borderLeft:"pf-m-border-left",expanded:"pf-m-expanded",truncate:"pf-m-truncate",wrap:"pf-m-wrap",nowrap:"pf-m-nowrap",fitContent:"pf-m-fit-content",breakWord:"pf-m-break-word",noBorderRows:"pf-m-no-border-rows",clickable:"pf-m-clickable",selected:"pf-m-selected",firstCellOffsetReset:"pf-m-first-cell-offset-reset",dragOver:"pf-m-drag-over",standalone:"pf-m-standalone",favorited:"pf-m-favorited",noPadding:"pf-m-no-padding",compact:"pf-m-compact",width_10:"pf-m-width-10",width_15:"pf-m-width-15",width_20:"pf-m-width-20",width_25:"pf-m-width-25",width_30:"pf-m-width-30",width_35:"pf-m-width-35",width_40:"pf-m-width-40",width_45:"pf-m-width-45",width_50:"pf-m-width-50",width_60:"pf-m-width-60",width_70:"pf-m-width-70",width_80:"pf-m-width-80",width_90:"pf-m-width-90",width_100:"pf-m-width-100"},table:"pf-v5-c-table",tableAction:"pf-v5-c-table__action",tableButton:"pf-v5-c-table__button",tableButtonContent:"pf-v5-c-table__button-content",tableCaption:"pf-v5-c-table__caption",tableCheck:"pf-v5-c-table__check",tableColumnHelp:"pf-v5-c-table__column-help",tableColumnHelpAction:"pf-v5-c-table__column-help-action",tableCompoundExpansionToggle:"pf-v5-c-table__compound-expansion-toggle",tableControlRow:"pf-v5-c-table__control-row",tableDraggable:"pf-v5-c-table__draggable",tableExpandableRow:"pf-v5-c-table__expandable-row",tableExpandableRowContent:"pf-v5-c-table__expandable-row-content",tableFavorite:"pf-v5-c-table__favorite",tableIcon:"pf-v5-c-table__icon",tableIconInline:"pf-v5-c-table__icon-inline",tableInlineEditAction:"pf-v5-c-table__inline-edit-action",tableSort:"pf-v5-c-table__sort",tableSortIndicator:"pf-v5-c-table__sort-indicator",tableSubhead:"pf-v5-c-table__subhead",tableTbody:"pf-v5-c-table__tbody",tableTd:"pf-v5-c-table__td",tableText:"pf-v5-c-table__text",tableTh:"pf-v5-c-table__th",tableThead:"pf-v5-c-table__thead",tableToggle:"pf-v5-c-table__toggle",tableToggleIcon:"pf-v5-c-table__toggle-icon",tableTr:"pf-v5-c-table__tr",themeDark:"pf-v5-theme-dark"};function q0e(e){const{t}=Ie(),{columns:n,keyFn:r,items:i,setItems:a,isSelected:o,selectItem:s,unselectItem:l,allSelected:c,selectAll:u,unselectAll:f,hideColumnHeaders:d,isSelectableWithCheckbox:h}=e,[p,g]=b.useState(null),[v,y]=b.useState(null),[x,_]=b.useState(!1),S=b.useRef(null),w=D=>{if(S.current){const I=S.current.getBoundingClientRect();return D.clientX>I.x&&D.clientX<I.x+I.width&&D.clientY>I.y&&D.clientY<I.y+I.height}return!1},O=D=>{w(D)||T()},T=()=>{S.current&&Array.from(S.current.children).forEach(D=>{D.classList.remove(eb.modifiers.ghostRow),D.setAttribute("aria-pressed","false")}),y(null),g(null),_(!1)},k=D=>{D.preventDefault();const I=D.target.closest("tr");if(!I||!(S.current&&S.current.contains(I))||I.id===v)return null;{const B=I.id,R=Array.from(S.current.children).findIndex(V=>V.id===B);if(R!==p&&v){const V=$([...i],v,R);a(V)}}return null},$=(D,I,B)=>{const R=D.findIndex(W=>r(W)===I);if(R===B)return D;const V=D.splice(R,1);return D.splice(B,0,V[0]),D},M=D=>{w(D)||g(null)},A=D=>{const I=D.target;I.classList.remove(eb.modifiers.ghostRow),I.setAttribute("aria-pressed","false"),y(null),g(null),_(!1)},j=D=>{if(S.current){D.dataTransfer.effectAllowed="move";const I=D.currentTarget.id,B=Array.from(S.current.children).findIndex(R=>R.id===D.currentTarget.id);D.currentTarget.setAttribute("aria-pressed","true"),y(I),g(B)}},P=b.useCallback(D=>{const I=i.findIndex(R=>r(R)===r(D)),B=[...i];B[I]=D,a(B)},[i,a,r]);return m.jsxs(Le.Table,{"aria-label":t("Table with draggable rows"),className:x?eb.modifiers.dragOver:"",variant:"compact",gridBreakPoint:"",children:[!d&&m.jsx(Le.Thead,{children:m.jsxs(Le.Tr,{children:[m.jsx(Le.Th,{}),h&&m.jsx(Le.Th,{select:{onSelect:(D,I)=>{I?u():f()},isSelected:c}}),n.map((D,I)=>m.jsx(Le.Th,{children:D.header},I))]})}),m.jsx(Le.Tbody,{ref:S,onDragOver:k,onDragLeave:M,children:i.map((D,I)=>{const B=r(D);return m.jsxs(Le.Tr,{id:B.toString(),draggable:!0,onDrop:O,onDragEnd:A,onDragStart:j,children:[m.jsx(Le.Td,{draggableRow:{id:`draggable-row-${B.toString()}`}}),h&&m.jsx(Le.Td,{select:{rowIndex:I,variant:"checkbox",onSelect:(R,V)=>{V?s(D):l(D)},isSelected:o(D)}}),n.map(R=>m.jsx(Le.Td,{children:R.cell(D,P)},R.header))]},B)})})]})}function Y0e(e){const[t,n]=Fi(),[r]=b.useState(()=>e.keyFn),[i]=b.useState(()=>e.saveFn),[a]=b.useState(()=>e.loadFn),[o,s]=b.useState(()=>{try{const d=localStorage.getItem(e.id);if(typeof d=="string"){const h=JSON.parse(d);if(Array.isArray(h)&&h.every(p=>typeof p=="object")&&h.every(p=>"key"in p&&"enabled"in p))return h}}catch{}}),l=b.useMemo(()=>o?e.items.map(d=>{if(a){const h=o.find(p=>p.key===r(d));h&&h.state&&a(d,h.state)}return d}).sort((d,h)=>{const p=o.findIndex(v=>v.key===r(d)),g=o.findIndex(v=>v.key===r(h));return p===-1&&g===-1?0:p===-1?1:g===-1?-1:p-g}):e.items,[o,r,a,e.items]),c=b.useMemo(()=>o?l.filter(d=>{const h=o.find(p=>p.key===r(d));return h?h.enabled:!0}):l,[l,o,r]),u=b.useCallback((d,h)=>{const p=d.map(g=>({key:r(g),enabled:h.includes(g),state:i?i(g):void 0}));s(p),localStorage.setItem(e.id,JSON.stringify(p)),e.onSubmit&&e.onSubmit(d)},[r,e,i]);return{openManageItems:()=>n(m.jsx(K0e,{...e,keyFn:r,items:l,defaultSelectedItems:c,onApplyChanges:u})),managedItems:c}}function K0e(e){const{t}=Ie(),{title:n,description:r,columns:i,onApplyChanges:a}=e,[o]=b.useState(()=>e.keyFn),[s,l]=Fi(),c=()=>l(void 0),[u,f]=b.useState(()=>e.items),{selectedItems:d,isSelected:h,selectItem:p,unselectItem:g,allSelected:v,selectAll:y,unselectAll:x}=Zy(u,o,e.defaultSelectedItems),_=()=>{a(u,d),l(void 0)};return m.jsxs(E.Modal,{title:n,"aria-label":n,ouiaId:n,description:m.jsx("div",{style:{marginBottom:16},children:r}),variant:e.variant??E.ModalVariant.medium,isOpen:!0,onClose:c,actions:[m.jsx(E.Button,{variant:"primary",onClick:_,children:t`Apply`},"apply"),m.jsx(E.Button,{variant:"link",onClick:c,children:t`Cancel`},"cancel")],hasNoBodyWrapper:!0,children:[m.jsx(E.Divider,{}),m.jsx(E.ModalBoxBody,{style:{padding:0},children:m.jsx(q0e,{keyFn:o,items:u,setItems:f,columns:i,isSelected:h,selectItem:p,unselectItem:g,allSelected:v,selectAll:y,unselectAll:x,hideColumnHeaders:e.hideColumnHeaders,isSelectableWithCheckbox:e.hideSelection!==!0})}),m.jsx(E.Divider,{})]})}function X0e(e,t,n,r,i){const{t:a}=Ie(),o=b.useMemo(()=>{const f=[{header:a("Name"),cell:d=>d.header}];return n||f.push({header:a("Table"),cell:(d,h)=>m.jsx(Ni,{value:d.table??"",onSelect:p=>{switch(p){case"":h({...d,table:void 0});break;case va.description:case va.expanded:case va.hidden:h({...d,table:p});break}},placeholder:a("Column"),options:[{value:"",label:a("Column"),description:a("Show the column in the table.")},{value:va.description,label:a("Description"),description:a("Show the column when the item is expanded as a full width description.")},{value:va.expanded,label:a("Expanded"),description:a("Show the column when the item is expanded as a detail.")},{value:va.hidden,label:a("Hidden"),description:a("Hide the column.")}],isRequired:!0})}),r||f.push({header:a("List"),cell:(d,h)=>m.jsx(Ni,{value:d.list??"",onSelect:p=>{switch(p){case"":h({...d,list:void 0});break;case"name":case"subtitle":case"description":case"primary":case"secondary":case"hidden":h({...d,list:p});break}},options:[{value:"name",label:a("Name"),description:a("Show the column as the name of the list item.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the list.")},{value:"description",label:a("Description"),description:a("Show the column as the list item description.")},{value:"primary",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"secondary",label:a("Right side"),description:a("Show the column on the right side of the list.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the list.")}],placeholder:a("Left side"),isRequired:!0})}),i||f.push({header:a("Card"),cell:(d,h)=>m.jsx(Ni,{value:d.card??"",onSelect:p=>{switch(p){case"":h({...d,card:void 0});break;case"name":case"subtitle":case"description":case"hidden":h({...d,card:p});break}},placeholder:a("Detail"),options:[{value:"name",label:a("Name"),description:a("Show the column as the name on the card.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the card.")},{value:"description",label:a("Description"),description:a("Show the column as the card description.")},{value:"",label:a("Detail"),description:a("Show the column one of the details on the card.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the card.")}],isRequired:!0})}),f},[i,r,n,a]),s=b.useCallback((f,d)=>{typeof d=="object"&&d!==null&&("table"in d&&typeof d.table=="string"?f.table=d.table:f.table=void 0,"list"in d&&typeof d.list=="string"?f.list=d.list:f.list=void 0,"card"in d&&typeof d.card=="string"?f.card=d.card:f.card=void 0)},[]),l=b.useCallback(f=>{const{table:d,list:h,card:p}=f;return{table:d,list:h,card:p}},[]),{openManageItems:c,managedItems:u}=Y0e({id:e,title:a("Manage Columns"),description:a("Manage the order, placement, and format of columns."),items:t,keyFn:f=>f.id??f.header,columns:o,loadFn:s,saveFn:l,hideSelection:!0});return{openColumnManagement:c,managedColumns:u}}function Z0e(){return m.jsx(Le.Table,{gridBreakPoint:"",className:"page-table",children:m.jsx(Le.Tbody,{children:new Array(10).fill(0).map((e,t)=>m.jsx(Le.Tr,{children:m.jsx(Le.Td,{children:m.jsx(E.Skeleton,{height:"27px"})})},t))})})}function J0e(e){const{setPage:t,setPerPage:n}=e,r=b.useCallback((o,s)=>t(s),[t]),i=b.useCallback((o,s)=>n(s),[n]),a=!rn("md");return m.jsx(E.Pagination,{"data-cy":"pagination",variant:E.PaginationVariant.bottom,itemCount:e.itemCount,page:e.page,perPage:e.perPage,onSetPage:r,onPerPageSelect:i,perPageOptions:e.perPageOptions,style:{...e.style,boxShadow:"none",zIndex:400,paddingTop:a?4:6,paddingBottom:a?4:6},className:"border-top bg-lighten"})}function Q0e(e){const t=e.size??350,n=b.useRef(null),[r,i]=b.useState("1fr"),a=b.useCallback(s=>{let l=Math.min(e.maxColumns??12,Math.max(Math.floor(s/t),1));l<1&&(l=1),i(()=>new Array(l).fill("1fr").join(" "))},[e.maxColumns,t]);return Yo(n,s=>a(s.contentRect.width)),b.useLayoutEffect(()=>{var s;a(((s=n.current)==null?void 0:s.clientWidth)??0)},[a]),m.jsx("div",{ref:n,style:{display:"grid",gridAutoRows:"1fr",gridTemplateColumns:r,gap:16},children:e.children})}const n6=Pe.small`
409
409
  opacity: 0.7;
410
410
  `,eye=Pe.div`
411
411
  display: flex;
@@ -439,7 +439,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
439
439
  align-items: baseline;
440
440
  `;function a6(e){const{item:t,itemToCardFn:n,isSelected:r,selectItem:i,unselectItem:a,itemActions:o,showSelect:s,defaultCardSubtitle:l}=e,c=b.useMemo(()=>n(t),[t,n]),u=!!(r!=null&&r(t)),f=b.useCallback(()=>{r!=null&&r(t)?a==null||a(t):i==null||i(t)},[r,t,i,a]),d=o!==void 0&&o.length>0,h=s||d;return m.jsxs(E.Card,{id:c.id,ouiaId:c.id,isFlat:!0,isLarge:!0,isRounded:!0,isSelectable:u,isSelected:u,style:{transition:"box-shadow 0.25s",cursor:"default",maxWidth:"100%"},children:[m.jsx(E.CardHeader,{...h&&{actions:{actions:m.jsxs(m.Fragment,{children:[o&&o.length&&m.jsx(zr,{actions:o,position:Qt.right,selectedItem:t,iconOnly:!0,collapse:"always"}),s&&m.jsx(E.Checkbox,{isChecked:r==null?void 0:r(t),onChange:f,id:"check-1"})]}),hasNoOffset:!1,className:void 0}},style:{display:"flex",flexWrap:"nowrap",maxWidth:"100%"},children:m.jsxs(eye,{children:[m.jsxs(nye,{children:[c.iconAboveTitle?null:c.icon&&m.jsx(kl,{size:"xl",children:c.icon}),m.jsxs(rye,{children:[c.iconAboveTitle?m.jsx(tye,{children:c.icon&&m.jsx(kl,{size:"xl",children:c.icon})}):null,m.jsx(E.CardTitle,{children:m.jsx(E.Truncate,{content:c.title})}),c.subtitle?m.jsx(E.Text,{component:"small",style:{opacity:.7},children:c.subtitle}):l&&m.jsx(E.Text,{component:"small",style:{opacity:.7},children:l})]})]}),c.badge&&c.badgeTooltip&&m.jsx(E.FlexItem,{children:m.jsx("div",{onClick:p=>p.stopPropagation(),children:m.jsx(E.Popover,{headerContent:c.badgeTooltipTitle,bodyContent:c.badgeTooltip,children:m.jsx(E.Label,{color:c.badgeColor,children:c.badge})})})}),c.badge&&!c.badgeTooltip&&m.jsx(E.FlexItem,{children:m.jsx(E.Label,{color:c.badgeColor,children:c.badge})})]})}),c.cardBody,c.labels&&m.jsx(E.CardFooter,{children:m.jsx(iye,{children:m.jsx(aye,{children:c.labels&&m.jsx(E.LabelGroup,{numLabels:999,children:c.labels.map(p=>m.jsx(E.Label,{color:p.color,icon:p.icon,variant:p.variant,children:m.jsx(E.Truncate,{content:p.label,style:{minWidth:0}})},p.label))})})})}),c.alertTitle&&m.jsx(E.Alert,{title:c.alertTitle,isInline:!0,variant:c.alertVariant,children:c.alertContent})]},c.id??c.title)}function o6(e,t){const n=b.useMemo(()=>{let c,u,f;const d=[];let h;const p=[];for(const g of e)if(g.card!=="hidden")switch(g.type){case"description":f||(f=g);break;case"labels":h||(h=g);break;case"count":d.push(g);break;default:switch(g.card){case"name":c=g;break;case"subtitle":u=g;break;case"description":f=g;break;default:p.push(g);break}break}return{nameColumn:c,subtitleColumn:u,descriptionColumn:f,countColumns:d,cardColumns:p,labelColumn:h}},[e]),{nameColumn:r,subtitleColumn:i,descriptionColumn:a,countColumns:o,cardColumns:s,labelColumn:l}=n;return b.useMemo(()=>c=>{var h,p;let u=!!a;a!=null&&a.value&&!a.value(c)&&(u=!1);const f=s.filter(g=>!g.value||g.value(c)),d={id:t(c),icon:(h=r==null?void 0:r.icon)==null?void 0:h.call(r,c),title:m.jsx(Jt,{column:r,item:c}),subtitle:i&&(!i.value||i.value(c))&&m.jsx(Jt,{column:i,item:c}),cardBody:m.jsx(E.CardBody,{children:m.jsxs(E.DescriptionList,{isCompact:!0,children:[u&&a&&m.jsx(js,{children:a.type==="description"?m.jsx("div",{children:a.value(c)}):m.jsx(Jt,{column:a,item:c})},a.id??a.header),f.map(g=>m.jsx(js,{label:g.header,children:m.jsx(Jt,{column:g,item:c})},g.id??g.header)),o.length>0&&m.jsx(js,{children:m.jsx(r6,{children:o.map((g,v)=>m.jsxs(i6,{children:[m.jsx(Jt,{column:g,item:c}),m.jsx(n6,{children:g.header})]},v))})},"count-columns")]})}),labels:l&&((p=l.value(c))==null?void 0:p.map(g=>({label:g})))};return!u&&f.length===0&&o.length===0&&(d.cardBody=void 0),d},[s,o,a,l,r,i,t])}function tb(e){const{keyFn:t,pageItems:n,tableColumns:r,isSelected:i,selectItem:a,unselectItem:o,rowActions:s,showSelect:l,defaultSubtitle:c}=e,u=o6(r,t),f=b.useMemo(()=>m.jsx(Q0e,{size:400,children:n==null?void 0:n.map(d=>m.jsx(a6,{item:d,itemToCardFn:u,isSelected:i,selectItem:a,unselectItem:o,itemActions:s,showSelect:l,defaultCardSubtitle:c},t(d)))}),[n,t,u,i,a,o,s,l,c]);return m.jsx(E.PageSection,{style:{flexGrow:1},children:f})}function s6(e){const{keyFn:t,pageItems:n,tableColumns:r,isSelected:i,selectItem:a,unselectItem:o,rowActions:s,defaultSubtitle:l,showSelect:c}=e,u=oye(r,t,i,a,o,s,l,c);return m.jsx(E.DataList,{"aria-label":"TODO",style:{marginTop:-1,maxWidth:"100%",overflow:"hidden"},children:n==null?void 0:n.map(u)})}function oye(e,t,n,r,i,a,o,s){const l=b.useMemo(()=>{let y,x,_;const S=[];let w;const O=[],T=[];for(const k of e)if(k.list!=="hidden")switch(k.type){case"description":_||(_=k);break;case"labels":w||(w=k);break;case"count":S.push(k);break;default:switch(k.list){case"name":y=k;break;case"subtitle":x=k;break;case"description":_=k;break;case"secondary":T.push(k);break;default:O.push(k);break}break}return{nameColumn:y,subtitleColumn:x,descriptionColumn:_,countColumns:S,primaryColumns:O,secondaryColumns:T,labelColumn:w}},[e]),c=b.useCallback(y=>{n!=null&&n(y)?i==null||i(y):r==null||r(y)},[n,r,i]),{nameColumn:u,subtitleColumn:f,descriptionColumn:d,countColumns:h,primaryColumns:p,secondaryColumns:g,labelColumn:v}=l;return b.useCallback(y=>{const x=t(y),_=n==null?void 0:n(y);return m.jsx(E.DataListItem,{"aria-labelledby":`data-list-${x}`,isExpanded:_,children:m.jsxs(E.DataListItemRow,{children:[s&&m.jsx(E.DataListCheck,{"aria-labelledby":`data-list-check-${x}`,name:`data-list-check-${x}`,isChecked:n==null?void 0:n(y),onClick:()=>c(y),"data-cy":"data-list-check"}),m.jsx(E.DataListItemCells,{dataListCells:[m.jsx(E.DataListCell,{width:5,children:m.jsx(E.Flex,{children:m.jsxs(E.Stack,{hasGutter:!0,children:[m.jsxs(E.Flex,{alignItems:{default:"alignItemsCenter"},children:[(u==null?void 0:u.icon)&&m.jsx(kl,{size:"xl",children:u==null?void 0:u.icon(y)}),m.jsxs(E.Stack,{children:[m.jsx(E.Title,{headingLevel:"h2",style:{marginTop:-4,fontWeight:"bold"},"data-cy":"data-list-name",children:m.jsx("span",{id:`data-list-${x}`,children:m.jsx(Jt,{column:u,item:y})})}),f?m.jsx(E.Text,{component:"small",style:{opacity:.7},children:m.jsx(Jt,{column:f,item:y})}):o&&m.jsx(E.Text,{component:"small",style:{opacity:.7},children:o})]})]}),(d||p.length>0||h.length>0||v)&&m.jsxs(E.DescriptionList,{isCompact:!0,children:[d&&(!d.value||d.value(y))&&m.jsx(E.DescriptionListGroup,{children:m.jsx(E.DescriptionListDescription,{children:m.jsx(Jt,{column:d,item:y})})},d.header),p.map(S=>S.value&&!S.value(y)?m.jsx(m.Fragment,{}):m.jsxs(E.DescriptionListGroup,{children:[m.jsx(E.DescriptionListTerm,{style:{whiteSpace:"nowrap",opacity:.6},children:S.header}),m.jsx(E.DescriptionListDescription,{children:m.jsx(Jt,{column:S,item:y})})]},S.header)),h.length>0&&m.jsx(E.DescriptionListGroup,{children:m.jsx(E.DescriptionListDescription,{children:m.jsx("div",{style:{display:"flex",gap:16,marginTop:8,flexWrap:"wrap"},children:h.map((S,w)=>m.jsxs("div",{style:{display:"flex",gap:6,alignItems:"baseline"},children:[m.jsx(Jt,{column:S,item:y}),m.jsx("small",{style:{opacity:.7},children:S.header})]},w))})})},"counts"),v&&m.jsx(E.DescriptionListGroup,{children:m.jsx(E.DescriptionListDescription,{children:m.jsx(Jt,{column:v,item:y})})},v.header)]})]})})},"primary"),g.length>0?m.jsx(E.DataListCell,{children:m.jsx(E.DescriptionList,{isCompact:!0,children:g.map(S=>S.value&&!S.value(y)?m.jsx(m.Fragment,{}):m.jsxs(E.DescriptionListGroup,{children:[m.jsx(E.DescriptionListTerm,{style:{whiteSpace:"nowrap",opacity:.6},children:S.header}),m.jsx(E.DescriptionListDescription,{children:m.jsx(Jt,{column:S,item:y})})]},S.header))})},"secondary"):null]}),a&&m.jsx(E.DataListAction,{"aria-labelledby":"check-action-item1 check-action-action1",id:"check-action-action1","aria-label":"Actions",isPlainButtonAction:!0,style:{whiteSpace:"nowrap"},"data-cy":"data-list-action",children:m.jsx(zr,{actions:a,position:Qt.right,selectedItem:y,iconOnly:!0,collapse:"always"})})]})},x)},[t,n,s,u,f,o,p,d,h,v,g,a,c])}const sye=Pe.div`
441
441
  flex: 1;
442
- `;function Oc(e){const{id:t,toolbarActions:n,filterState:r,error:i,itemCount:a}=e,o=e.showSelect||(n==null?void 0:n.find(v=>"selection"in v&&v.selection===qe.Multiple))!==void 0,s=!e.disableTableView,l=!e.disableListView,[c,u]=b.useState(()=>{switch(e.id?localStorage.getItem(e.id+"-view"):void 0){case"table":return et.Table;case"list":return et.List;case"cards":return et.Cards}return e.defaultTableView??(s?et.Table:l?et.List:et.Cards)}),f=b.useCallback(v=>{u(v),e.id&&localStorage.setItem(e.id+"-view",v)},[e.id]),{openColumnManagement:d,managedColumns:h}=X0e((t??"")+"-columns",e.tableColumns,c!==et.Table,c!==et.List,c!==et.Cards),p=R0e(e.tableColumns);if(i)return m.jsx(W0e,{titleProp:e.errorStateTitle,message:i.message});if(a===0&&Object.keys(r??{}).length===0)return m.jsx(U0e,{title:e.emptyStateTitle,description:e.emptyStateDescription,button:e.emptyStateButtonClick&&m.jsx(E.Button,{"data-cy":e.emptyStateButtonText?fye(e.emptyStateButtonText):"create-resource",variant:"primary",onClick:e.emptyStateButtonClick,icon:e.emptyStateButtonIcon?e.emptyStateButtonIcon:null,children:e.emptyStateButtonText})||e.emptyStateActions&&m.jsx(E.Flex,{justifyContent:{default:"justifyContentCenter"},children:m.jsx(zr,{actions:e.emptyStateActions})})});let g=e.topContent;return g&&(g=m.jsx(E.PageSection,{variant:"light",padding:{default:"noPadding"},style:{borderBottom:"thin solid var(--pf-v5-global--BorderColor--100)"},children:e.topContent})),m.jsxs(m.Fragment,{children:[m.jsx(ZA,{...e,openColumnModal:e.id?d:void 0,showSelect:o,viewType:c,setViewType:f,sortOptions:p,limitFiltersToOneOrOperation:e.limitFiltersToOneOrOperation}),c===et.Table&&m.jsx(m.Fragment,{children:e.scrollTopContent?m.jsxs(Cr,{children:[g,!e.hideTable&&m.jsx(l6,{...e,tableColumns:h})]}):m.jsxs(m.Fragment,{children:[g,!e.hideTable&&m.jsx(l6,{...e,tableColumns:h})]})}),c===et.List&&m.jsx(m.Fragment,{children:e.scrollTopContent?m.jsxs(Cr,{children:[g,m.jsx(E.PageSection,{padding:{default:"noPadding"},children:!e.hideTable&&m.jsx(s6,{...e,showSelect:o,tableColumns:h})})]}):m.jsxs(m.Fragment,{children:[g,m.jsx(Cr,{children:m.jsx(E.PageSection,{padding:{default:"noPadding"},children:!e.hideTable&&m.jsx(s6,{...e,showSelect:o,tableColumns:h})})})]})}),c===et.Cards&&m.jsx(m.Fragment,{children:e.scrollTopContent?m.jsxs(Cr,{children:[g,!e.hideTable&&m.jsx(tb,{...e,showSelect:o,tableColumns:h})]}):m.jsxs(m.Fragment,{children:[g,m.jsx(Cr,{children:!e.hideTable&&m.jsx(tb,{...e,showSelect:o,tableColumns:h})})]})}),!e.disablePagination&&(!e.autoHidePagination||(e.itemCount??0)>e.perPage)&&m.jsx(J0e,{...e,topBorder:!e.autoHidePagination})]})}function l6(e){const{pageItems:t,selectItem:n,unselectItem:r,isSelected:i,isSelectMultiple:a,keyFn:o,rowActions:s,toolbarActions:l,itemCount:c,clearAllFilters:u,onSelect:f,unselectAll:d,maxSelections:h}=e,p=qy(e.tableColumns),g=DA(e.tableColumns),v=$A(e.tableColumns),y=b.useMemo(()=>{const A=[];if(g.length)for(const P of g)"value"in P?A.push(D=>{var B;const I=(B=P.value)==null?void 0:B.call(P,D);if(I)return m.jsx("div",{children:I},P.id??P.header)}):A.push(D=>P.cell(D));return v.length&&A.push(P=>v.some(I=>{var B;return((B=I.value)==null?void 0:B.call(I,P))!==void 0})?m.jsx(CA,{disablePadding:!0,numberOfColumns:"multiple",labelOrientation:"vertical",isCompact:!0,disableScroll:!0,children:m.jsx(LA,{item:P,columns:v},o(P))}):null),e.expandedRow&&A.push(e.expandedRow),A.length===0?void 0:P=>A.map(I=>I(P)).filter(I=>I!=null).length===0?null:m.jsx(E.Stack,{hasGutter:!0,children:A.map(I=>I(P))})},[g,v,o,e.expandedRow]),[x]=Pt(),_=e.showSelect||(l==null?void 0:l.find(A=>"selection"in A&&A.selection===qe.Multiple))!==void 0,S=b.useRef(null),[w,O]=b.useState({left:0,right:0,top:0,bottom:0}),T=b.useCallback(A=>{A&&O({top:A.scrollTop,bottom:A.scrollHeight-A.clientHeight-A.scrollTop,left:A.scrollLeft,right:A.scrollWidth-A.clientWidth-A.scrollLeft})},[]),k=b.useCallback(A=>T(A.currentTarget),[T]);Yo(S,()=>T(S.current)),b.useEffect(()=>T(S.current),[T]);const $=za();let M;return e.itemCount===void 0||t===void 0?M=m.jsx(Z0e,{}):M=m.jsxs(m.Fragment,{children:[m.jsxs(Le.Table,{"aria-label":"Simple table",ouiaId:"simple-table",variant:e.compact||$.tableLayout==="compact"?"compact":void 0,borders:!e.borderless,gridBreakPoint:"",isStickyHeader:!0,className:"page-table",children:[m.jsx(lye,{...e,showSelect:_,scrollLeft:w.left>0,scrollRight:w.right>1,tableColumns:p,onSelect:f,expandedRow:y}),m.jsx(Le.Tbody,{children:t.map((A,j)=>m.jsx(cye,{columns:p,item:A,isItemSelected:i==null?void 0:i(A),isSelectMultiple:a,selectItem:n,unselectItem:r,rowActions:s,rowIndex:j,showSelect:_,scrollLeft:w.left>0,scrollRight:w.right>1,unselectAll:d,onSelect:f,expandedRow:y,isLastRow:j===t.length-1,disableLastRowBorder:e.disableLastRowBorder,maxSelections:h,selectedItems:e.selectedItems,defaultExpandedRows:e.defaultExpandedRows},o?o(A):j))})]}),c===0&&m.jsxs(E.EmptyState,{isFullHeight:!0,children:[m.jsx(E.EmptyStateHeader,{titleText:m.jsx(m.Fragment,{children:x.noResultsFound}),icon:m.jsx(E.EmptyStateIcon,{icon:ve.SearchIcon}),headingLevel:"h2"}),m.jsx(E.EmptyStateBody,{children:x.noResultsMatchCriteria}),m.jsx(E.EmptyStateFooter,{children:u&&m.jsx(E.EmptyStateActions,{children:m.jsx(E.Button,{variant:"primary",onClick:u,children:x.clearAllFilters})})})]})]}),e.scrollTopContent||(M=m.jsx(sye,{className:"pf-v5-c-scroll-inner-wrapper",ref:S,onScroll:k,style:{backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:M})),M}function lye(e){const{tableColumns:t,rowActions:n,sort:r,setSort:i,sortDirection:a,setSortDirection:o,showSelect:s,onSelect:l,expandedRow:c}=e,u=b.useCallback((f,d)=>{if(d.sort)return{onSort:(h,p,g)=>{d.sort&&(i==null||i(d.sort),o==null||o(g))},sortBy:{index:d.sort===r?f:void 0,direction:d.sort===r?a:void 0,defaultDirection:d.defaultSortDirection},columnIndex:f}},[i,o,r,a]);return m.jsx(Le.Thead,{children:m.jsxs(Le.Tr,{className:"bg-lighten",children:[c&&m.jsx(Le.Th,{style:{padding:0},className:"bg-lighten"}),(s||l)&&m.jsx(Le.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft,"data-cy":"selections-column-header",className:e.scrollLeft?"bg-lighten-2":"bg-lighten",children:" "}),t.map((f,d)=>m.jsx(Le.Th,{sort:u(d,f),modifier:"nowrap",style:{minWidth:f.minWidth===0?"1%":f.minWidth!==void 0?f.minWidth:void 0,maxWidth:f.maxWidth!==void 0?f.maxWidth:void 0,width:f.fullWidth?"100%":void 0},"data-cy":gi(f.header+"-column-header"),className:"bg-lighten",children:f.header},f.header)),n!==void 0&&m.jsx(Le.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0,zIndex:302},className:e.scrollRight?"pf-m-border-left bg-lighten-2":"bg-lighten","data-cy":"action-column-header",children:" "})]})})}function cye(e){const{columns:t,unselectAll:n,selectItem:r,unselectItem:i,isItemSelected:a,isSelectMultiple:o,item:s,rowActions:l,rowIndex:c,showSelect:u,onSelect:f,expandedRow:d,disableLastRowBorder:h,maxSelections:p,selectedItems:g}=e,v=d==null?void 0:d(s),[y,x]=b.useState(!!e.defaultExpandedRows&&!!v),_=za(),S=b.useCallback(w=>(g==null?void 0:g.length)===p?!(g!=null&&g.includes(w)):!1,[p,g]);return m.jsxs(m.Fragment,{children:[m.jsxs(Le.Tr,{style:{boxShadow:"unset",borderBottom:y||e.isLastRow&&h?"unset":void 0,cursor:f?"pointer":"default"},"data-cy":"id"in s&&(typeof s.id=="string"||typeof s.id=="number")?`row-id-${s.id.toString()}`:`row-${c}`,className:a?"selected":void 0,onClick:()=>{f&&(o||n==null||n(),o&&a?i==null||i(s):r==null||r(s),f(s))},children:[d&&m.jsx(Le.Td,{expand:v?{rowIndex:c,isExpanded:y,onToggle:()=>x(w=>!w)}:void 0,style:{paddingLeft:v?8:4},"data-cy":"expand-column-cell"}),u&&m.jsx(Le.Th,{select:a!==void 0?{onSelect:(w,O)=>{O?r==null||r(s):i==null||i(s)},isSelected:a,isDisabled:p&&g?S(s):!1}:void 0,isStickyColumn:e.scrollLeft,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft,"data-cy":"checkbox-column-cell",className:e.scrollLeft?"bg-lighten":void 0}),f&&m.jsx(Le.Td,{select:{rowIndex:c,isSelected:a??!1,variant:o?"checkbox":"radio",isDisabled:p&&g?S(s):!1},isStickyColumn:e.scrollLeft,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft,"data-cy":"checkbox-column-cell",className:e.scrollLeft?"bg-lighten":void 0}),m.jsx(uye,{columns:t,item:s,rowActions:l,scrollLeft:e.scrollLeft,scrollRight:e.scrollRight})]}),d&&y&&v&&m.jsxs(Le.Tr,{isExpanded:y,style:{boxShadow:"unset"},className:a?"selected":void 0,children:[m.jsx(Le.Td,{}),u&&m.jsx(Le.Th,{isStickyColumn:e.scrollLeft,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft,className:e.scrollLeft?"bg-lighten":void 0}),f&&m.jsx(Le.Td,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft}),m.jsx(Le.Td,{colSpan:t.length,style:{paddingBottom:_.tableLayout==="compact"?12:24,paddingTop:0},children:m.jsx(Le.CollapseColumn,{children:v})}),l!==void 0&&l.length>0&&m.jsx(Le.Td,{isActionCell:!0,isStickyColumn:e.scrollRight,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0},className:e.scrollRight?"pf-m-border-left bg-lighten":void 0,children:" "})]})]})}function uye(e){const{columns:t,item:n,rowActions:r}=e,[i,a]=b.useState(!1);return m.jsxs(b.Fragment,{children:[t.map(o=>m.jsx(Le.Td,{dataLabel:o.header,modifier:"nowrap",style:{width:o.minWidth===0?"0%":void 0},"data-cy":gi(o.header+"-column-cell"),children:m.jsx(Jt,{item:n,column:o})},o.header)),r!==void 0&&r.length>0&&m.jsx(Le.Td,{isActionCell:!0,isStickyColumn:e.scrollRight,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:8,zIndex:i?400:void 0},"data-cy":"actions-column-cell",className:e.scrollRight?"pf-m-border-left bg-lighten":void 0,children:m.jsx(zr,{actions:r,selectedItem:n,position:Qt.right,iconOnly:!0,onOpen:a})})]})}function fye(e){return e.toLowerCase().split(" ").join("-")}function dye(){const e=b.useRef(new AbortController);return b.useEffect(()=>{const t=e.current;return()=>t.abort()},[]),e.current}function c6(e){const{title:t,items:n,keyFn:r,actionColumns:i,actionFn:a,onComplete:o,onClose:s,processingText:l,isDanger:c,errorAdapter:u=wc,description:f}=e,{t:d}=Ie(),[h]=Pt(),[p,g]=b.useState(!0),[v,y]=b.useState(!1),[x,_]=b.useState(0),[S,w]=b.useState(""),[O,T]=b.useState(),k=dye(),[$,M]=Fi(),A=b.useCallback(()=>{y(!0),k.abort(),g(!1),T(I=>{const B={...I};for(const R of n){const V=r(R);B[V]===void 0&&(B[V]=d("Cancelled"))}return B})},[k,n,r,d]),j=b.useCallback(()=>{M(void 0),s==null||s()},[s,M]);b.useEffect(()=>{async function I(){const B=T0e(5);let R=0;const V=[];await Promise.all(n.map(W=>B(async()=>{if(k.signal.aborted)return;const L=r(W);try{await a(W,k.signal),k.signal.aborted||T(H=>({...H??{},[L]:null})),V.push(W)}catch(H){const{genericErrors:J,fieldErrors:ne}=u(H),te=[...J,...ne.filter(K=>K.message)];if(!k.signal.aborted){if(H instanceof Error){const K=typeof te[0].message=="string"&&te.length===1?te[0].message:d("Unknown error");T(re=>({...re??{},[L]:K}))}else T(K=>({...K??{},[L]:d("Unknown error")}));w(h.errorText)}}finally{k.signal.aborted||_(++R)}}))),k.signal.aborted||g(!1),o==null||o(V)}I()},[k,a,n,r,o,h.errorText,d,u]);const P=Sc(n),D=Lh(i);return m.jsxs(E.Modal,{titleIconVariant:c?"warning":void 0,title:t,ouiaId:t,"aria-label":t,description:f,variant:E.ModalVariant.medium,isOpen:!0,onClose:()=>{A(),j()},actions:p?[m.jsx(E.Button,{variant:"link",onClick:A,children:h.cancelText},"cancel")]:[m.jsx(E.Button,{variant:"secondary",onClick:j,children:h.closeText},"close")],hasNoBodyWrapper:!0,children:[m.jsx(E.ModalBoxBody,{style:{paddingBottom:0,paddingLeft:0,paddingRight:0},children:m.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:560,overflow:"hidden",borderTop:"thin solid var(--pf-v5-global--BorderColor--100)"},children:m.jsx(Oc,{pageItems:[...P.paged],itemCount:n.length,tableColumns:[...D,{header:d("Status"),cell:I=>{const B=r(I),R=O==null?void 0:O[B];return R===void 0?m.jsxs("span",{style:{color:lm},children:[m.jsx(ve.PendingIcon,{}),"  ",h.pendingText]}):R===null?m.jsxs("span",{style:{color:om},children:[m.jsx(ve.CheckCircleIcon,{}),"  ",h.successText]}):m.jsxs("span",{style:{color:sm},children:[m.jsx(ve.ExclamationCircleIcon,{}),"  ",O==null?void 0:O[B]]})}}],keyFn:r,compact:!0,errorStateTitle:"",emptyStateTitle:d("No items"),autoHidePagination:!0,disableBodyPadding:!0,...P},"status")})}),m.jsx(E.ModalBoxBody,{style:{paddingTop:0},children:m.jsx(E.Progress,{"data-cy":"progress",value:x/n.length*100,title:k.signal.aborted?h.canceledText:S?h.errorText:p?l??h.processingText:h.successText,size:E.ProgressSize.lg,variant:S||v?E.ProgressVariant.danger:x===n.length?E.ProgressVariant.success:void 0})})]})}function u6(e=wc){const[t,n]=Fi(),[r,i]=b.useState();return b.useEffect(()=>{if(r){const a=()=>{var o;i(void 0),(o=r.onClose)==null||o.call(r)};n(m.jsx(c6,{...r,errorAdapter:r.errorAdapter??e,onClose:a}))}else n(void 0)},[r,n,e]),i}function f6(e,t){if(e===void 0&&t===void 0)return 0;if(e===void 0)return 1;if(t===void 0)return-1;if(typeof e=="string"){if(typeof t=="string")return Cc(e,t);if(typeof t=="number")return Cc(e,t.toString())}else if(typeof e=="number"){if(typeof t=="number")return d6(e,t);if(typeof t=="string")return Cc(e.toString(),t)}return 0}function Cc(e,t){return e===void 0&&t===void 0?0:e==null?1:t==null||e<t?-1:e>t?1:0}function d6(e,t){return e===void 0&&t===void 0?0:e==null?1:t==null||e<t?-1:e>t?1:0}const hye=Pe.div`
442
+ `;function Oc(e){const{id:t,toolbarActions:n,filterState:r,error:i,itemCount:a}=e,o=e.showSelect||(n==null?void 0:n.find(v=>"selection"in v&&v.selection===qe.Multiple))!==void 0,s=!e.disableTableView,l=!e.disableListView,[c,u]=b.useState(()=>{switch(e.id?localStorage.getItem(e.id+"-view"):void 0){case"table":return et.Table;case"list":return et.List;case"cards":return et.Cards}return e.defaultTableView??(s?et.Table:l?et.List:et.Cards)}),f=b.useCallback(v=>{u(v),e.id&&localStorage.setItem(e.id+"-view",v)},[e.id]),{openColumnManagement:d,managedColumns:h}=X0e((t??"")+"-columns",e.tableColumns,c!==et.Table,c!==et.List,c!==et.Cards),p=R0e(e.tableColumns);if(i)return m.jsx(W0e,{titleProp:e.errorStateTitle,message:i.message});if(a===0&&Object.keys(r??{}).length===0)return m.jsx(U0e,{title:e.emptyStateTitle,description:e.emptyStateDescription,icon:e.emptyStateNoDataIcon,button:e.emptyStateButtonClick&&m.jsx(E.Button,{"data-cy":e.emptyStateButtonText?fye(e.emptyStateButtonText):"create-resource",variant:"primary",onClick:e.emptyStateButtonClick,icon:e.emptyStateButtonIcon?e.emptyStateButtonIcon:null,children:e.emptyStateButtonText})||e.emptyStateActions&&m.jsx(E.Flex,{justifyContent:{default:"justifyContentCenter"},children:m.jsx(zr,{actions:e.emptyStateActions})})});let g=e.topContent;return g&&(g=m.jsx(E.PageSection,{variant:"light",padding:{default:"noPadding"},style:{borderBottom:"thin solid var(--pf-v5-global--BorderColor--100)"},children:e.topContent})),m.jsxs(m.Fragment,{children:[m.jsx(ZA,{...e,openColumnModal:e.id?d:void 0,showSelect:o,viewType:c,setViewType:f,sortOptions:p,limitFiltersToOneOrOperation:e.limitFiltersToOneOrOperation}),c===et.Table&&m.jsx(m.Fragment,{children:e.scrollTopContent?m.jsxs(Cr,{children:[g,!e.hideTable&&m.jsx(l6,{...e,tableColumns:h})]}):m.jsxs(m.Fragment,{children:[g,!e.hideTable&&m.jsx(l6,{...e,tableColumns:h})]})}),c===et.List&&m.jsx(m.Fragment,{children:e.scrollTopContent?m.jsxs(Cr,{children:[g,m.jsx(E.PageSection,{padding:{default:"noPadding"},children:!e.hideTable&&m.jsx(s6,{...e,showSelect:o,tableColumns:h})})]}):m.jsxs(m.Fragment,{children:[g,m.jsx(Cr,{children:m.jsx(E.PageSection,{padding:{default:"noPadding"},children:!e.hideTable&&m.jsx(s6,{...e,showSelect:o,tableColumns:h})})})]})}),c===et.Cards&&m.jsx(m.Fragment,{children:e.scrollTopContent?m.jsxs(Cr,{children:[g,!e.hideTable&&m.jsx(tb,{...e,showSelect:o,tableColumns:h})]}):m.jsxs(m.Fragment,{children:[g,m.jsx(Cr,{children:!e.hideTable&&m.jsx(tb,{...e,showSelect:o,tableColumns:h})})]})}),!e.disablePagination&&(!e.autoHidePagination||(e.itemCount??0)>e.perPage)&&m.jsx(J0e,{...e,topBorder:!e.autoHidePagination})]})}function l6(e){const{pageItems:t,selectItem:n,unselectItem:r,isSelected:i,isSelectMultiple:a,keyFn:o,rowActions:s,toolbarActions:l,itemCount:c,clearAllFilters:u,onSelect:f,unselectAll:d,maxSelections:h}=e,p=qy(e.tableColumns),g=DA(e.tableColumns),v=$A(e.tableColumns),y=b.useMemo(()=>{const A=[];if(g.length)for(const P of g)"value"in P?A.push(D=>{var B;const I=(B=P.value)==null?void 0:B.call(P,D);if(I)return m.jsx("div",{children:I},P.id??P.header)}):A.push(D=>P.cell(D));return v.length&&A.push(P=>v.some(I=>{var B;return((B=I.value)==null?void 0:B.call(I,P))!==void 0})?m.jsx(CA,{disablePadding:!0,numberOfColumns:"multiple",labelOrientation:"vertical",isCompact:!0,disableScroll:!0,children:m.jsx(LA,{item:P,columns:v},o(P))}):null),e.expandedRow&&A.push(e.expandedRow),A.length===0?void 0:P=>A.map(I=>I(P)).filter(I=>I!=null).length===0?null:m.jsx(E.Stack,{hasGutter:!0,children:A.map(I=>I(P))})},[g,v,o,e.expandedRow]),[x]=Pt(),_=e.showSelect||(l==null?void 0:l.find(A=>"selection"in A&&A.selection===qe.Multiple))!==void 0,S=b.useRef(null),[w,O]=b.useState({left:0,right:0,top:0,bottom:0}),T=b.useCallback(A=>{A&&O({top:A.scrollTop,bottom:A.scrollHeight-A.clientHeight-A.scrollTop,left:A.scrollLeft,right:A.scrollWidth-A.clientWidth-A.scrollLeft})},[]),k=b.useCallback(A=>T(A.currentTarget),[T]);Yo(S,()=>T(S.current)),b.useEffect(()=>T(S.current),[T]);const $=za();let M;return e.itemCount===void 0||t===void 0?M=m.jsx(Z0e,{}):M=m.jsxs(m.Fragment,{children:[m.jsxs(Le.Table,{"aria-label":"Simple table",ouiaId:"simple-table",variant:e.compact||$.tableLayout==="compact"?"compact":void 0,borders:!e.borderless,gridBreakPoint:"",isStickyHeader:!0,className:"page-table",children:[m.jsx(lye,{...e,showSelect:_,scrollLeft:w.left>0,scrollRight:w.right>1,tableColumns:p,onSelect:f,expandedRow:y}),m.jsx(Le.Tbody,{children:t.map((A,j)=>m.jsx(cye,{columns:p,item:A,isItemSelected:i==null?void 0:i(A),isSelectMultiple:a,selectItem:n,unselectItem:r,rowActions:s,rowIndex:j,showSelect:_,scrollLeft:w.left>0,scrollRight:w.right>1,unselectAll:d,onSelect:f,expandedRow:y,isLastRow:j===t.length-1,disableLastRowBorder:e.disableLastRowBorder,maxSelections:h,selectedItems:e.selectedItems,defaultExpandedRows:e.defaultExpandedRows},o?o(A):j))})]}),c===0&&m.jsxs(E.EmptyState,{isFullHeight:!0,children:[m.jsx(E.EmptyStateHeader,{titleText:m.jsx(m.Fragment,{children:x.noResultsFound}),icon:m.jsx(E.EmptyStateIcon,{icon:e.emptyStateIcon??ve.SearchIcon}),headingLevel:"h2"}),m.jsx(E.EmptyStateBody,{children:x.noResultsMatchCriteria}),m.jsx(E.EmptyStateFooter,{children:u&&m.jsx(E.EmptyStateActions,{children:m.jsx(E.Button,{variant:"primary",onClick:u,children:x.clearAllFilters})})})]})]}),e.scrollTopContent||(M=m.jsx(sye,{className:"pf-v5-c-scroll-inner-wrapper",ref:S,onScroll:k,style:{backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:M})),M}function lye(e){const{tableColumns:t,rowActions:n,sort:r,setSort:i,sortDirection:a,setSortDirection:o,showSelect:s,onSelect:l,expandedRow:c}=e,u=b.useCallback((f,d)=>{if(d.sort)return{onSort:(h,p,g)=>{d.sort&&(i==null||i(d.sort),o==null||o(g))},sortBy:{index:d.sort===r?f:void 0,direction:d.sort===r?a:void 0,defaultDirection:d.defaultSortDirection},columnIndex:f}},[i,o,r,a]);return m.jsx(Le.Thead,{children:m.jsxs(Le.Tr,{className:"bg-lighten",children:[c&&m.jsx(Le.Th,{style:{padding:0},className:"bg-lighten"}),(s||l)&&m.jsx(Le.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft,"data-cy":"selections-column-header",className:e.scrollLeft?"bg-lighten-2":"bg-lighten",children:" "}),t.map((f,d)=>m.jsx(Le.Th,{sort:u(d,f),modifier:"nowrap",style:{minWidth:f.minWidth===0?"1%":f.minWidth!==void 0?f.minWidth:void 0,maxWidth:f.maxWidth!==void 0?f.maxWidth:void 0,width:f.fullWidth?"100%":void 0},"data-cy":gi(f.header+"-column-header"),className:"bg-lighten",children:f.header},f.header)),n!==void 0&&m.jsx(Le.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0,zIndex:302},className:e.scrollRight?"pf-m-border-left bg-lighten-2":"bg-lighten","data-cy":"action-column-header",children:" "})]})})}function cye(e){const{columns:t,unselectAll:n,selectItem:r,unselectItem:i,isItemSelected:a,isSelectMultiple:o,item:s,rowActions:l,rowIndex:c,showSelect:u,onSelect:f,expandedRow:d,disableLastRowBorder:h,maxSelections:p,selectedItems:g}=e,v=d==null?void 0:d(s),[y,x]=b.useState(!!e.defaultExpandedRows&&!!v),_=za(),S=b.useCallback(w=>(g==null?void 0:g.length)===p?!(g!=null&&g.includes(w)):!1,[p,g]);return m.jsxs(m.Fragment,{children:[m.jsxs(Le.Tr,{style:{boxShadow:"unset",borderBottom:y||e.isLastRow&&h?"unset":void 0,cursor:f?"pointer":"default"},"data-cy":"id"in s&&(typeof s.id=="string"||typeof s.id=="number")?`row-id-${s.id.toString()}`:`row-${c}`,className:a?"selected":void 0,onClick:()=>{f&&(o||n==null||n(),o&&a?i==null||i(s):r==null||r(s),f(s))},children:[d&&m.jsx(Le.Td,{expand:v?{rowIndex:c,isExpanded:y,onToggle:()=>x(w=>!w)}:void 0,style:{paddingLeft:v?8:4},"data-cy":"expand-column-cell"}),u&&m.jsx(Le.Th,{select:a!==void 0?{onSelect:(w,O)=>{O?r==null||r(s):i==null||i(s)},isSelected:a,isDisabled:p&&g?S(s):!1}:void 0,isStickyColumn:e.scrollLeft,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft,"data-cy":"checkbox-column-cell",className:e.scrollLeft?"bg-lighten":void 0}),f&&m.jsx(Le.Td,{select:{rowIndex:c,isSelected:a??!1,variant:o?"checkbox":"radio",isDisabled:p&&g?S(s):!1},isStickyColumn:e.scrollLeft,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft,"data-cy":"checkbox-column-cell",className:e.scrollLeft?"bg-lighten":void 0}),m.jsx(uye,{columns:t,item:s,rowActions:l,scrollLeft:e.scrollLeft,scrollRight:e.scrollRight})]}),d&&y&&v&&m.jsxs(Le.Tr,{isExpanded:y,style:{boxShadow:"unset"},className:a?"selected":void 0,children:[m.jsx(Le.Td,{}),u&&m.jsx(Le.Th,{isStickyColumn:e.scrollLeft,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft,className:e.scrollLeft?"bg-lighten":void 0}),f&&m.jsx(Le.Td,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:e.scrollLeft}),m.jsx(Le.Td,{colSpan:t.length,style:{paddingBottom:_.tableLayout==="compact"?12:24,paddingTop:0},children:m.jsx(Le.CollapseColumn,{children:v})}),l!==void 0&&l.length>0&&m.jsx(Le.Td,{isActionCell:!0,isStickyColumn:e.scrollRight,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0},className:e.scrollRight?"pf-m-border-left bg-lighten":void 0,children:" "})]})]})}function uye(e){const{columns:t,item:n,rowActions:r}=e,[i,a]=b.useState(!1);return m.jsxs(b.Fragment,{children:[t.map(o=>m.jsx(Le.Td,{dataLabel:o.header,modifier:"nowrap",style:{width:o.minWidth===0?"0%":void 0},"data-cy":gi(o.header+"-column-cell"),children:m.jsx(Jt,{item:n,column:o})},o.header)),r!==void 0&&r.length>0&&m.jsx(Le.Td,{isActionCell:!0,isStickyColumn:e.scrollRight,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:8,zIndex:i?400:void 0},"data-cy":"actions-column-cell",className:e.scrollRight?"pf-m-border-left bg-lighten":void 0,children:m.jsx(zr,{actions:r,selectedItem:n,position:Qt.right,iconOnly:!0,onOpen:a})})]})}function fye(e){return e.toLowerCase().split(" ").join("-")}function dye(){const e=b.useRef(new AbortController);return b.useEffect(()=>{const t=e.current;return()=>t.abort()},[]),e.current}function c6(e){const{title:t,items:n,keyFn:r,actionColumns:i,actionFn:a,onComplete:o,onClose:s,processingText:l,isDanger:c,errorAdapter:u=wc,description:f}=e,{t:d}=Ie(),[h]=Pt(),[p,g]=b.useState(!0),[v,y]=b.useState(!1),[x,_]=b.useState(0),[S,w]=b.useState(""),[O,T]=b.useState(),k=dye(),[$,M]=Fi(),A=b.useCallback(()=>{y(!0),k.abort(),g(!1),T(I=>{const B={...I};for(const R of n){const V=r(R);B[V]===void 0&&(B[V]=d("Cancelled"))}return B})},[k,n,r,d]),j=b.useCallback(()=>{M(void 0),s==null||s()},[s,M]);b.useEffect(()=>{async function I(){const B=T0e(5);let R=0;const V=[];await Promise.all(n.map(W=>B(async()=>{if(k.signal.aborted)return;const L=r(W);try{await a(W,k.signal),k.signal.aborted||T(H=>({...H??{},[L]:null})),V.push(W)}catch(H){const{genericErrors:J,fieldErrors:ne}=u(H),te=[...J,...ne.filter(K=>K.message)];if(!k.signal.aborted){if(H instanceof Error){const K=typeof te[0].message=="string"&&te.length===1?te[0].message:d("Unknown error");T(re=>({...re??{},[L]:K}))}else T(K=>({...K??{},[L]:d("Unknown error")}));w(h.errorText)}}finally{k.signal.aborted||_(++R)}}))),k.signal.aborted||g(!1),o==null||o(V)}I()},[k,a,n,r,o,h.errorText,d,u]);const P=Sc(n),D=Lh(i);return m.jsxs(E.Modal,{titleIconVariant:c?"warning":void 0,title:t,ouiaId:t,"aria-label":t,description:f,variant:E.ModalVariant.medium,isOpen:!0,onClose:()=>{A(),j()},actions:p?[m.jsx(E.Button,{variant:"link",onClick:A,children:h.cancelText},"cancel")]:[m.jsx(E.Button,{variant:"secondary",onClick:j,children:h.closeText},"close")],hasNoBodyWrapper:!0,children:[m.jsx(E.ModalBoxBody,{style:{paddingBottom:0,paddingLeft:0,paddingRight:0},children:m.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:560,overflow:"hidden",borderTop:"thin solid var(--pf-v5-global--BorderColor--100)"},children:m.jsx(Oc,{pageItems:[...P.paged],itemCount:n.length,tableColumns:[...D,{header:d("Status"),cell:I=>{const B=r(I),R=O==null?void 0:O[B];return R===void 0?m.jsxs("span",{style:{color:lm},children:[m.jsx(ve.PendingIcon,{}),"  ",h.pendingText]}):R===null?m.jsxs("span",{style:{color:om},children:[m.jsx(ve.CheckCircleIcon,{}),"  ",h.successText]}):m.jsxs("span",{style:{color:sm},children:[m.jsx(ve.ExclamationCircleIcon,{}),"  ",O==null?void 0:O[B]]})}}],keyFn:r,compact:!0,errorStateTitle:"",emptyStateTitle:d("No items"),autoHidePagination:!0,disableBodyPadding:!0,...P},"status")})}),m.jsx(E.ModalBoxBody,{style:{paddingTop:0},children:m.jsx(E.Progress,{"data-cy":"progress",value:x/n.length*100,title:k.signal.aborted?h.canceledText:S?h.errorText:p?l??h.processingText:h.successText,size:E.ProgressSize.lg,variant:S||v?E.ProgressVariant.danger:x===n.length?E.ProgressVariant.success:void 0})})]})}function u6(e=wc){const[t,n]=Fi(),[r,i]=b.useState();return b.useEffect(()=>{if(r){const a=()=>{var o;i(void 0),(o=r.onClose)==null||o.call(r)};n(m.jsx(c6,{...r,errorAdapter:r.errorAdapter??e,onClose:a}))}else n(void 0)},[r,n,e]),i}function f6(e,t){if(e===void 0&&t===void 0)return 0;if(e===void 0)return 1;if(t===void 0)return-1;if(typeof e=="string"){if(typeof t=="string")return Cc(e,t);if(typeof t=="number")return Cc(e,t.toString())}else if(typeof e=="number"){if(typeof t=="number")return d6(e,t);if(typeof t=="string")return Cc(e.toString(),t)}return 0}function Cc(e,t){return e===void 0&&t===void 0?0:e==null?1:t==null||e<t?-1:e>t?1:0}function d6(e,t){return e===void 0&&t===void 0?0:e==null?1:t==null||e<t?-1:e>t?1:0}const hye=Pe.div`
443
443
  display: flex;
444
444
  flex-direction: column;
445
445
  max-height: 560px;
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.1901",
4
+ "version": "2.4.1903",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",