"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[23776],{238761(e,t,i){i.d(t,{A:()=>l});var n=i(296540),r=i(54227);(0,i(349005).A)(".radioList__OhdxuB5n{display:flex;flex-direction:column;width:100%}.radioList-column__OhdxuB5n .item__OhdxuB5n{margin-top:20px}.radioList-column__OhdxuB5n .item-condensed__OhdxuB5n{margin-top:8px}.radioList-column__OhdxuB5n .item-flush__OhdxuB5n{margin-top:0}.radioList-column__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:has(label[data-checked=true]){z-index:1}.radioList-column__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:hover{z-index:1}.radioList-column__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n .item__OhdxuB5n{margin-bottom:0}.radioList-column__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:not(:first-child):not(:last-child) .item__OhdxuB5n{border-radius:0;margin-top:-1px}.radioList-column__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:first-child .item__OhdxuB5n{border-radius:4px 4px 0 0}.radioList-column__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:last-child .item__OhdxuB5n{border-radius:0 0 4px 4px;margin-top:-1px}.radioList-row__OhdxuB5n{flex-direction:row;flex-wrap:wrap;margin-bottom:-8px;margin-right:-8px}.radioList-row__OhdxuB5n.radioList-row-nowrap__OhdxuB5n{flex-wrap:nowrap}.radioList-row__OhdxuB5n .item__OhdxuB5n{margin-bottom:8px;margin-right:8px}.radioList-row__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:has(label[data-checked=true]){z-index:1}.radioList-row__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:hover{z-index:1}.radioList-row__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n .item__OhdxuB5n{margin-bottom:0}.radioList-row__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:not(:first-child):not(:last-child) .item__OhdxuB5n{border-radius:0;margin-right:-1px}.radioList-row__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:first-child .item__OhdxuB5n{border-radius:4px 0 0 4px;margin-right:-1px}.radioList-row__OhdxuB5n.radioList-inputless__OhdxuB5n .itemWrapper__OhdxuB5n:last-child .item__OhdxuB5n{border-radius:0 4px 4px 0}");var d=i(70595),a=i(722860),o=i(273133);const s=(0,a.c)({radioList:"radioList__OhdxuB5n","radioList-column":"radioList-column__OhdxuB5n",item:"item__OhdxuB5n","item-condensed":"item-condensed__OhdxuB5n","item-flush":"item-flush__OhdxuB5n","radioList-inputless":"radioList-inputless__OhdxuB5n",itemWrapper:"itemWrapper__OhdxuB5n","radioList-row":"radioList-row__OhdxuB5n","radioList-row-nowrap":"radioList-row-nowrap__OhdxuB5n"}),l=n.memo((0,o.A)(({className:e,direction:t="column",full:i,items:a,motif:o,noWrap:l,spacing:m,variant:u})=>n.createElement("div",{className:s.concat(e)("radioList",`radioList-${t}`,u&&`radioList-${u}`,l&&"radioList-row-nowrap")},a.map(e=>{const{tooltipProps:t,...a}=e;return n.createElement(d.A,{...t,shouldFlip:!0,key:e.id},n.createElement("div",{className:s("itemWrapper")},n.createElement(r.A,{full:i,variant:u,...a,className:s.concat(e.className)("item",m&&`item-${m}`),motif:o})))}))))},151360(e,t,i){i.d(t,{A:()=>d});var n=i(71479),r=i(311785);const d=(0,n.A)("div",(0,r.A)("hidden","height"))`
  /* Height animation from UIC <Accordion/> */
  transition:
    height 300ms cubic-bezier(0.7, 0, 0.3, 1),
    opacity 100ms ease-in;
  height: ${e=>e.height}px; // cannot animate to height: auto
  opacity: 1;
  ${e=>e.hidden&&"\n    visibility: hidden;\n    height: 0;\n    min-height: unset;\n    opacity: 0;\n  "}
`},224948(e,t,i){i.d(t,{A:()=>u});var n=i(296540),r=i(217439),d=i(71479),a=i(566723),o=i(294303),s=i(689965);const l=(0,d.A)("div")`
  margin-right: ${a.kc};
`,m=(0,d.A)("div")`
  margin-left: ${a.kc};
`,u=({icon:e,closeIcon:t,nested:i,children:d,...a})=>n.createElement(s.A,{nested:i,...a},n.createElement(o.A,null,n.createElement(l,null,e),n.createElement(r.A,{size:"medium"},d),t?n.createElement(m,null,t):null))},689965(e,t,i){i.d(t,{A:()=>_,I:()=>n});var n,r=i(296540),d=i(822336),a=i(963724),o=i(71479),s=i(825032),l=i(566723),m=i(294303),u=i(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const c=(0,o.A)(m.A,(0,u.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:i}})=>e||d.Ay[i===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:i})=>i||(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}})=>d.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,h=(0,o.A)(a.A,(0,u.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:i}})=>e||d.Ay[i===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||d.Ay[t===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${l.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${l.Ln} ${l.Ln};
      }
    }
  }
`,_=({type:e,marginBottom:t,margin:i,padding:d,flex:a,width:o,nested:s,...l})=>"items"in l?r.createElement(h,{marginBottom:t,margin:i,padding:d,flex:a,nested:s,...l}):r.createElement(c,{nested:s,width:o,marginBottom:t,margin:i,padding:d,flex:a,isButtonList:e===n.BUTTON_LIST,...l},l.children)},923776(e,t,i){i.r(t),i.d(t,{default:()=>$});var n=i(296540),r=i(469733),d=i(217439),a=i(617147),o=i(162420),s=i(742920),l=i(224948),m=i(151360),u=i(845030),c=i(675359),h=i(126457),_=i(916537),p=i(87485),x=i(83344),g=i(323572),O=i(602021),B=i(171073),L=i(822336),f=i(892145),A=i(238761),b=i(71479);const E="site-radio",w=(0,b.A)(A.A)`
  margin: 10px 0;

  max-height: 192px;
  overflow-y: auto;

  &::-webkit-scrollbar-thumb {
    /* Workaround to fix missing scrollbar if too many entries (~100+) */
    min-height: 20px;
  }

  .${E} {
    border-radius: ${L.Ay["desktop-radius-base"]};
    padding-left: 6px;
    padding-right: 6px;
  }
`,k=({sites:e,selectedSiteId:t,onSelect:i})=>{const[r,d]=(0,n.useState)(),a=(0,n.useMemo)(()=>e.filter(({desc:e})=>!r||e?.toLowerCase().includes(r.toLowerCase())).map(({desc:e,_id:n})=>({children:e,id:n,onChange:()=>i(n),checked:n===t,className:E})),[i,r,t,e]);return n.createElement(n.Fragment,null,e.length>6?n.createElement(f.A,{variant:"secondary",full:!0,value:r,onChange:(e,t)=>{d(t)},onClear:()=>{d(void 0)}}):null,n.createElement(w,{items:a,variant:"list",spacing:"flush"}))},v=(e,t)=>t.find(({_id:t})=>e===t),$=({mac:e,deviceName:t})=>{const i=(0,r.useDispatch)(),[L,f]=(0,n.useState)(null),A=(0,r.useSelector)(O.Gd),b=(0,r.useSelector)(O.n),E=(0,n.useCallback)(e=>{const t=v(e,b);t?e!==L?._id&&f(t):f(null)},[L,b]),w=(0,n.useCallback)(()=>{i((0,h.AS)())},[i]),$=(0,n.useCallback)(async()=>{if(!L)return;const n=v(L._id,b);if(!n)return i((0,c.ox)({type:s.C.danger,message:"DEVICE_ACTIONS_MOVE_ERROR_SITE_DOES_NOT_EXIST",values:{siteDesc:L.desc,deviceName:t}})),void w();const{failureToast:r}=(0,p.rk)("DEVICE_ACTIONS_MOVE_ERROR",{deviceName:t,siteDesc:n.desc});i((0,g.gM)(e,n._id)).then(()=>{i((0,B.XL)(e)),i((0,x.W)(e)),i((0,u.K5)()),w()}).catch(e=>i((0,c.ox)(r(null,e))))},[i,e,L,b,t,w]),C=(0,n.useMemo)(()=>[{type:"button",text:n.createElement(_.sA,{id:"COMMON_ACTION_CANCEL"}),onClick:w},{type:"button",text:n.createElement(_.sA,{id:"DEVICE_MOVE_TO_SITE_ACTION"}),onClick:$,variant:"primary",disabled:!L}],[w,$,L]),N=(0,n.useMemo)(()=>b.filter(e=>{return!((t=e)._id===(i=A)._id&&t.desc===i.desc);var t,i}),[A,b]);return n.createElement(a.A,{title:n.createElement(_.sA,{id:"DEVICE_ACTIONS_MOVE_TO_SITE"}),size:"small",onRequestClose:w,actions:C,isOpen:!0,allowOverflow:!0},n.createElement(k,{sites:N,selectedSiteId:L?._id,onSelect:E}),n.createElement(m.A,{hidden:!L,height:76},n.createElement(l.A,{icon:n.createElement(o.A,{variant:"twoTone",isActive:!0}),nested:!0},n.createElement(d.A,{size:"small"},L?n.createElement(_.sA,{id:"DEVICE_MOVE_WARNING",values:{siteDesc:L.desc}}):null))))}}}]);