"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[74635],{333316(e,t,n){n.d(t,{A:()=>o});const o=(0,n(602086).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},232932(e,t,n){n.d(t,{A:()=>s});var o=n(602086),i=n(333316);function s(e){const{children:t}=e,{isStandalone:n,footer:[,s]}=(0,o.useContext)(i.A);return(0,o.useLayoutEffect)(()=>{if(!n)return s(t),()=>s(null)},[n,t]),o.createElement(o.Fragment,null,n&&t)}},111727(e,t,n){n.d(t,{A:()=>_});var o=n(602086),i=n(53946),s=n(68898),l=n(226883),a=n(120582),r=n(144555),d=n(188430),c=n(566997),m=n(861674),u=n(550320),p=n(925385),h=n(185426),A=n(143816),g=n(730071),f=n(551058),b=n(275607),v=n(754522),x=n(646201),y=n(650557),C=n(997133),S=n(759363),E=n(558948);const O=o.forwardRef((e,t)=>{const{searchInputProps:n,customSearchFilter:O,items:_=[],localizationTexts:M,selectedKeys:N,indeterminateKeys:j,onSelectionChange:I,onIndeterminateKeysChange:L,isVirtualized:T,treeProps:k,onSelectAll:w,onDeselectAll:D,searchInputRef:$,searchInputControl:R,height:P=g.iq,footerActions:B,onClearFilter:K,layout:F="list",autoFocus:V=!1,isAllSelected:U,isSelectAllDisabled:z=!1,hasSelectAllControl:H=!0,virtualizerProps:G,setSelectedKeys:q,gap:Y="spacious",loadMore:Q,isLoading:X,treeLoadMoreItemProps:W,onKeyDown:J,treeMetadata:Z,...ee}=e,te=o.useMemo(()=>"all"===N&&(null==Z?void 0:Z.allKeys)?Z.allKeys:N,[N,null==Z?void 0:Z.allKeys]),ne=o.useMemo(()=>({...g.nX,...M}),[M]),oe=(0,l.U)($),{value:ie,defaultValue:se,onChange:le,...ae}=o.useMemo(()=>(0,s.v)(g.Ul,n),[n]),{items:re,onValueChange:de,clearFilter:ce,isItemsEmpty:me,isSearching:ue}=(0,v.A)(_,O,le,se),pe="tree"===F?x.A:y.A,he=o.useMemo(()=>"tree"===F?(0,f.FS)(_):void 0,[_,F]);o.useEffect(()=>{K&&K(ce)},[ce,K]);const{keyboardProps:Ae}=(0,i.d)({onKeyDown:e=>{null==J||J(e),(0,C.Ay)(e,()=>{var e,t;null===(t=null===(e=oe.current)||void 0===e?void 0:e.querySelector("input"))||void 0===t||t.focus()},{whitelistedKeys:new Set(["Escape"])})}}),ge=o.useCallback(()=>(0,b.Qu)(re,null==k?void 0:k.disabledKeys),[re,null==k?void 0:k.disabledKeys]),fe=o.useCallback(()=>null==w?void 0:w(ge()),[w,ge]),be=o.useCallback(()=>null==D?void 0:D(ge()),[D,ge]),ve=o.useMemo(()=>!!U&&U(ge()),[U,ge]),xe=o.useCallback(()=>o.createElement(A.A,{height:g.rh},ne.NO_RESULTS_LABEL),[ne.NO_RESULTS_LABEL]),ye=(0,r.A)(re)&&(0,d.A)(null==k?void 0:k.renderEmptyState)?xe:null==k?void 0:k.renderEmptyState,Ce=o.useMemo(()=>(0,b.nI)(re,null==k?void 0:k.disabledKeys),[re,null==k?void 0:k.disabledKeys]),Se=ue?void 0:Q,Ee=!ue&&X,Oe=z||me||Ce;return o.createElement(c.A,{ref:t,height:P,isVirtualized:T,...Ae,...ee},o.createElement(S.A,{ref:oe,variant:"inline",placeholder:ne.SEARCH_PLACEHOLDER,value:ie,onChange:de,defaultValue:(0,a.A)(se,""),...ae,"aria-label":ne.SEARCH_PLACEHOLDER,control:R,autoFocus:V}),!me&&o.createElement(E.A,null),o.createElement(h.A,{isVirtualized:T},o.createElement(pe,{items:re,width:"full",height:T?g.rh:"auto",isVirtualized:T,onSelectionChange:I,selectedKeys:te,indeterminateKeys:j,onIndeterminateKeysChange:L,escapeKeyBehavior:"none",defaultExpandedKeys:he,virtualizerProps:G,gap:Y,loadMore:Se,isLoading:Ee,treeLoadMoreItemProps:W,renderEmptyState:ye,dependencies:[re],...k})),(H||B&&B.length>0)&&o.createElement(m.A,{hasCustomButtons:!!(B&&B.length>0)},H&&o.createElement(u.A,{isAllSelected:!Oe&&ve,onSelectAllPress:fe,onDeselectAllPress:be,localizationTexts:ne,isDisabled:Oe}),B&&B.length>0&&o.createElement(p.A,{controls:B})))});O.displayName="PickList_Default";var _=o.memo(O)},352844(e,t,n){n.d(t,{c:()=>l,z:()=>s});var o=n(241792),i=n(260334);const s=e=>o.Yj().min(1).max(32).refine(t=>!e.some(e=>e.name===t),{message:(0,i.rn)("COMMON_PLEASE_ENTER_UNIQUE_NAME")}),l=e=>o.Ik({name:s(e),member_macs:o.YO(o.Yj()).min(1)})},493849(e,t,n){var o;n.d(t,{k:()=>o}),function(e){e.CLIENTS="CLIENTS",e.USERS="USERS"}(o||(o={}))},486061(e,t,n){n.d(t,{VT:()=>l,i9:()=>i,ng:()=>a,nt:()=>s});var o=n(241365);const i=n(409844).AH`
  font-size: ${o.Ay["font-size-m"]};
  font-weight: normal;
  border-radius: 0;
`,s=112,l=20,a=345},531984(e,t,n){n.d(t,{w:()=>l});var o=n(602086),i=n(977872),s=n(205521);const l=e=>{const t=(0,i.wA)();(0,o.useEffect)(()=>{t((0,s.SQ)(e))},[t,e])}},762542(e,t,n){n.d(t,{y:()=>i});var o=n(531984);const i=e=>(0,o.w)(e.formState.isDirty)},535322(e,t,n){n.d(t,{A:()=>h,I:()=>o});var o,i=n(274934),s=n(814557),l=n(158885),a=n(247816),r=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(o||(o={}));const u=(0,a.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===r.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${r.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${r.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||d.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,p=(0,a.A)(l.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===r.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${r.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${r.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||s.Ay[t===r.S.DARK?`desktop-color-neutral-01-${r.S.DARK}`:`desktop-color-neutral-00-${r.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,h=({type:e,marginBottom:t,margin:n,padding:s,flex:l,width:a,nested:r,...d})=>"items"in d?(0,i.jsx)(p,{marginBottom:t,margin:n,padding:s,flex:l,nested:r,...d}):(0,i.jsx)(u,{nested:r,width:a,marginBottom:t,margin:n,padding:s,flex:l,isButtonList:e===o.BUTTON_LIST,...d,children:d.children})},597750(e,t,n){n.d(t,{A:()=>l});var o=n(274934),i=n(486061),s=n(100978);const l=({maxWidth:e,label:t,children:n,...l})=>(0,o.jsxs)(s.A,{flexDirection:"column",width:"100%",maxWidth:"settingsGridContent"===e?i.ng:e,...l,children:[t,n]})},164487(e,t,n){n.d(t,{A:()=>d});var o=n(274934),i=n(632622),s=n(184931),l=n(309130),a=n(304151),r=n(100978);const d=({tooltip:e,htmlFor:t,children:n,labelProps:d,wrapperProps:c,tooltipProps:m})=>{const u=(0,s.iL)();return(0,o.jsxs)(r.A,{alignItems:"center",gap:l.YC,...c,children:[(0,o.jsx)(i.A,{as:"label",htmlFor:t,color:"tertiary",...d,style:{opacity:u?l.xN:void 0,...d?.style},children:n}),e?(0,o.jsx)(a.A,{description:e,...m}):null]})}},89469(e,t,n){n.d(t,{A:()=>a});var o=n(274934),i=n(602086),s=n(309130),l=n(100978);const a=(0,i.forwardRef)((e,t)=>(0,o.jsx)(l.A,{ref:t,flexDirection:"column",gap:s.kc,width:"100%",...e}))},756782(e,t,n){n.d(t,{A:()=>f});var o=n(274934),i=n(814557),s=n(602086),l=n(938984),a=n(247816),r=n(309130),d=n(590979),c=n(147045),m=n(291508),u=n(304151),p=n(100978),h=n(535322),A=n(89469);const g=(0,a.A)(h.A,(0,m.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?i.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,f=({children:e,title:t,tooltip:n,tooltipProps:i,[c.L]:a,titleAction:m,isOutlined:h})=>{const f=(e=>s.Children.toArray(e).length>0)(e);return(0,o.jsx)(g,{marginBottom:"none",...d.A.addDataTestId(a??""),isOutlined:h,children:(0,o.jsxs)(p.A,{flexDirection:"column",...f&&{gap:r.Ln},width:"100%",children:[t?(0,o.jsxs)(p.A,{alignItems:"center",gap:r.YC,justifyContent:"space-between",width:"100%",children:[(0,o.jsxs)(p.A,{gap:r.YC,alignItems:"center",children:[(0,o.jsx)(l.A,{variant:"heading-medium",children:t}),n?(0,o.jsx)(u.A,{description:n,portal:!0,...i}):null]}),m?(0,o.jsx)(p.A,{children:m}):null]}):null,f?(0,o.jsx)(A.A,{children:e}):null]})})}},594492(e,t,n){n.d(t,{A:()=>m});var o=n(274934),i=n(602086),s=n(599110),l=n(247816),a=n(309130),r=n(470070),d=n(291508);const c=(0,l.A)("footer",(0,d.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${a.S2} ${a.fS};
  gap: ${a.kc};
`,m=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:l,onFormSubmit:a,onFormReset:d,onFormCancel:m,className:u,submitButtonText:p,customButton:h,applyButton:A,applyButtonFirst:g,hideCancelButton:f,form:b})=>{const v=(0,i.useMemo)(()=>A||(0,o.jsx)(s.A,{name:"submit",variant:"primary",type:"submit",onClick:a,disabled:!t||n||l,form:b,children:(0,o.jsx)(r.sA,{id:p||"COMMON_ACTION_APPLY_CHANGES"})}),[A,b,t,n,l,a,p]);return(0,o.jsxs)(c,{className:u,hasFormResetButton:!!d,children:[g?v:h,f?null:(0,o.jsx)(s.A,{name:"cancel",variant:"default",type:"button",onClick:m,disabled:!e&&!t,children:(0,o.jsx)(r.sA,{id:"COMMON_ACTION_CANCEL"})}),d?(0,o.jsx)(s.A,{name:"reset",variant:"default",type:"button",onClick:d,disabled:!t,children:(0,o.jsx)(r.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})}):null,g?h:v]})}},115114(e,t,n){n.d(t,{A:()=>c});var o=n(274934),i=n(232932),s=n(247816),l=n(409844),a=n(594492);const r=(0,s.A)("div")`
  height: 66px;
`,d=l.AH`
  padding: 0px !important;
`,c=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:s,...l})=>e?(0,o.jsx)(i.A,{children:(0,o.jsx)(a.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:s,className:d,...l})}):(0,o.jsx)(r,{})},274635(e,t,n){n.r(t),n.d(t,{default:()=>H});var o=n(274934),i=n(977872),s=n(602086),l=n(159469),a=n(464920),r=n(762542),d=n(635891),c=n(877840),m=n(436417),u=n(42220),p=n(117948),h=n(314191),A=n(656647),g=n(100978),f=n(650632),b=n(831433),v=n(34118);const x=function({form:e,name:t,additionalInfo:n="mac",excludeUnifiDevices:l,getGroup:a,groups:r,...d}){const c=(0,u.FH)({control:e.control,name:t}),m=(0,i.d4)(v.GB),x=(0,s.useMemo)(()=>{const e=m.filter(e=>!(l&&"unifi_device"in e&&e.unifi_device)),t=(c||[]).filter(t=>!e.some(e=>"mac"in e&&e.mac===t)).map(e=>({mac:e,name:e})),n=[...e,...t].flatMap(e=>"mac"in e?[e]:[]);return(r&&a?(0,p.A)(Object.entries((0,h.A)(n,a)),([e])=>r[e]?.order??0).map(([e,t])=>({id:e,label:r[e]?.label,options:t})).filter(e=>e.options.length>0):[{id:void 0,label:void 0,options:n}]).flatMap(({options:e,label:t,id:n})=>[...t&&n?[{type:"SECTION",title:t,id:n,children:[]}]:[],...e.map(e=>({type:"CHECKBOX",title:(0,b.tn)(e),id:e.mac,checkboxProps:{symbol:(0,o.jsx)(g.A,{maxWidth:24,maxHeight:24,children:(0,o.jsx)(f.A,{client:e})})},children:[]}))])},[n,m.length,c,l]),y=(0,s.useCallback)(()=>{e.setValue(t,x.map(e=>e.id),{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})},[x,e,t]),C=(0,s.useCallback)(()=>{const n=new Set(e.getValues(t));return x.length>0&&x.every(e=>n.has(e.id))},[x,e,t]);return(0,o.jsx)(A.A,{control:e.control,name:t,options:x,isVirtualized:!0,onSelectAll:y,isAllSelected:C,...d})};var y=n(449339),C=n(309130),S=n(756782),E=n(535322),O=n(205521),_=n(700444),M=n(470070),N=n(493849),j=n(169642),I=n(352844),L=n(823469),T=n(897166),k=n(969288),w=n(115114),D=n(938984),$=n(7130),R=n(623737),P=n(291157),B=n(954702),K=n(642687),F=n(775211);const V=({existingRecord:e})=>{const t=(0,i.wA)();return(0,o.jsx)("div",{children:(0,o.jsxs)(P.A,{children:[(0,o.jsx)(R.A,{children:(0,o.jsx)(B.A,{fontSize:"medium",variant:"destructive",children:(0,o.jsx)(M.sA,{id:"COMMON_ACTION_DELETE"})})}),(0,o.jsx)($.A,{actionButtons:(0,o.jsx)(K.A,{variant:"destructive",onPress:async()=>{await t((0,L.aX)(e.id)),await t((0,F.rt)())},children:(0,o.jsx)(M.sA,{id:"COMMON_ACTION_DELETE"})}),title:(0,o.jsx)(M.sA,{id:"COMMON_ARE_YOU_SURE"}),children:(0,o.jsx)(D.A,{variant:"inherit",size:"medium",children:(0,o.jsx)(M.sA,{id:"COMMON_CLIENT_GROUP_DELETE_CONFIRMATION",values:{name:e?.name}})})})]})})},U="network-members-group-form",z=({activeItem:e})=>{const t=e&&e.id!==k.R6?e:void 0,n=(0,i.wA)(),u=(0,i.d4)(T.EL),p=(0,i.d4)(j.y),h=(0,s.useMemo)(()=>p.filter(e=>e.id!==t?.id),[t?.id,p]),A=(0,s.useMemo)(()=>(0,I.c)(h),[h]),f=(0,m.m)({schema:A,defaultValues:{name:t?.name||"",member_macs:t?.members||[]}});(0,r.y)(f);const b=f.handleSubmit(e=>n((0,L.YH)({id:t?.id,name:e.name,members:e.member_macs,type:t?.type||N.k.CLIENTS})).then(async e=>(await n((0,L.O$)(void 0,{resolveWithExisting:!1})),e)).then(e=>{n((0,O.SQ)(!1)),n((0,O.XP)({type:y.H.NETWORK_MEMBERS_GROUP,id:e.id}))}).then(()=>f.reset()).catch(e=>{const t=(0,a.F)(e)?e:void 0;n((0,_.ox)({icon:l.C.danger,message:"COMMON_CLIENT_GROUP_FAILED_SAVE",errorMessage:t?.msg,errorValues:t?.details}))}));return(0,o.jsx)("form",{onSubmit:b,id:U,children:(0,o.jsxs)(c.A,{isDisabled:u,children:[(0,o.jsxs)(g.A,{gap:C.kc,flexDirection:"column",width:"100%",children:[(0,o.jsxs)(S.A,{children:[(0,o.jsx)(d.A,{control:f.control,name:"name",label:(0,o.jsx)(M.sA,{id:"COMMON_NAME"})}),(0,o.jsx)(x,{form:f,name:"member_macs"})]}),t?(0,o.jsx)(E.A,{children:(0,o.jsx)(V,{existingRecord:t})}):null]}),(0,o.jsx)(w.A,{onFormCancel:()=>f.reset(),isDirty:f.formState.isDirty||!t,hideCancelButton:!f.formState.isDirty,form:U,isSubmitting:f.formState.isSubmitting,submitButtonText:t?"COMMON_ACTION_SAVE":"COMMON_ACTION_CREATE"})]})})},H=({activeItem:e})=>(0,o.jsx)(z,{activeItem:e},e.id)},436417(e,t,n){n.d(t,{m:()=>a});var o=n(602086),i=n(42220),s=n(369289),l=n(721533);function a({schema:e,defaultValues:t,presets:n}){const a=(0,o.useMemo)(()=>n?(0,s.A)(n,e=>e.defaultValues):{},[n]),r=(0,o.useMemo)(()=>({...t,...a}),[a,t]),d=(0,i.mN)({resolver:(0,l.u)(e),shouldFocusError:!0,defaultValues:r,shouldUseNativeValidation:!1,mode:"onTouched"}),c=(0,o.useRef)(r);c.current=r;const m=(0,o.useCallback)((...e)=>{const[t,...n]=e;return d.reset(t?{...t,...a}:c.current,...n)},[a,d]);return{...d,reset:m,formState:{...d.formState,isDirty:!!Object.keys(d.formState.dirtyFields).length,isSubmitting:d.formState.isSubmitting},handleSubmit:(...e)=>d.handleSubmit(e[0],(t,...n)=>{const o=Object.keys(t)[0];if(o)try{const e=document.getElementsByName(o)?.[0];e?.scrollIntoView?.({behavior:"smooth",block:"center"}),e?.focus?.({preventScroll:!0})}catch{}e[1]?.(t,...n)})}}},877840(e,t,n){n.d(t,{A:()=>a});var o=n(274934),i=n(602086),s=n(184931),l=n(712642);const a=({isDisabled:e,isAdditive:t=!0,children:n})=>{const a=(0,s.pv)(),r=(0,i.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),d=(0,i.useMemo)(()=>({fields:t?r.fields||a.fields:r.fields,labels:t?r.labels||a.labels:r.labels,tooltipIcons:t?r.tooltipIcons||a.tooltipIcons:r.tooltipIcons,tooltipPopovers:t?r.tooltipPopovers||a.tooltipPopovers:r.tooltipPopovers}),[t,r.fields,r.labels,r.tooltipIcons,r.tooltipPopovers,a.fields,a.labels,a.tooltipIcons,a.tooltipPopovers]);return(0,o.jsx)(l.I.Provider,{value:d,children:n})}},260334(e,t,n){n.d(t,{L_:()=>c,MS:()=>d,rn:()=>r});var o=n(602086),i=n(949812),s=n(765282),l=n(470070);const a="{::}",r=(e,t)=>`${e}${a}${JSON.stringify(t??{})}`,d=(e,t)=>{if("string"!=typeof t)return;const[n,...o]=t.split(a);if(!n||!o.length)return t;let i={};try{i=Object.fromEntries(Object.entries(JSON.parse(o.join(a))).map(([t,n])=>[t,"string"==typeof n?d(e,n):n]))}catch{}return e.formatMessage({id:n},i)};function c(){const{formatMessage:e}=(0,l.tz)();return(0,o.useCallback)(t=>d({formatMessage:e},t),[e])}i.pJ((e,t)=>e.message?{message:e.message}:e.code===s.eq.too_small&&"string"===e.type?{message:r("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===s.eq.too_big&&"string"===e.type?{message:r("COMMON_MAX_CHARS",{name:r("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===s.eq.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:r("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===s.eq.too_small&&"array"===e.type?{message:r("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===s.eq.invalid_type&&"undefined"===e.received?{message:r("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===s.eq.invalid_type&&"number"===e.expected?{message:r("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},656647(e,t,n){n.d(t,{A:()=>h});var o=n(274934),i=n(602086),s=n(42220),l=n(104669),a=n(111727),r=n(164487),d=n(597750),c=n(309130),m=n(260334),u=n(184931);const p=()=>{},h=function({control:e,name:t,tooltip:n,label:h,options:A,isVirtualized:g,isAllSelected:f,onSelectAll:b,disabledKeys:v,maxSelections:x}){const y=(0,u.mQ)(),C=(0,m.L_)(),{field:S,fieldState:E,formState:O}=(0,s.as)({control:e,name:t}),_=(0,i.useMemo)(()=>new Set(S.value),[S.value]),M=(0,i.useMemo)(()=>y?A.map(e=>e.id):v||A.flatMap(e=>"CHECKBOX"===e.type&&(e.checkboxProps?.isDisabled||x&&_.size>=x&&!_.has(e.id))?[e.id]:[]),[y,A,v,x,_]),N=(0,i.useCallback)(()=>S.onChange(A.map(e=>e.id)),[A,S]),j=(0,i.useMemo)(()=>f||(()=>!!A.length&&A.every(e=>_.has(e.id))),[f,A,_]),I=(0,i.useCallback)(()=>S.onChange([]),[S]),L=(0,i.useMemo)(()=>({disabledKeys:M}),[M]),T=(0,i.useCallback)(e=>{S.onChange("all"!==e?[...e]:A.map(e=>e.id))},[S,A]);return(0,o.jsxs)(d.A,{style:{opacity:y?c.xN:void 0},children:[h?(0,o.jsx)(r.A,{tooltip:n,children:h}):null,(0,o.jsx)(a.A,{onSelectionChange:T,"aria-disabled":y,selectedKeys:_,treeProps:L,items:A,isVirtualized:g,setSelectedKeys:p,onSelectAll:b??N,onDeselectAll:I,isAllSelected:j,hasSelectAllControl:!x}),E.invalid?(0,o.jsx)(l.A,{isInvalid:!0,label:C((0,s.Jt)(O.errors,t)?.message)}):void 0]})}},635891(e,t,n){n.d(t,{A:()=>c});var o=n(274934),i=n(42220),s=n(843615),l=n(95032),a=n(309130),r=n(260334),d=n(184931);const c=function({control:e,name:t,label:n,placeholder:c,tooltip:m,tooltipProps:u,autoFocus:p,motif:h,onChange:A,onBlur:g,onAfterChange:f,onPaste:b,onKeyDown:v,passwordToggle:x,type:y,helperMessage:C,autoComplete:S,contentBefore:E,contentAfter:O,onFocus:_,value:M,invalid:N}){const j=(0,d.mQ)(),I=(0,d.Im)(),L=(0,d.q)(),T=(0,r.L_)();return(0,o.jsx)(i.xI,{control:e,name:t,render:({field:e,fieldState:r,formState:d})=>(0,o.jsx)(s.A,{type:y||(x?"password":"text"),variant:"secondary",width:"100%",autoFocus:p,...e,onChange:t=>{A?A(t,e,d):e.onChange(t),f?.(t)},onBlur:t=>{g?g(t,e,d):e.onBlur()},onFocus:_,onPaste:b,disabled:j,value:M??e.value?.toString(),invalid:N||(r.invalid?(0,o.jsxs)(l.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[T((0,i.Jt)(d.errors,t)?.message)||!0," "]}):void 0),label:n,placeholder:c,labelTooltip:m,labelTooltipProps:{style:{opacity:I?a.xN:void 0,pointerEvents:L?"none":void 0,...u?.style},...u},motif:h,passwordToggle:x,helperMessage:C,autoComplete:S,onKeyDown:v,contentBefore:E,contentAfter:O})})}},314191(e,t,n){n.d(t,{A:()=>l});var o=n(967059),i=n(24627),s=Object.prototype.hasOwnProperty;const l=(0,i.A)(function(e,t,n){s.call(e,n)?e[n].push(t):(0,o.A)(e,n,[t])})}}]);