var B=Object.defineProperty,F=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var L=(a,e,t)=>e in a?B(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,y=(a,e)=>{for(var t in e||(e={}))P.call(e,t)&&L(a,t,e[t]);if(j)for(var t of j(e))k.call(e,t)&&L(a,t,e[t]);return a},h=(a,e)=>F(a,G(e));import{a as I,g as $,i as K,aY as M,u as N,aZ as C,a7 as E,ap as U,aK as V,at as u,j as d,h as p,f as g,bG as R}from"./main-634.js";import{F as W}from"./bf-767-388.js";import{S as X}from"./bf-982-242.js";import"./bf-25-81.js";import"./bf-497-246.js";import"./bf-641-107.js";import"./bf-400-72.js";import"./bf-438-114.js";function ee(){var S;const{css:a}=I(),{fieldKey:e}=$(),[t,w]=K(M),z=N(C),i=N(E);let l=((S=t==null?void 0:t[i])==null?void 0:S.find(n=>n.i===e))||{};const v=U(V);l||Object.values(z).forEach(n=>{var r;const s=(r=n==null?void 0:n[i])==null?void 0:r.find(o=>o.i===e);s&&(l=s)});const x=t[i].reduce((n,s)=>n.y>s.y?n.y:s.y,0),c={lg:{w:u.lg,h:l.maxH||null,x:Math.abs(u.lg-l.w),y:x},md:{w:u.md,h:l.maxH||null,x:Math.abs(u.md-l.w),y:x},sm:{w:u.sm,h:l.maxH||null,x:Math.abs(u.sm-l.w),y:x}},H=n=>{const s=n.target.valueAsNumber;if(s<0||s>c[i].x)return;const r=g(t,o=>{const b=o[i].findIndex(f=>f.i===e);o[i][b].x=s});w(r),v(o=>h(y({},o),{reRenderGridLayoutByRootLay:o.reRenderGridLayoutByRootLay+1})),R({event:"Update Size and Position X",state:{layouts:r,fldKey:e}})},A=n=>{const s=n.target.valueAsNumber;if(s<0||s>c[i].w)return;const r=g(t,o=>{const b=o[i].findIndex(f=>f.i===e);o[i][b].w=s});w(r),v(o=>h(y({},o),{reRenderGridLayoutByRootLay:o.reRenderGridLayoutByRootLay+1})),R({event:"Update Size and Position W",state:{layouts:r,fldKey:e}})};return d.jsx(X,{title:"Size & Position",className:a(W.fieldSection),id:"siz-n-pos",children:d.jsxs("div",{className:a(m.fd),children:[d.jsxs("label",{className:a(p.w5,m.label),htmlFor:"x",children:[d.jsx("span",{className:a(m.name),children:"X"}),d.jsx("input",{"data-testid":"siz-n-pos-x-inp","aria-label":"position x",placeholder:"",min:"0",max:c[i].x,onChange:H,value:l.x,className:a(p.w8,m.input),id:"x",type:"number"})]}),d.jsxs("label",{className:a(p.w5,m.label),htmlFor:"w",children:[d.jsx("span",{className:a(m.name),children:"W"}),d.jsx("input",{"data-testid":"siz-n-pos-w-inp","aria-label":"position w",placeholder:"",min:"0",max:c[i].w,onChange:A,value:l.w,className:a(p.w8,m.input),id:"w",type:"number"})]})]})})}const m={fd:{flx:"center",flxp:1,m:6},label:{pn:"relative"},name:{pn:"absolute",tp:8,lt:10,fw:500},input:{ta:"center",bd:"var(--white-100) !important",b:"1px solid rgb(230, 230, 230) !important",oe:"none",brs:"var(--bf-bdr-radius-sm) !important",pl:"30px !important",w:100,lh:"1 !important",fw:"500 !important",bs:"none !important","&:hover":{bd:"var(--white-0-81-32)"},"&:focus":{focusShadow:1},":focus-visible":{bs:"0 0 0 2px var(--b-50) !important"}}};export{ee as default};
