"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[12469],{212469(e,t,n){n.r(t),n.d(t,{default:()=>De});var o,l=n(296540),a=n(943390),r=n(469733),i=n(349785),s=n(895424),c=n(62170),m=n(188738),d=n(641777),u=n(79786),p=n(329109),A=n(242366),g=n(294303),h=n(689965),E=n(845030),f=n(916537),C=n(924526),b=n(659833),v=n(566425),_=n(602021),O=n(532419),y=n(391855),I=n(675359),M=n(742920),N=n(953141),S=n(201630),R=n(370333),x=n(413089);!function(e){e.MIRRORING="mirroring",e.VIDEO_WALL="video-wall"}(o||(o={}));const T="video-bridge-group-form",D="audio-bridge-group-form",L={name:"",host:"",clients:[],mode:{type:o.MIRRORING}},w={name:"",host:"",clients:[]},k=e=>{const t=e*e,n=t>9;return Array.from({length:t},(e,t)=>{const o=t+1;return n?String(o).padStart(2,"0"):String(o)})};var V=n(768195),$=n(6510);const P=e=>({name:e.group?.name,host:e.host,clients:e.clients}),B=e=>{const t=P(e),{group:n}=e,l=n.clients||[],r=l.every(({mode:e})=>e===a.Vn.UNICAST),i=Math.max(2,Math.floor(Math.sqrt(e.clients.length))),s=l.find(({tvwall_layout_x:e})=>e)?.tvwall_layout_x||i,c=((e,t)=>{const n=k(t),o=e.slice().sort((e,n)=>(t-1-e.tvwall_start_y)*t+e.tvwall_start_x-((t-1-n.tvwall_start_y)*t+n.tvwall_start_x)),l=Object.fromEntries(o.map((e,t)=>[e.mac,n[t]]));return e.map(({mac:e})=>({mac:e,label:l[e]}))})(l,s);return{...t,mode:{type:r?o.MIRRORING:o.VIDEO_WALL,layout:s,clients:c}}},F=(e,t)=>{const n=k(t),o=e.padStart(t>3?2:1,"0"),l=Math.max(0,n.indexOf(o)),a=l%t+1,r=Math.floor(l/t)+1;return{tvwall_layout_x:t,tvwall_layout_y:t,tvwall_start_x:a-1,tvwall_end_x:a,tvwall_start_y:t-r,tvwall_end_y:t-r+1}},U=(e,t,n)=>e.filter(e=>Boolean(e)&&!t.includes(e)&&n.get(e)?.eav_bridge_role===V.uD.HOST).map(e=>({value:e,label:(0,$.Q)(n.get(e))})),W=(e,t,n)=>e.filter(e=>e!==t&&n.get(e)?.eav_bridge_role===V.uD.CLIENT).map(e=>({value:e,label:(0,$.Q)(n.get(e))})),H=(e,t,n)=>e===n||t?.includes(e);var z=n(614476),G=n(263963);const Q=z.Ay.object({mac:z.Ay.string(),label:z.Ay.string().max(2)}),Y=z.Ay.discriminatedUnion("type",[z.Ay.object({type:z.Ay.literal(o.MIRRORING)}),z.Ay.object({type:z.Ay.literal(o.VIDEO_WALL),layout:z.Ay.number().min(2).max(8),clients:z.Ay.array(Q).optional()})]),j=z.Ay.object({name:z.Ay.string().min(1,{message:(0,G.rn)("COMMON_VALIDATION_NAME_REQUIRED")}),host:z.Ay.string().min(1,{message:(0,G.rn)("COMMON_VALIDATION_VALUE_REQUIRED")}),clients:z.Ay.array(z.Ay.string()).min(1,{message:(0,G.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")})}),K=j.extend({mode:Y}).refine(e=>e.mode.type!==o.VIDEO_WALL||e.clients?.length===e.mode.layout*e.mode.layout,{path:["clients"],message:(0,G.rn)("PRO_AV_VIDEO_WALL_LAYOUT_CLIENT_ERROR")}),q=j;var Z=n(901502),J=n(170121),X=n(349665),ee=n(553432),te=n(610356),ne=n(566723);const oe=({form:e})=>{const t=(0,i.FH)({control:e.control,name:"clients"}),n=(0,i.FH)({control:e.control,name:"mode"}),a=Math.max(2,Math.floor(Math.sqrt(t?.length||1)));return l.createElement(X.A,{gap:ne.kc},l.createElement(J.A,{size:"medium"},l.createElement(f.sA,{id:"COMMON_MODE"})),l.createElement(ee.A,null,l.createElement(te.A,{control:e.control,name:"mode.type",value:o.MIRRORING,onCheck:()=>{e.trigger("clients")}},l.createElement(f.sA,{id:"PRO_AV_MIRRORING"})),l.createElement(d.A,{isDisabled:t?.length<4},l.createElement(te.A,{control:e.control,name:"mode.type",value:o.VIDEO_WALL,onCheck:()=>{if("layout"in n&&n.layout||e.setValue("mode.layout",a,{shouldValidate:!0}),!("clients"in n)||!n.clients){const o=k("layout"in n&&n.layout||a);e.setValue("mode.clients",t?.map((e,t)=>({mac:e,label:o[t]})),{shouldValidate:!0})}}},l.createElement(f.sA,{id:"PRO_AV_VIDEO_WALL"})))))};var le=n(217439),ae=n(382389),re=n(822336),ie=n(592563),se=n(71479),ce=n(74750),me=n(720903),de=n(180524),ue=n(372737),pe=n(959341),Ae=n(311785),ge=n(602197),he=n(960987);const Ee=(0,se.A)("div",(0,Ae.A)("count"))`
  width: 100%;
  display: grid;
  grid-template-columns: repeat(${e=>e.count}, 1fr);
  grid-template-rows: repeat(${e=>e.count}, 1fr);
  aspect-ratio: 16/9;
  gap: ${ne.YC};
`,fe=(0,se.A)("input",(0,Ae.A)("fontSize","errorColor"))`
  border: none;
  outline: none;
  background: transparent;
  text-align: center;
  font-weight: bold;
  max-width: 100%;
  min-width: 0;
  font-size: ${({fontSize:e})=>e};
  color: ${({errorColor:e,color:t})=>e||t};
  align-items: center;
  justify-content: center;
  border: 1px solid ${({errorColor:e,borderColor:t})=>e||t};
  border-radius: ${ne.YC};
  aspect-ratio: 16/9;

  &:focus {
    border: 1px solid ${({errorColor:e,focusedBorderColor:t})=>e||t};
    background: ${({focusedBackgroundColor:e})=>e};
    filter: drop-shadow(0 0 4px rgba(0, 111, 255, 0.3));
  }
`,Ce=({form:e,isCalibrating:t,setIsCalibrating:n,groupId:o})=>{const a=(0,ae.u)(),s=(0,i.FH)({control:e.control,name:"mode.layout"}),c=(0,i.FH)({control:e.control,name:"clients"}),m=(0,i.FH)({control:e.control,name:"mode.clients"}),d=(0,r.useSelector)(O.$s),u=(0,l.useMemo)(()=>c.every(e=>{const t=d.get(e);return t&&t.state===he.A[ge.g.CONNECTED]}),[c,d]),p=(0,l.useMemo)(()=>o===pe.R6,[o]),[A,h]=(0,l.useState)(new Map((0,me.A)(m||[]).map(e=>[e.mac,e.label]))),[E,C]=(0,l.useState)([]),b=(0,l.useMemo)(()=>{const e=new Map;A.forEach((t,n)=>{if(t){const o=e.get(t)||[];o.push(n),e.set(t,o)}});const t=new Set;return e.forEach(e=>{e.length>1&&e.forEach(e=>t.add(e))}),t},[A]),_=(0,l.useMemo)(()=>Array.from(A.values()).filter(Boolean).length===c.length,[A,c.length]),[y,I]=(0,l.useState)(!1),M=(0,r.useDispatch)(),N=s,[S,R]=(0,l.useState)(0),x=(0,l.useRef)([]),T=re.Ay[`desktop-color-neutral-01-${a.themeName}`],D=re.Ay[`desktop-color-ublue-01-${a.themeName}`],L=re.Ay[`desktop-color-ublue-03-${a.themeName}`],w=re.Ay[`desktop-color-ublue-06-${a.themeName}`],V=re.Ay[`desktop-color-neutral-04-${a.themeName}`],$=re.Ay[`desktop-color-red-06-${a.themeName}`],P=(0,l.useMemo)(()=>k(N),[N]),B=N>3?2:1,F=(0,l.useCallback)(()=>{M((0,v.OC)({id:p?void 0:o,clients:c})).then(()=>{n(!1),R(0)})},[c,M,o,p,n]),U=(0,l.useCallback)(()=>{const e=m&&m.length>0&&(!m||m.length===c.length)?m.map(({mac:e,label:t})=>({mac:e,label:t})):c.map((e,t)=>({mac:e,label:P[t]}));C(e),M((0,v.hk)({id:p?void 0:o,calibration_list:e.map(e=>({mac:e.mac,display:e.label}))})).then(()=>{n(!0),R(0)})},[P,c,m,M,o,p,n]),W=(0,l.useCallback)((e,t)=>{h(n=>{const o=new Map(n);return o.set(e,t),o})},[]);(0,l.useEffect)(()=>{x.current[S]?.focus()},[S]);const H=(0,l.useCallback)(()=>{if(!_||b.size>0)return void I(!0);I(!1),F();const t=new Map(E.map(({mac:e,label:t})=>[t,e]));e.setValue("mode.clients",c.map((e,n)=>{const o=A.get(e)||"";return{mac:t.get(o)||e,label:P[n]}}),{shouldDirty:!0}),n(!1)},[A,P,c,b.size,e,_,F,E,n]),z=c.map((e,t)=>l.createElement(fe,{color:w,errorColor:y&&b.has(e)?$:void 0,fontSize:N>3?ne.Er:ne.fS,borderColor:V,focusedBorderColor:L,focusedBackgroundColor:D,name:e,ref:e=>{x.current[t]=e},maxLength:B,autoFocus:S===t,onFocus:()=>{R(t)},key:e,onBlur:t=>{const{value:n}=t.target;if(n.length>0&&n.length<B){const o=n.padStart(B,"0");P.includes(o)&&(t.target.value=o,W(e,o))}},onPaste:e=>{e.preventDefault()},onKeyDown:n=>{const{key:o}=n,l=n.target;if(o===ue.U.ENTER)return n.preventDefault(),void H();if(o===ue.U.ARROW_LEFT&&t%N!==0)return n.preventDefault(),void R(t-1);if(o===ue.U.ARROW_RIGHT&&t%N!==N-1)return n.preventDefault(),void R(t+1);if(o===ue.U.ARROW_UP&&t>=N)return n.preventDefault(),void R(t-N);if(o===ue.U.ARROW_DOWN&&t<N*N-N)return n.preventDefault(),void R(t+N);if(o===ue.U.BACKSPACE||o===ue.U.DELETE){n.preventDefault();const o=l.selectionStart??l.value.length,a=l.selectionEnd??l.value.length;if(o!==a)l.value=l.value.slice(0,o)+l.value.slice(a),l.setSelectionRange(o,o);else{if(!(o>0))return void R(Math.max(0,t-1));l.value=l.value.slice(0,o-1)+l.value.slice(o),l.setSelectionRange(o-1,o-1)}return void W(e,l.value)}if(o===ue.U.ESCAPE||o===ue.U.TAB)return;if(!/^\d$/.test(o))return void n.preventDefault();n.preventDefault();const a=l.selectionStart??l.value.length,r=l.selectionEnd??l.value.length,i=l.value.slice(0,a)+o+l.value.slice(r),s=i.padStart(B,"0");if(!P.some(e=>e.startsWith(i))&&!P.includes(s))return;l.value=i;const c=a+1;l.setSelectionRange(c,c),W(e,i),i.length>=B&&R(Math.min(t+1,N*N-1))}}));return t?l.createElement(g.A,{flexDirection:"column",gap:ne.Ln,width:"100%",background:T,padding:ne.kc,borderRadius:ne.YC},l.createElement(g.A,{flexDirection:"column"},l.createElement(g.A,{alignItems:"center",height:ne.S2},l.createElement(le.A,{color:"text-1",weight:"bold"},l.createElement(f.sA,{id:"PRO_AV_CALIBRATION"}))),l.createElement(le.A,{color:"text-2"},l.createElement(f.sA,{id:"PRO_AV_CALIBRATION_DESCRIPTION"}))),l.createElement(Ee,{count:N},z),l.createElement(g.A,{gap:ne.kc},l.createElement(ce.A,{type:"button",onClick:H},l.createElement(f.sA,{id:"COMMON_ACTION_DONE"})),l.createElement(ce.A,{type:"button",variant:"neutral",onClick:F},l.createElement(f.sA,{id:"COMMON_ACTION_CANCEL"})))):l.createElement(g.A,null,l.createElement(de.A,{description:u?void 0:l.createElement(f.sA,{id:"PRO_AV_CALIBRATION_TOOLTIP_DEVICES_NOT_READY"})},l.createElement(ie.A,{isDisabled:!s||!u,onClick:U,fontSize:"medium"},l.createElement(f.sA,{id:"PRO_AV_CLICK_TO_CALIBRATE"}))))};const be=(0,n(621690).A)(2,9),ve=(e,t)=>e===t*t,_e=(0,se.A)(g.A,(0,Ae.A)("count","borderColor","isLarge"))`
  display: grid;
  grid-template-columns: repeat(${({count:e})=>e}, 1fr);
  grid-template-rows: repeat(${({count:e})=>e}, 1fr);
  gap: 1px;
  width: 100%;
  height: 100%;
  min-width: ${({isLarge:e=!1})=>e?62:56}px;
  min-height: 36px;
  border: 1px solid ${({borderColor:e})=>e};
  background: ${({borderColor:e})=>e};
`,Oe=({isSelected:e,isDisabled:t,count:n=2,isLarge:o=!1,onClick:a})=>{const r=(0,ae.u)(),i=e&&!t?re.Ay[`desktop-color-ublue-01-${r.themeName}`]:re.Ay[`desktop-color-neutral-01-${r.themeName}`];return l.createElement(g.A,{flexDirection:"column",alignItems:"center",gap:ne.YC,opacity:t?.4:1,cursor:t?"inherit":"pointer",onClick:()=>!t&&a?.()},l.createElement(_e,{count:n,borderColor:e&&!t?re.Ay[`desktop-color-ublue-06-${r.themeName}`]:re.Ay[`desktop-color-neutral-06-${r.themeName}`],isLarge:o},Array.from({length:n*n}).map((e,t)=>l.createElement(g.A,{key:t,background:i}))),l.createElement(le.A,{size:o?"medium":"small",color:"text-3"},n,"x",n))},ye=({form:e,isCalibrating:t})=>{const n=(0,i.FH)({control:e.control,name:"clients"}),o=(0,i.FH)({control:e.control,name:"mode.layout"}),a=(0,l.useMemo)(()=>!be.some(e=>ve(n.length,e)),[n.length]),r=(0,l.useMemo)(()=>Math.max(4,Math.max(...be.filter(e=>e*e<=n.length))),[n.length]),s=(0,l.useMemo)(()=>be.filter(e=>e<=r),[r]),c=r<=4,m=(0,l.useMemo)(()=>s.map(a=>l.createElement(Oe,{key:a,count:a,isLarge:c,isDisabled:!ve(n.length,a)||o!==a&&t,isSelected:o===a,onClick:()=>e.setValue("mode.layout",a,{shouldDirty:!0})})),[n.length,o,e,t]);return l.createElement(X.A,{gap:ne.Ln,marginBottom:ne.kc},l.createElement(J.A,{size:"medium"},l.createElement(f.sA,{id:"COMMON_LAYOUT"})),l.createElement(de.A,{description:a?l.createElement(f.sA,{id:"PRO_AV_TV_WALL_COUNT"}):void 0},l.createElement(g.A,{gap:c?ne.fS:ne.xO,flexWrap:"wrap"},m)))},Ie=({form:e,isCalibrating:t,setIsCalibrating:n,groupId:o})=>l.createElement(l.Fragment,null,l.createElement(ye,{form:e,isCalibrating:t}),l.createElement(Ce,{form:e,isCalibrating:t,setIsCalibrating:n,groupId:o}));var Me=n(147606);const Ne=({id:e,type:t})=>{const n=(0,r.useDispatch)(),o=t===a.CQ.AUDIO,i=(0,l.useCallback)(()=>{const t=o?v.aP:v.Hq;n((o?v.mA:v.f4)(e)).then(()=>{n(t(void 0,{resolveWithExisting:!1}))}),n((0,E.K5)())},[n,e,o]);return l.createElement(Me.A,{title:l.createElement(f.sA,{id:"COMMON_ARE_YOU_SURE"}),message:l.createElement(f.sA,{id:o?"PRO_AV_AUDIO_CONFIRM_REMOVE_GROUP":"PRO_AV_VIDEO_CONFIRM_REMOVE_GROUP"}),onConfirm:i,trigger:l.createElement(ce.A,{variant:"tertiary-destructive",style:{height:36}},l.createElement(f.sA,{id:"COMMON_ACTION_REMOVE"}))})},Se=({activeItem:e})=>{const t=(0,r.useDispatch)(),n=(0,r.useSelector)(_.EL),{groups:D=[]}=(0,r.useSelector)(b.tM),w=(0,r.useSelector)(O.$s),V=(0,r.useSelector)(b.a_),$=(0,r.useSelector)(b.j5),P=D,z=!!e.group?.clients?.every(e=>w.get(e.mac)?.is_calibrating&&!w.get(e.mac)?.calibrating_display),[G,Q]=(0,l.useState)(z),Y=e.id===C.P9,j=(0,l.useMemo)(()=>(0,S.qG)(P,e.id),[P,e.id]),q=(0,l.useMemo)(()=>H(e.host,V,j?.host.mac),[e.host,V,j?.host.mac]),J=(0,l.useMemo)(()=>e.id===C.P9?{...L,host:q?e.host:void 0,clients:e.clients}:{...L,...B(e),clients:j?.clients.map(e=>e.mac)??[]},[e,q,j]),X=(0,u.m)({schema:K,defaultValues:J}),{control:ee,reset:te,formState:{isDirty:ne,isSubmitting:le},handleSubmit:ae}=X,re=(0,i.FH)({control:ee,name:"host"}),ie=(0,i.FH)({control:ee,name:"clients"}),se=(0,i.FH)({control:ee,name:"mode"}),ce=(0,l.useCallback)((e,t)=>{const n=e&&e!==re,o=t&&!(0,R.BI)(t,ie);(n||o)&&(X.setValue("host",n?e:re,{shouldDirty:!0}),X.setValue("clients",o?t:ie,{shouldDirty:!0}))},[re,ie,X]),me=(0,l.useMemo)(()=>{const t=[Y?void 0:e.host,...V].filter(x.z);return U(t,ie,w)},[e.host,ie,w,V,Y]),de=(0,l.useMemo)(()=>W([...Y?[]:e.clients||[],...$],re,w),[e.clients,$,re,w,Y]),ue=(0,l.useRef)(e.id);(0,l.useEffect)(()=>{ue.current!==e.id&&(ue.current=e.id,te()),ce(e.host,e.clients)},[e.id,e.host,e.clients]);const pe=(0,l.useMemo)(()=>{if(Y)return ie;const e=j?.clients.map(e=>e.mac)??[];return ie.filter(t=>!e.includes(t))},[Y,ie,j]);(0,l.useEffect)(()=>(t((0,Z.nF)(pe)),t((0,Z.XC)(pe.length>0?re:void 0)),()=>{t((0,Z.nF)([])),t((0,Z.XC)(void 0))}),[pe,re,t]);const Ae=ae(({name:e,host:n,clients:l,mode:r})=>{const i=r.type===o.VIDEO_WALL,s=r.type===o.VIDEO_WALL?(()=>{const e=k(r.layout);return Object.fromEntries(r.clients.map((t,n)=>[t.mac,F(t.label||e[n],r.layout)]))})():[];t(Y?(0,v.K_)({name:e,type:a.CQ.VIDEO,host:{...C.EK,mac:n,host_type:a.CQ.VIDEO},clients:l.map(e=>({...C.Zo,mac:e,client_type:a.CQ.VIDEO,mode:i?a.Vn.MULTICAST:a.Vn.UNICAST,...i?s[e]:{}}))}):(0,v.t)({...j,name:e,host:{...j.host,mac:n},clients:l.map(e=>({...j.clients.find(t=>t.mac===e)||C.Zo,mac:e,client_type:a.CQ.VIDEO,mode:i?a.Vn.MULTICAST:a.Vn.UNICAST,...i?s[e]:{}}))})).then(()=>{t((0,v.Hq)(void 0,{resolveWithExisting:!1})),t((0,E.K5)())}).catch(e=>{t((0,I.ox)({icon:M.C.danger,message:N.API_STRING_TRANSLATION[e.apiMsg]||"PRO_AV_NOTICE_SAVE_ERROR"}))})});return l.createElement("form",{onSubmit:Ae,id:T},l.createElement(d.A,{isDisabled:n},l.createElement(g.A,{flexDirection:"column"},l.createElement(h.A,null,l.createElement(A.A,null,l.createElement(s.A,{control:ee,name:"name",label:l.createElement(f.sA,{id:"COMMON_NAME"})}),l.createElement(m.A,{name:"host",control:ee,options:me,label:l.createElement(f.sA,{id:"PRO_AV_VIDEO_IN"})}),l.createElement(c.A,{name:"clients",control:ee,label:"PRO_AV_VIDEO_OUT",options:de,onAfterChange:()=>{se.type===o.VIDEO_WALL&&X.trigger("mode")}}),l.createElement(oe,{form:X}),se.type===o.VIDEO_WALL?l.createElement(Ie,{form:X,isCalibrating:G,setIsCalibrating:Q,groupId:e.id}):null))),G?null:l.createElement(p.A,{form:T,onFormCancel:()=>te(),isDirty:ne||!Y,hideCancelButton:!ne,isSubmitting:le,customButton:Y?null:l.createElement(g.A,{flexDirection:"row",flex:1},l.createElement(Ne,{id:e.id,type:e.type})),applyButton:Y||ne?l.createElement(y.A,{onSubmit:Ae,label:Y?"COMMON_ACTION_CREATE":void 0}):l.createElement(l.Fragment,null)})))};var Re=n(48925),xe=n(212178);const Te=({activeItem:e})=>{const t=(0,r.useDispatch)(),n=(0,r.useSelector)(_.EL),{groups:o=[]}=(0,r.useSelector)(b.kn),A=(0,r.useSelector)(O.$s),h=(0,r.useSelector)(b.ZM),x=(0,r.useSelector)(b.Q1),T=o,L=e.id===C.P9,k=(0,l.useMemo)(()=>(0,S.z2)(T,e.id),[T,e.id]),V=(0,l.useMemo)(()=>H(e.host,h,k?.host.mac),[e.host,h,k?.host.mac]),$=(0,l.useMemo)(()=>e.id===C.P9?{...w,host:V?e.host:void 0,clients:e.clients}:{...w,...P(e),clients:k?.clients.map(e=>e.mac)??[]},[e,V,k]),B=(0,u.m)({schema:q,defaultValues:$}),{control:F,reset:z,formState:{isDirty:G,isSubmitting:Q},handleSubmit:Y}=B,j=(0,i.FH)({control:F,name:"host"}),K=(0,i.FH)({control:F,name:"clients"}),J=(0,l.useCallback)((e,t)=>{const n=e&&e!==j,o=t&&!(0,R.BI)(t,K);(n||o)&&(B.setValue("host",n?e:j,{shouldDirty:!0}),B.setValue("clients",o?t:K,{shouldDirty:!0}))},[j,K,B]),X=(0,xe.A)(e.id);(0,l.useEffect)(()=>{X!==e.id&&z(),J(e.host,e.clients)},[e.id,e.host,e.clients]);const ee=(0,l.useMemo)(()=>{if(L)return K;const e=k?.clients.map(e=>e.mac)??[];return K.filter(t=>!e.includes(t))},[L,K,k]);(0,l.useEffect)(()=>(t((0,Z.nF)(ee)),t((0,Z.XC)(ee.length>0?j:void 0)),()=>{t((0,Z.nF)([])),t((0,Z.XC)(void 0))}),[ee,j,t]);const te=(0,l.useMemo)(()=>U([...L?[]:[e.host],...h],K,A),[e.host,K,A,h,L]),ne=(0,l.useMemo)(()=>W([...L?[]:e.clients||[],...x],j,A),[e.clients,x,j,A,L]),oe=Y(({name:e,host:n,clients:o})=>{t(L?(0,v.Ly)({name:e,type:a.CQ.AUDIO,host:{...C.f_,mac:n,host_type:a.CQ.AUDIO},clients:o.map(e=>({...C.Wc,mac:e,client_type:a.CQ.AUDIO}))}):(0,v.Cn)({...k,name:e,host:{...k.host,mac:n},clients:o.map(e=>({...k.clients.find(t=>t.mac===e)||C.Wc,mac:e,client_type:a.CQ.AUDIO}))})).then(()=>{t((0,v.aP)(void 0,{resolveWithExisting:!1})),t((0,E.K5)())}).catch(e=>{t((0,I.ox)({icon:M.C.danger,message:N.API_STRING_TRANSLATION[e.apiMsg]||"PRO_AV_NOTICE_SAVE_ERROR"}))})});return l.createElement("form",{onSubmit:oe,id:D},l.createElement(d.A,{isDisabled:n},l.createElement(g.A,{flexDirection:"column"},l.createElement(Re.A,null,l.createElement(s.A,{control:F,name:"name",label:l.createElement(f.sA,{id:"COMMON_NAME"})}),l.createElement(m.A,{name:"host",control:F,options:te,label:l.createElement(f.sA,{id:"PRO_AV_AUDIO_IN"})}),l.createElement(c.A,{name:"clients",control:F,label:"PRO_AV_AUDIO_OUT",options:ne}))),l.createElement(p.A,{form:D,onFormCancel:()=>z(),isDirty:G||!L,hideCancelButton:!G,isSubmitting:Q,customButton:L?null:l.createElement(g.A,{flexDirection:"row",flex:1},l.createElement(Ne,{id:e.id,type:e.type})),applyButton:L||G?l.createElement(y.A,{onSubmit:oe,label:L?"COMMON_ACTION_CREATE":void 0}):l.createElement(l.Fragment,null)})))},De=({activeItem:e})=>{switch(e.type){case a.CQ.VIDEO:return l.createElement(Se,{activeItem:e,key:e.id});case a.CQ.AUDIO:return l.createElement(Te,{activeItem:e,key:e.id});default:return null}}},705228(e,t,n){n.d(t,{VT:()=>r,i9:()=>l,ng:()=>i,nt:()=>a});var o=n(888170);const l=n(132196).AH`
  font-size: ${o.Ay["font-size-m"]};
  font-weight: normal;
  border-radius: 0;
`,a=112,r=20,i=345},689965(e,t,n){n.d(t,{A:()=>A,I:()=>o});var o,l=n(296540),a=n(822336),r=n(963724),i=n(71479),s=n(825032),c=n(566723),m=n(294303),d=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(o||(o={}));const u=(0,i.A)(m.A,(0,d.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({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}})=>a.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,p=(0,i.A)(r.A,(0,d.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-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||a.Ay[t===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${c.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${c.Ln} ${c.Ln};
      }
    }
  }
`,A=({type:e,marginBottom:t,margin:n,padding:a,flex:r,width:i,nested:s,...c})=>"items"in c?l.createElement(p,{marginBottom:t,margin:n,padding:a,flex:r,nested:s,...c}):l.createElement(u,{nested:s,width:i,marginBottom:t,margin:n,padding:a,flex:r,isButtonList:e===o.BUTTON_LIST,...c},c.children)},391855(e,t,n){n.d(t,{A:()=>m});var o=n(296540),l=n(271856),a=n(858931),r=n(823858),i=n(71479),s=n(916537);const c=(0,i.A)(r.A)`
  color: #ffffff;
`,m=(0,o.memo)(({isDisabled:e,showLoader:t,showWarning:n,showWarningIcon:r,warning:i,label:m="COMMON_ACTION_APPLY_CHANGES",onSubmit:d,form:u})=>o.createElement(l.A,{description:n?i??o.createElement(s.sA,{id:"COMMON_FORM_CHANGES_TRIGGER_PROVISION"}):null,portal:!0,width:240},o.createElement(a.A,{disabled:e,type:"submit",onClick:d,variant:"primary",Icon:n||r?o.createElement(c,{variant:"fill"}):null,loader:t?"loading":void 0,form:u},o.createElement(s.sA,{id:m}))))},349665(e,t,n){n.d(t,{A:()=>r});var o=n(296540),l=n(705228),a=n(294303);const r=({maxWidth:e,label:t,children:n,...r})=>o.createElement(a.A,{flexDirection:"column",width:"100%",maxWidth:"settingsGridContent"===e?l.ng:e,...r},t,n)},317672(e,t,n){n.d(t,{A:()=>c});var o=n(296540),l=n(498577),a=n(284428),r=n(566723),i=n(766624),s=n(294303);const c=({tooltip:e,htmlFor:t,children:n,labelProps:c,wrapperProps:m,tooltipProps:d})=>{const u=(0,a.iL)();return o.createElement(s.A,{alignItems:"center",gap:r.YC,...m},o.createElement(l.A,{htmlFor:t,color:"tertiary",...c,style:{opacity:u?r.xN:void 0,...c?.style}},n),e?o.createElement(i.A,{description:e,...d}):null)}},242366(e,t,n){n.d(t,{A:()=>r});var o=n(296540),l=n(566723),a=n(294303);const r=(0,o.forwardRef)((e,t)=>o.createElement(a.A,{ref:t,flexDirection:"column",gap:l.kc,width:"100%",...e}))},662297(e,t,n){n.d(t,{A:()=>y});var o=n(296540),l=n(217439),a=n(888170),r=n(318195),i=n(86838),s=n(71479),c=n(132196),m=n(311785),d=n(454195),u=n(566723),p=n(916537),A=n(705228),g=n(294303),h=n(317672);const E=(e,t,n)=>c.AH`
  width: ${n?"100%":`${A.ng}px`};
  max-width: 100%;
  ${e&&`box-shadow: inset 0 0 0 1px ${a.Ay["red-1"]};`}
  ${!t&&"display: none;"}
`,f=c.AH`
  vertical-align: top;
`,C=e=>c.AH`
  div[class*='toggleWrap'] {
    ${e&&"width: 100%;"}
  }

  label > div[class*='selectorLabel'] {
    /* A bug in UIC causes the need for this override. If you can remove this without PickLists overflowing horizontally, please do. https://ui.slack.com/archives/GF9JUGVEV/p1739435275590989 */
    width: calc(100% - 24px) !important;
  }
`,b=(0,s.A)("div",(0,m.A)("disabled","isFullWidth"))`
  ${({isFullWidth:e})=>e&&"width: 100%;"}

  ${({disabled:e})=>e&&`\n  opacity: ${u.xN};\n  pointer-events: none;\n  cursor: default;\n`}
`,v={padding:0},_={margin:0},O={keys:["label","additionalInfo"]},y=({name:e,options:t,onChange:n,value:a,disabled:s=!1,label:m,invalid:u,triggerButtonText:A="COMMON_EDIT_SELECTIONS",triggerButtonHeight:y,translateTriggerButtonText:I=!0,alwaysShowTriggerButtonText:M=!1,popoverClassName:N="",placement:S="bottom start",isWindowed:R,isFullWidth:x=!1,tooltipVisibility:T,maxSelections:D=null,isDefaultOpen:L=!1,onCheckConfirm:w,isSelectAllVisible:k,onCheckSelectAllConfirm:V,onChangeSelectAll:$,onOpenChange:P,truncateLabels:B,selectAllText:F,siteGroups:U,showSiteGroups:W,tooltipDescription:H,chipClassName:z,imageWidth:G,searchOptions:Q,tooltipProps:Y})=>{const{formatMessage:j}=(0,p.tz)(),K=(a?.length||0)>0,[q,Z]=(0,o.useState)(L),J=(0,o.useMemo)(()=>({...O,...Q}),[Q]);return o.createElement(b,{disabled:s,isFullWidth:x},m?o.createElement(h.A,{htmlFor:e,tooltip:H,tooltipProps:Y},"string"==typeof m?o.createElement(p.sA,{id:m}):m):null,o.createElement(r.A.Popover,{isOpen:q,options:t,value:a,onOpenChange:e=>{P?.(e),Z(e)},searchOptions:J,onCheckConfirm:w,onCheckSelectAllConfirm:V,onChangeSelectAll:$,isSelectAllVisible:k,onSave:n,searchPlaceholder:j({id:"COMMON_SEARCH"}),saveButtonText:j({id:"COMMON_ACTION_SAVE"}),cancelButtonText:j({id:"COMMON_ACTION_CANCEL"}),className:(0,c.cx)(C(x),N),placement:S,isWindowed:R,maxSelections:F&&null===D?void 0:D,tooltipVisibility:T,truncateLabels:B,selectAllText:F?j({id:F}):void 0,siteGroups:U,showSiteGroups:W,imageWidth:G,renderToggle:()=>o.createElement(r.A.Trigger,{options:t,chipClassName:(0,c.cx)(f,z),chipContainerClassName:E(!!u,K,x),editSelectionsButtonStyle:_,maxLines:6,overflowBehavior:"truncate",editSelectionsButtonText:K&&!M?o.createElement(l.A,{size:"medium",color:"inherit"},M,o.createElement(p.sA,{id:"COMMON_ACTION_EDIT"})," (",a?.length||0,")"):o.createElement(g.A,{height:y??d.b,alignItems:"center"},I&&"string"==typeof A?o.createElement(p.sA,{id:A}):A)})}),u?o.createElement(i.A,{isInvalid:!0,style:v,label:u}):null)}},553432(e,t,n){n.d(t,{A:()=>i});var o=n(296540),l=n(454195),a=n(566723),r=n(294303);const i=e=>o.createElement(r.A,{paddingTop:a.YC,paddingBottom:a.YC,gap:a.Ln,rowGap:a.YC,flexWrap:"wrap",minHeight:l.b,alignItems:"center",...e})},48925(e,t,n){n.d(t,{A:()=>h});var o=n(822336),l=n(296540),a=n(217439),r=n(71479),i=n(566723),s=n(968906),c=n(199582),m=n(311785),d=n(766624),u=n(294303),p=n(689965),A=n(242366);const g=(0,r.A)(p.A,(0,m.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?o.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,h=({children:e,title:t,tooltip:n,tooltipProps:o,[c.L]:r,titleAction:m,isOutlined:p})=>{const h=(e=>l.Children.toArray(e).length>0)(e);return l.createElement(g,{marginBottom:"none",...s.A.addDataTestId(r??""),isOutlined:p},l.createElement(u.A,{flexDirection:"column",...h&&{gap:i.Ln},width:"100%"},t?l.createElement(u.A,{alignItems:"center",gap:i.YC,justifyContent:"space-between",width:"100%"},l.createElement(u.A,{gap:i.YC,alignItems:"center"},l.createElement(a.A,{variant:"heading-medium"},t),n?l.createElement(d.A,{description:n,portal:!0,...o}):null),m?l.createElement(u.A,null,m):null):null,h?l.createElement(A.A,null,e):null))}},704025(e,t,n){n.d(t,{i:()=>r});var o=n(296540),l=n(271856),a=n(805837);const r=e=>o.createElement(l.A,{description:e.option&&"tooltipDescription"in e.option?e.option.tooltipDescription:null,position:"left",portal:!0},o.createElement(a.q,{...e}))},373229(e,t,n){n.d(t,{A:()=>m});var o=n(296540),l=n(758649),a=n(71479),r=n(566723),i=n(916537),s=n(311785);const c=(0,a.A)("footer",(0,s.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${r.S2} ${r.fS};
  gap: ${r.kc};
`,m=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:a,onFormSubmit:r,onFormReset:s,onFormCancel:m,className:d,submitButtonText:u,customButton:p,applyButton:A,applyButtonFirst:g,hideCancelButton:h,form:E})=>{const f=(0,o.useMemo)(()=>A||o.createElement(l.A,{name:"submit",variant:"primary",type:"submit",onClick:r,disabled:!t||n||a,form:E},o.createElement(i.sA,{id:u||"COMMON_ACTION_APPLY_CHANGES"})),[A,E,t,n,a,r,u]);return o.createElement(c,{className:d,hasFormResetButton:!!s},g?f:p,h?null:o.createElement(l.A,{name:"cancel",variant:"default",type:"button",onClick:m,disabled:!e&&!t},o.createElement(i.sA,{id:"COMMON_ACTION_CANCEL"})),s?o.createElement(l.A,{name:"reset",variant:"default",type:"button",onClick:s,disabled:!t},o.createElement(i.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})):null,g?p:f)}},329109(e,t,n){n.d(t,{A:()=>m});var o=n(296540),l=n(691441),a=n(71479),r=n(132196),i=n(373229);const s=(0,a.A)("div")`
  height: 66px;
`,c=r.AH`
  padding: 0px !important;
`,m=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:a,...r})=>e?o.createElement(l.A,null,o.createElement(i.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:a,className:c,...r})):o.createElement(s,null)},766624(e,t,n){n.d(t,{A:()=>s});var o=n(296540),l=n(271856),a=n(709690),r=n(284428),i=n(566723);const s=({description:e,isInteractive:t,portal:n=!0,cursorType:s,title:c,position:m,width:d,iconProps:u,disabled:p=!1})=>{const A=(0,r.Im)()||p,g=(0,r.q)();return o.createElement(l.A,{description:e,portal:n,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:s,title:c,position:m,width:d,disableHover:g},o.createElement(a.A,{isActive:!0,size:"original",opacity:A?i.xN:void 0,...u}))}},372737(e,t,n){var o;n.d(t,{U:()=>o}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(o||(o={}))},454195(e,t,n){n.d(t,{b:()=>o});const o=32},79786(e,t,n){n.d(t,{m:()=>i});var o=n(296540),l=n(349785),a=n(59116),r=n(870893);function i({schema:e,defaultValues:t,presets:n}){const i=(0,o.useMemo)(()=>n?(0,a.A)(n,e=>e.defaultValues):{},[n]),s=(0,o.useMemo)(()=>({...t,...i}),[i,t]),c=(0,l.mN)({resolver:(0,r.u)(e),shouldFocusError:!0,defaultValues:s,shouldUseNativeValidation:!1,mode:"onTouched"}),m=(0,o.useRef)(s);m.current=s;const d=(0,o.useCallback)((...e)=>{const[t,...n]=e;return c.reset(t?{...t,...i}:m.current,...n)},[i,c]);return{...c,reset:d,formState:{...c.formState,isDirty:!!Object.keys(c.formState.dirtyFields).length,isSubmitting:c.formState.isSubmitting},handleSubmit:(...e)=>c.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)})}}},451449(e,t,n){n.d(t,{I:()=>o});const o=(0,n(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},641777(e,t,n){n.d(t,{A:()=>r});var o=n(296540),l=n(284428),a=n(451449);const r=({isDisabled:e,isAdditive:t=!0,children:n})=>{const r=(0,l.pv)(),i=(0,o.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),s=(0,o.useMemo)(()=>({fields:t?i.fields||r.fields:i.fields,labels:t?i.labels||r.labels:i.labels,tooltipIcons:t?i.tooltipIcons||r.tooltipIcons:i.tooltipIcons,tooltipPopovers:t?i.tooltipPopovers||r.tooltipPopovers:i.tooltipPopovers}),[t,i.fields,i.labels,i.tooltipIcons,i.tooltipPopovers,r.fields,r.labels,r.tooltipIcons,r.tooltipPopovers]);return o.createElement(a.I.Provider,{value:s},n)}},284428(e,t,n){n.d(t,{Im:()=>s,iL:()=>c,mQ:()=>r,pv:()=>a,q:()=>i});var o=n(296540),l=n(451449);function a(){return(0,o.useContext)(l.I)}function r(){return a().fields}function i(){return a().tooltipPopovers}function s(){return a().tooltipIcons}function c(){return a().labels}},263963(e,t,n){n.d(t,{L_:()=>c,MS:()=>s,rn:()=>i});var o=n(296540),l=n(614476),a=n(916537);const r="{::}",i=(e,t)=>`${e}${r}${JSON.stringify(t??{})}`,s=(e,t)=>{if("string"!=typeof t)return;const[n,...o]=t.split(r);if(!n||!o.length)return t;let l={};try{l=Object.fromEntries(Object.entries(JSON.parse(o.join(r))).map(([t,n])=>[t,"string"==typeof n?s(e,n):n]))}catch{}return e.formatMessage({id:n},l)};function c(){const{formatMessage:e}=(0,a.tz)();return(0,o.useCallback)(t=>s({formatMessage:e},t),[e])}l.z.setErrorMap((e,t)=>e.message?{message:e.message}:e.code===l.z.ZodIssueCode.too_small&&"string"===e.type?{message:i("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===l.z.ZodIssueCode.too_big&&"string"===e.type?{message:i("COMMON_MAX_CHARS",{name:i("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===l.z.ZodIssueCode.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:i("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===l.z.ZodIssueCode.too_small&&"array"===e.type?{message:i("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===l.z.ZodIssueCode.invalid_type&&"undefined"===e.received?{message:i("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===l.z.ZodIssueCode.invalid_type&&"number"===e.expected?{message:i("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},188738(e,t,n){n.d(t,{A:()=>u});var o=n(296540),l=n(436331),a=n(349785),r=n(704025),i=n(317672),s=n(349665),c=n(199582),m=n(263963),d=n(284428);const u=function({control:e,name:t,label:n,options:u,tooltip:p,tooltipProps:A,placeholder:g,renderOption:h,onChange:E,onAfterChange:f,searchable:C,searchableProps:b,portal:v,maxHeight:_,disableValidationMessage:O,isReadOnly:y,[c.L]:I}){const M=(0,d.mQ)(),N=(0,m.L_)();return o.createElement(a.xI,{control:e,name:t,render:({field:e,fieldState:c,formState:m})=>o.createElement(s.A,{gap:2},n?o.createElement(i.A,{htmlFor:t,tooltip:p,tooltipProps:{portal:!0,...A}},n):null,o.createElement(l.A,{variant:"secondary",width:"100%",renderOption:h??r.i,options:u,...e,readOnly:y,disabled:M,onChange:(t,n)=>{const o=E?E(n,{field:e,fieldState:c,formState:m}):e.onChange(n);return f?.(n),o},value:e.value??"",invalid:c.invalid&&!O?N((0,a.Jt)(m.errors,t)?.message)||!0:void 0,placeholder:g,searchable:C,searchableProps:b,portal:v,"data-testid":I,maxHeight:_}))})}},62170(e,t,n){n.d(t,{A:()=>d});var o=n(296540),l=n(349785),a=n(566723),r=n(662297),i=n(916537),s=n(263963),c=n(284428);const m=[],d=function({control:e,name:t,tooltip:n,options:d,triggerButtonText:u,truncateLabels:p=!0,isWindowed:A,searchOptions:g,maxSelections:h,narrowTrigger:E,chipClassName:f,label:C,onAfterChange:b}){const v=(0,c.mQ)(),_=(0,s.L_)();return o.createElement(l.xI,{control:e,name:t,render:({field:e,fieldState:s,formState:c})=>o.createElement(r.A,{name:e.name,onChange:t=>{e.onChange(t),b?.(t)},disabled:v,value:e.value||m,tooltipDescription:n,options:d,truncateLabels:p,invalid:s.invalid?_((0,l.Jt)(c.errors,t)?.message)||!0:void 0,translateTriggerButtonText:!1,triggerButtonText:u??o.createElement(i.sA,{id:"COMMON_EDIT_SELECTIONS"}),isWindowed:A,searchOptions:g,maxSelections:h,isFullWidth:!0,triggerButtonHeight:E?a.S2:void 0,chipClassName:f,label:C})})}},610356(e,t,n){n.d(t,{A:()=>m});var o=n(296540),l=n(349785),a=n(54227),r=n(566723),i=n(766624),s=n(294303),c=n(284428);const m=(0,o.forwardRef)(function({control:e,name:t,children:n,tooltip:m,tooltipProps:d,value:u,onCheck:p,...A},g){const h=(0,c.mQ)();return o.createElement(l.xI,{control:e,name:t,render:({field:e})=>o.createElement(s.A,{gap:r.YC,alignItems:"center",ref:g,...A},o.createElement(a.A,{id:e.name,onChange:({target:{checked:t}})=>{t&&(e.onChange(u),p?.())},checked:e.value===u,disabled:h,value:e.value},n),m?o.createElement(i.A,{description:m,...d}):null)})})},895424(e,t,n){n.d(t,{A:()=>m});var o=n(296540),l=n(349785),a=n(438628),r=n(705145),i=n(566723),s=n(263963),c=n(284428);const m=function({control:e,name:t,label:n,placeholder:m,tooltip:d,tooltipProps:u,autoFocus:p,motif:A,onChange:g,onBlur:h,onAfterChange:E,onPaste:f,onKeyDown:C,passwordToggle:b,type:v,helperMessage:_,autoComplete:O,contentBefore:y,contentAfter:I,onFocus:M,value:N,invalid:S}){const R=(0,c.mQ)(),x=(0,c.Im)(),T=(0,c.q)(),D=(0,s.L_)();return o.createElement(l.xI,{control:e,name:t,render:({field:e,fieldState:s,formState:c})=>o.createElement(a.A,{type:v||(b?"password":"text"),variant:"secondary",width:"100%",autoFocus:p,...e,onChange:t=>{g?g(t,e,c):e.onChange(t),E?.(t)},onBlur:t=>{h?h(t,e,c):e.onBlur()},onFocus:M,onPaste:f,disabled:R,value:N??e.value?.toString(),invalid:S||(s.invalid?o.createElement(r.A,{variant:"inherit",style:{overflowWrap:"break-word"}},D((0,l.Jt)(c.errors,t)?.message)||!0," "):void 0),label:n,placeholder:m,labelTooltip:d,labelTooltipProps:{style:{opacity:x?i.xN:void 0,pointerEvents:T?"none":void 0,...u?.style},...u},motif:A,passwordToggle:b,helperMessage:_,autoComplete:O,onKeyDown:C,contentBefore:y,contentAfter:I})})}},212178(e,t,n){n.d(t,{A:()=>l});var o=n(296540);const l=e=>{const t=(0,o.useRef)();return(0,o.useEffect)(()=>{t.current=e},[e]),t.current}},413089(e,t,n){function o(e){return Boolean(e)}n.d(t,{z:()=>o})}}]);