import{i as e}from"./chunk-aKtaBQYM.js";import{Ft as t,Mt as n,o as r,vt as i}from"./mui-BgU4WrXF.js";import{t as a}from"./EditAttributesAccordion-J3XCwwrK.js";import{i as o,n as s,r as c,t as l}from"./ExpandMore-D0ycvrdR.js";import{t as u}from"./Typography-7EcQ2i3p.js";import{t as d}from"./TextField-DctlzLY-.js";import{ct as f,pt as p,w as m}from"./index-bel1r0Sr.js";import{t as h}from"./SelectField-Bcp-L6wk.js";import{n as g,t as _}from"./useSettingsStyles-Bugi6oTj.js";import{t as v}from"./EditItemView-BPUZddYO.js";import{t as y}from"./useCommonDeviceAttributes-jzyUxblM.js";var b=e(t(),1),x=e=>(0,b.useMemo)(()=>({"processing.copyAttributes":{name:e(`attributeProcessingCopyAttributes`),type:`string`},"decoder.timezone":{name:e(`sharedTimezone`),type:`string`}}),[e]),S=i(),C=()=>{let{classes:e}=_(),t=n(),i=p(),C=y(i),w=x(i),[T,E]=(0,b.useState)(),D=f(async()=>{let e=await m(`/api/groups`);t(r.refresh(await e.json()))});return(0,S.jsx)(v,{endpoint:`groups`,item:T,setItem:E,validate:()=>T&&T.name,onItemSaved:D,menu:(0,S.jsx)(g,{}),breadcrumbs:[`settingsTitle`,`groupDialog`],children:T&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(o,{defaultExpanded:!0,children:[(0,S.jsx)(s,{expandIcon:(0,S.jsx)(l,{}),children:(0,S.jsx)(u,{variant:`subtitle1`,children:i(`sharedRequired`)})}),(0,S.jsx)(c,{className:e.details,children:(0,S.jsx)(d,{value:T.name||``,onChange:e=>E({...T,name:e.target.value}),label:i(`sharedName`)})})]}),(0,S.jsxs)(o,{children:[(0,S.jsx)(s,{expandIcon:(0,S.jsx)(l,{}),children:(0,S.jsx)(u,{variant:`subtitle1`,children:i(`sharedExtra`)})}),(0,S.jsx)(c,{className:e.details,children:(0,S.jsx)(h,{value:T.groupId,onChange:e=>E({...T,groupId:Number(e.target.value)}),endpoint:`/api/groups`,label:i(`groupParent`)})})]}),(0,S.jsx)(a,{attributes:T.attributes,setAttributes:e=>E({...T,attributes:e}),definitions:{...C,...w}})]})})};export{C as default};