@ansible/ansible-ui-framework 2.4.375 → 2.4.377
Sign up to get free protection for your applications and to get access to all the features.
- package/framework/PageTable/PageTable.d.ts +4 -7
- package/framework/hooks/useClipboard.d.ts +6 -0
- package/index.js +29 -29
- package/index.umd.cjs +2 -2
- package/package.json +1 -1
@@ -4,12 +4,6 @@ import { PageTableViewType } from '../PageToolbar/PageTableViewType';
|
|
4
4
|
import { IFilterState, IToolbarFilter } from '../PageToolbar/PageToolbarFilter';
|
5
5
|
import './PageTable.css';
|
6
6
|
import { ITableColumn } from './PageTableColumn';
|
7
|
-
export type IPaginationRelatedProps = {
|
8
|
-
page: number;
|
9
|
-
perPage: number;
|
10
|
-
setPage: (page: number) => void;
|
11
|
-
setPerPage: (perPage: number) => void;
|
12
|
-
};
|
13
7
|
export type PageTableProps<T extends object> = {
|
14
8
|
id?: string;
|
15
9
|
keyFn: (item: T) => string | number;
|
@@ -22,7 +16,10 @@ export type PageTableProps<T extends object> = {
|
|
22
16
|
filterState?: IFilterState;
|
23
17
|
setFilterState?: Dispatch<SetStateAction<IFilterState>>;
|
24
18
|
clearAllFilters?: () => void;
|
25
|
-
|
19
|
+
page: number;
|
20
|
+
perPage: number;
|
21
|
+
setPage: (page: number) => void;
|
22
|
+
setPerPage: (perPage: number) => void;
|
26
23
|
sort?: string;
|
27
24
|
setSort?: (sort: string) => void;
|
28
25
|
sortDirection?: 'asc' | 'desc';
|
package/index.js
CHANGED
@@ -36073,15 +36073,15 @@ const KKe = mn.div`
|
|
36073
36073
|
padding-bottom: 5px;
|
36074
36074
|
`;
|
36075
36075
|
function Tk(n) {
|
36076
|
-
const { id: e, toolbarActions: t, filterState: i, error: r, itemCount: o, disableBodyPadding: s
|
36076
|
+
const { id: e, toolbarActions: t, filterState: i, error: r, itemCount: o, disableBodyPadding: s } = n, { openColumnManagement: a, managedColumns: l } = IKe(
|
36077
36077
|
(e ?? "") + "-columns",
|
36078
36078
|
n.tableColumns,
|
36079
36079
|
n.disableTableView,
|
36080
36080
|
n.disableListView,
|
36081
36081
|
n.disableCardView
|
36082
|
-
),
|
36083
|
-
(
|
36084
|
-
)) !== void 0,
|
36082
|
+
), c = n.showSelect || (t == null ? void 0 : t.find(
|
36083
|
+
(v) => "selection" in v && v.selection === hi.Multiple
|
36084
|
+
)) !== void 0, u = !n.disableTableView, d = !n.disableListView, [h, f] = Ve(() => {
|
36085
36085
|
switch (n.id ? localStorage.getItem(n.id + "-view") : void 0) {
|
36086
36086
|
case "table":
|
36087
36087
|
return Xn.Table;
|
@@ -36090,13 +36090,13 @@ function Tk(n) {
|
|
36090
36090
|
case "cards":
|
36091
36091
|
return Xn.Cards;
|
36092
36092
|
}
|
36093
|
-
return n.defaultTableView ?? (
|
36094
|
-
}),
|
36095
|
-
(
|
36096
|
-
|
36093
|
+
return n.defaultTableView ?? (u ? Xn.Table : d ? Xn.List : Xn.Cards);
|
36094
|
+
}), g = ze(
|
36095
|
+
(v) => {
|
36096
|
+
f(v), n.id && localStorage.setItem(n.id + "-view", v);
|
36097
36097
|
},
|
36098
36098
|
[n.id]
|
36099
|
-
),
|
36099
|
+
), m = bs("md") && s !== !0, p = pKe(n.tableColumns);
|
36100
36100
|
if (r)
|
36101
36101
|
return /* @__PURE__ */ x.jsx(GKe, { children: /* @__PURE__ */ x.jsx(yKe, { titleProp: n.errorStateTitle, message: r.message }) });
|
36102
36102
|
if (o === 0 && Object.keys(i ?? {}).length === 0)
|
@@ -36119,42 +36119,42 @@ function Tk(n) {
|
|
36119
36119
|
) });
|
36120
36120
|
if (o === void 0)
|
36121
36121
|
return /* @__PURE__ */ x.jsx($o, { isFilled: !0, variant: "light", children: /* @__PURE__ */ x.jsx(sK, { children: /* @__PURE__ */ x.jsx(s4, {}) }) });
|
36122
|
-
let
|
36122
|
+
let _ = /* @__PURE__ */ x.jsxs(x.Fragment, { children: [
|
36123
36123
|
n.topContent && /* @__PURE__ */ x.jsx($o, { children: n.topContent }),
|
36124
|
-
/* @__PURE__ */ x.jsx(XKe, { ...n,
|
36124
|
+
/* @__PURE__ */ x.jsx(XKe, { ...n, tableColumns: l })
|
36125
36125
|
] });
|
36126
|
-
return n.scrollOutsideTable && (
|
36126
|
+
return n.scrollOutsideTable && (_ = /* @__PURE__ */ x.jsx(yw, { children: _ })), /* @__PURE__ */ x.jsxs(x.Fragment, { children: [
|
36127
36127
|
/* @__PURE__ */ x.jsx(
|
36128
36128
|
bKe,
|
36129
36129
|
{
|
36130
36130
|
...n,
|
36131
|
-
openColumnModal: n.id ?
|
36132
|
-
showSelect:
|
36133
|
-
viewType:
|
36134
|
-
setViewType:
|
36131
|
+
openColumnModal: n.id ? a : void 0,
|
36132
|
+
showSelect: c,
|
36133
|
+
viewType: h,
|
36134
|
+
setViewType: g,
|
36135
36135
|
bottomBorder: !0,
|
36136
|
-
sortOptions:
|
36136
|
+
sortOptions: p
|
36137
36137
|
}
|
36138
36138
|
),
|
36139
|
-
|
36140
|
-
|
36139
|
+
h === Xn.Table && /* @__PURE__ */ x.jsx(qK, { disablePadding: s, children: _ }),
|
36140
|
+
h === Xn.List && /* @__PURE__ */ x.jsxs(yw, { children: [
|
36141
36141
|
n.topContent && /* @__PURE__ */ x.jsx($o, { children: n.topContent }),
|
36142
36142
|
/* @__PURE__ */ x.jsx($o, { padding: { default: "noPadding", md: "padding" }, children: /* @__PURE__ */ x.jsx(
|
36143
36143
|
"div",
|
36144
36144
|
{
|
36145
36145
|
style: {
|
36146
|
-
borderLeft:
|
36147
|
-
borderRight:
|
36146
|
+
borderLeft: m ? "thin solid var(--pf-global--BorderColor--100)" : void 0,
|
36147
|
+
borderRight: m ? "thin solid var(--pf-global--BorderColor--100)" : void 0
|
36148
36148
|
},
|
36149
|
-
children: /* @__PURE__ */ x.jsx(UKe, { ...n, showSelect:
|
36149
|
+
children: /* @__PURE__ */ x.jsx(UKe, { ...n, showSelect: c, tableColumns: l })
|
36150
36150
|
}
|
36151
36151
|
) })
|
36152
36152
|
] }),
|
36153
|
-
|
36153
|
+
h === Xn.Cards && /* @__PURE__ */ x.jsxs(yw, { children: [
|
36154
36154
|
n.topContent && /* @__PURE__ */ x.jsx($o, { children: n.topContent }),
|
36155
|
-
/* @__PURE__ */ x.jsx(zKe, { ...n, showSelect:
|
36155
|
+
/* @__PURE__ */ x.jsx(zKe, { ...n, showSelect: c, tableColumns: l })
|
36156
36156
|
] }),
|
36157
|
-
|
36157
|
+
!n.disablePagination && (!n.autoHidePagination || (n.itemCount ?? 0) > n.perPage) && /* @__PURE__ */ x.jsx(AKe, { ...n, topBorder: !0 })
|
36158
36158
|
] });
|
36159
36159
|
}
|
36160
36160
|
function XKe(n) {
|
@@ -36611,12 +36611,12 @@ function tGe(n) {
|
|
36611
36611
|
}
|
36612
36612
|
],
|
36613
36613
|
keyFn: i,
|
36614
|
-
pagination: A,
|
36615
36614
|
compact: !0,
|
36616
36615
|
errorStateTitle: "",
|
36617
36616
|
emptyStateTitle: "No items",
|
36618
36617
|
autoHidePagination: !0,
|
36619
|
-
disableBodyPadding: !0
|
36618
|
+
disableBodyPadding: !0,
|
36619
|
+
...A
|
36620
36620
|
},
|
36621
36621
|
"status"
|
36622
36622
|
)
|
@@ -36752,12 +36752,12 @@ function aGe(n) {
|
|
36752
36752
|
itemCount: t.length,
|
36753
36753
|
tableColumns: L,
|
36754
36754
|
keyFn: i,
|
36755
|
-
pagination: v,
|
36756
36755
|
compact: !0,
|
36757
36756
|
errorStateTitle: "Error",
|
36758
36757
|
emptyStateTitle: "No items",
|
36759
36758
|
autoHidePagination: !0,
|
36760
|
-
disableBodyPadding: !0
|
36759
|
+
disableBodyPadding: !0,
|
36760
|
+
...v
|
36761
36761
|
},
|
36762
36762
|
"items"
|
36763
36763
|
)
|
package/index.umd.cjs
CHANGED
@@ -389,7 +389,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
389
389
|
`,XWe=un.div`
|
390
390
|
padding-top: 5px;
|
391
391
|
padding-bottom: 5px;
|
392
|
-
`;function sv(n){const{id:e,toolbarActions:t,filterState:i,error:r,itemCount:o,disableBodyPadding:s,pagination:a}=n,{openColumnManagement:l,managedColumns:c}=OWe((e??"")+"-columns",n.tableColumns,n.disableTableView,n.disableListView,n.disableCardView),u=n.showSelect||(t==null?void 0:t.find(y=>"selection"in y&&y.selection===ii.Multiple))!==void 0,d=!n.disableTableView,h=!n.disableListView,[f,g]=E.useState(()=>{switch(n.id?localStorage.getItem(n.id+"-view"):void 0){case"table":return Xn.Table;case"list":return Xn.List;case"cards":return Xn.Cards}return n.defaultTableView??(d?Xn.Table:h?Xn.List:Xn.Cards)}),m=E.useCallback(y=>{g(y),n.id&&localStorage.setItem(n.id+"-view",y)},[n.id]),p=Do("md")&&s!==!0,v=bWe(n.tableColumns),_=!n.disablePagination&&a;if(r)return x.jsx(YWe,{children:x.jsx(CWe,{titleProp:n.errorStateTitle,message:r.message})});if(o===0&&Object.keys(i??{}).length===0)return x.jsx(P.PageSection,{style:{backgroundColor:"transparent"},children:x.jsx(xWe,{title:n.emptyStateTitle,description:n.emptyStateDescription,button:n.emptyStateButtonClick&&x.jsx(P.Button,{variant:"primary",onClick:n.emptyStateButtonClick,icon:n.emptyStateButtonIcon?n.emptyStateButtonIcon:null,children:n.emptyStateButtonText})||n.emptyStateActions&&x.jsx(P.Flex,{justifyContent:{default:"justifyContentCenter"},children:x.jsx(Lg,{actions:n.emptyStateActions})}),variant:P.EmptyStateVariant.large})});if(o===void 0)return x.jsx(P.PageSection,{isFilled:!0,variant:"light",children:x.jsx(P.Bullseye,{children:x.jsx(P.Spinner,{})})});let b=x.jsxs(x.Fragment,{children:[n.topContent&&x.jsx(P.PageSection,{children:n.topContent}),x.jsx(QWe,{...n,...a,tableColumns:c})]});return n.scrollOutsideTable&&(b=x.jsx(Z0,{children:b})),x.jsxs(x.Fragment,{children:[x.jsx(Lq,{...n,openColumnModal:n.id?l:void 0,showSelect:u,viewType:f,setViewType:m,bottomBorder:!0,sortOptions:v}),f===Xn.Table&&x.jsx(CD,{disablePadding:s,children:b}),f===Xn.List&&x.jsxs(Z0,{children:[n.topContent&&x.jsx(P.PageSection,{children:n.topContent}),x.jsx(P.PageSection,{padding:{default:"noPadding",md:"padding"},children:x.jsx("div",{style:{borderLeft:p?"thin solid var(--pf-global--BorderColor--100)":void 0,borderRight:p?"thin solid var(--pf-global--BorderColor--100)":void 0},children:x.jsx(qWe,{...n,showSelect:u,tableColumns:c})})})]}),f===Xn.Cards&&x.jsxs(Z0,{children:[n.topContent&&x.jsx(P.PageSection,{children:n.topContent}),x.jsx(Dq,{...n,showSelect:u,tableColumns:c})]}),_&&(!n.autoHidePagination||a.perPage&&(n.itemCount??0)>a.perPage)&&x.jsx(NWe,{...n,...a,topBorder:!0})]})}function QWe(n){const{pageItems:e,selectItem:t,unselectItem:i,isSelected:r,isSelectMultiple:o,keyFn:s,rowActions:a,toolbarActions:l,itemCount:c,clearAllFilters:u,onSelect:d,unselectAll:h}=n,f=pA(n.tableColumns),g=jU(n.tableColumns),m=HU(n.tableColumns),p=E.useMemo(()=>{const O=[];if(g.length)for(const I of g)"value"in I?O.push(M=>{var V;const B=(V=I.value)==null?void 0:V.call(I,M);if(B)return x.jsx("div",{children:B},I.id??I.header)}):O.push(M=>I.cell(M));return m.length&&O.push(I=>x.jsx(zU,{item:I,columns:m,disablePadding:!0,numberOfColumns:"multiple"},s(I))),n.expandedRow&&O.push(n.expandedRow),O.length===0?void 0:O.length===1?O[0]:I=>x.jsx(P.Stack,{hasGutter:!0,style:{gap:12},children:O.map(M=>M(I))})},[g,m,s,n.expandedRow]),[v]=Ci(),_=n.showSelect||(l==null?void 0:l.find(O=>"selection"in O&&O.selection===ii.Multiple))!==void 0,b=E.useRef(null),[y,C]=E.useState({left:0,right:0,top:0,bottom:0}),k=E.useCallback(O=>{O&&C({top:O.scrollTop,bottom:O.scrollHeight-O.clientHeight-O.scrollTop,left:O.scrollLeft,right:O.scrollWidth-O.clientWidth-O.scrollLeft})},[]),L=E.useCallback(O=>k(O.currentTarget),[k]);Vg(b,()=>k(b.current)),E.useEffect(()=>k(b.current),[k]);const D=Tg();let T=x.jsxs(x.Fragment,{children:[x.jsxs(Ht.TableComposable,{"aria-label":"Simple table",variant:n.compact||D.tableLayout==="compact"?"compact":void 0,gridBreakPoint:"",isStickyHeader:!0,className:"page-table",children:[c===void 0?x.jsx(Ht.Thead,{children:x.jsx(Ht.Tr,{children:x.jsx(Ht.Th,{children:x.jsx(P.Skeleton,{})})})}):x.jsx(JWe,{...n,showSelect:_,scrollLeft:y.left>0,scrollRight:y.right>1,tableColumns:f,onSelect:d,expandedRow:p}),x.jsx(Ht.Tbody,{children:c===void 0?new Array(10).fill(0).map((O,N)=>x.jsx(Ht.Tr,{children:x.jsx(Ht.Td,{children:x.jsx(ZWe,{children:x.jsx(P.Skeleton,{height:"27px"})})})},N)):e===void 0?new Array(Math.min(10,c)).fill(0).map((O,N)=>x.jsxs(Ht.Tr,{children:[_&&x.jsx(Ht.Td,{}),x.jsx(Ht.Td,{colSpan:f.length,children:x.jsx(XWe,{children:x.jsx(P.Skeleton,{height:"27px"})})})]},N)):e==null?void 0:e.map((O,N)=>x.jsx(e$e,{columns:f,item:O,isItemSelected:r==null?void 0:r(O),isSelectMultiple:o,selectItem:t,unselectItem:i,rowActions:a,rowIndex:N,showSelect:_,scrollLeft:y.left>0,scrollRight:y.right>1,unselectAll:h,onSelect:d,expandedRow:p,isLastRow:N===e.length-1,disableLastRowBorder:n.disableLastRowBorder},s?s(O):N))})]}),c===0&&x.jsxs(P.EmptyState,{style:{paddingTop:48},children:[x.jsx(P.EmptyStateIcon,{icon:Ct.SearchIcon}),x.jsx(P.Title,{headingLevel:"h2",size:"lg",children:v.noResultsFound}),x.jsx(P.EmptyStateBody,{children:v.noResultsMatchCriteria}),u&&x.jsx(P.EmptyStateSecondaryActions,{children:x.jsx(P.Button,{variant:"primary",onClick:u,children:v.clearAllFilters})})]})]});return n.scrollOutsideTable||(T=x.jsx(GWe,{className:"pf-c-scroll-inner-wrapper",ref:b,onScroll:L,children:T})),T}function JWe(n){const{tableColumns:e,rowActions:t,sort:i,setSort:r,sortDirection:o,setSortDirection:s,showSelect:a,onSelect:l,expandedRow:c}=n,u=E.useCallback((d,h)=>{if(h.sort)return{onSort:(f,g,m)=>{h.sort&&(r==null||r(h.sort),s==null||s(m))},sortBy:{index:h.sort===i?d:void 0,direction:h.sort===i?o:void 0,defaultDirection:h.defaultSortDirection},columnIndex:d}},[r,s,i,o]);return x.jsx(Ht.Thead,{children:x.jsxs(Ht.Tr,{className:"light dark-2",children:[c&&x.jsx(Ht.Th,{style:{padding:0,backgroundColor:"inherit"}}),(a||l)&&x.jsx(Ht.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft,style:{backgroundColor:"inherit"},children:" "}),e.map((d,h)=>x.jsx(Ht.Th,{sort:u(h,d),modifier:"nowrap",style:{minWidth:d.minWidth===0?"1%":d.minWidth!==void 0?d.minWidth:void 0,maxWidth:d.maxWidth!==void 0?d.maxWidth:void 0,backgroundColor:"inherit"},children:d.header},d.header)),t!==void 0&&x.jsx(Ht.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0,backgroundColor:"inherit",zIndex:302},className:n.scrollRight?"pf-m-border-left":void 0,children:" "})]})})}function e$e(n){const{columns:e,unselectAll:t,selectItem:i,unselectItem:r,isItemSelected:o,isSelectMultiple:s,item:a,rowActions:l,rowIndex:c,showSelect:u,onSelect:d,expandedRow:h,disableLastRowBorder:f}=n,[g,m]=E.useState(!1),p=Tg(),v=h==null?void 0:h(a);return x.jsxs(x.Fragment,{children:[x.jsxs(Ht.Tr,{isRowSelected:g,style:{boxShadow:"unset",borderBottom:g||n.isLastRow&&f?"unset":void 0},children:[h&&x.jsx(Ht.Td,{expand:v?{rowIndex:c,isExpanded:g,onToggle:()=>m(_=>!_)}:void 0,style:{paddingLeft:v?8:4}}),u&&x.jsx(Ht.Th,{select:o!==void 0?{onSelect:(_,b)=>{b?i==null||i(a):r==null||r(a)},isSelected:o}:void 0,isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft}),d&&x.jsx(Ht.Td,{select:{rowIndex:c,onSelect:()=>{s||t==null||t(),i==null||i(a),d==null||d(a)},isSelected:o??!1,variant:s?"checkbox":"radio"},isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft}),x.jsx(t$e,{columns:e,item:a,rowActions:l,scrollLeft:n.scrollLeft,scrollRight:n.scrollRight})]}),h&&g&&v&&x.jsxs(Ht.Tr,{isExpanded:g,style:{boxShadow:"unset"},children:[x.jsx(Ht.Td,{}),u&&x.jsx(Ht.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft}),d&&x.jsx(Ht.Td,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft}),x.jsx(Ht.Td,{colSpan:e.length,style:{paddingBottom:p.tableLayout==="compact"?12:24,paddingTop:0},children:x.jsx(Ht.CollapseColumn,{children:v})}),l!==void 0&&l.length>0&&x.jsx(Ht.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0},className:n.scrollRight?"pf-m-border-left":void 0,children:" "})]})]})}function t$e(n){const{columns:e,item:t,rowActions:i}=n,[r,o]=E.useState(!1);return x.jsxs(E.Fragment,{children:[e.map(s=>x.jsx(Ht.Td,{dataLabel:s.header,modifier:"nowrap",style:{width:s.minWidth===0?"0%":void 0},children:x.jsx(jr,{item:t,column:s})},s.header)),i!==void 0&&i.length>0&&x.jsx(Ht.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:8,zIndex:r?400:void 0},className:n.scrollRight?"pf-m-border-left":void 0,children:x.jsx(Lg,{actions:i,selectedItem:t,position:P.DropdownPosition.right,iconOnly:!0,onOpen:o})})]})}function n$e(n){const{title:e,items:t,keyFn:i,actionColumns:r,actionFn:o,onComplete:s,onClose:a,processingText:l,isDanger:c}=n,[u]=Ci(),[d,h]=E.useState(!0),[f,g]=E.useState(!1),[m,p]=E.useState(0),[v,_]=E.useState(""),[b,y]=E.useState(),[C]=E.useState(()=>new AbortController),[k,L]=tl(),D=E.useCallback(()=>{g(!0),C.abort(),h(!1),y(I=>{const M={...I};for(const B of t){const V=i(B);M[V]===void 0&&(M[V]="Cancelled")}return M})},[C,t,i]),T=E.useCallback(()=>{L(void 0),a==null||a()},[a,L]);E.useEffect(()=>{async function I(){const M=XBe(5);let B=0;const V=[];await Promise.all(t.map(ee=>M(async()=>{if(C.signal.aborted)return;const se=i(ee);try{await o(ee,C.signal),C.signal.aborted||y(ae=>({...ae??{},[se]:null})),V.push(ee)}catch(ae){if(!C.signal.aborted){if(ae instanceof Error){const re=ae.message;y(J=>({...J??{},[se]:re}))}else y(re=>({...re??{},[se]:"Unknown error"}));_(u.errorText)}}finally{C.signal.aborted||p(++B)}}))),C.signal.aborted||h(!1),s==null||s(V)}I()},[C,o,t,i,s,u.errorText]);const O=ov(t),N=_A(r);return x.jsxs(P.Modal,{titleIconVariant:c?"warning":void 0,title:e,"aria-label":e,variant:P.ModalVariant.medium,isOpen:!0,onClose:()=>{D(),T()},actions:d?[x.jsx(P.Button,{variant:"link",onClick:D,children:u.cancelText},"cancel")]:[x.jsx(P.Button,{variant:"secondary",onClick:T,children:u.closeText},"close")],hasNoBodyWrapper:!0,children:[x.jsx(P.ModalBoxBody,{style:{paddingBottom:0,paddingLeft:0,paddingRight:0},children:x.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:560,overflow:"hidden",borderTop:"thin solid var(--pf-global--BorderColor--100)"},children:x.jsx(sv,{pageItems:[...O.paged],itemCount:t.length,tableColumns:[...N,{header:"Status",cell:I=>{const M=i(I),B=b==null?void 0:b[M];return B===void 0?x.jsxs("span",{style:{color:zD},children:[x.jsx(Ct.PendingIcon,{})," ",u.pendingText]}):B===null?x.jsxs("span",{style:{color:jD},children:[x.jsx(Ct.CheckCircleIcon,{})," ",u.successText]}):x.jsxs("span",{style:{color:HD},children:[x.jsx(Ct.ExclamationCircleIcon,{})," ",b==null?void 0:b[M]]})}}],keyFn:i,pagination:O,compact:!0,errorStateTitle:"",emptyStateTitle:"No items",autoHidePagination:!0,disableBodyPadding:!0},"status")})}),x.jsx(P.ModalBoxBody,{style:{paddingTop:0},children:x.jsx(P.Progress,{value:m/t.length*100,title:C.signal.aborted?u.canceledText:v?u.errorText:d?l??u.processingText:u.successText,size:P.ProgressSize.lg,variant:v||f?P.ProgressVariant.danger:m===t.length?P.ProgressVariant.success:void 0})})]})}function Eq(){const[n,e]=tl(),[t,i]=E.useState();return E.useEffect(()=>{if(t){const r=()=>{var o;i(void 0),(o=t.onClose)==null||o.call(t)};e(x.jsx(n$e,{...t,onClose:r}))}else e(void 0)},[t,e]),i}function Tq(n,e){if(n==null&&e==null)return 0;if(n==null)return 1;if(e==null)return-1;if(typeof n=="string"){if(typeof e=="string")return av(n,e);if(typeof e=="number")return av(n,e.toString())}else if(typeof n=="number"){if(typeof e=="number")return Iq(n,e);if(typeof e=="string")return av(n.toString(),e)}return 0}function av(n,e){return n==null&&e==null?0:n==null?1:e==null||n<e?-1:n>e?1:0}function Iq(n,e){return n==null&&e==null?0:n==null?1:e==null||n<e?-1:n>e?1:0}const i$e=un.div`
|
392
|
+
`;function sv(n){const{id:e,toolbarActions:t,filterState:i,error:r,itemCount:o,disableBodyPadding:s}=n,{openColumnManagement:a,managedColumns:l}=OWe((e??"")+"-columns",n.tableColumns,n.disableTableView,n.disableListView,n.disableCardView),c=n.showSelect||(t==null?void 0:t.find(_=>"selection"in _&&_.selection===ii.Multiple))!==void 0,u=!n.disableTableView,d=!n.disableListView,[h,f]=E.useState(()=>{switch(n.id?localStorage.getItem(n.id+"-view"):void 0){case"table":return Xn.Table;case"list":return Xn.List;case"cards":return Xn.Cards}return n.defaultTableView??(u?Xn.Table:d?Xn.List:Xn.Cards)}),g=E.useCallback(_=>{f(_),n.id&&localStorage.setItem(n.id+"-view",_)},[n.id]),m=Do("md")&&s!==!0,p=bWe(n.tableColumns);if(r)return x.jsx(YWe,{children:x.jsx(CWe,{titleProp:n.errorStateTitle,message:r.message})});if(o===0&&Object.keys(i??{}).length===0)return x.jsx(P.PageSection,{style:{backgroundColor:"transparent"},children:x.jsx(xWe,{title:n.emptyStateTitle,description:n.emptyStateDescription,button:n.emptyStateButtonClick&&x.jsx(P.Button,{variant:"primary",onClick:n.emptyStateButtonClick,icon:n.emptyStateButtonIcon?n.emptyStateButtonIcon:null,children:n.emptyStateButtonText})||n.emptyStateActions&&x.jsx(P.Flex,{justifyContent:{default:"justifyContentCenter"},children:x.jsx(Lg,{actions:n.emptyStateActions})}),variant:P.EmptyStateVariant.large})});if(o===void 0)return x.jsx(P.PageSection,{isFilled:!0,variant:"light",children:x.jsx(P.Bullseye,{children:x.jsx(P.Spinner,{})})});let v=x.jsxs(x.Fragment,{children:[n.topContent&&x.jsx(P.PageSection,{children:n.topContent}),x.jsx(QWe,{...n,tableColumns:l})]});return n.scrollOutsideTable&&(v=x.jsx(Z0,{children:v})),x.jsxs(x.Fragment,{children:[x.jsx(Lq,{...n,openColumnModal:n.id?a:void 0,showSelect:c,viewType:h,setViewType:g,bottomBorder:!0,sortOptions:p}),h===Xn.Table&&x.jsx(CD,{disablePadding:s,children:v}),h===Xn.List&&x.jsxs(Z0,{children:[n.topContent&&x.jsx(P.PageSection,{children:n.topContent}),x.jsx(P.PageSection,{padding:{default:"noPadding",md:"padding"},children:x.jsx("div",{style:{borderLeft:m?"thin solid var(--pf-global--BorderColor--100)":void 0,borderRight:m?"thin solid var(--pf-global--BorderColor--100)":void 0},children:x.jsx(qWe,{...n,showSelect:c,tableColumns:l})})})]}),h===Xn.Cards&&x.jsxs(Z0,{children:[n.topContent&&x.jsx(P.PageSection,{children:n.topContent}),x.jsx(Dq,{...n,showSelect:c,tableColumns:l})]}),!n.disablePagination&&(!n.autoHidePagination||(n.itemCount??0)>n.perPage)&&x.jsx(NWe,{...n,topBorder:!0})]})}function QWe(n){const{pageItems:e,selectItem:t,unselectItem:i,isSelected:r,isSelectMultiple:o,keyFn:s,rowActions:a,toolbarActions:l,itemCount:c,clearAllFilters:u,onSelect:d,unselectAll:h}=n,f=pA(n.tableColumns),g=jU(n.tableColumns),m=HU(n.tableColumns),p=E.useMemo(()=>{const O=[];if(g.length)for(const I of g)"value"in I?O.push(M=>{var V;const B=(V=I.value)==null?void 0:V.call(I,M);if(B)return x.jsx("div",{children:B},I.id??I.header)}):O.push(M=>I.cell(M));return m.length&&O.push(I=>x.jsx(zU,{item:I,columns:m,disablePadding:!0,numberOfColumns:"multiple"},s(I))),n.expandedRow&&O.push(n.expandedRow),O.length===0?void 0:O.length===1?O[0]:I=>x.jsx(P.Stack,{hasGutter:!0,style:{gap:12},children:O.map(M=>M(I))})},[g,m,s,n.expandedRow]),[v]=Ci(),_=n.showSelect||(l==null?void 0:l.find(O=>"selection"in O&&O.selection===ii.Multiple))!==void 0,b=E.useRef(null),[y,C]=E.useState({left:0,right:0,top:0,bottom:0}),k=E.useCallback(O=>{O&&C({top:O.scrollTop,bottom:O.scrollHeight-O.clientHeight-O.scrollTop,left:O.scrollLeft,right:O.scrollWidth-O.clientWidth-O.scrollLeft})},[]),L=E.useCallback(O=>k(O.currentTarget),[k]);Vg(b,()=>k(b.current)),E.useEffect(()=>k(b.current),[k]);const D=Tg();let T=x.jsxs(x.Fragment,{children:[x.jsxs(Ht.TableComposable,{"aria-label":"Simple table",variant:n.compact||D.tableLayout==="compact"?"compact":void 0,gridBreakPoint:"",isStickyHeader:!0,className:"page-table",children:[c===void 0?x.jsx(Ht.Thead,{children:x.jsx(Ht.Tr,{children:x.jsx(Ht.Th,{children:x.jsx(P.Skeleton,{})})})}):x.jsx(JWe,{...n,showSelect:_,scrollLeft:y.left>0,scrollRight:y.right>1,tableColumns:f,onSelect:d,expandedRow:p}),x.jsx(Ht.Tbody,{children:c===void 0?new Array(10).fill(0).map((O,N)=>x.jsx(Ht.Tr,{children:x.jsx(Ht.Td,{children:x.jsx(ZWe,{children:x.jsx(P.Skeleton,{height:"27px"})})})},N)):e===void 0?new Array(Math.min(10,c)).fill(0).map((O,N)=>x.jsxs(Ht.Tr,{children:[_&&x.jsx(Ht.Td,{}),x.jsx(Ht.Td,{colSpan:f.length,children:x.jsx(XWe,{children:x.jsx(P.Skeleton,{height:"27px"})})})]},N)):e==null?void 0:e.map((O,N)=>x.jsx(e$e,{columns:f,item:O,isItemSelected:r==null?void 0:r(O),isSelectMultiple:o,selectItem:t,unselectItem:i,rowActions:a,rowIndex:N,showSelect:_,scrollLeft:y.left>0,scrollRight:y.right>1,unselectAll:h,onSelect:d,expandedRow:p,isLastRow:N===e.length-1,disableLastRowBorder:n.disableLastRowBorder},s?s(O):N))})]}),c===0&&x.jsxs(P.EmptyState,{style:{paddingTop:48},children:[x.jsx(P.EmptyStateIcon,{icon:Ct.SearchIcon}),x.jsx(P.Title,{headingLevel:"h2",size:"lg",children:v.noResultsFound}),x.jsx(P.EmptyStateBody,{children:v.noResultsMatchCriteria}),u&&x.jsx(P.EmptyStateSecondaryActions,{children:x.jsx(P.Button,{variant:"primary",onClick:u,children:v.clearAllFilters})})]})]});return n.scrollOutsideTable||(T=x.jsx(GWe,{className:"pf-c-scroll-inner-wrapper",ref:b,onScroll:L,children:T})),T}function JWe(n){const{tableColumns:e,rowActions:t,sort:i,setSort:r,sortDirection:o,setSortDirection:s,showSelect:a,onSelect:l,expandedRow:c}=n,u=E.useCallback((d,h)=>{if(h.sort)return{onSort:(f,g,m)=>{h.sort&&(r==null||r(h.sort),s==null||s(m))},sortBy:{index:h.sort===i?d:void 0,direction:h.sort===i?o:void 0,defaultDirection:h.defaultSortDirection},columnIndex:d}},[r,s,i,o]);return x.jsx(Ht.Thead,{children:x.jsxs(Ht.Tr,{className:"light dark-2",children:[c&&x.jsx(Ht.Th,{style:{padding:0,backgroundColor:"inherit"}}),(a||l)&&x.jsx(Ht.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft,style:{backgroundColor:"inherit"},children:" "}),e.map((d,h)=>x.jsx(Ht.Th,{sort:u(h,d),modifier:"nowrap",style:{minWidth:d.minWidth===0?"1%":d.minWidth!==void 0?d.minWidth:void 0,maxWidth:d.maxWidth!==void 0?d.maxWidth:void 0,backgroundColor:"inherit"},children:d.header},d.header)),t!==void 0&&x.jsx(Ht.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0,backgroundColor:"inherit",zIndex:302},className:n.scrollRight?"pf-m-border-left":void 0,children:" "})]})})}function e$e(n){const{columns:e,unselectAll:t,selectItem:i,unselectItem:r,isItemSelected:o,isSelectMultiple:s,item:a,rowActions:l,rowIndex:c,showSelect:u,onSelect:d,expandedRow:h,disableLastRowBorder:f}=n,[g,m]=E.useState(!1),p=Tg(),v=h==null?void 0:h(a);return x.jsxs(x.Fragment,{children:[x.jsxs(Ht.Tr,{isRowSelected:g,style:{boxShadow:"unset",borderBottom:g||n.isLastRow&&f?"unset":void 0},children:[h&&x.jsx(Ht.Td,{expand:v?{rowIndex:c,isExpanded:g,onToggle:()=>m(_=>!_)}:void 0,style:{paddingLeft:v?8:4}}),u&&x.jsx(Ht.Th,{select:o!==void 0?{onSelect:(_,b)=>{b?i==null||i(a):r==null||r(a)},isSelected:o}:void 0,isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft}),d&&x.jsx(Ht.Td,{select:{rowIndex:c,onSelect:()=>{s||t==null||t(),i==null||i(a),d==null||d(a)},isSelected:o??!1,variant:s?"checkbox":"radio"},isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft}),x.jsx(t$e,{columns:e,item:a,rowActions:l,scrollLeft:n.scrollLeft,scrollRight:n.scrollRight})]}),h&&g&&v&&x.jsxs(Ht.Tr,{isExpanded:g,style:{boxShadow:"unset"},children:[x.jsx(Ht.Td,{}),u&&x.jsx(Ht.Th,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft}),d&&x.jsx(Ht.Td,{isStickyColumn:!0,stickyMinWidth:"0px",hasRightBorder:n.scrollLeft}),x.jsx(Ht.Td,{colSpan:e.length,style:{paddingBottom:p.tableLayout==="compact"?12:24,paddingTop:0},children:x.jsx(Ht.CollapseColumn,{children:v})}),l!==void 0&&l.length>0&&x.jsx(Ht.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:0},className:n.scrollRight?"pf-m-border-left":void 0,children:" "})]})]})}function t$e(n){const{columns:e,item:t,rowActions:i}=n,[r,o]=E.useState(!1);return x.jsxs(E.Fragment,{children:[e.map(s=>x.jsx(Ht.Td,{dataLabel:s.header,modifier:"nowrap",style:{width:s.minWidth===0?"0%":void 0},children:x.jsx(jr,{item:t,column:s})},s.header)),i!==void 0&&i.length>0&&x.jsx(Ht.Td,{isActionCell:!0,isStickyColumn:!0,stickyMinWidth:"0px",style:{right:0,padding:0,paddingRight:8,zIndex:r?400:void 0},className:n.scrollRight?"pf-m-border-left":void 0,children:x.jsx(Lg,{actions:i,selectedItem:t,position:P.DropdownPosition.right,iconOnly:!0,onOpen:o})})]})}function n$e(n){const{title:e,items:t,keyFn:i,actionColumns:r,actionFn:o,onComplete:s,onClose:a,processingText:l,isDanger:c}=n,[u]=Ci(),[d,h]=E.useState(!0),[f,g]=E.useState(!1),[m,p]=E.useState(0),[v,_]=E.useState(""),[b,y]=E.useState(),[C]=E.useState(()=>new AbortController),[k,L]=tl(),D=E.useCallback(()=>{g(!0),C.abort(),h(!1),y(I=>{const M={...I};for(const B of t){const V=i(B);M[V]===void 0&&(M[V]="Cancelled")}return M})},[C,t,i]),T=E.useCallback(()=>{L(void 0),a==null||a()},[a,L]);E.useEffect(()=>{async function I(){const M=XBe(5);let B=0;const V=[];await Promise.all(t.map(ee=>M(async()=>{if(C.signal.aborted)return;const se=i(ee);try{await o(ee,C.signal),C.signal.aborted||y(ae=>({...ae??{},[se]:null})),V.push(ee)}catch(ae){if(!C.signal.aborted){if(ae instanceof Error){const re=ae.message;y(J=>({...J??{},[se]:re}))}else y(re=>({...re??{},[se]:"Unknown error"}));_(u.errorText)}}finally{C.signal.aborted||p(++B)}}))),C.signal.aborted||h(!1),s==null||s(V)}I()},[C,o,t,i,s,u.errorText]);const O=ov(t),N=_A(r);return x.jsxs(P.Modal,{titleIconVariant:c?"warning":void 0,title:e,"aria-label":e,variant:P.ModalVariant.medium,isOpen:!0,onClose:()=>{D(),T()},actions:d?[x.jsx(P.Button,{variant:"link",onClick:D,children:u.cancelText},"cancel")]:[x.jsx(P.Button,{variant:"secondary",onClick:T,children:u.closeText},"close")],hasNoBodyWrapper:!0,children:[x.jsx(P.ModalBoxBody,{style:{paddingBottom:0,paddingLeft:0,paddingRight:0},children:x.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:560,overflow:"hidden",borderTop:"thin solid var(--pf-global--BorderColor--100)"},children:x.jsx(sv,{pageItems:[...O.paged],itemCount:t.length,tableColumns:[...N,{header:"Status",cell:I=>{const M=i(I),B=b==null?void 0:b[M];return B===void 0?x.jsxs("span",{style:{color:zD},children:[x.jsx(Ct.PendingIcon,{})," ",u.pendingText]}):B===null?x.jsxs("span",{style:{color:jD},children:[x.jsx(Ct.CheckCircleIcon,{})," ",u.successText]}):x.jsxs("span",{style:{color:HD},children:[x.jsx(Ct.ExclamationCircleIcon,{})," ",b==null?void 0:b[M]]})}}],keyFn:i,compact:!0,errorStateTitle:"",emptyStateTitle:"No items",autoHidePagination:!0,disableBodyPadding:!0,...O},"status")})}),x.jsx(P.ModalBoxBody,{style:{paddingTop:0},children:x.jsx(P.Progress,{value:m/t.length*100,title:C.signal.aborted?u.canceledText:v?u.errorText:d?l??u.processingText:u.successText,size:P.ProgressSize.lg,variant:v||f?P.ProgressVariant.danger:m===t.length?P.ProgressVariant.success:void 0})})]})}function Eq(){const[n,e]=tl(),[t,i]=E.useState();return E.useEffect(()=>{if(t){const r=()=>{var o;i(void 0),(o=t.onClose)==null||o.call(t)};e(x.jsx(n$e,{...t,onClose:r}))}else e(void 0)},[t,e]),i}function Tq(n,e){if(n==null&&e==null)return 0;if(n==null)return 1;if(e==null)return-1;if(typeof n=="string"){if(typeof e=="string")return av(n,e);if(typeof e=="number")return av(n,e.toString())}else if(typeof n=="number"){if(typeof e=="number")return Iq(n,e);if(typeof e=="string")return av(n.toString(),e)}return 0}function av(n,e){return n==null&&e==null?0:n==null?1:e==null||n<e?-1:n>e?1:0}function Iq(n,e){return n==null&&e==null?0:n==null?1:e==null||n<e?-1:n>e?1:0}const i$e=un.div`
|
393
393
|
display: flex;
|
394
394
|
flex-direction: column;
|
395
395
|
max-height: 560px;
|
@@ -400,7 +400,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
400
400
|
height: 64px;
|
401
401
|
display: flex;
|
402
402
|
align-items: center;
|
403
|
-
`;function o$e(n){const{title:e,items:t,keyFn:i,prompt:r,alertPrompts:o,confirmationColumns:s,isItemNonActionable:a,onConfirm:l,onClose:c,confirmText:u,actionButtonText:d,isDanger:h}=n,[f,g]=tl(),[m]=Ci(),p=E.useCallback(()=>{g(void 0),c==null||c()},[c,g]),v=E.useMemo(()=>a&&t.some(a)?t.sort((D,T)=>av(a(D),a(T))):t,[t,a]),_=ov(v),[b,y]=E.useState(!u),C=E.useMemo(()=>a&&t.some(a)?[{header:"",cell:D=>a(D)?x.jsx(P.Tooltip,{content:a(D),trigger:a(D)?void 0:"manual",children:x.jsx(P.Icon,{status:"warning",children:x.jsx(Ct.ExclamationTriangleIcon,{})})}):null},...s]:s,[s,a,t]),k=E.useMemo(()=>a?t.filter(D=>!a(D)):t,[a,t]),L=_A(C);return x.jsx(P.Modal,{titleIconVariant:h?"warning":void 0,title:e,"aria-label":e,description:r,variant:P.ModalVariant.medium,isOpen:!0,onClose:p,actions:[x.jsx(P.Button,{variant:h?"danger":"primary",onClick:()=>{p(),l()},isAriaDisabled:!b,children:d},"submit"),x.jsx(P.Button,{variant:"link",onClick:c,children:m.cancelText},"cancel")],hasNoBodyWrapper:!0,children:t.length>0&&x.jsxs(P.ModalBoxBody,{style:{paddingLeft:0,paddingRight:0},children:[x.jsxs(i$e,{children:[o&&o.length>0&&o.map((D,T)=>x.jsx(P.Alert,{isInline:!0,title:D,variant:"warning"},T)),x.jsx(sv,{pageItems:_.paged,itemCount:t.length,tableColumns:L,keyFn:i,pagination:_,compact:!0,errorStateTitle:"Error",emptyStateTitle:"No items",autoHidePagination:!0,disableBodyPadding:!0},"items")]}),u&&k.length>0&&x.jsx(r$e,{children:x.jsx(P.Checkbox,{id:"confirm",label:u,isChecked:b,onChange:y})})]})})}function s$e(){const[n,e]=tl(),[t,i]=E.useState();return E.useEffect(()=>{if(t){const r=()=>{var o;i(void 0),(o=t.onClose)==null||o.call(t)};e(x.jsx(o$e,{...t,onClose:r}))}else e(void 0)},[t,e]),i}function a$e(){const n=s$e(),e=Eq();return E.useCallback(t=>{const i=Object.assign({},t);return t.isItemNonActionable&&t.isItemNonActionable!==void 0&&(i.items=t.items.filter(r=>t.isItemNonActionable!==void 0&&!t.isItemNonActionable(r))),n({...t,onConfirm:()=>e(i)})},[e,n])}function l$e(n){const{title:e,view:t,tableColumns:i,toolbarFilters:r,confirmText:o,cancelText:s,onSelect:a}=n,[l,c]=tl(),u=E.useCallback(()=>c(void 0),[c]),[d]=Ci();return x.jsx(P.Modal,{title:e,"aria-label":e,isOpen:!0,onClose:u,variant:P.ModalVariant.medium,tabIndex:0,actions:[x.jsx(P.Button,{variant:"primary",id:"confirm",onClick:()=>{u(),a(t.selectedItems)},isAriaDisabled:t.selectedItems.length===0,children:o??d.confirmText},"confirm"),x.jsx(P.Button,{variant:"link",onClick:u,children:s??d.cancelText},"cancel")],hasNoBodyWrapper:!0,children:x.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:500,overflow:"hidden"},children:x.jsx(sv,{tableColumns:i,toolbarFilters:r,...t,emptyStateTitle:n.emptyStateTitle??d.noItemsFound,errorStateTitle:n.errorStateTitle??d.errorText,showSelect:!0,disableCardView:!0,disableListView:!0,compact:!0,disableBodyPadding:!0})})})}const N_t="";function WA(n){let e="collapsed";return n.open&&(e+=" expanded"),x.jsx("div",{className:e,children:n.children})}function c$e(n){const{view:e,tableColumns:t,toolbarFilters:i,confirm:r,cancel:o,selected:s,isMultiple:a}=n,[l,c]=E.useState(""),[u,d]=E.useState(),h=E.useCallback((m,p)=>{c(p??""),d(()=>m)},[]),[f,g]=tl();return E.useEffect(()=>{u!==void 0?g(x.jsx(Aq,{title:l,open:!0,isMultiple:a,setOpen:()=>d(void 0),onSelect:u,view:e,tableColumns:t,toolbarFilters:i,confirm:r,cancel:o,selected:s,keyFn:e.keyFn})):(g(void 0),e.unselectAll())},[o,r,u,s,g,t,l,i,e,a]),h}function Aq(n){const{title:e,open:t,isMultiple:i=!1,setOpen:r,onSelect:o,view:s,tableColumns:a,toolbarFilters:l,confirm:c,cancel:u,selected:d}=n,h=()=>r(!1),{t:f}=$r();return x.jsxs(P.Modal,{title:e,"aria-label":e,isOpen:t,onClose:h,variant:P.ModalVariant.medium,tabIndex:0,actions:[x.jsx(P.Button,{variant:"primary",onClick:()=>{!i&&s.selectedItems.length>0?o(s.selectedItems[0]):i&&o(s.selectedItems),h()},isAriaDisabled:s.selectedItems.length===0,children:c},"confirm"),x.jsx(P.Button,{variant:"link",onClick:h,children:u},"cancel")],hasNoBodyWrapper:!0,children:[x.jsx(P.ModalBoxBody,{style:{overflow:"hidden"},children:x.jsxs(P.Split,{hasGutter:!0,children:[x.jsx(P.SplitItem,{style:{fontWeight:"bold"},children:d}),s.selectedItems.length>0?x.jsx(P.ChipGroup,{children:s.selectedItems.map((g,m)=>a&&a.length>0?x.jsx(P.Chip,{onClick:()=>s.unselectItem(g),children:x.jsx(jr,{item:g,column:a.find(p=>p.card==="name"||p.list==="name")??a[0]})},m):x.jsx(x.Fragment,{}))}):x.jsx(P.SplitItem,{style:{fontStyle:"italic"},children:f`None - Please make a selection below.`})]})}),x.jsx(WA,{open:s.itemCount===void 0,children:x.jsx(P.Skeleton,{height:"80px"})}),x.jsx(WA,{open:s.itemCount!==void 0,children:x.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:500,overflow:"hidden"},children:x.jsx(sv,{tableColumns:a,toolbarFilters:l,emptyStateTitle:"No organizations found",errorStateTitle:"Error loading organizations",...s,isSelectMultiple:i,onSelect:()=>null,disableCardView:!0,disableListView:!0,compact:!0,disableBodyPadding:!0})})})]})}function u$e(n){const{onSelect:e,value:t}=n,i=E.useCallback((l,c)=>{var u;e(l,(u=n.options.find(d=>d.label===c.toString()))==null?void 0:u.value)},[e,n.options]),{options:r}=n;r.sort((l,c)=>(l.group??"")<(c.group??"")?-1:(l.group??"")>(c.group??"")?1:l.label<c.label?-1:l.label>c.label?1:0);const o=r.reduce((l,c)=>{const u=c.group??"";let d=l[u];return d||(d=[],l[u]=d),d.push(c),l},{}),s=Object.keys(o).length>1||Object.keys(o).length===1&&Object.keys(o)[0]!=="",a=n.options.find(l=>l.value===t);return x.jsx(Dg,{...n,value:a==null?void 0:a.label,onSelect:i,isGrouped:s,children:s?Object.keys(o).map(l=>x.jsx(P.SelectGroup,{label:l,children:o[l].map(c=>x.jsx(P.SelectOption,{value:c.label,label:c.label,description:c.description,children:c.label},c.label))},l)):r.map(l=>x.jsx(P.SelectOption,{value:l.label,label:l.label,description:l.description,children:l.label},l.label))})}function Oq(n){const[e,t]=E.useState(!1),{helperTextInvalid:i,...r}=n;return x.jsx(yy,{...n,children:x.jsxs(P.InputGroup,{children:[x.jsx(P.TextArea,{...r,id:n.id,label:void 0,"aria-describedby":n.id?`${n.id}-form-group`:void 0,validated:n.helperTextInvalid?"error":void 0}),n.type==="password"&&x.jsx(P.Button,{variant:"control",onClick:()=>t(!e),isDisabled:n.isDisabled||n.isReadOnly,children:e?x.jsx(Ct.EyeIcon,{}):x.jsx(Ct.EyeSlashIcon,{})})]})})}function d$e(n){const[e,t]=E.useState(!1),{children:i,isReadOnly:r,placeholder:o,...s}=n,a=n.id?n.id:typeof n.label=="string"?n.label.toLowerCase().split(" ").join("-"):void 0;return x.jsx(yy,{...s,id:a,children:x.jsxs(P.InputGroup,{children:[x.jsx(P.TextInput,{autoComplete:n.autoComplete,placeholder:o,onChange:n.onChange,id:a,onBlur:n.onBlur,label:void 0,value:n.value,"aria-describedby":a?`${a}-form-group`:void 0,validated:n.helperTextInvalid?"error":void 0,type:n.type==="password"?e?"text":"password":n.type,readOnlyVariant:r?"default":void 0,isDisabled:n.isDisabled,min:n.min}),n.type==="password"&&x.jsx(P.Button,{variant:"control",onClick:()=>t(!e),isDisabled:n.isDisabled||n.isReadOnly,children:e?x.jsx(Ct.EyeIcon,{}):x.jsx(Ct.EyeSlashIcon,{})}),n.children]})})}var lv=n=>n.type==="checkbox",Cm=n=>n instanceof Date,so=n=>n==null;const Nq=n=>typeof n=="object";var tr=n=>!so(n)&&!Array.isArray(n)&&Nq(n)&&!Cm(n),Mq=n=>tr(n)&&n.target?lv(n.target)?n.target.checked:n.target.value:n,h$e=n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n,Pq=(n,e)=>n.has(h$e(e)),f$e=n=>{const e=n.constructor&&n.constructor.prototype;return tr(e)&&e.hasOwnProperty("isPrototypeOf")},$A=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function vl(n){let e;const t=Array.isArray(n);if(n instanceof Date)e=new Date(n);else if(n instanceof Set)e=new Set(n);else if(!($A&&(n instanceof Blob||n instanceof FileList))&&(t||tr(n)))if(e=t?[]:{},!t&&!f$e(n))e=n;else for(const i in n)n.hasOwnProperty(i)&&(e[i]=vl(n[i]));else return n;return e}var cv=n=>Array.isArray(n)?n.filter(Boolean):[],Si=n=>n===void 0,Qe=(n,e,t)=>{if(!e||!tr(n))return t;const i=cv(e.split(/[,[\].]+?/)).reduce((r,o)=>so(r)?r:r[o],n);return Si(i)||i===n?Si(n[e])?t:n[e]:i};const RS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Da={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Oc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Rq=E.createContext(null),Nc=()=>E.useContext(Rq),g$e=n=>{const{children:e,...t}=n;return E.createElement(Rq.Provider,{value:t},e)};var Fq=(n,e,t,i=!0)=>{const r={defaultValues:e._defaultValues};for(const o in n)Object.defineProperty(r,o,{get:()=>{const s=o;return e._proxyFormState[s]!==Da.all&&(e._proxyFormState[s]=!i||Da.all),t&&(t[s]=!0),n[s]}});return r},Us=n=>tr(n)&&!Object.keys(n).length,Bq=(n,e,t,i)=>{t(n);const{name:r,...o}=n;return Us(o)||Object.keys(o).length>=Object.keys(e).length||Object.keys(o).find(s=>e[s]===(!i||Da.all))},FS=n=>Array.isArray(n)?n:[n],Vq=(n,e,t)=>t&&e?n===e:!n||!e||n===e||FS(n).some(i=>i&&(i.startsWith(e)||e.startsWith(i)));function jA(n){const e=E.useRef(n);e.current=n,E.useEffect(()=>{const t=!n.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{t&&t.unsubscribe()}},[n.disabled])}function Wq(n){const e=Nc(),{control:t=e.control,disabled:i,name:r,exact:o}=n||{},[s,a]=E.useState(t._formState),l=E.useRef(!0),c=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=E.useRef(r);return u.current=r,jA({disabled:i,next:d=>l.current&&Vq(u.current,d.name,o)&&Bq(d,c.current,t._updateFormState)&&a({...t._formState,...d}),subject:t._subjects.state}),E.useEffect(()=>(l.current=!0,c.current.isValid&&t._updateValid(!0),()=>{l.current=!1}),[t]),Fq(s,t,c.current,!1)}var bl=n=>typeof n=="string",$q=(n,e,t,i,r)=>bl(n)?(i&&e.watch.add(n),Qe(t,n,r)):Array.isArray(n)?n.map(o=>(i&&e.watch.add(o),Qe(t,o))):(i&&(e.watchAll=!0),t);function m$e(n){const e=Nc(),{control:t=e.control,name:i,defaultValue:r,disabled:o,exact:s}=n||{},a=E.useRef(i);a.current=i,jA({disabled:o,subject:t._subjects.values,next:u=>{Vq(a.current,u.name,s)&&c(vl($q(a.current,t._names,u.values||t._formValues,!1,r)))}});const[l,c]=E.useState(t._getWatch(i,r));return E.useEffect(()=>t._removeUnmounted()),l}var HA=n=>/^\w*$/.test(n),jq=n=>cv(n.replace(/["|']|\]/g,"").split(/\.|\[/));function zn(n,e,t){let i=-1;const r=HA(e)?[e]:jq(e),o=r.length,s=o-1;for(;++i<o;){const a=r[i];let l=t;if(i!==s){const c=n[a];l=tr(c)||Array.isArray(c)?c:isNaN(+r[i+1])?{}:[]}n[a]=l,n=n[a]}return n}function p$e(n){const e=Nc(),{name:t,control:i=e.control,shouldUnregister:r}=n,o=Pq(i._names.array,t),s=m$e({control:i,name:t,defaultValue:Qe(i._formValues,t,Qe(i._defaultValues,t,n.defaultValue)),exact:!0}),a=Wq({control:i,name:t}),l=E.useRef(i.register(t,{...n.rules,value:s}));return l.current=i.register(t,n.rules),E.useEffect(()=>{const c=i._options.shouldUnregister||r,u=(d,h)=>{const f=Qe(i._fields,d);f&&(f._f.mount=h)};if(u(t,!0),c){const d=vl(Qe(i._options.defaultValues,t));zn(i._defaultValues,t,d),Si(Qe(i._formValues,t))&&zn(i._formValues,t,d)}return()=>{(o?c&&!i._state.action:c)?i.unregister(t):u(t,!1)}},[t,i,o,r]),{field:{name:t,value:s,onChange:E.useCallback(c=>l.current.onChange({target:{value:Mq(c),name:t},type:RS.CHANGE}),[t]),onBlur:E.useCallback(()=>l.current.onBlur({target:{value:Qe(i._formValues,t),name:t},type:RS.BLUR}),[t,i]),ref:c=>{const u=Qe(i._fields,t);u&&c&&(u._f.ref={focus:()=>c.focus(),select:()=>c.select(),setCustomValidity:d=>c.setCustomValidity(d),reportValidity:()=>c.reportValidity()})}},formState:a,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Qe(a.errors,t)},isDirty:{enumerable:!0,get:()=>!!Qe(a.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!Qe(a.touchedFields,t)},error:{enumerable:!0,get:()=>Qe(a.errors,t)}})}}const Sm=n=>n.render(p$e(n));var _$e=(n,e,t,i,r)=>e?{...t[n],types:{...t[n]&&t[n].types?t[n].types:{},[i]:r||!0}}:{};const zA=(n,e,t)=>{for(const i of t||Object.keys(n)){const r=Qe(n,i);if(r){const{_f:o,...s}=r;if(o&&e(o.name)){if(o.ref.focus){o.ref.focus();break}else if(o.refs&&o.refs[0].focus){o.refs[0].focus();break}}else tr(s)&&zA(s,e)}}};var Hq=n=>({isOnSubmit:!n||n===Da.onSubmit,isOnBlur:n===Da.onBlur,isOnChange:n===Da.onChange,isOnAll:n===Da.all,isOnTouch:n===Da.onTouched}),zq=(n,e,t)=>!t&&(e.watchAll||e.watch.has(n)||[...e.watch].some(i=>n.startsWith(i)&&/^\.\w+/.test(n.slice(i.length)))),v$e=(n,e,t)=>{const i=cv(Qe(n,t));return zn(i,"root",e[t]),zn(n,t,i),n},xm=n=>typeof n=="boolean",UA=n=>n.type==="file",Gu=n=>typeof n=="function",BS=n=>{if(!$A)return!1;const e=n?n.ownerDocument:0;return n instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},VS=n=>bl(n),qA=n=>n.type==="radio",WS=n=>n instanceof RegExp;const Uq={value:!1,isValid:!1},qq={value:!0,isValid:!0};var Kq=n=>{if(Array.isArray(n)){if(n.length>1){const e=n.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:e,isValid:!!e.length}}return n[0].checked&&!n[0].disabled?n[0].attributes&&!Si(n[0].attributes.value)?Si(n[0].value)||n[0].value===""?qq:{value:n[0].value,isValid:!0}:qq:Uq}return Uq};const Gq={isValid:!1,value:null};var Yq=n=>Array.isArray(n)?n.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Gq):Gq;function Zq(n,e,t="validate"){if(VS(n)||Array.isArray(n)&&n.every(VS)||xm(n)&&!n)return{type:t,message:VS(n)?n:"",ref:e}}var Lm=n=>tr(n)&&!WS(n)?n:{value:n,message:""},Xq=async(n,e,t,i,r)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:u,max:d,pattern:h,validate:f,name:g,valueAsNumber:m,mount:p,disabled:v}=n._f,_=Qe(e,g);if(!p||v)return{};const b=s?s[0]:o,y=I=>{i&&b.reportValidity&&(b.setCustomValidity(xm(I)?"":I||""),b.reportValidity())},C={},k=qA(o),L=lv(o),D=k||L,T=(m||UA(o))&&Si(o.value)&&Si(_)||BS(o)&&o.value===""||_===""||Array.isArray(_)&&!_.length,O=_$e.bind(null,g,t,C),N=(I,M,B,V=Oc.maxLength,ee=Oc.minLength)=>{const se=I?M:B;C[g]={type:I?V:ee,message:se,ref:o,...O(I?V:ee,se)}};if(r?!Array.isArray(_)||!_.length:a&&(!D&&(T||so(_))||xm(_)&&!_||L&&!Kq(s).isValid||k&&!Yq(s).isValid)){const{value:I,message:M}=VS(a)?{value:!!a,message:a}:Lm(a);if(I&&(C[g]={type:Oc.required,message:M,ref:b,...O(Oc.required,M)},!t))return y(M),C}if(!T&&(!so(u)||!so(d))){let I,M;const B=Lm(d),V=Lm(u);if(!so(_)&&!isNaN(_)){const ee=o.valueAsNumber||_&&+_;so(B.value)||(I=ee>B.value),so(V.value)||(M=ee<V.value)}else{const ee=o.valueAsDate||new Date(_),se=J=>new Date(new Date().toDateString()+" "+J),ae=o.type=="time",re=o.type=="week";bl(B.value)&&_&&(I=ae?se(_)>se(B.value):re?_>B.value:ee>new Date(B.value)),bl(V.value)&&_&&(M=ae?se(_)<se(V.value):re?_<V.value:ee<new Date(V.value))}if((I||M)&&(N(!!I,B.message,V.message,Oc.max,Oc.min),!t))return y(C[g].message),C}if((l||c)&&!T&&(bl(_)||r&&Array.isArray(_))){const I=Lm(l),M=Lm(c),B=!so(I.value)&&_.length>+I.value,V=!so(M.value)&&_.length<+M.value;if((B||V)&&(N(B,I.message,M.message),!t))return y(C[g].message),C}if(h&&!T&&bl(_)){const{value:I,message:M}=Lm(h);if(WS(I)&&!_.match(I)&&(C[g]={type:Oc.pattern,message:M,ref:o,...O(Oc.pattern,M)},!t))return y(M),C}if(f){if(Gu(f)){const I=await f(_,e),M=Zq(I,b);if(M&&(C[g]={...M,...O(Oc.validate,M.message)},!t))return y(M.message),C}else if(tr(f)){let I={};for(const M in f){if(!Us(I)&&!t)break;const B=Zq(await f[M](_,e),b,M);B&&(I={...B,...O(M,B.message)},y(B.message),t&&(C[g]=I))}if(!Us(I)&&(C[g]={ref:b,...I},!t))return C}}return y(!0),C};function b$e(n,e){const t=e.slice(0,-1).length;let i=0;for(;i<t;)n=Si(n)?i++:n[e[i++]];return n}function y$e(n){for(const e in n)if(n.hasOwnProperty(e)&&!Si(n[e]))return!1;return!0}function Sr(n,e){const t=Array.isArray(e)?e:HA(e)?[e]:jq(e),i=t.length===1?n:b$e(n,t),r=t.length-1,o=t[r];return i&&delete i[o],r!==0&&(tr(i)&&Us(i)||Array.isArray(i)&&y$e(i))&&Sr(n,t.slice(0,-1)),n}function KA(){let n=[];return{get observers(){return n},next:r=>{for(const o of n)o.next&&o.next(r)},subscribe:r=>(n.push(r),{unsubscribe:()=>{n=n.filter(o=>o!==r)}}),unsubscribe:()=>{n=[]}}}var $S=n=>so(n)||!Nq(n);function jh(n,e){if($S(n)||$S(e))return n===e;if(Cm(n)&&Cm(e))return n.getTime()===e.getTime();const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const r of t){const o=n[r];if(!i.includes(r))return!1;if(r!=="ref"){const s=e[r];if(Cm(o)&&Cm(s)||tr(o)&&tr(s)||Array.isArray(o)&&Array.isArray(s)?!jh(o,s):o!==s)return!1}}return!0}var Qq=n=>n.type==="select-multiple",w$e=n=>qA(n)||lv(n),GA=n=>BS(n)&&n.isConnected,Jq=n=>{for(const e in n)if(Gu(n[e]))return!0;return!1};function jS(n,e={}){const t=Array.isArray(n);if(tr(n)||t)for(const i in n)Array.isArray(n[i])||tr(n[i])&&!Jq(n[i])?(e[i]=Array.isArray(n[i])?[]:{},jS(n[i],e[i])):so(n[i])||(e[i]=!0);return e}function eK(n,e,t){const i=Array.isArray(n);if(tr(n)||i)for(const r in n)Array.isArray(n[r])||tr(n[r])&&!Jq(n[r])?Si(e)||$S(t[r])?t[r]=Array.isArray(n[r])?jS(n[r],[]):{...jS(n[r])}:eK(n[r],so(e)?{}:e[r],t[r]):t[r]=!jh(n[r],e[r]);return t}var YA=(n,e)=>eK(n,e,jS(e)),tK=(n,{valueAsNumber:e,valueAsDate:t,setValueAs:i})=>Si(n)?n:e?n===""?NaN:n&&+n:t&&bl(n)?new Date(n):i?i(n):n;function ZA(n){const e=n.ref;if(!(n.refs?n.refs.every(t=>t.disabled):e.disabled))return UA(e)?e.files:qA(e)?Yq(n.refs).value:Qq(e)?[...e.selectedOptions].map(({value:t})=>t):lv(e)?Kq(n.refs).value:tK(Si(e.value)?n.ref.value:e.value,n)}var C$e=(n,e,t,i)=>{const r={};for(const o of n){const s=Qe(e,o);s&&zn(r,o,s._f)}return{criteriaMode:t,names:[...n],fields:r,shouldUseNativeValidation:i}},uv=n=>Si(n)?n:WS(n)?n.source:tr(n)?WS(n.value)?n.value.source:n.value:n,S$e=n=>n.mount&&(n.required||n.min||n.max||n.maxLength||n.minLength||n.pattern||n.validate);function nK(n,e,t){const i=Qe(n,t);if(i||HA(t))return{error:i,name:t};const r=t.split(".");for(;r.length;){const o=r.join("."),s=Qe(e,o),a=Qe(n,o);if(s&&!Array.isArray(s)&&t!==o)return{name:t};if(a&&a.type)return{name:o,error:a};r.pop()}return{name:t}}var x$e=(n,e,t,i,r)=>r.isOnAll?!1:!t&&r.isOnTouch?!(e||n):(t?i.isOnBlur:r.isOnBlur)?!n:(t?i.isOnChange:r.isOnChange)?n:!0,L$e=(n,e)=>!cv(Qe(n,e)).length&&Sr(n,e);const k$e={mode:Da.onSubmit,reValidateMode:Da.onChange,shouldFocusError:!0};function D$e(n={},e){let t={...k$e,...n},i={submitCount:0,isDirty:!1,isLoading:Gu(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},r={},o=tr(t.defaultValues)||tr(t.values)?vl(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:vl(o),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={values:KA(),array:KA(),state:KA()},f=n.resetOptions&&n.resetOptions.keepDirtyValues,g=Hq(t.mode),m=Hq(t.reValidateMode),p=t.criteriaMode===Da.all,v=H=>le=>{clearTimeout(u),u=setTimeout(H,le)},_=async H=>{if(d.isValid||H){const le=t.resolver?Us((await T()).errors):await N(r,!0);le!==i.isValid&&h.state.next({isValid:le})}},b=H=>d.isValidating&&h.state.next({isValidating:H}),y=(H,le=[],be,je,Y=!0,j=!0)=>{if(je&&be){if(a.action=!0,j&&Array.isArray(Qe(r,H))){const q=be(Qe(r,H),je.argA,je.argB);Y&&zn(r,H,q)}if(j&&Array.isArray(Qe(i.errors,H))){const q=be(Qe(i.errors,H),je.argA,je.argB);Y&&zn(i.errors,H,q),L$e(i.errors,H)}if(d.touchedFields&&j&&Array.isArray(Qe(i.touchedFields,H))){const q=be(Qe(i.touchedFields,H),je.argA,je.argB);Y&&zn(i.touchedFields,H,q)}d.dirtyFields&&(i.dirtyFields=YA(o,s)),h.state.next({name:H,isDirty:M(H,le),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else zn(s,H,le)},C=(H,le)=>{zn(i.errors,H,le),h.state.next({errors:i.errors})},k=(H,le,be,je)=>{const Y=Qe(r,H);if(Y){const j=Qe(s,H,Si(be)?Qe(o,H):be);Si(j)||je&&je.defaultChecked||le?zn(s,H,le?j:ZA(Y._f)):ee(H,j),a.mount&&_()}},L=(H,le,be,je,Y)=>{let j=!1,q=!1;const R={name:H};if(!be||je){d.isDirty&&(q=i.isDirty,i.isDirty=R.isDirty=M(),j=q!==R.isDirty);const F=jh(Qe(o,H),le);q=Qe(i.dirtyFields,H),F?Sr(i.dirtyFields,H):zn(i.dirtyFields,H,!0),R.dirtyFields=i.dirtyFields,j=j||d.dirtyFields&&q!==!F}if(be){const F=Qe(i.touchedFields,H);F||(zn(i.touchedFields,H,be),R.touchedFields=i.touchedFields,j=j||d.touchedFields&&F!==be)}return j&&Y&&h.state.next(R),j?R:{}},D=(H,le,be,je)=>{const Y=Qe(i.errors,H),j=d.isValid&&xm(le)&&i.isValid!==le;if(n.delayError&&be?(c=v(()=>C(H,be)),c(n.delayError)):(clearTimeout(u),c=null,be?zn(i.errors,H,be):Sr(i.errors,H)),(be?!jh(Y,be):Y)||!Us(je)||j){const q={...je,...j&&xm(le)?{isValid:le}:{},errors:i.errors,name:H};i={...i,...q},h.state.next(q)}b(!1)},T=async H=>t.resolver(s,t.context,C$e(H||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation)),O=async H=>{const{errors:le}=await T();if(H)for(const be of H){const je=Qe(le,be);je?zn(i.errors,be,je):Sr(i.errors,be)}else i.errors=le;return le},N=async(H,le,be={valid:!0})=>{for(const je in H){const Y=H[je];if(Y){const{_f:j,...q}=Y;if(j){const R=l.array.has(j.name),F=await Xq(Y,s,p,t.shouldUseNativeValidation&&!le,R);if(F[j.name]&&(be.valid=!1,le))break;!le&&(Qe(F,j.name)?R?v$e(i.errors,F,j.name):zn(i.errors,j.name,F[j.name]):Sr(i.errors,j.name))}q&&await N(q,le,be)}}return be.valid},I=()=>{for(const H of l.unMount){const le=Qe(r,H);le&&(le._f.refs?le._f.refs.every(be=>!GA(be)):!GA(le._f.ref))&&te(H)}l.unMount=new Set},M=(H,le)=>(H&&le&&zn(s,H,le),!jh(ue(),o)),B=(H,le,be)=>$q(H,l,{...a.mount?s:Si(le)?o:bl(H)?{[H]:le}:le},be,le),V=H=>cv(Qe(a.mount?s:o,H,n.shouldUnregister?Qe(o,H,[]):[])),ee=(H,le,be={})=>{const je=Qe(r,H);let Y=le;if(je){const j=je._f;j&&(!j.disabled&&zn(s,H,tK(le,j)),Y=BS(j.ref)&&so(le)?"":le,Qq(j.ref)?[...j.ref.options].forEach(q=>q.selected=Y.includes(q.value)):j.refs?lv(j.ref)?j.refs.length>1?j.refs.forEach(q=>(!q.defaultChecked||!q.disabled)&&(q.checked=Array.isArray(Y)?!!Y.find(R=>R===q.value):Y===q.value)):j.refs[0]&&(j.refs[0].checked=!!Y):j.refs.forEach(q=>q.checked=q.value===Y):UA(j.ref)?j.ref.value="":(j.ref.value=Y,j.ref.type||h.values.next({name:H,values:{...s}})))}(be.shouldDirty||be.shouldTouch)&&L(H,Y,be.shouldTouch,be.shouldDirty,!0),be.shouldValidate&&J(H)},se=(H,le,be)=>{for(const je in le){const Y=le[je],j=`${H}.${je}`,q=Qe(r,j);(l.array.has(H)||!$S(Y)||q&&!q._f)&&!Cm(Y)?se(j,Y,be):ee(j,Y,be)}},ae=(H,le,be={})=>{const je=Qe(r,H),Y=l.array.has(H),j=vl(le);zn(s,H,j),Y?(h.array.next({name:H,values:{...s}}),(d.isDirty||d.dirtyFields)&&be.shouldDirty&&h.state.next({name:H,dirtyFields:YA(o,s),isDirty:M(H,j)})):je&&!je._f&&!so(j)?se(H,j,be):ee(H,j,be),zq(H,l)&&h.state.next({...i}),h.values.next({name:H,values:{...s}}),!a.mount&&e()},re=async H=>{const le=H.target;let be=le.name,je=!0;const Y=Qe(r,be),j=()=>le.type?ZA(Y._f):Mq(H);if(Y){let q,R;const F=j(),z=H.type===RS.BLUR||H.type===RS.FOCUS_OUT,U=!S$e(Y._f)&&!t.resolver&&!Qe(i.errors,be)&&!Y._f.deps||x$e(z,Qe(i.touchedFields,be),i.isSubmitted,m,g),fe=zq(be,l,z);zn(s,be,F),z?(Y._f.onBlur&&Y._f.onBlur(H),c&&c(0)):Y._f.onChange&&Y._f.onChange(H);const ke=L(be,F,z,!1),Ae=!Us(ke)||fe;if(!z&&h.values.next({name:be,type:H.type,values:{...s}}),U)return d.isValid&&_(),Ae&&h.state.next({name:be,...fe?{}:ke});if(!z&&fe&&h.state.next({...i}),b(!0),t.resolver){const{errors:Fe}=await T([be]),Ze=nK(i.errors,r,be),Ye=nK(Fe,r,Ze.name||be);q=Ye.error,be=Ye.name,R=Us(Fe)}else q=(await Xq(Y,s,p,t.shouldUseNativeValidation))[be],je=isNaN(F)||F===Qe(s,be,F),je&&(q?R=!1:d.isValid&&(R=await N(r,!0)));je&&(Y._f.deps&&J(Y._f.deps),D(be,R,q,ke))}},J=async(H,le={})=>{let be,je;const Y=FS(H);if(b(!0),t.resolver){const j=await O(Si(H)?H:Y);be=Us(j),je=H?!Y.some(q=>Qe(j,q)):be}else H?(je=(await Promise.all(Y.map(async j=>{const q=Qe(r,j);return await N(q&&q._f?{[j]:q}:q)}))).every(Boolean),!(!je&&!i.isValid)&&_()):je=be=await N(r);return h.state.next({...!bl(H)||d.isValid&&be!==i.isValid?{}:{name:H},...t.resolver||!H?{isValid:be}:{},errors:i.errors,isValidating:!1}),le.shouldFocus&&!je&&zA(r,j=>j&&Qe(i.errors,j),H?Y:l.mount),je},ue=H=>{const le={...o,...a.mount?s:{}};return Si(H)?le:bl(H)?Qe(le,H):H.map(be=>Qe(le,be))},Z=(H,le)=>({invalid:!!Qe((le||i).errors,H),isDirty:!!Qe((le||i).dirtyFields,H),isTouched:!!Qe((le||i).touchedFields,H),error:Qe((le||i).errors,H)}),X=H=>{H&&FS(H).forEach(le=>Sr(i.errors,le)),h.state.next({errors:H?i.errors:{}})},ce=(H,le,be)=>{const je=(Qe(r,H,{_f:{}})._f||{}).ref;zn(i.errors,H,{...le,ref:je}),h.state.next({name:H,errors:i.errors,isValid:!1}),be&&be.shouldFocus&&je&&je.focus&&je.focus()},De=(H,le)=>Gu(H)?h.values.subscribe({next:be=>H(B(void 0,le),be)}):B(H,le,!0),te=(H,le={})=>{for(const be of H?FS(H):l.mount)l.mount.delete(be),l.array.delete(be),le.keepValue||(Sr(r,be),Sr(s,be)),!le.keepError&&Sr(i.errors,be),!le.keepDirty&&Sr(i.dirtyFields,be),!le.keepTouched&&Sr(i.touchedFields,be),!t.shouldUnregister&&!le.keepDefaultValue&&Sr(o,be);h.values.next({values:{...s}}),h.state.next({...i,...le.keepDirty?{isDirty:M()}:{}}),!le.keepIsValid&&_()},xe=(H,le={})=>{let be=Qe(r,H);const je=xm(le.disabled);return zn(r,H,{...be||{},_f:{...be&&be._f?be._f:{ref:{name:H}},name:H,mount:!0,...le}}),l.mount.add(H),be?je&&zn(s,H,le.disabled?void 0:Qe(s,H,ZA(be._f))):k(H,!0,le.value),{...je?{disabled:le.disabled}:{},...t.progressive?{required:!!le.required,min:uv(le.min),max:uv(le.max),minLength:uv(le.minLength),maxLength:uv(le.maxLength),pattern:uv(le.pattern)}:{},name:H,onChange:re,onBlur:re,ref:Y=>{if(Y){xe(H,le),be=Qe(r,H);const j=Si(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,q=w$e(j),R=be._f.refs||[];if(q?R.find(F=>F===j):j===be._f.ref)return;zn(r,H,{_f:{...be._f,...q?{refs:[...R.filter(GA),j,...Array.isArray(Qe(o,H))?[{}]:[]],ref:{type:j.type,name:H}}:{ref:j}}}),k(H,!1,void 0,j)}else be=Qe(r,H,{}),be._f&&(be._f.mount=!1),(t.shouldUnregister||le.shouldUnregister)&&!(Pq(l.array,H)&&a.action)&&l.unMount.add(H)}}},ge=()=>t.shouldFocusError&&zA(r,H=>H&&Qe(i.errors,H),l.mount),we=(H,le)=>async be=>{be&&(be.preventDefault&&be.preventDefault(),be.persist&&be.persist());let je=vl(s);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:j}=await T();i.errors=Y,je=j}else await N(r);Sr(i.errors,"root"),Us(i.errors)?(h.state.next({errors:{}}),await H(je,be)):(le&&await le({...i.errors},be),ge(),setTimeout(ge)),h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Us(i.errors),submitCount:i.submitCount+1,errors:i.errors})},Se=(H,le={})=>{Qe(r,H)&&(Si(le.defaultValue)?ae(H,Qe(o,H)):(ae(H,le.defaultValue),zn(o,H,le.defaultValue)),le.keepTouched||Sr(i.touchedFields,H),le.keepDirty||(Sr(i.dirtyFields,H),i.isDirty=le.defaultValue?M(H,Qe(o,H)):M()),le.keepError||(Sr(i.errors,H),d.isValid&&_()),h.state.next({...i}))},pe=(H,le={})=>{const be=H||o,je=vl(be),Y=H&&!Us(H)?je:o;if(le.keepDefaultValues||(o=be),!le.keepValues){if(le.keepDirtyValues||f)for(const j of l.mount)Qe(i.dirtyFields,j)?zn(Y,j,Qe(s,j)):ae(j,Qe(Y,j));else{if($A&&Si(H))for(const j of l.mount){const q=Qe(r,j);if(q&&q._f){const R=Array.isArray(q._f.refs)?q._f.refs[0]:q._f.ref;if(BS(R)){const F=R.closest("form");if(F){F.reset();break}}}}r={}}s=n.shouldUnregister?le.keepDefaultValues?vl(o):{}:vl(Y),h.array.next({values:{...Y}}),h.values.next({values:{...Y}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&e(),a.mount=!d.isValid||!!le.keepIsValid,a.watch=!!n.shouldUnregister,h.state.next({submitCount:le.keepSubmitCount?i.submitCount:0,isDirty:le.keepDirty?i.isDirty:!!(le.keepDefaultValues&&!jh(H,o)),isSubmitted:le.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:le.keepDirtyValues?i.dirtyFields:le.keepDefaultValues&&H?YA(o,H):{},touchedFields:le.keepTouched?i.touchedFields:{},errors:le.keepErrors?i.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Q=(H,le)=>pe(Gu(H)?H(s):H,le);return{control:{register:xe,unregister:te,getFieldState:Z,handleSubmit:we,setError:ce,_executeSchema:T,_getWatch:B,_getDirty:M,_updateValid:_,_removeUnmounted:I,_updateFieldArray:y,_getFieldArray:V,_reset:pe,_resetDefaultValues:()=>Gu(t.defaultValues)&&t.defaultValues().then(H=>{Q(H,t.resetOptions),h.state.next({isLoading:!1})}),_updateFormState:H=>{i={...i,...H}},_subjects:h,_proxyFormState:d,get _fields(){return r},get _formValues(){return s},get _state(){return a},set _state(H){a=H},get _defaultValues(){return o},get _names(){return l},set _names(H){l=H},get _formState(){return i},set _formState(H){i=H},get _options(){return t},set _options(H){t={...t,...H}}},trigger:J,register:xe,handleSubmit:we,watch:De,setValue:ae,getValues:ue,reset:Q,resetField:Se,clearErrors:X,unregister:te,setError:ce,setFocus:(H,le={})=>{const be=Qe(r,H),je=be&&be._f;if(je){const Y=je.refs?je.refs[0]:je.ref;Y.focus&&(Y.focus(),le.shouldSelect&&Y.select())}},getFieldState:Z}}function E$e(n={}){const e=E.useRef(),t=E.useRef(),[i,r]=E.useState({isDirty:!1,isValidating:!1,isLoading:Gu(n.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Gu(n.defaultValues)?void 0:n.defaultValues});e.current||(e.current={...D$e(n,()=>r(s=>({...s}))),formState:i});const o=e.current.control;return o._options=n,jA({subject:o._subjects.state,next:s=>{Bq(s,o._proxyFormState,o._updateFormState,!0)&&r({...o._formState})}}),E.useEffect(()=>{n.values&&!jh(n.values,t.current)?(o._reset(n.values,o._options.resetOptions),t.current=n.values):o._resetDefaultValues()},[n.values,o]),E.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),e.current.formState=Fq(i,o),e.current}function T$e(n){const{name:e,readOnly:t,validate:i,...r}=n,{control:o,formState:{isSubmitting:s}}=Nc();return x.jsx(Sm,{name:e,control:o,shouldUnregister:!0,render:({field:{onChange:a,value:l}})=>x.jsx(P.Checkbox,{...r,id:n.id??e.split(".").join("-"),isChecked:!!l,onChange:a,readOnly:t||s,minLength:void 0,maxLength:void 0,ref:void 0}),rules:{validate:i}})}function yl(n){return n?n.charAt(0).toUpperCase()+n.slice(1):""}/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function iK(n){return typeof n>"u"||n===null}function I$e(n){return typeof n=="object"&&n!==null}function A$e(n){return Array.isArray(n)?n:iK(n)?[]:[n]}function O$e(n,e){var t,i,r,o;if(e)for(o=Object.keys(e),t=0,i=o.length;t<i;t+=1)r=o[t],n[r]=e[r];return n}function N$e(n,e){var t="",i;for(i=0;i<e;i+=1)t+=n;return t}function M$e(n){return n===0&&Number.NEGATIVE_INFINITY===1/n}var P$e=iK,R$e=I$e,F$e=A$e,B$e=N$e,V$e=M$e,W$e=O$e,nr={isNothing:P$e,isObject:R$e,toArray:F$e,repeat:B$e,isNegativeZero:V$e,extend:W$e};function rK(n,e){var t="",i=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(t+='in "'+n.mark.name+'" '),t+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!e&&n.mark.snippet&&(t+=`
|
403
|
+
`;function o$e(n){const{title:e,items:t,keyFn:i,prompt:r,alertPrompts:o,confirmationColumns:s,isItemNonActionable:a,onConfirm:l,onClose:c,confirmText:u,actionButtonText:d,isDanger:h}=n,[f,g]=tl(),[m]=Ci(),p=E.useCallback(()=>{g(void 0),c==null||c()},[c,g]),v=E.useMemo(()=>a&&t.some(a)?t.sort((D,T)=>av(a(D),a(T))):t,[t,a]),_=ov(v),[b,y]=E.useState(!u),C=E.useMemo(()=>a&&t.some(a)?[{header:"",cell:D=>a(D)?x.jsx(P.Tooltip,{content:a(D),trigger:a(D)?void 0:"manual",children:x.jsx(P.Icon,{status:"warning",children:x.jsx(Ct.ExclamationTriangleIcon,{})})}):null},...s]:s,[s,a,t]),k=E.useMemo(()=>a?t.filter(D=>!a(D)):t,[a,t]),L=_A(C);return x.jsx(P.Modal,{titleIconVariant:h?"warning":void 0,title:e,"aria-label":e,description:r,variant:P.ModalVariant.medium,isOpen:!0,onClose:p,actions:[x.jsx(P.Button,{variant:h?"danger":"primary",onClick:()=>{p(),l()},isAriaDisabled:!b,children:d},"submit"),x.jsx(P.Button,{variant:"link",onClick:c,children:m.cancelText},"cancel")],hasNoBodyWrapper:!0,children:t.length>0&&x.jsxs(P.ModalBoxBody,{style:{paddingLeft:0,paddingRight:0},children:[x.jsxs(i$e,{children:[o&&o.length>0&&o.map((D,T)=>x.jsx(P.Alert,{isInline:!0,title:D,variant:"warning"},T)),x.jsx(sv,{pageItems:_.paged,itemCount:t.length,tableColumns:L,keyFn:i,compact:!0,errorStateTitle:"Error",emptyStateTitle:"No items",autoHidePagination:!0,disableBodyPadding:!0,..._},"items")]}),u&&k.length>0&&x.jsx(r$e,{children:x.jsx(P.Checkbox,{id:"confirm",label:u,isChecked:b,onChange:y})})]})})}function s$e(){const[n,e]=tl(),[t,i]=E.useState();return E.useEffect(()=>{if(t){const r=()=>{var o;i(void 0),(o=t.onClose)==null||o.call(t)};e(x.jsx(o$e,{...t,onClose:r}))}else e(void 0)},[t,e]),i}function a$e(){const n=s$e(),e=Eq();return E.useCallback(t=>{const i=Object.assign({},t);return t.isItemNonActionable&&t.isItemNonActionable!==void 0&&(i.items=t.items.filter(r=>t.isItemNonActionable!==void 0&&!t.isItemNonActionable(r))),n({...t,onConfirm:()=>e(i)})},[e,n])}function l$e(n){const{title:e,view:t,tableColumns:i,toolbarFilters:r,confirmText:o,cancelText:s,onSelect:a}=n,[l,c]=tl(),u=E.useCallback(()=>c(void 0),[c]),[d]=Ci();return x.jsx(P.Modal,{title:e,"aria-label":e,isOpen:!0,onClose:u,variant:P.ModalVariant.medium,tabIndex:0,actions:[x.jsx(P.Button,{variant:"primary",id:"confirm",onClick:()=>{u(),a(t.selectedItems)},isAriaDisabled:t.selectedItems.length===0,children:o??d.confirmText},"confirm"),x.jsx(P.Button,{variant:"link",onClick:u,children:s??d.cancelText},"cancel")],hasNoBodyWrapper:!0,children:x.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:500,overflow:"hidden"},children:x.jsx(sv,{tableColumns:i,toolbarFilters:r,...t,emptyStateTitle:n.emptyStateTitle??d.noItemsFound,errorStateTitle:n.errorStateTitle??d.errorText,showSelect:!0,disableCardView:!0,disableListView:!0,compact:!0,disableBodyPadding:!0})})})}const N_t="";function WA(n){let e="collapsed";return n.open&&(e+=" expanded"),x.jsx("div",{className:e,children:n.children})}function c$e(n){const{view:e,tableColumns:t,toolbarFilters:i,confirm:r,cancel:o,selected:s,isMultiple:a}=n,[l,c]=E.useState(""),[u,d]=E.useState(),h=E.useCallback((m,p)=>{c(p??""),d(()=>m)},[]),[f,g]=tl();return E.useEffect(()=>{u!==void 0?g(x.jsx(Aq,{title:l,open:!0,isMultiple:a,setOpen:()=>d(void 0),onSelect:u,view:e,tableColumns:t,toolbarFilters:i,confirm:r,cancel:o,selected:s,keyFn:e.keyFn})):(g(void 0),e.unselectAll())},[o,r,u,s,g,t,l,i,e,a]),h}function Aq(n){const{title:e,open:t,isMultiple:i=!1,setOpen:r,onSelect:o,view:s,tableColumns:a,toolbarFilters:l,confirm:c,cancel:u,selected:d}=n,h=()=>r(!1),{t:f}=$r();return x.jsxs(P.Modal,{title:e,"aria-label":e,isOpen:t,onClose:h,variant:P.ModalVariant.medium,tabIndex:0,actions:[x.jsx(P.Button,{variant:"primary",onClick:()=>{!i&&s.selectedItems.length>0?o(s.selectedItems[0]):i&&o(s.selectedItems),h()},isAriaDisabled:s.selectedItems.length===0,children:c},"confirm"),x.jsx(P.Button,{variant:"link",onClick:h,children:u},"cancel")],hasNoBodyWrapper:!0,children:[x.jsx(P.ModalBoxBody,{style:{overflow:"hidden"},children:x.jsxs(P.Split,{hasGutter:!0,children:[x.jsx(P.SplitItem,{style:{fontWeight:"bold"},children:d}),s.selectedItems.length>0?x.jsx(P.ChipGroup,{children:s.selectedItems.map((g,m)=>a&&a.length>0?x.jsx(P.Chip,{onClick:()=>s.unselectItem(g),children:x.jsx(jr,{item:g,column:a.find(p=>p.card==="name"||p.list==="name")??a[0]})},m):x.jsx(x.Fragment,{}))}):x.jsx(P.SplitItem,{style:{fontStyle:"italic"},children:f`None - Please make a selection below.`})]})}),x.jsx(WA,{open:s.itemCount===void 0,children:x.jsx(P.Skeleton,{height:"80px"})}),x.jsx(WA,{open:s.itemCount!==void 0,children:x.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:500,overflow:"hidden"},children:x.jsx(sv,{tableColumns:a,toolbarFilters:l,emptyStateTitle:"No organizations found",errorStateTitle:"Error loading organizations",...s,isSelectMultiple:i,onSelect:()=>null,disableCardView:!0,disableListView:!0,compact:!0,disableBodyPadding:!0})})})]})}function u$e(n){const{onSelect:e,value:t}=n,i=E.useCallback((l,c)=>{var u;e(l,(u=n.options.find(d=>d.label===c.toString()))==null?void 0:u.value)},[e,n.options]),{options:r}=n;r.sort((l,c)=>(l.group??"")<(c.group??"")?-1:(l.group??"")>(c.group??"")?1:l.label<c.label?-1:l.label>c.label?1:0);const o=r.reduce((l,c)=>{const u=c.group??"";let d=l[u];return d||(d=[],l[u]=d),d.push(c),l},{}),s=Object.keys(o).length>1||Object.keys(o).length===1&&Object.keys(o)[0]!=="",a=n.options.find(l=>l.value===t);return x.jsx(Dg,{...n,value:a==null?void 0:a.label,onSelect:i,isGrouped:s,children:s?Object.keys(o).map(l=>x.jsx(P.SelectGroup,{label:l,children:o[l].map(c=>x.jsx(P.SelectOption,{value:c.label,label:c.label,description:c.description,children:c.label},c.label))},l)):r.map(l=>x.jsx(P.SelectOption,{value:l.label,label:l.label,description:l.description,children:l.label},l.label))})}function Oq(n){const[e,t]=E.useState(!1),{helperTextInvalid:i,...r}=n;return x.jsx(yy,{...n,children:x.jsxs(P.InputGroup,{children:[x.jsx(P.TextArea,{...r,id:n.id,label:void 0,"aria-describedby":n.id?`${n.id}-form-group`:void 0,validated:n.helperTextInvalid?"error":void 0}),n.type==="password"&&x.jsx(P.Button,{variant:"control",onClick:()=>t(!e),isDisabled:n.isDisabled||n.isReadOnly,children:e?x.jsx(Ct.EyeIcon,{}):x.jsx(Ct.EyeSlashIcon,{})})]})})}function d$e(n){const[e,t]=E.useState(!1),{children:i,isReadOnly:r,placeholder:o,...s}=n,a=n.id?n.id:typeof n.label=="string"?n.label.toLowerCase().split(" ").join("-"):void 0;return x.jsx(yy,{...s,id:a,children:x.jsxs(P.InputGroup,{children:[x.jsx(P.TextInput,{autoComplete:n.autoComplete,placeholder:o,onChange:n.onChange,id:a,onBlur:n.onBlur,label:void 0,value:n.value,"aria-describedby":a?`${a}-form-group`:void 0,validated:n.helperTextInvalid?"error":void 0,type:n.type==="password"?e?"text":"password":n.type,readOnlyVariant:r?"default":void 0,isDisabled:n.isDisabled,min:n.min}),n.type==="password"&&x.jsx(P.Button,{variant:"control",onClick:()=>t(!e),isDisabled:n.isDisabled||n.isReadOnly,children:e?x.jsx(Ct.EyeIcon,{}):x.jsx(Ct.EyeSlashIcon,{})}),n.children]})})}var lv=n=>n.type==="checkbox",Cm=n=>n instanceof Date,so=n=>n==null;const Nq=n=>typeof n=="object";var tr=n=>!so(n)&&!Array.isArray(n)&&Nq(n)&&!Cm(n),Mq=n=>tr(n)&&n.target?lv(n.target)?n.target.checked:n.target.value:n,h$e=n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n,Pq=(n,e)=>n.has(h$e(e)),f$e=n=>{const e=n.constructor&&n.constructor.prototype;return tr(e)&&e.hasOwnProperty("isPrototypeOf")},$A=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function vl(n){let e;const t=Array.isArray(n);if(n instanceof Date)e=new Date(n);else if(n instanceof Set)e=new Set(n);else if(!($A&&(n instanceof Blob||n instanceof FileList))&&(t||tr(n)))if(e=t?[]:{},!t&&!f$e(n))e=n;else for(const i in n)n.hasOwnProperty(i)&&(e[i]=vl(n[i]));else return n;return e}var cv=n=>Array.isArray(n)?n.filter(Boolean):[],Si=n=>n===void 0,Qe=(n,e,t)=>{if(!e||!tr(n))return t;const i=cv(e.split(/[,[\].]+?/)).reduce((r,o)=>so(r)?r:r[o],n);return Si(i)||i===n?Si(n[e])?t:n[e]:i};const RS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Da={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Oc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Rq=E.createContext(null),Nc=()=>E.useContext(Rq),g$e=n=>{const{children:e,...t}=n;return E.createElement(Rq.Provider,{value:t},e)};var Fq=(n,e,t,i=!0)=>{const r={defaultValues:e._defaultValues};for(const o in n)Object.defineProperty(r,o,{get:()=>{const s=o;return e._proxyFormState[s]!==Da.all&&(e._proxyFormState[s]=!i||Da.all),t&&(t[s]=!0),n[s]}});return r},Us=n=>tr(n)&&!Object.keys(n).length,Bq=(n,e,t,i)=>{t(n);const{name:r,...o}=n;return Us(o)||Object.keys(o).length>=Object.keys(e).length||Object.keys(o).find(s=>e[s]===(!i||Da.all))},FS=n=>Array.isArray(n)?n:[n],Vq=(n,e,t)=>t&&e?n===e:!n||!e||n===e||FS(n).some(i=>i&&(i.startsWith(e)||e.startsWith(i)));function jA(n){const e=E.useRef(n);e.current=n,E.useEffect(()=>{const t=!n.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{t&&t.unsubscribe()}},[n.disabled])}function Wq(n){const e=Nc(),{control:t=e.control,disabled:i,name:r,exact:o}=n||{},[s,a]=E.useState(t._formState),l=E.useRef(!0),c=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=E.useRef(r);return u.current=r,jA({disabled:i,next:d=>l.current&&Vq(u.current,d.name,o)&&Bq(d,c.current,t._updateFormState)&&a({...t._formState,...d}),subject:t._subjects.state}),E.useEffect(()=>(l.current=!0,c.current.isValid&&t._updateValid(!0),()=>{l.current=!1}),[t]),Fq(s,t,c.current,!1)}var bl=n=>typeof n=="string",$q=(n,e,t,i,r)=>bl(n)?(i&&e.watch.add(n),Qe(t,n,r)):Array.isArray(n)?n.map(o=>(i&&e.watch.add(o),Qe(t,o))):(i&&(e.watchAll=!0),t);function m$e(n){const e=Nc(),{control:t=e.control,name:i,defaultValue:r,disabled:o,exact:s}=n||{},a=E.useRef(i);a.current=i,jA({disabled:o,subject:t._subjects.values,next:u=>{Vq(a.current,u.name,s)&&c(vl($q(a.current,t._names,u.values||t._formValues,!1,r)))}});const[l,c]=E.useState(t._getWatch(i,r));return E.useEffect(()=>t._removeUnmounted()),l}var HA=n=>/^\w*$/.test(n),jq=n=>cv(n.replace(/["|']|\]/g,"").split(/\.|\[/));function zn(n,e,t){let i=-1;const r=HA(e)?[e]:jq(e),o=r.length,s=o-1;for(;++i<o;){const a=r[i];let l=t;if(i!==s){const c=n[a];l=tr(c)||Array.isArray(c)?c:isNaN(+r[i+1])?{}:[]}n[a]=l,n=n[a]}return n}function p$e(n){const e=Nc(),{name:t,control:i=e.control,shouldUnregister:r}=n,o=Pq(i._names.array,t),s=m$e({control:i,name:t,defaultValue:Qe(i._formValues,t,Qe(i._defaultValues,t,n.defaultValue)),exact:!0}),a=Wq({control:i,name:t}),l=E.useRef(i.register(t,{...n.rules,value:s}));return l.current=i.register(t,n.rules),E.useEffect(()=>{const c=i._options.shouldUnregister||r,u=(d,h)=>{const f=Qe(i._fields,d);f&&(f._f.mount=h)};if(u(t,!0),c){const d=vl(Qe(i._options.defaultValues,t));zn(i._defaultValues,t,d),Si(Qe(i._formValues,t))&&zn(i._formValues,t,d)}return()=>{(o?c&&!i._state.action:c)?i.unregister(t):u(t,!1)}},[t,i,o,r]),{field:{name:t,value:s,onChange:E.useCallback(c=>l.current.onChange({target:{value:Mq(c),name:t},type:RS.CHANGE}),[t]),onBlur:E.useCallback(()=>l.current.onBlur({target:{value:Qe(i._formValues,t),name:t},type:RS.BLUR}),[t,i]),ref:c=>{const u=Qe(i._fields,t);u&&c&&(u._f.ref={focus:()=>c.focus(),select:()=>c.select(),setCustomValidity:d=>c.setCustomValidity(d),reportValidity:()=>c.reportValidity()})}},formState:a,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Qe(a.errors,t)},isDirty:{enumerable:!0,get:()=>!!Qe(a.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!Qe(a.touchedFields,t)},error:{enumerable:!0,get:()=>Qe(a.errors,t)}})}}const Sm=n=>n.render(p$e(n));var _$e=(n,e,t,i,r)=>e?{...t[n],types:{...t[n]&&t[n].types?t[n].types:{},[i]:r||!0}}:{};const zA=(n,e,t)=>{for(const i of t||Object.keys(n)){const r=Qe(n,i);if(r){const{_f:o,...s}=r;if(o&&e(o.name)){if(o.ref.focus){o.ref.focus();break}else if(o.refs&&o.refs[0].focus){o.refs[0].focus();break}}else tr(s)&&zA(s,e)}}};var Hq=n=>({isOnSubmit:!n||n===Da.onSubmit,isOnBlur:n===Da.onBlur,isOnChange:n===Da.onChange,isOnAll:n===Da.all,isOnTouch:n===Da.onTouched}),zq=(n,e,t)=>!t&&(e.watchAll||e.watch.has(n)||[...e.watch].some(i=>n.startsWith(i)&&/^\.\w+/.test(n.slice(i.length)))),v$e=(n,e,t)=>{const i=cv(Qe(n,t));return zn(i,"root",e[t]),zn(n,t,i),n},xm=n=>typeof n=="boolean",UA=n=>n.type==="file",Gu=n=>typeof n=="function",BS=n=>{if(!$A)return!1;const e=n?n.ownerDocument:0;return n instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},VS=n=>bl(n),qA=n=>n.type==="radio",WS=n=>n instanceof RegExp;const Uq={value:!1,isValid:!1},qq={value:!0,isValid:!0};var Kq=n=>{if(Array.isArray(n)){if(n.length>1){const e=n.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:e,isValid:!!e.length}}return n[0].checked&&!n[0].disabled?n[0].attributes&&!Si(n[0].attributes.value)?Si(n[0].value)||n[0].value===""?qq:{value:n[0].value,isValid:!0}:qq:Uq}return Uq};const Gq={isValid:!1,value:null};var Yq=n=>Array.isArray(n)?n.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Gq):Gq;function Zq(n,e,t="validate"){if(VS(n)||Array.isArray(n)&&n.every(VS)||xm(n)&&!n)return{type:t,message:VS(n)?n:"",ref:e}}var Lm=n=>tr(n)&&!WS(n)?n:{value:n,message:""},Xq=async(n,e,t,i,r)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:u,max:d,pattern:h,validate:f,name:g,valueAsNumber:m,mount:p,disabled:v}=n._f,_=Qe(e,g);if(!p||v)return{};const b=s?s[0]:o,y=I=>{i&&b.reportValidity&&(b.setCustomValidity(xm(I)?"":I||""),b.reportValidity())},C={},k=qA(o),L=lv(o),D=k||L,T=(m||UA(o))&&Si(o.value)&&Si(_)||BS(o)&&o.value===""||_===""||Array.isArray(_)&&!_.length,O=_$e.bind(null,g,t,C),N=(I,M,B,V=Oc.maxLength,ee=Oc.minLength)=>{const se=I?M:B;C[g]={type:I?V:ee,message:se,ref:o,...O(I?V:ee,se)}};if(r?!Array.isArray(_)||!_.length:a&&(!D&&(T||so(_))||xm(_)&&!_||L&&!Kq(s).isValid||k&&!Yq(s).isValid)){const{value:I,message:M}=VS(a)?{value:!!a,message:a}:Lm(a);if(I&&(C[g]={type:Oc.required,message:M,ref:b,...O(Oc.required,M)},!t))return y(M),C}if(!T&&(!so(u)||!so(d))){let I,M;const B=Lm(d),V=Lm(u);if(!so(_)&&!isNaN(_)){const ee=o.valueAsNumber||_&&+_;so(B.value)||(I=ee>B.value),so(V.value)||(M=ee<V.value)}else{const ee=o.valueAsDate||new Date(_),se=J=>new Date(new Date().toDateString()+" "+J),ae=o.type=="time",re=o.type=="week";bl(B.value)&&_&&(I=ae?se(_)>se(B.value):re?_>B.value:ee>new Date(B.value)),bl(V.value)&&_&&(M=ae?se(_)<se(V.value):re?_<V.value:ee<new Date(V.value))}if((I||M)&&(N(!!I,B.message,V.message,Oc.max,Oc.min),!t))return y(C[g].message),C}if((l||c)&&!T&&(bl(_)||r&&Array.isArray(_))){const I=Lm(l),M=Lm(c),B=!so(I.value)&&_.length>+I.value,V=!so(M.value)&&_.length<+M.value;if((B||V)&&(N(B,I.message,M.message),!t))return y(C[g].message),C}if(h&&!T&&bl(_)){const{value:I,message:M}=Lm(h);if(WS(I)&&!_.match(I)&&(C[g]={type:Oc.pattern,message:M,ref:o,...O(Oc.pattern,M)},!t))return y(M),C}if(f){if(Gu(f)){const I=await f(_,e),M=Zq(I,b);if(M&&(C[g]={...M,...O(Oc.validate,M.message)},!t))return y(M.message),C}else if(tr(f)){let I={};for(const M in f){if(!Us(I)&&!t)break;const B=Zq(await f[M](_,e),b,M);B&&(I={...B,...O(M,B.message)},y(B.message),t&&(C[g]=I))}if(!Us(I)&&(C[g]={ref:b,...I},!t))return C}}return y(!0),C};function b$e(n,e){const t=e.slice(0,-1).length;let i=0;for(;i<t;)n=Si(n)?i++:n[e[i++]];return n}function y$e(n){for(const e in n)if(n.hasOwnProperty(e)&&!Si(n[e]))return!1;return!0}function Sr(n,e){const t=Array.isArray(e)?e:HA(e)?[e]:jq(e),i=t.length===1?n:b$e(n,t),r=t.length-1,o=t[r];return i&&delete i[o],r!==0&&(tr(i)&&Us(i)||Array.isArray(i)&&y$e(i))&&Sr(n,t.slice(0,-1)),n}function KA(){let n=[];return{get observers(){return n},next:r=>{for(const o of n)o.next&&o.next(r)},subscribe:r=>(n.push(r),{unsubscribe:()=>{n=n.filter(o=>o!==r)}}),unsubscribe:()=>{n=[]}}}var $S=n=>so(n)||!Nq(n);function jh(n,e){if($S(n)||$S(e))return n===e;if(Cm(n)&&Cm(e))return n.getTime()===e.getTime();const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const r of t){const o=n[r];if(!i.includes(r))return!1;if(r!=="ref"){const s=e[r];if(Cm(o)&&Cm(s)||tr(o)&&tr(s)||Array.isArray(o)&&Array.isArray(s)?!jh(o,s):o!==s)return!1}}return!0}var Qq=n=>n.type==="select-multiple",w$e=n=>qA(n)||lv(n),GA=n=>BS(n)&&n.isConnected,Jq=n=>{for(const e in n)if(Gu(n[e]))return!0;return!1};function jS(n,e={}){const t=Array.isArray(n);if(tr(n)||t)for(const i in n)Array.isArray(n[i])||tr(n[i])&&!Jq(n[i])?(e[i]=Array.isArray(n[i])?[]:{},jS(n[i],e[i])):so(n[i])||(e[i]=!0);return e}function eK(n,e,t){const i=Array.isArray(n);if(tr(n)||i)for(const r in n)Array.isArray(n[r])||tr(n[r])&&!Jq(n[r])?Si(e)||$S(t[r])?t[r]=Array.isArray(n[r])?jS(n[r],[]):{...jS(n[r])}:eK(n[r],so(e)?{}:e[r],t[r]):t[r]=!jh(n[r],e[r]);return t}var YA=(n,e)=>eK(n,e,jS(e)),tK=(n,{valueAsNumber:e,valueAsDate:t,setValueAs:i})=>Si(n)?n:e?n===""?NaN:n&&+n:t&&bl(n)?new Date(n):i?i(n):n;function ZA(n){const e=n.ref;if(!(n.refs?n.refs.every(t=>t.disabled):e.disabled))return UA(e)?e.files:qA(e)?Yq(n.refs).value:Qq(e)?[...e.selectedOptions].map(({value:t})=>t):lv(e)?Kq(n.refs).value:tK(Si(e.value)?n.ref.value:e.value,n)}var C$e=(n,e,t,i)=>{const r={};for(const o of n){const s=Qe(e,o);s&&zn(r,o,s._f)}return{criteriaMode:t,names:[...n],fields:r,shouldUseNativeValidation:i}},uv=n=>Si(n)?n:WS(n)?n.source:tr(n)?WS(n.value)?n.value.source:n.value:n,S$e=n=>n.mount&&(n.required||n.min||n.max||n.maxLength||n.minLength||n.pattern||n.validate);function nK(n,e,t){const i=Qe(n,t);if(i||HA(t))return{error:i,name:t};const r=t.split(".");for(;r.length;){const o=r.join("."),s=Qe(e,o),a=Qe(n,o);if(s&&!Array.isArray(s)&&t!==o)return{name:t};if(a&&a.type)return{name:o,error:a};r.pop()}return{name:t}}var x$e=(n,e,t,i,r)=>r.isOnAll?!1:!t&&r.isOnTouch?!(e||n):(t?i.isOnBlur:r.isOnBlur)?!n:(t?i.isOnChange:r.isOnChange)?n:!0,L$e=(n,e)=>!cv(Qe(n,e)).length&&Sr(n,e);const k$e={mode:Da.onSubmit,reValidateMode:Da.onChange,shouldFocusError:!0};function D$e(n={},e){let t={...k$e,...n},i={submitCount:0,isDirty:!1,isLoading:Gu(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},r={},o=tr(t.defaultValues)||tr(t.values)?vl(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:vl(o),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={values:KA(),array:KA(),state:KA()},f=n.resetOptions&&n.resetOptions.keepDirtyValues,g=Hq(t.mode),m=Hq(t.reValidateMode),p=t.criteriaMode===Da.all,v=H=>le=>{clearTimeout(u),u=setTimeout(H,le)},_=async H=>{if(d.isValid||H){const le=t.resolver?Us((await T()).errors):await N(r,!0);le!==i.isValid&&h.state.next({isValid:le})}},b=H=>d.isValidating&&h.state.next({isValidating:H}),y=(H,le=[],be,je,Y=!0,j=!0)=>{if(je&&be){if(a.action=!0,j&&Array.isArray(Qe(r,H))){const q=be(Qe(r,H),je.argA,je.argB);Y&&zn(r,H,q)}if(j&&Array.isArray(Qe(i.errors,H))){const q=be(Qe(i.errors,H),je.argA,je.argB);Y&&zn(i.errors,H,q),L$e(i.errors,H)}if(d.touchedFields&&j&&Array.isArray(Qe(i.touchedFields,H))){const q=be(Qe(i.touchedFields,H),je.argA,je.argB);Y&&zn(i.touchedFields,H,q)}d.dirtyFields&&(i.dirtyFields=YA(o,s)),h.state.next({name:H,isDirty:M(H,le),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else zn(s,H,le)},C=(H,le)=>{zn(i.errors,H,le),h.state.next({errors:i.errors})},k=(H,le,be,je)=>{const Y=Qe(r,H);if(Y){const j=Qe(s,H,Si(be)?Qe(o,H):be);Si(j)||je&&je.defaultChecked||le?zn(s,H,le?j:ZA(Y._f)):ee(H,j),a.mount&&_()}},L=(H,le,be,je,Y)=>{let j=!1,q=!1;const R={name:H};if(!be||je){d.isDirty&&(q=i.isDirty,i.isDirty=R.isDirty=M(),j=q!==R.isDirty);const F=jh(Qe(o,H),le);q=Qe(i.dirtyFields,H),F?Sr(i.dirtyFields,H):zn(i.dirtyFields,H,!0),R.dirtyFields=i.dirtyFields,j=j||d.dirtyFields&&q!==!F}if(be){const F=Qe(i.touchedFields,H);F||(zn(i.touchedFields,H,be),R.touchedFields=i.touchedFields,j=j||d.touchedFields&&F!==be)}return j&&Y&&h.state.next(R),j?R:{}},D=(H,le,be,je)=>{const Y=Qe(i.errors,H),j=d.isValid&&xm(le)&&i.isValid!==le;if(n.delayError&&be?(c=v(()=>C(H,be)),c(n.delayError)):(clearTimeout(u),c=null,be?zn(i.errors,H,be):Sr(i.errors,H)),(be?!jh(Y,be):Y)||!Us(je)||j){const q={...je,...j&&xm(le)?{isValid:le}:{},errors:i.errors,name:H};i={...i,...q},h.state.next(q)}b(!1)},T=async H=>t.resolver(s,t.context,C$e(H||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation)),O=async H=>{const{errors:le}=await T();if(H)for(const be of H){const je=Qe(le,be);je?zn(i.errors,be,je):Sr(i.errors,be)}else i.errors=le;return le},N=async(H,le,be={valid:!0})=>{for(const je in H){const Y=H[je];if(Y){const{_f:j,...q}=Y;if(j){const R=l.array.has(j.name),F=await Xq(Y,s,p,t.shouldUseNativeValidation&&!le,R);if(F[j.name]&&(be.valid=!1,le))break;!le&&(Qe(F,j.name)?R?v$e(i.errors,F,j.name):zn(i.errors,j.name,F[j.name]):Sr(i.errors,j.name))}q&&await N(q,le,be)}}return be.valid},I=()=>{for(const H of l.unMount){const le=Qe(r,H);le&&(le._f.refs?le._f.refs.every(be=>!GA(be)):!GA(le._f.ref))&&te(H)}l.unMount=new Set},M=(H,le)=>(H&&le&&zn(s,H,le),!jh(ue(),o)),B=(H,le,be)=>$q(H,l,{...a.mount?s:Si(le)?o:bl(H)?{[H]:le}:le},be,le),V=H=>cv(Qe(a.mount?s:o,H,n.shouldUnregister?Qe(o,H,[]):[])),ee=(H,le,be={})=>{const je=Qe(r,H);let Y=le;if(je){const j=je._f;j&&(!j.disabled&&zn(s,H,tK(le,j)),Y=BS(j.ref)&&so(le)?"":le,Qq(j.ref)?[...j.ref.options].forEach(q=>q.selected=Y.includes(q.value)):j.refs?lv(j.ref)?j.refs.length>1?j.refs.forEach(q=>(!q.defaultChecked||!q.disabled)&&(q.checked=Array.isArray(Y)?!!Y.find(R=>R===q.value):Y===q.value)):j.refs[0]&&(j.refs[0].checked=!!Y):j.refs.forEach(q=>q.checked=q.value===Y):UA(j.ref)?j.ref.value="":(j.ref.value=Y,j.ref.type||h.values.next({name:H,values:{...s}})))}(be.shouldDirty||be.shouldTouch)&&L(H,Y,be.shouldTouch,be.shouldDirty,!0),be.shouldValidate&&J(H)},se=(H,le,be)=>{for(const je in le){const Y=le[je],j=`${H}.${je}`,q=Qe(r,j);(l.array.has(H)||!$S(Y)||q&&!q._f)&&!Cm(Y)?se(j,Y,be):ee(j,Y,be)}},ae=(H,le,be={})=>{const je=Qe(r,H),Y=l.array.has(H),j=vl(le);zn(s,H,j),Y?(h.array.next({name:H,values:{...s}}),(d.isDirty||d.dirtyFields)&&be.shouldDirty&&h.state.next({name:H,dirtyFields:YA(o,s),isDirty:M(H,j)})):je&&!je._f&&!so(j)?se(H,j,be):ee(H,j,be),zq(H,l)&&h.state.next({...i}),h.values.next({name:H,values:{...s}}),!a.mount&&e()},re=async H=>{const le=H.target;let be=le.name,je=!0;const Y=Qe(r,be),j=()=>le.type?ZA(Y._f):Mq(H);if(Y){let q,R;const F=j(),z=H.type===RS.BLUR||H.type===RS.FOCUS_OUT,U=!S$e(Y._f)&&!t.resolver&&!Qe(i.errors,be)&&!Y._f.deps||x$e(z,Qe(i.touchedFields,be),i.isSubmitted,m,g),fe=zq(be,l,z);zn(s,be,F),z?(Y._f.onBlur&&Y._f.onBlur(H),c&&c(0)):Y._f.onChange&&Y._f.onChange(H);const ke=L(be,F,z,!1),Ae=!Us(ke)||fe;if(!z&&h.values.next({name:be,type:H.type,values:{...s}}),U)return d.isValid&&_(),Ae&&h.state.next({name:be,...fe?{}:ke});if(!z&&fe&&h.state.next({...i}),b(!0),t.resolver){const{errors:Fe}=await T([be]),Ze=nK(i.errors,r,be),Ye=nK(Fe,r,Ze.name||be);q=Ye.error,be=Ye.name,R=Us(Fe)}else q=(await Xq(Y,s,p,t.shouldUseNativeValidation))[be],je=isNaN(F)||F===Qe(s,be,F),je&&(q?R=!1:d.isValid&&(R=await N(r,!0)));je&&(Y._f.deps&&J(Y._f.deps),D(be,R,q,ke))}},J=async(H,le={})=>{let be,je;const Y=FS(H);if(b(!0),t.resolver){const j=await O(Si(H)?H:Y);be=Us(j),je=H?!Y.some(q=>Qe(j,q)):be}else H?(je=(await Promise.all(Y.map(async j=>{const q=Qe(r,j);return await N(q&&q._f?{[j]:q}:q)}))).every(Boolean),!(!je&&!i.isValid)&&_()):je=be=await N(r);return h.state.next({...!bl(H)||d.isValid&&be!==i.isValid?{}:{name:H},...t.resolver||!H?{isValid:be}:{},errors:i.errors,isValidating:!1}),le.shouldFocus&&!je&&zA(r,j=>j&&Qe(i.errors,j),H?Y:l.mount),je},ue=H=>{const le={...o,...a.mount?s:{}};return Si(H)?le:bl(H)?Qe(le,H):H.map(be=>Qe(le,be))},Z=(H,le)=>({invalid:!!Qe((le||i).errors,H),isDirty:!!Qe((le||i).dirtyFields,H),isTouched:!!Qe((le||i).touchedFields,H),error:Qe((le||i).errors,H)}),X=H=>{H&&FS(H).forEach(le=>Sr(i.errors,le)),h.state.next({errors:H?i.errors:{}})},ce=(H,le,be)=>{const je=(Qe(r,H,{_f:{}})._f||{}).ref;zn(i.errors,H,{...le,ref:je}),h.state.next({name:H,errors:i.errors,isValid:!1}),be&&be.shouldFocus&&je&&je.focus&&je.focus()},De=(H,le)=>Gu(H)?h.values.subscribe({next:be=>H(B(void 0,le),be)}):B(H,le,!0),te=(H,le={})=>{for(const be of H?FS(H):l.mount)l.mount.delete(be),l.array.delete(be),le.keepValue||(Sr(r,be),Sr(s,be)),!le.keepError&&Sr(i.errors,be),!le.keepDirty&&Sr(i.dirtyFields,be),!le.keepTouched&&Sr(i.touchedFields,be),!t.shouldUnregister&&!le.keepDefaultValue&&Sr(o,be);h.values.next({values:{...s}}),h.state.next({...i,...le.keepDirty?{isDirty:M()}:{}}),!le.keepIsValid&&_()},xe=(H,le={})=>{let be=Qe(r,H);const je=xm(le.disabled);return zn(r,H,{...be||{},_f:{...be&&be._f?be._f:{ref:{name:H}},name:H,mount:!0,...le}}),l.mount.add(H),be?je&&zn(s,H,le.disabled?void 0:Qe(s,H,ZA(be._f))):k(H,!0,le.value),{...je?{disabled:le.disabled}:{},...t.progressive?{required:!!le.required,min:uv(le.min),max:uv(le.max),minLength:uv(le.minLength),maxLength:uv(le.maxLength),pattern:uv(le.pattern)}:{},name:H,onChange:re,onBlur:re,ref:Y=>{if(Y){xe(H,le),be=Qe(r,H);const j=Si(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,q=w$e(j),R=be._f.refs||[];if(q?R.find(F=>F===j):j===be._f.ref)return;zn(r,H,{_f:{...be._f,...q?{refs:[...R.filter(GA),j,...Array.isArray(Qe(o,H))?[{}]:[]],ref:{type:j.type,name:H}}:{ref:j}}}),k(H,!1,void 0,j)}else be=Qe(r,H,{}),be._f&&(be._f.mount=!1),(t.shouldUnregister||le.shouldUnregister)&&!(Pq(l.array,H)&&a.action)&&l.unMount.add(H)}}},ge=()=>t.shouldFocusError&&zA(r,H=>H&&Qe(i.errors,H),l.mount),we=(H,le)=>async be=>{be&&(be.preventDefault&&be.preventDefault(),be.persist&&be.persist());let je=vl(s);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:j}=await T();i.errors=Y,je=j}else await N(r);Sr(i.errors,"root"),Us(i.errors)?(h.state.next({errors:{}}),await H(je,be)):(le&&await le({...i.errors},be),ge(),setTimeout(ge)),h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Us(i.errors),submitCount:i.submitCount+1,errors:i.errors})},Se=(H,le={})=>{Qe(r,H)&&(Si(le.defaultValue)?ae(H,Qe(o,H)):(ae(H,le.defaultValue),zn(o,H,le.defaultValue)),le.keepTouched||Sr(i.touchedFields,H),le.keepDirty||(Sr(i.dirtyFields,H),i.isDirty=le.defaultValue?M(H,Qe(o,H)):M()),le.keepError||(Sr(i.errors,H),d.isValid&&_()),h.state.next({...i}))},pe=(H,le={})=>{const be=H||o,je=vl(be),Y=H&&!Us(H)?je:o;if(le.keepDefaultValues||(o=be),!le.keepValues){if(le.keepDirtyValues||f)for(const j of l.mount)Qe(i.dirtyFields,j)?zn(Y,j,Qe(s,j)):ae(j,Qe(Y,j));else{if($A&&Si(H))for(const j of l.mount){const q=Qe(r,j);if(q&&q._f){const R=Array.isArray(q._f.refs)?q._f.refs[0]:q._f.ref;if(BS(R)){const F=R.closest("form");if(F){F.reset();break}}}}r={}}s=n.shouldUnregister?le.keepDefaultValues?vl(o):{}:vl(Y),h.array.next({values:{...Y}}),h.values.next({values:{...Y}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&e(),a.mount=!d.isValid||!!le.keepIsValid,a.watch=!!n.shouldUnregister,h.state.next({submitCount:le.keepSubmitCount?i.submitCount:0,isDirty:le.keepDirty?i.isDirty:!!(le.keepDefaultValues&&!jh(H,o)),isSubmitted:le.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:le.keepDirtyValues?i.dirtyFields:le.keepDefaultValues&&H?YA(o,H):{},touchedFields:le.keepTouched?i.touchedFields:{},errors:le.keepErrors?i.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Q=(H,le)=>pe(Gu(H)?H(s):H,le);return{control:{register:xe,unregister:te,getFieldState:Z,handleSubmit:we,setError:ce,_executeSchema:T,_getWatch:B,_getDirty:M,_updateValid:_,_removeUnmounted:I,_updateFieldArray:y,_getFieldArray:V,_reset:pe,_resetDefaultValues:()=>Gu(t.defaultValues)&&t.defaultValues().then(H=>{Q(H,t.resetOptions),h.state.next({isLoading:!1})}),_updateFormState:H=>{i={...i,...H}},_subjects:h,_proxyFormState:d,get _fields(){return r},get _formValues(){return s},get _state(){return a},set _state(H){a=H},get _defaultValues(){return o},get _names(){return l},set _names(H){l=H},get _formState(){return i},set _formState(H){i=H},get _options(){return t},set _options(H){t={...t,...H}}},trigger:J,register:xe,handleSubmit:we,watch:De,setValue:ae,getValues:ue,reset:Q,resetField:Se,clearErrors:X,unregister:te,setError:ce,setFocus:(H,le={})=>{const be=Qe(r,H),je=be&&be._f;if(je){const Y=je.refs?je.refs[0]:je.ref;Y.focus&&(Y.focus(),le.shouldSelect&&Y.select())}},getFieldState:Z}}function E$e(n={}){const e=E.useRef(),t=E.useRef(),[i,r]=E.useState({isDirty:!1,isValidating:!1,isLoading:Gu(n.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Gu(n.defaultValues)?void 0:n.defaultValues});e.current||(e.current={...D$e(n,()=>r(s=>({...s}))),formState:i});const o=e.current.control;return o._options=n,jA({subject:o._subjects.state,next:s=>{Bq(s,o._proxyFormState,o._updateFormState,!0)&&r({...o._formState})}}),E.useEffect(()=>{n.values&&!jh(n.values,t.current)?(o._reset(n.values,o._options.resetOptions),t.current=n.values):o._resetDefaultValues()},[n.values,o]),E.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),e.current.formState=Fq(i,o),e.current}function T$e(n){const{name:e,readOnly:t,validate:i,...r}=n,{control:o,formState:{isSubmitting:s}}=Nc();return x.jsx(Sm,{name:e,control:o,shouldUnregister:!0,render:({field:{onChange:a,value:l}})=>x.jsx(P.Checkbox,{...r,id:n.id??e.split(".").join("-"),isChecked:!!l,onChange:a,readOnly:t||s,minLength:void 0,maxLength:void 0,ref:void 0}),rules:{validate:i}})}function yl(n){return n?n.charAt(0).toUpperCase()+n.slice(1):""}/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function iK(n){return typeof n>"u"||n===null}function I$e(n){return typeof n=="object"&&n!==null}function A$e(n){return Array.isArray(n)?n:iK(n)?[]:[n]}function O$e(n,e){var t,i,r,o;if(e)for(o=Object.keys(e),t=0,i=o.length;t<i;t+=1)r=o[t],n[r]=e[r];return n}function N$e(n,e){var t="",i;for(i=0;i<e;i+=1)t+=n;return t}function M$e(n){return n===0&&Number.NEGATIVE_INFINITY===1/n}var P$e=iK,R$e=I$e,F$e=A$e,B$e=N$e,V$e=M$e,W$e=O$e,nr={isNothing:P$e,isObject:R$e,toArray:F$e,repeat:B$e,isNegativeZero:V$e,extend:W$e};function rK(n,e){var t="",i=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(t+='in "'+n.mark.name+'" '),t+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!e&&n.mark.snippet&&(t+=`
|
404
404
|
|
405
405
|
`+n.mark.snippet),i+" "+t):i}function dv(n,e){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=e,this.message=rK(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}dv.prototype=Object.create(Error.prototype),dv.prototype.constructor=dv,dv.prototype.toString=function(e){return this.name+": "+rK(this,e)};var ao=dv;function XA(n,e,t,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-e>a&&(o=" ... ",e=i-a+o.length),t-i>a&&(s=" ...",t=i+a-s.length),{str:o+n.slice(e,t).replace(/\t/g,"→")+s,pos:i-e+o.length}}function QA(n,e){return nr.repeat(" ",e-n.length)+n}function $$e(n,e){if(e=Object.create(e||null),!n.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,i=[0],r=[],o,s=-1;o=t.exec(n.buffer);)r.push(o.index),i.push(o.index+o[0].length),n.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,c,u=Math.min(n.line+e.linesAfter,r.length).toString().length,d=e.maxLength-(e.indent+u+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)c=XA(n.buffer,i[s-l],r[s-l],n.position-(i[s]-i[s-l]),d),a=nr.repeat(" ",e.indent)+QA((n.line-l+1).toString(),u)+" | "+c.str+`
|
406
406
|
`+a;for(c=XA(n.buffer,i[s],r[s],n.position,d),a+=nr.repeat(" ",e.indent)+QA((n.line+1).toString(),u)+" | "+c.str+`
|