@dipusevilla/componentes-iu 1.0.54 → 1.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -58,7 +58,7 @@ attempted value: ${i}
58
58
  dark:bg-[var(--color-ds-background-surface)]\r
59
59
  hover:bg-[var(--color-ds-background-accent)]/10\r
60
60
  focus:outline-none\r
61
- `,children:[o.jsx(Vn,{className:"w-5 h-5 text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]"}),o.jsx("span",{className:"sr-only",children:"Cerrar modal"})]})]}),o.jsx("div",{className:"px-6 py-6 text-[var(--color-ds-text-primary)]",children:s}),n&&o.jsx("div",{className:"px-6 py-4 border-t border-[var(--color-ds-border-muted)] bg-[var(--color-ds-background-surface)]",children:n})]})})]}),document.body):null),Qn=({items:e,selected:t,onSelect:r,level:s=0})=>{const[n,a]=h.useState(new Set),i=l=>{const c=new Set(n);s===0?(c.clear(),n.has(l)||c.add(l)):c.has(l)?c.delete(l):c.add(l),a(c)};return o.jsx("ul",{className:se(s>0?"mt-1":"mt-0"),children:e.map(l=>{var g;const c=l.value===t,d=n.has(l.value),u=["pl-2","pl-2","pl-2"][s]||"pl-4",f=s===0?d||c?"bg-[var(--color-ds-background-accent)] text-[var(--color-ds-text-on-accent)] rounded-r-lg":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]":c?"bg-[var(--color-ds-background-surface)] text-[var(--color-ds-text-primary)]":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]",p=s===0&&(d||c)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",b=!!((g=l.children)!=null&&g.length);return o.jsxs("li",{children:[o.jsxs("button",{type:"button",onClick:()=>b?i(l.value):r(l.value),"aria-expanded":b?d:void 0,className:se("w-full flex items-center justify-between h-8 transition-colors",u,f),children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[s===0&&l.icon&&o.jsx(l.icon,{className:"w-5 h-5 ml-2"}),o.jsx("span",{className:"text-ds-sm",children:l.label})]}),b&&(d?o.jsx(Rs,{className:se("w-4 h-4",p)}):o.jsx(Lo,{className:se("w-4 h-4",p)}))]}),b&&o.jsx("div",{className:se("overflow-hidden transition-[max-height] duration-300 ease-in-out","border-l-1 border-[var(--color-ds-background-accent)] ml-6",d?"max-h-screen":"max-h-0"),children:o.jsx(Qn,{items:l.children,selected:t,onSelect:r,level:s+1})})]},l.value)})})},sf="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23FFFFFF;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",nf="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23005751;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",Gi=({appName:e,orgName:t,username:r,footerText:s,navItems:n,selectedNav:a,onSelectNav:i,width:l="200px"})=>{const{theme:c}=Xn(),d=c==="dark"?sf:nf;return o.jsxs("aside",{className:"flex flex-col h-screen bg-[var(--color-ds-background-page)]",style:{width:l},children:[o.jsxs("div",{className:"flex gap-1 flex-col items-center py-4 space-y-1",children:[o.jsx("img",{src:d,alt:"Logo Diputación",className:"w-20 h-20"}),o.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-lg ",children:e}),o.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:t}),o.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:r}),o.jsx("div",{className:"w-1/5 h-0.5 rounded-full bg-[var(--color-ds-background-accent)] mt-2"})]}),o.jsx("nav",{className:"flex-1 overflow-auto pt-3",children:o.jsx(Qn,{items:n,selected:a,onSelect:i})}),o.jsx("div",{className:"px-4 w-full py-3",children:o.jsx("span",{className:"text-ds-sm w-full text-center text-[var(--color-ds-text-secondary)]",children:s})})]})};function af({hideSidebar:e=!1,sidebar:t,header:r,children:s}){const{dark:n}=Xn(),a={...r,dark:n};return o.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[!e&&o.jsx(Gi,{...t}),o.jsxs("div",{className:`flex-1 flex flex-col overflow-auto [scrollbar-gutter:stable_both-edges] ${e?"px-0":"px-10"}`,children:[o.jsx(Ki,{...a}),o.jsx("main",{className:"flex-1 min-h-0",children:s})]})]})}function of({columns:e,data:t,loadData:r,loading:s,idAccessor:n,multiSelect:a=!1,onSelectionChange:i,pageSize:l=10,initialSort:c,onSort:d,className:u,onRowDoubleClick:f}){const p=t!==void 0,[b,g]=h.useState([]),[v,x]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>{var Y;if(!r||p)return;(Y=m.current)==null||Y.abort();const z=new AbortController;return m.current=z,x(!0),r().then(D=>{z.signal.aborted||g(D)}).finally(()=>{z.signal.aborted||x(!1)}),()=>z.abort()},[r,p]);const y=h.useMemo(()=>p?t:b,[t,b,p]),j=s??(r?v:!1),[_,k]=h.useState(new Set),[A,C]=h.useState(1),[N,M]=h.useState(c==null?void 0:c.sortBy),[U,V]=h.useState((c==null?void 0:c.sortDir)??"asc"),W=z=>typeof n=="function"?n(z):z[n],$=h.useRef(null);h.useEffect(()=>{$.current!==y&&(k(new Set),C(1),$.current=y)},[y]);const L=h.useMemo(()=>{if(!N)return y;const z=U==="asc"?1:-1;return[...y].sort((Y,D)=>{const T=Y[N],Z=D[N];return T==null?-z:Z==null||T>Z?z:T<Z?-z:0})},[y,N,U]),S=Math.max(1,Math.ceil(L.length/l)),te=h.useMemo(()=>{const z=(A-1)*l;return L.slice(z,z+l)},[L,A,l]),ie=z=>{const Y=new Set(_);Y.has(z)?Y.delete(z):Y.add(z),k(Y),i==null||i(y.filter(D=>Y.has(W(D))))},K=()=>{const z=te.every(D=>_.has(W(D))),Y=new Set(_);te.forEach(D=>{z?Y.delete(W(D)):Y.add(W(D))}),k(Y),i==null||i(y.filter(D=>Y.has(W(D))))},me=z=>{if(!z.sortable)return;const Y=typeof z.accessor=="string"?z.accessor:z.sortKey;if(N===Y){const D=U==="asc"?"desc":"asc";V(D),d==null||d(Y,D)}else M(Y),V("asc"),d==null||d(Y,"asc");C(1)},I=()=>j?o.jsx("tbody",{children:Array.from({length:l}).map((z,Y)=>o.jsxs("tr",{children:[a&&o.jsx("td",{children:o.jsx(Xt,{width:"1rem",height:"1rem",variant:"circle"})}),e.map((D,T)=>o.jsx("td",{children:o.jsx(Xt,{width:"100%",height:"1em",variant:"rect"})},T))]},Y))}):te.length?o.jsx("tbody",{children:te.map(z=>{const Y=W(z);return o.jsxs("tr",{className:se("hover:bg-gray-50",f&&"cursor-pointer select-none"),onDoubleClick:f?()=>f(z):void 0,title:f?"Doble clic para abrir":void 0,children:[a&&o.jsx("td",{children:o.jsx("input",{type:"checkbox",checked:_.has(Y),onChange:()=>ie(Y),onDoubleClick:D=>D.stopPropagation()})}),e.map((D,T)=>{const Z=D.render?D.render(z):typeof D.accessor=="function"?D.accessor(z):z[D.accessor];return o.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm",children:Z},T)})]},Y)})}):o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:e.length+(a?1:0),children:"No hay datos"})})});return o.jsxs("div",{className:se("w-full overflow-auto",u),children:[o.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[o.jsx("thead",{className:"bg-gray-50",children:o.jsxs("tr",{children:[a&&o.jsx("th",{children:o.jsx("input",{type:"checkbox",checked:te.length>0&&te.every(z=>_.has(W(z))),onChange:K,onDoubleClick:z=>z.stopPropagation()})}),e.map(z=>{const Y=typeof z.accessor=="string"?z.accessor:z.header,D=N===(typeof z.accessor=="string"?z.accessor:z.sortKey);return o.jsx("th",{className:se("px-4 py-2 text-left text-sm font-medium text-gray-700",z.width),onClick:()=>me(z),children:o.jsxs("div",{className:"inline-flex items-center space-x-1 cursor-pointer",children:[o.jsx("span",{children:z.header}),z.sortable&&o.jsx("span",{className:"text-xs",children:D?U==="asc"?"▲":"▼":"⇵"})]})},Y)})]})}),I()]}),o.jsxs("div",{className:"flex items-center justify-between py-2 px-4",children:[o.jsx("span",{className:"text-sm text-gray-700",children:j?"Cargando...":`Página ${A} de ${S}`}),o.jsxs("div",{className:"space-x-2",children:[o.jsx(fe,{size:"sm",variant:"outline",disabled:j||A<=1,onClick:()=>C(z=>Math.max(1,z-1)),children:"Prev"}),o.jsx(fe,{size:"sm",variant:"outline",disabled:j||A>=S,onClick:()=>C(z=>Math.min(S,z+1)),children:"Next"})]})]})]})}function Ji({control:e,name:t,rules:r,defaultValue:s=!1,checked:n,onChange:a,disabled:i=!1,label:l,labelPosition:c="right",errorMessage:d="",className:u}){const f=h.useId();if(e&&t)return o.jsx(gt,{name:t,control:e,rules:r,defaultValue:s,render:({field:b,fieldState:g})=>{var v;return o.jsx(Ji,{checked:b.value,onChange:b.onChange,disabled:i,label:l,labelPosition:c,errorMessage:((v=g.error)==null?void 0:v.message)||"",className:u})}});const p=!!n;return o.jsxs("div",{className:se("flex flex-col",u),children:[o.jsxs("label",{className:se("inline-flex items-center space-x-3 select-none",i&&"opacity-50 cursor-not-allowed"),htmlFor:f,children:[l&&c==="left"&&o.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l}),o.jsx("button",{id:f,type:"button",role:"switch","aria-checked":p,disabled:i,onClick:()=>!i&&(a==null?void 0:a(!p)),className:se("relative inline-flex items-center h-8 w-16","bg-[var(--color-ds-background-accent)] rounded-full transition-colors duration-200","focus:outline-none "),children:o.jsx("div",{className:se("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",p?"translate-x-9":"translate-x-1")})}),l&&c==="right"&&o.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l})]}),o.jsx("div",{className:"pt-1 min-h-[18px] w-full",children:d?o.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:d}):o.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Zi({items:e,value:t,onValueChange:r,multiple:s=!0,dense:n=!1,className:a}){const i=h.useMemo(()=>e.filter(g=>g.defaultOpen&&!g.disabled).map(g=>g.id),[e]),[l,c]=h.useState(i),d=t??l,u=g=>{r?r(g):c(g)},f=(g,v)=>{v&&u(s?d.includes(g)?d.filter(x=>x!==g):[...d,g]:d.includes(g)?[]:[g])},p=(g,v,x)=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),f(v,x))},b=n?"py-1":"py-2";return o.jsx("div",{className:["divide-y","divide-[var(--color-ds-border-default-50)]",a].filter(Boolean).join(" "),children:e.map(g=>{const v=d.includes(g.id),x=!g.disabled;return o.jsxs("section",{"aria-disabled":g.disabled||void 0,children:[o.jsxs("button",{type:"button",onClick:()=>f(g.id,x),onKeyDown:m=>p(m,g.id,x),"aria-expanded":v,className:["w-full flex items-center justify-between gap-2 text-left select-none",b,"text-[var(--color-ds-text-primary)]",g.disabled?"opacity-60 cursor-not-allowed":"hover:bg-[color-mix(in_srgb,var(--color-ds-background-surface)_80%,transparent)]"].join(" "),children:[o.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[g.leftAdornment&&o.jsx("span",{className:"shrink-0",children:g.leftAdornment}),o.jsx("span",{className:"font-medium truncate",children:g.title})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[g.actions,o.jsx(Rs,{className:["h-4 w-4 transition-transform",v?"rotate-180":"",g.disabled?"opacity-40":""].join(" ")})]})]}),v&&o.jsx("div",{className:[n?"py-1":"py-2"].join(" "),children:g.content})]},g.id)})})}const so=e=>{let t;const r=new Set,s=(d,u)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(b=>b(t,p))}},n=()=>t,l={setState:s,getState:n,getInitialState:()=>c,subscribe:d=>(r.add(d),()=>r.delete(d))},c=t=e(s,n,l);return l},lf=e=>e?so(e):so,cf=e=>e;function df(e,t=cf){const r=h.useSyncExternalStore(e.subscribe,h.useCallback(()=>t(e.getState()),[e,t]),h.useCallback(()=>t(e.getInitialState()),[e,t]));return h.useDebugValue(r),r}const no=e=>{const t=lf(e),r=s=>df(t,s);return Object.assign(r,t),r},uf=e=>e?no(e):no;var Yi=Symbol.for("immer-nothing"),ao=Symbol.for("immer-draftable"),ct=Symbol.for("immer-state"),ff=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function st(e,...t){if(process.env.NODE_ENV!=="production"){const r=ff[e],s=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${s}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fr=Object.getPrototypeOf;function mr(e){return!!e&&!!e[ct]}function Qt(e){var t;return e?Hi(e)||Array.isArray(e)||!!e[ao]||!!((t=e.constructor)!=null&&t[ao])||Br(e)||zs(e):!1}var mf=Object.prototype.constructor.toString();function Hi(e){if(!e||typeof e!="object")return!1;const t=fr(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===mf}function Ns(e,t){Ps(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function Ps(e){const t=e[ct];return t?t.type_:Array.isArray(e)?1:Br(e)?2:zs(e)?3:0}function _n(e,t){return Ps(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t,r){const s=Ps(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function hf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Br(e){return e instanceof Map}function zs(e){return e instanceof Set}function Gt(e){return e.copy_||e.base_}function Fn(e,t){if(Br(e))return new Map(e);if(zs(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=Hi(e);if(t===!0||t==="class_only"&&!r){const s=Object.getOwnPropertyDescriptors(e);delete s[ct];let n=Reflect.ownKeys(s);for(let a=0;a<n.length;a++){const i=n[a],l=s[i];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(s[i]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[i]})}return Object.create(fr(e),s)}else{const s=fr(e);if(s!==null&&r)return{...e};const n=Object.create(s);return Object.assign(n,e)}}function ea(e,t=!1){return Is(e)||mr(e)||!Qt(e)||(Ps(e)>1&&Object.defineProperties(e,{set:{value:os},add:{value:os},clear:{value:os},delete:{value:os}}),Object.freeze(e),t&&Object.values(e).forEach(r=>ea(r,!0))),e}function os(){st(2)}function Is(e){return Object.isFrozen(e)}var pf={};function er(e){const t=pf[e];return t||st(0,e),t}var Or;function Qi(){return Or}function bf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function oo(e,t){t&&(er("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function On(e){Rn(e),e.drafts_.forEach(gf),e.drafts_=null}function Rn(e){e===Or&&(Or=e.parent_)}function io(e){return Or=bf(Or,e)}function gf(e){const t=e[ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function lo(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[ct].modified_&&(On(t),st(4)),Qt(e)&&(e=Ss(t,e),t.parent_||Es(t,e)),t.patches_&&er("Patches").generateReplacementPatches_(r[ct].base_,e,t.patches_,t.inversePatches_)):e=Ss(t,r,[]),On(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Yi?e:void 0}function Ss(e,t,r){if(Is(t))return t;const s=t[ct];if(!s)return Ns(t,(n,a)=>co(e,s,t,n,a,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return Es(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const n=s.copy_;let a=n,i=!1;s.type_===3&&(a=new Set(n),n.clear(),i=!0),Ns(a,(l,c)=>co(e,s,n,l,c,r,i)),Es(e,n,!1),r&&e.patches_&&er("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function co(e,t,r,s,n,a,i){if(process.env.NODE_ENV!=="production"&&n===r&&st(5),mr(n)){const l=a&&t&&t.type_!==3&&!_n(t.assigned_,s)?a.concat(s):void 0,c=Ss(e,n,l);if(Xi(r,s,c),mr(c))e.canAutoFreeze_=!1;else return}else i&&r.add(n);if(Qt(n)&&!Is(n)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ss(e,n),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&(Br(r)?r.has(s):Object.prototype.propertyIsEnumerable.call(r,s))&&Es(e,n)}}function Es(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ea(t,r)}function xf(e,t){const r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:Qi(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=s,a=ta;r&&(n=[s],a=Rr);const{revoke:i,proxy:l}=Proxy.revocable(n,a);return s.draft_=l,s.revoke_=i,l}var ta={get(e,t){if(t===ct)return e;const r=Gt(e);if(!_n(r,t))return vf(e,r,t);const s=r[t];return e.finalized_||!Qt(s)?s:s===en(e.base_,t)?(tn(e),e.copy_[t]=Mn(s,e)):s},has(e,t){return t in Gt(e)},ownKeys(e){return Reflect.ownKeys(Gt(e))},set(e,t,r){const s=el(Gt(e),t);if(s!=null&&s.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){const n=en(Gt(e),t),a=n==null?void 0:n[ct];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(hf(r,n)&&(r!==void 0||_n(e.base_,t)))return!0;tn(e),Dn(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return en(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,tn(e),Dn(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Gt(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){st(11)},getPrototypeOf(e){return fr(e.base_)},setPrototypeOf(){st(12)}},Rr={};Ns(ta,(e,t)=>{Rr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Rr.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&st(13),Rr.set.call(this,e,t,void 0)};Rr.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&st(14),ta.set.call(this,e[0],t,r,e[0])};function en(e,t){const r=e[ct];return(r?Gt(r):e)[t]}function vf(e,t,r){var n;const s=el(t,r);return s?"value"in s?s.value:(n=s.get)==null?void 0:n.call(e.draft_):void 0}function el(e,t){if(!(t in e))return;let r=fr(e);for(;r;){const s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=fr(r)}}function Dn(e){e.modified_||(e.modified_=!0,e.parent_&&Dn(e.parent_))}function tn(e){e.copy_||(e.copy_=Fn(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var yf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const i=this;return function(c=a,...d){return i.produce(c,u=>r.call(this,u,...d))}}typeof r!="function"&&st(6),s!==void 0&&typeof s!="function"&&st(7);let n;if(Qt(t)){const a=io(this),i=Mn(t,void 0);let l=!0;try{n=r(i),l=!1}finally{l?On(a):Rn(a)}return oo(a,s),lo(n,a)}else if(!t||typeof t!="object"){if(n=r(t),n===void 0&&(n=t),n===Yi&&(n=void 0),this.autoFreeze_&&ea(n,!0),s){const a=[],i=[];er("Patches").generateReplacementPatches_(t,n,a,i),s(a,i)}return n}else st(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...l)=>this.produceWithPatches(i,c=>t(c,...l));let s,n;return[this.produce(t,r,(i,l)=>{s=i,n=l}),s,n]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Qt(e)||st(8),mr(e)&&(e=wf(e));const t=io(this),r=Mn(e,void 0);return r[ct].isManual_=!0,Rn(t),r}finishDraft(e,t){const r=e&&e[ct];(!r||!r.isManual_)&&st(9);const{scope_:s}=r;return oo(s,t),lo(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(n.path.length===0&&n.op==="replace"){e=n.value;break}}r>-1&&(t=t.slice(r+1));const s=er("Patches").applyPatches_;return mr(e)?s(e,t):this.produce(e,n=>s(n,t))}};function Mn(e,t){const r=Br(e)?er("MapSet").proxyMap_(e,t):zs(e)?er("MapSet").proxySet_(e,t):xf(e,t);return(t?t.scope_:Qi()).drafts_.push(r),r}function wf(e){return mr(e)||st(10,e),tl(e)}function tl(e){if(!Qt(e)||Is(e))return e;const t=e[ct];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Fn(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Fn(e,!0);return Ns(r,(s,n)=>{Xi(r,s,tl(n))}),t&&(t.finalized_=!1),r}var jf=new yf,kf=jf.produce;const rn=e=>Number(e.toFixed(2)),dr=e=>Math.max(0,Math.min(100,e??0)),Nf={text:{name:"text",label:"Texto"},number:{name:"number",label:"Número"},email:{name:"email",label:"Email"},select:{name:"select",label:"Select"},checkbox:{name:"checkbox",label:"Checkbox"},date:{name:"date",label:"Fecha"},textarea:{name:"textarea",label:"Textarea"},file:{name:"file",label:"Archivo"}},_e=e=>e.layout.find(t=>t.type==="rows"),mt=(e,t)=>{if(t==null)return _e(e);const r=e.layout[t];return r&&r.type==="rows"?r:_e(e)},sn=e=>e<=1?["w-full"]:e===2?["w-1/2","w-1/2"]:e===3?["w-1/3","w-1/3","w-1/3"]:Array.from({length:e},()=>"flex-1"),nn={1:["w-full"],2:["w-1/2","w-1/2"],3:["w-1/3","w-1/3","w-1/3"],4:["w-1/4","w-1/4","w-1/4","w-1/4"],"1/3-2/3":["w-1/3","w-2/3"],"2/3-1/3":["w-2/3","w-1/3"],"1/4-3/4":["w-1/4","w-3/4"],"3/4-1/4":["w-3/4","w-1/4"]},$e=(e,t)=>{for(let r=0;r<e.layout.length;r++){const s=e.layout[r];if((s==null?void 0:s.type)!=="tabs")continue;const n=s.tabs.findIndex(a=>a.key===t);if(n>=0)return{nodeIdx:r,tabIdx:n}}return null},Sf=e=>{const t=[];return e.layout.forEach(r=>{r.type==="rows"&&r.sections.forEach(s=>s.rows.forEach(n=>n.columns.forEach(a=>(a.fields??[]).forEach(i=>t.push(i))))),r.type==="tabs"&&r.tabs.forEach(s=>s.sections.forEach(n=>n.rows.forEach(a=>a.columns.forEach(i=>(i.fields??[]).forEach(l=>t.push(l))))))}),t},Ef=e=>({type:"rows",sections:[{sectionTitle:e??"Sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}),Cf=()=>({type:"tabs",tabs:[{key:`tab_${Date.now().toString(36)}_1`,label:"Pestaña 1",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]},{key:`tab_${Date.now().toString(36)}_2`,label:"Pestaña 2",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}]}),ir=(e,t)=>Sf(e).includes(t),$n=e=>e.replace(/(?:_copy)+$/i,"").replace(/_(\d+)$/i,""),rl=e=>e.replace(/\s\((\d+)\)$/i,""),Xe=(e,t)=>{const r=e||"campo";if(!t.has(r))return r;let s=2;for(;t.has(`${r}_${s}`);)s++;return`${r}_${s}`},ot=(e,t)=>{const r=e||"Campo";if(!t.has(r))return r;let s=2;for(;t.has(`${r} (${s})`);)s++;return`${r} (${s})`},Qe=e=>{const t=(e.type??"text").toString(),r=Nf[t]??{name:"campo",label:"Campo"},s=e.name?$n(e.name):r.name,n=e.label?rl(e.label):r.label;return{baseName:s,baseLabel:n}},Af={layout:[{type:"rows",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}],fields:[],onSubmit:async()=>{},successMessage:"Guardado",errorMessage:"Error"},J=uf((e,t)=>({schema:Af,selection:{kind:"none"},past:[],future:[],setSchema:r=>{const s=t().schema,n=kf(s,r),a=n;e(i=>({...i,schema:a,past:[...i.past,s],future:[]}))},setSelection:r=>e({selection:r}),undo:()=>e(r=>r.past.length?{schema:r.past[r.past.length-1],past:r.past.slice(0,-1),future:[r.schema,...r.future]}:r),redo:()=>e(r=>r.future.length?{schema:r.future[0],past:[...r.past,r.schema],future:r.future.slice(1)}:r),resetHistory:()=>e(r=>({past:[],future:[]})),addField:r=>t().setSchema(s=>{const{baseName:n,baseLabel:a}=Qe(r),i=new Set(s.fields.map(u=>u.name).filter(Boolean)),l=new Set(s.fields.map(u=>u.label??"").filter(Boolean)),c=Xe(n,i),d=ot(a,l);r.name=c,r.label||(r.label=d),s.fields.push(r)}),addFieldAt:(r,s)=>t().setSchema(n=>{const{baseName:a,baseLabel:i}=Qe(r),l=new Set(n.fields.map(p=>p.name).filter(Boolean)),c=new Set(n.fields.map(p=>p.label??"").filter(Boolean)),d=Xe(a,l),u=ot(i,c);r.name=d,r.label||(r.label=u);const f=Math.max(0,Math.min(s??n.fields.length,n.fields.length));n.fields.splice(f,0,r)}),removeField:r=>t().setSchema(s=>{s.fields=s.fields.filter(n=>n.name!==r),s.layout.forEach(n=>{n.type==="rows"&&n.sections.forEach(a=>a.rows.forEach(i=>i.columns.forEach(l=>{l.fields=(l.fields??[]).filter(c=>c!==r)}))),n.type==="tabs"&&n.tabs.forEach(a=>a.sections.forEach(i=>i.rows.forEach(l=>l.columns.forEach(c=>{c.fields=(c.fields??[]).filter(d=>d!==r)}))))})}),updateField:(r,s)=>t().setSchema(n=>{const a=n.fields.findIndex(i=>i.name===r);a>=0&&s(n.fields[a])}),duplicateField:(r,s)=>t().setSchema(n=>{const a=n.fields.findIndex(g=>g.name===r);if(a<0)return;const i=n.fields[a],l=$n((s==null?void 0:s.trim())||i.name||""),c=rl(i.label??""),d=new Set(n.fields.map(g=>g.name).filter(Boolean)),u=new Set(n.fields.map(g=>g.label??"").filter(Boolean)),f=Xe(l||Qe(i).baseName,d),p=ot(c||Qe(i).baseLabel,u),b=JSON.parse(JSON.stringify(i));b.name=f,b.label=p,n.fields.splice(a+1,0,b)}),renameField:(r,s)=>t().setSchema(n=>{const a=n.fields.findIndex(d=>d.name===r);if(a<0)return;const i=$n((s??r).trim()||"campo"),l=new Set(n.fields.map(d=>d.name).filter(Boolean));l.delete(r);const c=Xe(i,l);n.fields[a].name=c,n.layout.forEach(d=>{d.type==="rows"&&d.sections.forEach(u=>u.rows.forEach(f=>f.columns.forEach(p=>{p.fields&&(p.fields=p.fields.map(b=>b===r?c:b))}))),d.type==="tabs"&&d.tabs.forEach(u=>u.sections.forEach(f=>f.rows.forEach(p=>p.columns.forEach(b=>{b.fields&&(b.fields=b.fields.map(g=>g===r?c:g))}))))})}),addSection:r=>t().setSchema(s=>{const n=_e(s);if(!n)return;const a={sectionTitle:r??"Nueva sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]};n.sections.push(a)}),renameSection:(r,s)=>t().setSchema(n=>{const a=_e(n);if(!a)return;const i=a.sections[r];i&&(i.sectionTitle=(s??"").trim()||"Sección")}),moveSection:(r,s,n)=>e(a=>{const i=[...a.schema.layout],l=i[r];if(!l||l.type!=="rows")return a;const c=[...l.sections],[d]=c.splice(s,1),u=Math.max(0,Math.min(n,c.length));return c.splice(u,0,d),i[r]={...l,sections:c},{schema:{...a.schema,layout:i}}}),removeSection:r=>t().setSchema(s=>{const n=_e(s);if(!n||r<0||r>=n.sections.length)return;const a=[...n.sections];a.splice(r,1),n.sections=a}),duplicateSection:r=>t().setSchema(s=>{const n=_e(s);if(!n)return;const a=n.sections[r];if(!a)return;const i=JSON.parse(JSON.stringify(a)),l=(a.sectionTitle||"Sección").toString(),c=n.sections.map(f=>f.sectionTitle||""),d=new Set(c);let u=l;if(d.has(u)){let f=2;for(;d.has(`${l} (${f})`);)f++;u=`${l} (${f})`}i.sectionTitle=u,n.sections.splice(r+1,0,i)}),addRowsBlockAt:(r,s)=>t().setSchema(n=>{const a=Math.max(0,Math.min(r,n.layout.length));n.layout.splice(a,0,Ef(s))}),addTabsContainerAt:r=>t().setSchema(s=>{const n=Math.max(0,Math.min(r,s.layout.length));s.layout.splice(n,0,Cf())}),moveLayoutNode:(r,s)=>t().setSchema(n=>{const a=n.layout.length;if(r<0||r>=a)return;const i=Math.max(0,Math.min(s,a-1));if(r===i)return;const l=[...n.layout],[c]=l.splice(r,1);l.splice(i,0,c),n.layout=l}),removeLayoutNode:r=>t().setSchema(s=>{if(r<0||r>=s.layout.length)return;const n=[...s.layout];n.splice(r,1),s.layout=n}),addTabsContainer:()=>t().setSchema(r=>{const s={type:"tabs",tabs:[{key:"tab1",label:"Pestaña 1",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]},{key:"tab2",label:"Pestaña 2",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}]};r.layout.push(s)}),addTabAfter:r=>t().setSchema(s=>{const n=$e(s,r);if(!n)return;const a=s.layout[n.nodeIdx],i="Nueva pestaña",l=new Set(a.tabs.map(f=>f.label));let c=i,d=2;for(;l.has(c);)c=`${i} (${d++})`;const u={key:`tab_${Date.now().toString(36)}`,label:c,sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]};a.tabs.splice(n.tabIdx+1,0,u)}),removeTab:r=>t().setSchema(s=>{const n=$e(s,r);if(!n)return;const a=s.layout[n.nodeIdx];a.tabs.length<=1||a.tabs.splice(n.tabIdx,1)}),renameTab:(r,s)=>t().setSchema(n=>{const a=$e(n,r);if(!a)return;const i=n.layout[a.nodeIdx];i.tabs[a.tabIdx].label=(s??"").trim()||"Pestaña"}),moveTab:(r,s,n)=>e(a=>{const i=[...a.schema.layout],l=i[r];if(!l||l.type!=="tabs")return a;const c=[...l.tabs],[d]=c.splice(s,1),u=Math.max(0,Math.min(n,c.length));return c.splice(u,0,d),i[r]={...l,tabs:c},{schema:{...a.schema,layout:i}}}),moveTabSection:(r,s,n,a)=>e(i=>{const l=[...i.schema.layout],c=l[r];if(!c||c.type!=="tabs")return i;const d=c.tabs.find(g=>g.key===s);if(!d)return i;const u=[...d.sections],[f]=u.splice(n,1),p=Math.max(0,Math.min(a,u.length));u.splice(p,0,f);const b=c.tabs.map(g=>g.key===s?{...g,sections:u}:g);return l[r]={...c,tabs:b},{schema:{...i.schema,layout:l}}}),addSectionToTab:(r,s)=>t().setSchema(n=>{const a=$e(n,r);if(!a)return;n.layout[a.nodeIdx].tabs[a.tabIdx].sections.push({sectionTitle:s??"Nueva sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]})}),addRowToTabSection:(r,s)=>t().setSchema(n=>{var l;const a=$e(n,r);if(!a)return;(l=n.layout[a.nodeIdx].tabs[a.tabIdx].sections[s])==null||l.rows.push({title:"",columns:[{width:"w-full",fields:[]}]})}),renameTabSection:(r,s,n)=>t().setSchema(a=>{const i=$e(a,r);if(!i)return;const c=a.layout[i.nodeIdx].tabs[i.tabIdx].sections[s];c&&(c.sectionTitle=(n??"").trim()||"Sección")}),setTabRowColumns:(r,s,n,a)=>t().setSchema(i=>{var b,g;const l=$e(i,r);if(!l)return;const d=(g=(b=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[s])==null?void 0:b.rows)==null?void 0:g[n];if(!d)return;const u=(d.columns??[]).flatMap(v=>v.fields??[]),f=sn(a),p=Array.from({length:a},(v,x)=>({width:f[x],fields:[]}));u.forEach((v,x)=>p[x%a].fields.push(v)),d.columns=p}),addColumnToTabRow:(r,s,n)=>t().setSchema(a=>{var d,u;const i=$e(a,r);if(!i)return;const c=(u=(d=a.layout[i.nodeIdx].tabs[i.tabIdx].sections[s])==null?void 0:d.rows)==null?void 0:u[n];c&&c.columns.push({width:"w-1/2",fields:[]})}),removeTabColumn:(r,s,n,a)=>t().setSchema(i=>{var g,v;const l=$e(i,r);if(!l)return;const d=(v=(g=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[s])==null?void 0:g.rows)==null?void 0:v[n];if(!d)return;const u=d.columns??[];if(!u[a])return;const f=u[a],p=a>0?a-1:u[a+1]?a+1:-1,b=[...u];b.splice(a,1),p>=0&&b[p]&&(b[p].fields=[...b[p].fields??[],...f.fields??[]]),d.columns=b}),placeFieldInTabColumn:(r,s,n,a,i)=>t().setSchema(l=>{const c=$e(l,s);if(!c)return;const u=l.layout[c.nodeIdx].tabs[c.tabIdx].sections[n].rows[a].columns[i];let f=r;if(ir(l,r)){const p=l.fields.findIndex(b=>b.name===r);if(p>=0){const b=l.fields[p],{baseName:g,baseLabel:v}=Qe(b),x=new Set(l.fields.map(_=>_.name).filter(Boolean)),m=new Set(l.fields.map(_=>_.label??"").filter(Boolean));f=Xe(g,x);const y=ot(v,m),j=JSON.parse(JSON.stringify(b));j.name=f,j.label=y,l.fields.splice(p+1,0,j)}}u.fields=[...u.fields??[],f]}),moveFieldInTab:(r,s)=>t().setSchema(n=>{var b,g,v,x;const a=$e(n,r.tabKey);if(!a)return;const i=n.layout[a.nodeIdx],l=(g=(b=i.tabs[a.tabIdx].sections[r.s])==null?void 0:b.rows[r.r])==null?void 0:g.columns[r.c],c=(x=(v=i.tabs[a.tabIdx].sections[s.s])==null?void 0:v.rows[s.r])==null?void 0:x.columns[s.c];if(!l||!c)return;const d=[...l.fields??[]];if(r.idx<0||r.idx>=d.length)return;const[u]=d.splice(r.idx,1);l.fields=d;const f=[...c.fields??[]],p=s.idx===void 0?f.length:Math.max(0,Math.min(s.idx,f.length));f.splice(p,0,u),c.fields=f}),removeFieldFromTabLayout:r=>t().setSchema(s=>{var c,d;const n=$e(s,r.tabKey);if(!n)return;const i=(d=(c=s.layout[n.nodeIdx].tabs[n.tabIdx].sections[r.s])==null?void 0:c.rows[r.r])==null?void 0:d.columns[r.c];if(!i||!i.fields||r.idx<0||r.idx>=i.fields.length)return;const l=[...i.fields];l.splice(r.idx,1),i.fields=l}),moveRowInSection:(r,s,n)=>t().setSchema(a=>{const i=_e(a);if(!i)return;const l=i.sections[r];if(!l)return;const c=[...l.rows];if(s<0||s>=c.length)return;const d=Math.max(0,Math.min(n,c.length-1));if(s===d)return;const[u]=c.splice(s,1);c.splice(d,0,u),l.rows=c}),duplicateRowInSection:(r,s)=>t().setSchema(n=>{const a=_e(n);if(!a)return;const i=a.sections[r];if(!i)return;const l=i.rows[s];if(!l)return;const c=JSON.parse(JSON.stringify(l));i.rows.splice(s+1,0,c)}),removeRowFromSection:(r,s)=>t().setSchema(n=>{const a=_e(n);if(!a)return;const i=a.sections[r];if(!i)return;const l=[...i.rows];s<0||s>=l.length||(l.splice(s,1),l.length===0&&l.push({title:"",columns:[{width:"w-full",fields:[]}]}),i.rows=l)}),setRowColumnsPreset:(r,s,n)=>t().setSchema(a=>{var d,u;const i=_e(a);if(!i)return;const l=(u=(d=i.sections[r])==null?void 0:d.rows)==null?void 0:u[s];if(!l)return;const c=nn[n];c&&an(l,c)}),setRowResponsive:(r,s,n)=>t().setSchema(a=>{var b,g;const i=_e(a);if(!i)return;const l=(g=(b=i.sections[Number(r)])==null?void 0:b.rows)==null?void 0:g[Number(s)];if(!l)return;const c=Math.max(n.desktop.count??1,n.tablet.count??1,n.mobile.count??1),d=(l.columns??[]).flatMap(v=>v.fields??[]),u=ln(d,c),f=(v,x,m)=>x<(m??0)?dr((v==null?void 0:v[x])??0):null,p=Array.from({length:c},(v,x)=>{const m=f(n.mobile.widths,x,n.mobile.count),y=f(n.tablet.widths,x,n.tablet.count),j=f(n.desktop.widths,x,n.desktop.count);return{width:on(m,y,j),fields:u[x]??[]}});l.columns=p}),setRowColumnsAt:(r,s,n,a)=>t().setSchema(i=>{var p,b;const l=mt(i,r);if(!l)return;const c=(b=(p=l.sections[s])==null?void 0:p.rows)==null?void 0:b[n];if(!c)return;const d=(c.columns??[]).flatMap(g=>g.fields??[]),u=sn(a),f=Array.from({length:a},(g,v)=>({width:u[v],fields:[]}));d.forEach((g,v)=>f[v%a].fields.push(g)),c.columns=f}),addColumnToRowAt:(r,s,n)=>t().setSchema(a=>{var l,c,d,u;const i=mt(a,r);i&&((u=(d=(c=(l=i.sections[s])==null?void 0:l.rows)==null?void 0:c[n])==null?void 0:d.columns)==null||u.push({width:"w-1/2",fields:[]}))}),removeColumnAt:(r,s,n,a)=>t().setSchema(i=>{var b,g;const l=mt(i,r);if(!l)return;const c=(g=(b=l.sections[s])==null?void 0:b.rows)==null?void 0:g[n];if(!c)return;const d=c.columns??[];if(!d[a])return;const u=d[a],f=a>0?a-1:d[a+1]?a+1:-1,p=[...d];p.splice(a,1),f>=0&&p[f]&&(p[f].fields=[...p[f].fields??[],...u.fields??[]]),c.columns=p}),setRowColumnsPresetAt:(r,s,n,a)=>t().setSchema(i=>{var u,f;const l=mt(i,r);if(!l)return;const c=(f=(u=l.sections[s])==null?void 0:u.rows)==null?void 0:f[n];if(!c)return;const d=nn[a];d&&an(c,d)}),setRowResponsiveAt:(r,s,n,a)=>t().setSchema(i=>{var g,v;const l=mt(i,r);if(!l)return;const c=(v=(g=l.sections[Number(s)])==null?void 0:g.rows)==null?void 0:v[Number(n)];if(!c)return;const d=Math.max(a.desktop.count??1,a.tablet.count??1,a.mobile.count??1),u=(x,m,y)=>m<(y??0)?dr((x==null?void 0:x[m])??0):null,f=Tf(c,d),p=f.flatMap(x=>x.fields??[]),b=ln(p,d);for(let x=0;x<d;x++){const m=u(a.mobile.widths,x,a.mobile.count),y=u(a.tablet.widths,x,a.tablet.count),j=u(a.desktop.widths,x,a.desktop.count);f[x].width=on(m,y,j),f[x].fields=b[x]??[]}}),placeFieldInColumnAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var g,v,x,m;const d=mt(c,r);if(!d)return;const u=(m=(x=(v=(g=d.sections[n])==null?void 0:g.rows)==null?void 0:v[a])==null?void 0:x.columns)==null?void 0:m[i];if(!u)return;let f=s;if(ir(c,s)){const y=c.fields.findIndex(j=>j.name===s);if(y>=0){const j=c.fields[y],{baseName:_,baseLabel:k}=Qe(j),A=new Set(c.fields.map(U=>U.name).filter(Boolean)),C=new Set(c.fields.map(U=>U.label??"").filter(Boolean));f=Xe(_,A);const N=ot(k,C),M=JSON.parse(JSON.stringify(j));M.name=f,M.label=N,c.fields.splice(y+1,0,M)}}const p=[...u.fields??[]],b=l===void 0?p.length:Math.max(0,Math.min(l,p.length));p.splice(b,0,f),u.fields=p}),moveFieldAt:(r,s,n,a)=>t().setSchema(i=>{var v,x,m,y,j,_,k,A;const l=mt(i,r),c=mt(i,n);if(!l||!c)return;const d=(y=(m=(x=(v=l.sections[s.s])==null?void 0:v.rows)==null?void 0:x[s.r])==null?void 0:m.columns)==null?void 0:y[s.c],u=(A=(k=(_=(j=c.sections[a.s])==null?void 0:j.rows)==null?void 0:_[a.r])==null?void 0:k.columns)==null?void 0:A[a.c];if(!d||!u)return;const f=[...d.fields??[]];if(s.idx<0||s.idx>=f.length)return;const[p]=f.splice(s.idx,1);d.fields=f;const b=[...u.fields??[]],g=a.idx===void 0?b.length:Math.max(0,Math.min(a.idx,b.length));b.splice(g,0,p),u.fields=b}),removeFieldFromLayoutAt:(r,s)=>t().setSchema(n=>{var c,d,u,f;const a=mt(n,r);if(!a)return;const i=(f=(u=(d=(c=a.sections[s.s])==null?void 0:c.rows)==null?void 0:d[s.r])==null?void 0:u.columns)==null?void 0:f[s.c];if(!i||!i.fields||s.idx<0||s.idx>=i.fields.length)return;const l=[...i.fields];l.splice(s.idx,1),i.fields=l}),insertExistingFieldAtAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var g,v,x,m;const d=mt(c,r);if(!d)return;const u=(m=(x=(v=(g=d.sections[n])==null?void 0:g.rows)==null?void 0:v[a])==null?void 0:x.columns)==null?void 0:m[i];if(!u)return;let f=s;if(ir(c,s)){const y=c.fields.findIndex(j=>j.name===s);if(y>=0){const j=c.fields[y],{baseName:_,baseLabel:k}=Qe(j),A=new Set(c.fields.map(V=>V.name).filter(Boolean)),C=new Set(c.fields.map(V=>V.label??"").filter(Boolean)),N=Xe(_,A),M=ot(k,C),U=JSON.parse(JSON.stringify(j));U.name=N,U.label=M,c.fields.splice(y+1,0,U),f=N}}const p=[...u.fields??[]],b=Math.max(0,Math.min(l,p.length));p.splice(b,0,f),u.fields=p}),addFieldAndPlaceAtAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var _,k,A,C;const{baseName:d,baseLabel:u}=Qe(s),f=new Set(c.fields.map(N=>N.name).filter(Boolean)),p=new Set(c.fields.map(N=>N.label??"").filter(Boolean)),b=Xe(d,f),g=ot(u,p),v=JSON.parse(JSON.stringify(s));v.name=b,v.label||(v.label=g),c.fields.push(v);const x=mt(c,r);if(!x)return;const m=(C=(A=(k=(_=x.sections[n])==null?void 0:_.rows)==null?void 0:k[a])==null?void 0:A.columns)==null?void 0:C[i];if(!m)return;const y=[...m.fields??[]],j=Math.max(0,Math.min(l,y.length));y.splice(j,0,b),m.fields=y}),setTabRowResponsive:(r,s,n,a)=>t().setSchema(i=>{var v,x;const l=$e(i,r);if(!l)return;const d=(x=(v=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[Number(s)])==null?void 0:v.rows)==null?void 0:x[Number(n)];if(!d)return;const u=Math.max(a.desktop.count??1,a.tablet.count??1,a.mobile.count??1),f=(d.columns??[]).flatMap(m=>m.fields??[]),p=ln(f,u),b=(m,y,j)=>y<(j??0)?dr((m==null?void 0:m[y])??0):null,g=Array.from({length:u},(m,y)=>{const j=b(a.mobile.widths,y,a.mobile.count),_=b(a.tablet.widths,y,a.tablet.count),k=b(a.desktop.widths,y,a.desktop.count);return{width:on(j,_,k),fields:p[y]??[]}});d.columns=g}),moveTabRow:(r,s,n,a)=>t().setSchema(i=>{const l=$e(i,r);if(!l)return;const d=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[s];if(!d)return;const u=[...d.rows];if(n<0||n>=u.length)return;const f=Math.max(0,Math.min(a,u.length-1));if(n===f)return;const[p]=u.splice(n,1);u.splice(f,0,p),d.rows=u}),duplicateTabRow:(r,s,n)=>t().setSchema(a=>{const i=$e(a,r);if(!i)return;const c=a.layout[i.nodeIdx].tabs[i.tabIdx].sections[s];if(!c)return;const d=c.rows[n];if(!d)return;const u=JSON.parse(JSON.stringify(d));c.rows.splice(n+1,0,u)}),removeTabRow:(r,s,n)=>t().setSchema(a=>{const i=$e(a,r);if(!i)return;const c=a.layout[i.nodeIdx].tabs[i.tabIdx].sections[s];if(!c)return;const d=[...c.rows];n<0||n>=d.length||(d.splice(n,1),d.length===0&&d.push({title:"",columns:[{width:"w-full",fields:[]}]}),c.rows=d)}),setTabRowColumnsPreset:(r,s,n,a)=>t().setSchema(i=>{var f,p;const l=$e(i,r);if(!l)return;const d=(p=(f=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[s])==null?void 0:f.rows)==null?void 0:p[n];if(!d)return;const u=nn[a];u&&an(d,u)}),addRowToSection:r=>t().setSchema(s=>{const n=_e(s);n&&n.sections[r].rows.push({title:"",columns:[{width:"w-full",fields:[]}]})}),addColumnToRow:(r,s)=>t().setSchema(n=>{const a=_e(n);a&&a.sections[r].rows[s].columns.push({width:"w-1/2",fields:[]})}),setRowColumns:(r,s,n)=>t().setSchema(a=>{const i=_e(a);if(!i)return;const l=i.sections[r].rows[s],c=(l.columns??[]).flatMap(f=>f.fields??[]),d=sn(n),u=Array.from({length:n},(f,p)=>({width:d[p],fields:[]}));c.forEach((f,p)=>u[p%n].fields.push(f)),l.columns=u}),removeColumn:(r,s,n)=>t().setSchema(a=>{const i=_e(a);if(!i)return;const l=i.sections[r].rows[s],c=l.columns??[];if(!c[n])return;const d=c[n],u=n>0?n-1:c[n+1]?n+1:-1,f=[...c];f.splice(n,1),u>=0&&f[u]&&(f[u].fields=[...f[u].fields??[],...d.fields??[]]),l.columns=f}),placeFieldInColumn:(r,s,n,a)=>t().setSchema(i=>{const l=_e(i);if(!l)return;const c=l.sections[s].rows[n].columns[a];let d=r;if(ir(i,r)){const u=i.fields.findIndex(f=>f.name===r);if(u>=0){const f=i.fields[u],{baseName:p,baseLabel:b}=Qe(f),g=new Set(i.fields.map(j=>j.name).filter(Boolean)),v=new Set(i.fields.map(j=>j.label??"").filter(Boolean)),x=Xe(p,g),m=ot(b,v),y=JSON.parse(JSON.stringify(f));y.name=x,y.label=m,i.fields.splice(u+1,0,y),d=x}}c.fields=[...c.fields??[],d]}),moveField:(r,s)=>t().setSchema(n=>{var p,b,g,v;const a=_e(n);if(!a)return;const i=(b=(p=a.sections[r.s])==null?void 0:p.rows[r.r])==null?void 0:b.columns[r.c],l=(v=(g=a.sections[s.s])==null?void 0:g.rows[s.r])==null?void 0:v.columns[s.c];if(!i||!l)return;const c=[...i.fields??[]];if(r.idx<0||r.idx>=c.length)return;const[d]=c.splice(r.idx,1);i.fields=c;const u=[...l.fields??[]],f=s.idx===void 0?u.length:Math.max(0,Math.min(s.idx,u.length));u.splice(f,0,d),l.fields=u}),removeFieldFromLayout:r=>t().setSchema(s=>{var l,c;const n=_e(s);if(!n)return;const a=(c=(l=n.sections[r.s])==null?void 0:l.rows[r.r])==null?void 0:c.columns[r.c];if(!a||!a.fields||r.idx<0||r.idx>=a.fields.length)return;const i=[...a.fields];i.splice(r.idx,1),a.fields=i}),addFieldAndPlace:(r,s,n,a)=>t().setSchema(i=>{const{baseName:l,baseLabel:c}=Qe(r),d=new Set(i.fields.map(x=>x.name).filter(Boolean)),u=new Set(i.fields.map(x=>x.label??"").filter(Boolean)),f=Xe(l,d),p=ot(c,u),b=JSON.parse(JSON.stringify(r));b.name=f,b.label||(b.label=p),i.fields.push(b);const g=_e(i);if(!g)return;const v=g.sections[s].rows[n].columns[a];v.fields=[...v.fields??[],f]}),moveFieldWithinColumn:(r,s,n,a,i)=>t().setSchema(l=>{var b,g,v,x;const c=_e(l);if(!c)return;const d=(x=(v=(g=(b=c.sections[r])==null?void 0:b.rows)==null?void 0:g[s])==null?void 0:v.columns)==null?void 0:x[n];if(!d)return;const u=[...d.fields??[]];if(a<0||a>=u.length)return;const[f]=u.splice(a,1),p=Math.max(0,Math.min(i,u.length));u.splice(p,0,f),d.fields=u}),insertExistingFieldAt:(r,s,n,a,i)=>t().setSchema(l=>{var b,g,v,x;const c=_e(l);if(!c)return;const d=(x=(v=(g=(b=c.sections[s])==null?void 0:b.rows)==null?void 0:g[n])==null?void 0:v.columns)==null?void 0:x[a];if(!d)return;let u=r;if(ir(l,r)){const m=l.fields.findIndex(y=>y.name===r);if(m>=0){const y=l.fields[m],{baseName:j,baseLabel:_}=Qe(y),k=new Set(l.fields.map(U=>U.name).filter(Boolean)),A=new Set(l.fields.map(U=>U.label??"").filter(Boolean)),C=Xe(j,k),N=ot(_,A),M=JSON.parse(JSON.stringify(y));M.name=C,M.label=N,l.fields.splice(m+1,0,M),u=C}}const f=[...d.fields??[]],p=Math.max(0,Math.min(i,f.length));f.splice(p,0,u),d.fields=f}),addFieldAndPlaceAt:(r,s,n,a,i)=>t().setSchema(l=>{var j,_,k,A;const{baseName:c,baseLabel:d}=Qe(r),u=new Set(l.fields.map(C=>C.name).filter(Boolean)),f=new Set(l.fields.map(C=>C.label??"").filter(Boolean)),p=Xe(c,u),b=ot(d,f),g=JSON.parse(JSON.stringify(r));g.name=p,g.label||(g.label=b),l.fields.push(g);const v=_e(l);if(!v)return;const x=(A=(k=(_=(j=v.sections[s])==null?void 0:j.rows)==null?void 0:_[n])==null?void 0:k.columns)==null?void 0:A[a];if(!x)return;const m=[...x.fields??[]],y=Math.max(0,Math.min(i,m.length));m.splice(y,0,p),x.fields=m}),moveFieldWithinTab:(r,s,n,a,i,l)=>t().setSchema(c=>{var g,v,x,m;const d=$e(c,r);if(!d)return;const u=(m=(x=(v=(g=c.layout[d.nodeIdx].tabs[d.tabIdx].sections[s])==null?void 0:g.rows)==null?void 0:v[n])==null?void 0:x.columns)==null?void 0:m[a];if(!u)return;const f=[...u.fields??[]];if(i<0||i>=f.length)return;const[p]=f.splice(i,1),b=Math.max(0,Math.min(l,f.length));f.splice(b,0,p),u.fields=f}),insertExistingFieldInTabAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var g,v,x,m;const d=$e(c,s);if(!d)return;const u=(m=(x=(v=(g=c.layout[d.nodeIdx].tabs[d.tabIdx].sections[n])==null?void 0:g.rows)==null?void 0:v[a])==null?void 0:x.columns)==null?void 0:m[i];if(!u)return;let f=r;if(ir(c,r)){const y=c.fields.findIndex(j=>j.name===r);if(y>=0){const j=c.fields[y],{baseName:_,baseLabel:k}=Qe(j),A=new Set(c.fields.map(V=>V.name).filter(Boolean)),C=new Set(c.fields.map(V=>V.label??"").filter(Boolean)),N=Xe(_,A),M=ot(k,C),U=JSON.parse(JSON.stringify(j));U.name=N,U.label=M,c.fields.splice(y+1,0,U),f=N}}const p=[...u.fields??[]],b=Math.max(0,Math.min(l,p.length));p.splice(b,0,f),u.fields=p}),addFieldAndPlaceInTabAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var _,k,A,C;const d=$e(c,s);if(!d)return;const{baseName:u,baseLabel:f}=Qe(r),p=new Set(c.fields.map(N=>N.name).filter(Boolean)),b=new Set(c.fields.map(N=>N.label??"").filter(Boolean)),g=Xe(u,p),v=ot(f,b),x=JSON.parse(JSON.stringify(r));x.name=g,x.label||(x.label=v),c.fields.push(x);const m=(C=(A=(k=(_=c.layout[d.nodeIdx].tabs[d.tabIdx].sections[n])==null?void 0:_.rows)==null?void 0:k[a])==null?void 0:A.columns)==null?void 0:C[i];if(!m)return;const y=[...m.fields??[]],j=Math.max(0,Math.min(l,y.length));y.splice(j,0,g),m.fields=y}),changeFieldType:(r,s)=>t().setSchema(n=>{const a=n.fields.findIndex(d=>d.name===r);if(a<0)return;const i=n.fields[a],c={...{name:i.name,label:i.label,width:i.width,size:i.size,info:i.info,disabled:i.disabled,visibleWhen:i.visibleWhen,disabledWhen:i.disabledWhen,clearWhen:i.clearWhen,validation:i.validation,placeholder:i.placeholder},type:s};switch(s){case"text":case"email":case"password":case"number":break;case"textarea":c.maxLength=i.maxLength??void 0,c.showCounter=i.showCounter??!1;break;case"select":c.options=Array.isArray(i.options)?i.options:[],c.multiple=!!i.multiple,c.loadOptions=i.loadOptions??void 0;break;case"checkbox":c.defaultValue=!!i.defaultValue,delete c.placeholder;break;case"date":c.showTime=!!i.showTime;break;case"file":c.maxFiles=i.maxFiles??1,c.accept=i.accept??"",delete c.placeholder;break}s!=="select"&&(delete c.options,delete c.multiple,delete c.loadOptions),s!=="textarea"&&(delete c.maxLength,delete c.showCounter),s!=="checkbox"&&delete c.defaultValue,s!=="date"&&delete c.showTime,s!=="file"&&(delete c.maxFiles,delete c.accept),n.fields[a]=c})}));function an(e,t){const r=(e.columns??[]).flatMap(a=>a.fields??[]),s=t.length,n=t.map(a=>({width:a,fields:[]}));r.forEach((a,i)=>n[i%s].fields.push(a)),e.columns=n}function on(e,t,r){const s=[];return e===null?s.push("hidden"):s.push(`w-[${rn(dr(e))}%]`,"block"),t===null?s.push("md:hidden"):s.push(`md:w-[${rn(dr(t))}%]`,"md:block"),r===null?s.push("lg:hidden"):s.push(`lg:w-[${rn(dr(r))}%]`,"lg:block"),s.join(" ")}function Tf(e,t){const r=e.columns??[];if(r.length===t)return r;if(r.length<t){const n=t-r.length,a=[...r];for(let i=0;i<n;i++)a.push({width:"w-[100%]",fields:[]});return e.columns=a,a}const s=r.slice(0,t);for(let n=t;n<r.length;n++)s[t-1].fields=[...s[t-1].fields??[],...r[n].fields??[]];return e.columns=s,s}function ln(e,t){const r=Array.from({length:t},()=>[]);return e.forEach((s,n)=>r[n%t].push(s)),r}const Vs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function br(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ra(e){return"nodeType"in e}function Ye(e){var t,r;return e?br(e)?e:ra(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function sa(e){const{Document:t}=Ye(e);return e instanceof t}function Ur(e){return br(e)?!1:e instanceof Ye(e).HTMLElement}function sl(e){return e instanceof Ye(e).SVGElement}function gr(e){return e?br(e)?e.document:ra(e)?sa(e)?e:Ur(e)||sl(e)?e.ownerDocument:document:document:document}const _t=Vs?h.useLayoutEffect:h.useEffect;function Bs(e){const t=h.useRef(e);return _t(()=>{t.current=e}),h.useCallback(function(){for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t.current==null?void 0:t.current(...s)},[])}function _f(){const e=h.useRef(null),t=h.useCallback((s,n)=>{e.current=setInterval(s,n)},[]),r=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Dr(e,t){t===void 0&&(t=[e]);const r=h.useRef(e);return _t(()=>{r.current!==e&&(r.current=e)},t),r}function qr(e,t){const r=h.useRef();return h.useMemo(()=>{const s=e(r.current);return r.current=s,s},[...t])}function Cs(e){const t=Bs(e),r=h.useRef(null),s=h.useCallback(n=>{n!==r.current&&(t==null||t(n,r.current)),r.current=n},[]);return[r,s]}function As(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let cn={};function Us(e,t){return h.useMemo(()=>{if(t)return t;const r=cn[e]==null?0:cn[e]+1;return cn[e]=r,e+"-"+r},[e,t])}function nl(e){return function(t){for(var r=arguments.length,s=new Array(r>1?r-1:0),n=1;n<r;n++)s[n-1]=arguments[n];return s.reduce((a,i)=>{const l=Object.entries(i);for(const[c,d]of l){const u=a[c];u!=null&&(a[c]=u+e*d)}return a},{...t})}}const ur=nl(1),Ts=nl(-1);function Ff(e){return"clientX"in e&&"clientY"in e}function na(e){if(!e)return!1;const{KeyboardEvent:t}=Ye(e.target);return t&&e instanceof t}function Of(e){if(!e)return!1;const{TouchEvent:t}=Ye(e.target);return t&&e instanceof t}function _s(e){if(Of(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Ff(e)?{x:e.clientX,y:e.clientY}:null}const Mr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Mr.Translate.toString(e),Mr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:s}=e;return t+" "+r+"ms "+s}}}),uo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Rf(e){return e.matches(uo)?e:e.querySelector(uo)}const Df={display:"none"};function Mf(e){let{id:t,value:r}=e;return h.createElement("div",{id:t,style:Df},r)}function $f(e){let{id:t,announcement:r,ariaLiveType:s="assertive"}=e;const n={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h.createElement("div",{id:t,style:n,role:"status","aria-live":s,"aria-atomic":!0},r)}function Lf(){const[e,t]=h.useState("");return{announce:h.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const al=h.createContext(null);function Pf(e){const t=h.useContext(al);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zf(){const[e]=h.useState(()=>new Set),t=h.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[h.useCallback(s=>{let{type:n,event:a}=s;e.forEach(i=>{var l;return(l=i[n])==null?void 0:l.call(i,a)})},[e]),t]}const If={draggable:`
61
+ `,children:[o.jsx(Vn,{className:"w-5 h-5 text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]"}),o.jsx("span",{className:"sr-only",children:"Cerrar modal"})]})]}),o.jsx("div",{className:"px-6 py-6 text-[var(--color-ds-text-primary)]",children:s}),n&&o.jsx("div",{className:"px-6 py-4 border-t border-[var(--color-ds-border-muted)] bg-[var(--color-ds-background-surface)]",children:n})]})})]}),document.body):null),Qn=({items:e,selected:t,onSelect:r,level:s=0})=>{const[n,a]=h.useState(new Set),i=l=>{const c=new Set(n);s===0?(c.clear(),n.has(l)||c.add(l)):c.has(l)?c.delete(l):c.add(l),a(c)};return o.jsx("ul",{className:se(s>0?"mt-1":"mt-0"),children:e.map(l=>{var g;const c=l.value===t,d=n.has(l.value),u=["pl-2","pl-2","pl-2"][s]||"pl-4",f=s===0?d||c?"bg-[var(--color-ds-background-accent)] text-[var(--color-ds-text-on-accent)] rounded-r-lg":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]":c?"bg-[var(--color-ds-background-surface)] text-[var(--color-ds-text-primary)]":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]",p=s===0&&(d||c)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",b=!!((g=l.children)!=null&&g.length);return o.jsxs("li",{children:[o.jsxs("button",{type:"button",onClick:()=>b?i(l.value):r(l.value),"aria-expanded":b?d:void 0,className:se("w-full flex items-center justify-between h-8 transition-colors",u,f),children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[s===0&&l.icon&&o.jsx(l.icon,{className:"w-5 h-5 ml-2"}),o.jsx("span",{className:"text-ds-sm",children:l.label})]}),b&&(d?o.jsx(Rs,{className:se("w-4 h-4",p)}):o.jsx(Lo,{className:se("w-4 h-4",p)}))]}),b&&o.jsx("div",{className:se("overflow-hidden transition-[max-height] duration-300 ease-in-out","border-l-1 border-[var(--color-ds-background-accent)] ml-6",d?"max-h-screen":"max-h-0"),children:o.jsx(Qn,{items:l.children,selected:t,onSelect:r,level:s+1})})]},l.value)})})},sf="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23FFFFFF;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",nf="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23005751;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",Gi=({appName:e,orgName:t,username:r,footerText:s,navItems:n,selectedNav:a,onSelectNav:i,width:l="200px"})=>{const{theme:c}=Xn(),d=c==="dark"?sf:nf;return o.jsxs("aside",{className:"flex flex-col h-screen bg-[var(--color-ds-background-page)]",style:{width:l},children:[o.jsxs("div",{className:"flex gap-1 flex-col items-center py-4 space-y-1",children:[o.jsx("img",{src:d,alt:"Logo Diputación",className:"w-20 h-20"}),o.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-lg ",children:e}),o.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:t}),o.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:r}),o.jsx("div",{className:"w-1/5 h-0.5 rounded-full bg-[var(--color-ds-background-accent)] mt-2"})]}),o.jsx("nav",{className:"flex-1 overflow-auto pt-3",children:o.jsx(Qn,{items:n,selected:a,onSelect:i})}),o.jsx("div",{className:"px-4 w-full py-3",children:o.jsx("span",{className:"text-ds-sm w-full text-center text-[var(--color-ds-text-secondary)]",children:s})})]})};function af({hideSidebar:e=!1,sidebar:t,header:r,children:s}){const{dark:n}=Xn(),a={...r,dark:n};return o.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[!e&&o.jsx(Gi,{...t}),o.jsxs("div",{className:`flex-1 flex flex-col overflow-auto [scrollbar-gutter:stable_both-edges] ${e?"px-0":"px-10"}`,children:[o.jsx(Ki,{...a}),o.jsx("main",{className:"flex-1 min-h-0",children:s})]})]})}function of({columns:e,data:t,loadData:r,loading:s,idAccessor:n,multiSelect:a=!1,onSelectionChange:i,pageSize:l=10,initialSort:c,onSort:d,className:u,onRowDoubleClick:f}){const p=t!==void 0,[b,g]=h.useState([]),[v,x]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>{var Y;if(!r||p)return;(Y=m.current)==null||Y.abort();const z=new AbortController;return m.current=z,x(!0),r().then(D=>{z.signal.aborted||g(D)}).finally(()=>{z.signal.aborted||x(!1)}),()=>z.abort()},[r,p]);const y=h.useMemo(()=>p?t:b,[t,b,p]),j=s??(r?v:!1),[_,k]=h.useState(new Set),[A,C]=h.useState(1),[N,M]=h.useState(c==null?void 0:c.sortBy),[U,V]=h.useState((c==null?void 0:c.sortDir)??"asc"),W=z=>typeof n=="function"?n(z):z[n],$=h.useRef(null);h.useEffect(()=>{$.current!==y&&(k(new Set),C(1),$.current=y)},[y]);const L=h.useMemo(()=>{if(!N)return y;const z=U==="asc"?1:-1;return[...y].sort((Y,D)=>{const T=Y[N],Z=D[N];return T==null?-z:Z==null||T>Z?z:T<Z?-z:0})},[y,N,U]),S=Math.max(1,Math.ceil(L.length/l)),te=h.useMemo(()=>{const z=(A-1)*l;return L.slice(z,z+l)},[L,A,l]),ie=z=>{const Y=new Set(_);Y.has(z)?Y.delete(z):Y.add(z),k(Y),i==null||i(y.filter(D=>Y.has(W(D))))},K=()=>{const z=te.every(D=>_.has(W(D))),Y=new Set(_);te.forEach(D=>{z?Y.delete(W(D)):Y.add(W(D))}),k(Y),i==null||i(y.filter(D=>Y.has(W(D))))},me=z=>{if(!z.sortable)return;const Y=typeof z.accessor=="string"?z.accessor:z.sortKey;if(N===Y){const D=U==="asc"?"desc":"asc";V(D),d==null||d(Y,D)}else M(Y),V("asc"),d==null||d(Y,"asc");C(1)},I=()=>j?o.jsx("tbody",{children:Array.from({length:l}).map((z,Y)=>o.jsxs("tr",{children:[a&&o.jsx("td",{className:"px-3 py-2",children:o.jsx(Xt,{width:"1rem",height:"1rem",variant:"circle"})}),e.map((D,T)=>o.jsx("td",{className:"px-4 py-2",children:o.jsx(Xt,{width:"100%",height:"1em",variant:"rect"})},T))]},Y))}):te.length?o.jsx("tbody",{className:"bg-[var(--color-ds-background-surface)]",children:te.map(z=>{const Y=W(z);return o.jsxs("tr",{className:se("transition-colors","hover:bg-[var(--color-ds-border-default-50)]",f&&"cursor-pointer select-none"),onDoubleClick:f?()=>f(z):void 0,title:f?"Doble clic para abrir":void 0,children:[a&&o.jsx("td",{className:"px-3 py-2",children:o.jsx("input",{type:"checkbox",className:"accent-[var(--color-ds-button-primary-bg)]",checked:_.has(Y),onChange:()=>ie(Y),onDoubleClick:D=>D.stopPropagation()})}),e.map((D,T)=>{const Z=D.render?D.render(z):typeof D.accessor=="function"?D.accessor(z):z[D.accessor];return o.jsx("td",{className:se("px-4 py-2 whitespace-nowrap text-[var(--color-ds-text-primary)] text-sm",D.width),children:Z},`${String(D.header)}-${T}`)})]},Y)})}):o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{className:"px-4 py-6 text-center text-[var(--color-ds-text-secondary)]",colSpan:e.length+(a?1:0),children:"No hay datos"})})});return o.jsxs("div",{className:se("w-full overflow-auto rounded-lg border","border-[var(--color-ds-border-default-50)]",u),children:[o.jsxs("table",{className:"min-w-full",children:[o.jsx("thead",{className:"bg-[var(--color-ds-background-surface)] border-b border-[var(--color-ds-border-default-50)]",children:o.jsxs("tr",{children:[a&&o.jsx("th",{className:"px-3 py-2",children:o.jsx("input",{type:"checkbox",className:"accent-[var(--color-ds-button-primary-bg)]",checked:te.length>0&&te.every(z=>_.has(W(z))),onChange:K,onDoubleClick:z=>z.stopPropagation()})}),e.map(z=>{const Y=typeof z.accessor=="string"?z.accessor:z.header,D=N===(typeof z.accessor=="string"?z.accessor:z.sortKey);return o.jsx("th",{className:se("px-4 py-2 text-left text-xs font-semibold uppercase tracking-wide select-none","text-[var(--color-ds-text-secondary)]",z.width),onClick:()=>me(z),children:o.jsxs("div",{className:se("inline-flex items-center gap-1",z.sortable&&"cursor-pointer"),children:[o.jsx("span",{children:z.header}),z.sortable&&o.jsx("span",{className:se("text-[var(--color-ds-text-secondary)]"),children:D?U==="asc"?"▲":"▼":"⇵"})]})},Y)})]})}),I()]}),o.jsxs("div",{className:"flex items-center justify-between py-2 px-4 border-t border-[var(--color-ds-border-default-50)] bg-[var(--color-ds-background-page)]/40",children:[o.jsx("span",{className:"text-sm text-[var(--color-ds-text-secondary)]",children:j?"Cargando...":`Página ${A} de ${S}`}),o.jsxs("div",{className:"space-x-2",children:[o.jsx(fe,{size:"sm",variant:"outline",disabled:j||A<=1,onClick:()=>C(z=>Math.max(1,z-1)),children:"Prev"}),o.jsx(fe,{size:"sm",variant:"outline",disabled:j||A>=S,onClick:()=>C(z=>Math.min(S,z+1)),children:"Next"})]})]})]})}function Ji({control:e,name:t,rules:r,defaultValue:s=!1,checked:n,onChange:a,disabled:i=!1,label:l,labelPosition:c="right",errorMessage:d="",className:u}){const f=h.useId();if(e&&t)return o.jsx(gt,{name:t,control:e,rules:r,defaultValue:s,render:({field:b,fieldState:g})=>{var v;return o.jsx(Ji,{checked:b.value,onChange:b.onChange,disabled:i,label:l,labelPosition:c,errorMessage:((v=g.error)==null?void 0:v.message)||"",className:u})}});const p=!!n;return o.jsxs("div",{className:se("flex flex-col",u),children:[o.jsxs("label",{className:se("inline-flex items-center space-x-3 select-none",i&&"opacity-50 cursor-not-allowed"),htmlFor:f,children:[l&&c==="left"&&o.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l}),o.jsx("button",{id:f,type:"button",role:"switch","aria-checked":p,disabled:i,onClick:()=>!i&&(a==null?void 0:a(!p)),className:se("relative inline-flex items-center h-8 w-16","bg-[var(--color-ds-background-accent)] rounded-full transition-colors duration-200","focus:outline-none "),children:o.jsx("div",{className:se("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",p?"translate-x-9":"translate-x-1")})}),l&&c==="right"&&o.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l})]}),o.jsx("div",{className:"pt-1 min-h-[18px] w-full",children:d?o.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:d}):o.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Zi({items:e,value:t,onValueChange:r,multiple:s=!0,dense:n=!1,className:a}){const i=h.useMemo(()=>e.filter(g=>g.defaultOpen&&!g.disabled).map(g=>g.id),[e]),[l,c]=h.useState(i),d=t??l,u=g=>{r?r(g):c(g)},f=(g,v)=>{v&&u(s?d.includes(g)?d.filter(x=>x!==g):[...d,g]:d.includes(g)?[]:[g])},p=(g,v,x)=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),f(v,x))},b=n?"py-1":"py-2";return o.jsx("div",{className:["divide-y","divide-[var(--color-ds-border-default-50)]",a].filter(Boolean).join(" "),children:e.map(g=>{const v=d.includes(g.id),x=!g.disabled;return o.jsxs("section",{"aria-disabled":g.disabled||void 0,children:[o.jsxs("button",{type:"button",onClick:()=>f(g.id,x),onKeyDown:m=>p(m,g.id,x),"aria-expanded":v,className:["w-full flex items-center justify-between gap-2 text-left select-none",b,"text-[var(--color-ds-text-primary)]",g.disabled?"opacity-60 cursor-not-allowed":"hover:bg-[color-mix(in_srgb,var(--color-ds-background-surface)_80%,transparent)]"].join(" "),children:[o.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[g.leftAdornment&&o.jsx("span",{className:"shrink-0",children:g.leftAdornment}),o.jsx("span",{className:"font-medium truncate",children:g.title})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[g.actions,o.jsx(Rs,{className:["h-4 w-4 transition-transform",v?"rotate-180":"",g.disabled?"opacity-40":""].join(" ")})]})]}),v&&o.jsx("div",{className:[n?"py-1":"py-2"].join(" "),children:g.content})]},g.id)})})}const so=e=>{let t;const r=new Set,s=(d,u)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(b=>b(t,p))}},n=()=>t,l={setState:s,getState:n,getInitialState:()=>c,subscribe:d=>(r.add(d),()=>r.delete(d))},c=t=e(s,n,l);return l},lf=e=>e?so(e):so,cf=e=>e;function df(e,t=cf){const r=h.useSyncExternalStore(e.subscribe,h.useCallback(()=>t(e.getState()),[e,t]),h.useCallback(()=>t(e.getInitialState()),[e,t]));return h.useDebugValue(r),r}const no=e=>{const t=lf(e),r=s=>df(t,s);return Object.assign(r,t),r},uf=e=>e?no(e):no;var Yi=Symbol.for("immer-nothing"),ao=Symbol.for("immer-draftable"),ct=Symbol.for("immer-state"),ff=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function st(e,...t){if(process.env.NODE_ENV!=="production"){const r=ff[e],s=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${s}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fr=Object.getPrototypeOf;function mr(e){return!!e&&!!e[ct]}function Qt(e){var t;return e?Hi(e)||Array.isArray(e)||!!e[ao]||!!((t=e.constructor)!=null&&t[ao])||Br(e)||zs(e):!1}var mf=Object.prototype.constructor.toString();function Hi(e){if(!e||typeof e!="object")return!1;const t=fr(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===mf}function Ns(e,t){Ps(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function Ps(e){const t=e[ct];return t?t.type_:Array.isArray(e)?1:Br(e)?2:zs(e)?3:0}function _n(e,t){return Ps(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t,r){const s=Ps(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function hf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Br(e){return e instanceof Map}function zs(e){return e instanceof Set}function Gt(e){return e.copy_||e.base_}function Fn(e,t){if(Br(e))return new Map(e);if(zs(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=Hi(e);if(t===!0||t==="class_only"&&!r){const s=Object.getOwnPropertyDescriptors(e);delete s[ct];let n=Reflect.ownKeys(s);for(let a=0;a<n.length;a++){const i=n[a],l=s[i];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(s[i]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[i]})}return Object.create(fr(e),s)}else{const s=fr(e);if(s!==null&&r)return{...e};const n=Object.create(s);return Object.assign(n,e)}}function ea(e,t=!1){return Is(e)||mr(e)||!Qt(e)||(Ps(e)>1&&Object.defineProperties(e,{set:{value:os},add:{value:os},clear:{value:os},delete:{value:os}}),Object.freeze(e),t&&Object.values(e).forEach(r=>ea(r,!0))),e}function os(){st(2)}function Is(e){return Object.isFrozen(e)}var pf={};function er(e){const t=pf[e];return t||st(0,e),t}var Or;function Qi(){return Or}function bf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function oo(e,t){t&&(er("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function On(e){Rn(e),e.drafts_.forEach(gf),e.drafts_=null}function Rn(e){e===Or&&(Or=e.parent_)}function io(e){return Or=bf(Or,e)}function gf(e){const t=e[ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function lo(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[ct].modified_&&(On(t),st(4)),Qt(e)&&(e=Ss(t,e),t.parent_||Es(t,e)),t.patches_&&er("Patches").generateReplacementPatches_(r[ct].base_,e,t.patches_,t.inversePatches_)):e=Ss(t,r,[]),On(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Yi?e:void 0}function Ss(e,t,r){if(Is(t))return t;const s=t[ct];if(!s)return Ns(t,(n,a)=>co(e,s,t,n,a,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return Es(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const n=s.copy_;let a=n,i=!1;s.type_===3&&(a=new Set(n),n.clear(),i=!0),Ns(a,(l,c)=>co(e,s,n,l,c,r,i)),Es(e,n,!1),r&&e.patches_&&er("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function co(e,t,r,s,n,a,i){if(process.env.NODE_ENV!=="production"&&n===r&&st(5),mr(n)){const l=a&&t&&t.type_!==3&&!_n(t.assigned_,s)?a.concat(s):void 0,c=Ss(e,n,l);if(Xi(r,s,c),mr(c))e.canAutoFreeze_=!1;else return}else i&&r.add(n);if(Qt(n)&&!Is(n)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ss(e,n),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&(Br(r)?r.has(s):Object.prototype.propertyIsEnumerable.call(r,s))&&Es(e,n)}}function Es(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ea(t,r)}function xf(e,t){const r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:Qi(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=s,a=ta;r&&(n=[s],a=Rr);const{revoke:i,proxy:l}=Proxy.revocable(n,a);return s.draft_=l,s.revoke_=i,l}var ta={get(e,t){if(t===ct)return e;const r=Gt(e);if(!_n(r,t))return vf(e,r,t);const s=r[t];return e.finalized_||!Qt(s)?s:s===en(e.base_,t)?(tn(e),e.copy_[t]=Mn(s,e)):s},has(e,t){return t in Gt(e)},ownKeys(e){return Reflect.ownKeys(Gt(e))},set(e,t,r){const s=el(Gt(e),t);if(s!=null&&s.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){const n=en(Gt(e),t),a=n==null?void 0:n[ct];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(hf(r,n)&&(r!==void 0||_n(e.base_,t)))return!0;tn(e),Dn(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return en(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,tn(e),Dn(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Gt(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){st(11)},getPrototypeOf(e){return fr(e.base_)},setPrototypeOf(){st(12)}},Rr={};Ns(ta,(e,t)=>{Rr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Rr.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&st(13),Rr.set.call(this,e,t,void 0)};Rr.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&st(14),ta.set.call(this,e[0],t,r,e[0])};function en(e,t){const r=e[ct];return(r?Gt(r):e)[t]}function vf(e,t,r){var n;const s=el(t,r);return s?"value"in s?s.value:(n=s.get)==null?void 0:n.call(e.draft_):void 0}function el(e,t){if(!(t in e))return;let r=fr(e);for(;r;){const s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=fr(r)}}function Dn(e){e.modified_||(e.modified_=!0,e.parent_&&Dn(e.parent_))}function tn(e){e.copy_||(e.copy_=Fn(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var yf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const i=this;return function(c=a,...d){return i.produce(c,u=>r.call(this,u,...d))}}typeof r!="function"&&st(6),s!==void 0&&typeof s!="function"&&st(7);let n;if(Qt(t)){const a=io(this),i=Mn(t,void 0);let l=!0;try{n=r(i),l=!1}finally{l?On(a):Rn(a)}return oo(a,s),lo(n,a)}else if(!t||typeof t!="object"){if(n=r(t),n===void 0&&(n=t),n===Yi&&(n=void 0),this.autoFreeze_&&ea(n,!0),s){const a=[],i=[];er("Patches").generateReplacementPatches_(t,n,a,i),s(a,i)}return n}else st(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...l)=>this.produceWithPatches(i,c=>t(c,...l));let s,n;return[this.produce(t,r,(i,l)=>{s=i,n=l}),s,n]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Qt(e)||st(8),mr(e)&&(e=wf(e));const t=io(this),r=Mn(e,void 0);return r[ct].isManual_=!0,Rn(t),r}finishDraft(e,t){const r=e&&e[ct];(!r||!r.isManual_)&&st(9);const{scope_:s}=r;return oo(s,t),lo(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(n.path.length===0&&n.op==="replace"){e=n.value;break}}r>-1&&(t=t.slice(r+1));const s=er("Patches").applyPatches_;return mr(e)?s(e,t):this.produce(e,n=>s(n,t))}};function Mn(e,t){const r=Br(e)?er("MapSet").proxyMap_(e,t):zs(e)?er("MapSet").proxySet_(e,t):xf(e,t);return(t?t.scope_:Qi()).drafts_.push(r),r}function wf(e){return mr(e)||st(10,e),tl(e)}function tl(e){if(!Qt(e)||Is(e))return e;const t=e[ct];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Fn(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Fn(e,!0);return Ns(r,(s,n)=>{Xi(r,s,tl(n))}),t&&(t.finalized_=!1),r}var jf=new yf,kf=jf.produce;const rn=e=>Number(e.toFixed(2)),dr=e=>Math.max(0,Math.min(100,e??0)),Nf={text:{name:"text",label:"Texto"},number:{name:"number",label:"Número"},email:{name:"email",label:"Email"},select:{name:"select",label:"Select"},checkbox:{name:"checkbox",label:"Checkbox"},date:{name:"date",label:"Fecha"},textarea:{name:"textarea",label:"Textarea"},file:{name:"file",label:"Archivo"}},_e=e=>e.layout.find(t=>t.type==="rows"),mt=(e,t)=>{if(t==null)return _e(e);const r=e.layout[t];return r&&r.type==="rows"?r:_e(e)},sn=e=>e<=1?["w-full"]:e===2?["w-1/2","w-1/2"]:e===3?["w-1/3","w-1/3","w-1/3"]:Array.from({length:e},()=>"flex-1"),nn={1:["w-full"],2:["w-1/2","w-1/2"],3:["w-1/3","w-1/3","w-1/3"],4:["w-1/4","w-1/4","w-1/4","w-1/4"],"1/3-2/3":["w-1/3","w-2/3"],"2/3-1/3":["w-2/3","w-1/3"],"1/4-3/4":["w-1/4","w-3/4"],"3/4-1/4":["w-3/4","w-1/4"]},$e=(e,t)=>{for(let r=0;r<e.layout.length;r++){const s=e.layout[r];if((s==null?void 0:s.type)!=="tabs")continue;const n=s.tabs.findIndex(a=>a.key===t);if(n>=0)return{nodeIdx:r,tabIdx:n}}return null},Sf=e=>{const t=[];return e.layout.forEach(r=>{r.type==="rows"&&r.sections.forEach(s=>s.rows.forEach(n=>n.columns.forEach(a=>(a.fields??[]).forEach(i=>t.push(i))))),r.type==="tabs"&&r.tabs.forEach(s=>s.sections.forEach(n=>n.rows.forEach(a=>a.columns.forEach(i=>(i.fields??[]).forEach(l=>t.push(l))))))}),t},Ef=e=>({type:"rows",sections:[{sectionTitle:e??"Sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}),Cf=()=>({type:"tabs",tabs:[{key:`tab_${Date.now().toString(36)}_1`,label:"Pestaña 1",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]},{key:`tab_${Date.now().toString(36)}_2`,label:"Pestaña 2",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}]}),ir=(e,t)=>Sf(e).includes(t),$n=e=>e.replace(/(?:_copy)+$/i,"").replace(/_(\d+)$/i,""),rl=e=>e.replace(/\s\((\d+)\)$/i,""),Xe=(e,t)=>{const r=e||"campo";if(!t.has(r))return r;let s=2;for(;t.has(`${r}_${s}`);)s++;return`${r}_${s}`},ot=(e,t)=>{const r=e||"Campo";if(!t.has(r))return r;let s=2;for(;t.has(`${r} (${s})`);)s++;return`${r} (${s})`},Qe=e=>{const t=(e.type??"text").toString(),r=Nf[t]??{name:"campo",label:"Campo"},s=e.name?$n(e.name):r.name,n=e.label?rl(e.label):r.label;return{baseName:s,baseLabel:n}},Af={layout:[{type:"rows",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}],fields:[],onSubmit:async()=>{},successMessage:"Guardado",errorMessage:"Error"},J=uf((e,t)=>({schema:Af,selection:{kind:"none"},past:[],future:[],setSchema:r=>{const s=t().schema,n=kf(s,r),a=n;e(i=>({...i,schema:a,past:[...i.past,s],future:[]}))},setSelection:r=>e({selection:r}),undo:()=>e(r=>r.past.length?{schema:r.past[r.past.length-1],past:r.past.slice(0,-1),future:[r.schema,...r.future]}:r),redo:()=>e(r=>r.future.length?{schema:r.future[0],past:[...r.past,r.schema],future:r.future.slice(1)}:r),resetHistory:()=>e(r=>({past:[],future:[]})),addField:r=>t().setSchema(s=>{const{baseName:n,baseLabel:a}=Qe(r),i=new Set(s.fields.map(u=>u.name).filter(Boolean)),l=new Set(s.fields.map(u=>u.label??"").filter(Boolean)),c=Xe(n,i),d=ot(a,l);r.name=c,r.label||(r.label=d),s.fields.push(r)}),addFieldAt:(r,s)=>t().setSchema(n=>{const{baseName:a,baseLabel:i}=Qe(r),l=new Set(n.fields.map(p=>p.name).filter(Boolean)),c=new Set(n.fields.map(p=>p.label??"").filter(Boolean)),d=Xe(a,l),u=ot(i,c);r.name=d,r.label||(r.label=u);const f=Math.max(0,Math.min(s??n.fields.length,n.fields.length));n.fields.splice(f,0,r)}),removeField:r=>t().setSchema(s=>{s.fields=s.fields.filter(n=>n.name!==r),s.layout.forEach(n=>{n.type==="rows"&&n.sections.forEach(a=>a.rows.forEach(i=>i.columns.forEach(l=>{l.fields=(l.fields??[]).filter(c=>c!==r)}))),n.type==="tabs"&&n.tabs.forEach(a=>a.sections.forEach(i=>i.rows.forEach(l=>l.columns.forEach(c=>{c.fields=(c.fields??[]).filter(d=>d!==r)}))))})}),updateField:(r,s)=>t().setSchema(n=>{const a=n.fields.findIndex(i=>i.name===r);a>=0&&s(n.fields[a])}),duplicateField:(r,s)=>t().setSchema(n=>{const a=n.fields.findIndex(g=>g.name===r);if(a<0)return;const i=n.fields[a],l=$n((s==null?void 0:s.trim())||i.name||""),c=rl(i.label??""),d=new Set(n.fields.map(g=>g.name).filter(Boolean)),u=new Set(n.fields.map(g=>g.label??"").filter(Boolean)),f=Xe(l||Qe(i).baseName,d),p=ot(c||Qe(i).baseLabel,u),b=JSON.parse(JSON.stringify(i));b.name=f,b.label=p,n.fields.splice(a+1,0,b)}),renameField:(r,s)=>t().setSchema(n=>{const a=n.fields.findIndex(d=>d.name===r);if(a<0)return;const i=$n((s??r).trim()||"campo"),l=new Set(n.fields.map(d=>d.name).filter(Boolean));l.delete(r);const c=Xe(i,l);n.fields[a].name=c,n.layout.forEach(d=>{d.type==="rows"&&d.sections.forEach(u=>u.rows.forEach(f=>f.columns.forEach(p=>{p.fields&&(p.fields=p.fields.map(b=>b===r?c:b))}))),d.type==="tabs"&&d.tabs.forEach(u=>u.sections.forEach(f=>f.rows.forEach(p=>p.columns.forEach(b=>{b.fields&&(b.fields=b.fields.map(g=>g===r?c:g))}))))})}),addSection:r=>t().setSchema(s=>{const n=_e(s);if(!n)return;const a={sectionTitle:r??"Nueva sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]};n.sections.push(a)}),renameSection:(r,s)=>t().setSchema(n=>{const a=_e(n);if(!a)return;const i=a.sections[r];i&&(i.sectionTitle=(s??"").trim()||"Sección")}),moveSection:(r,s,n)=>e(a=>{const i=[...a.schema.layout],l=i[r];if(!l||l.type!=="rows")return a;const c=[...l.sections],[d]=c.splice(s,1),u=Math.max(0,Math.min(n,c.length));return c.splice(u,0,d),i[r]={...l,sections:c},{schema:{...a.schema,layout:i}}}),removeSection:r=>t().setSchema(s=>{const n=_e(s);if(!n||r<0||r>=n.sections.length)return;const a=[...n.sections];a.splice(r,1),n.sections=a}),duplicateSection:r=>t().setSchema(s=>{const n=_e(s);if(!n)return;const a=n.sections[r];if(!a)return;const i=JSON.parse(JSON.stringify(a)),l=(a.sectionTitle||"Sección").toString(),c=n.sections.map(f=>f.sectionTitle||""),d=new Set(c);let u=l;if(d.has(u)){let f=2;for(;d.has(`${l} (${f})`);)f++;u=`${l} (${f})`}i.sectionTitle=u,n.sections.splice(r+1,0,i)}),addRowsBlockAt:(r,s)=>t().setSchema(n=>{const a=Math.max(0,Math.min(r,n.layout.length));n.layout.splice(a,0,Ef(s))}),addTabsContainerAt:r=>t().setSchema(s=>{const n=Math.max(0,Math.min(r,s.layout.length));s.layout.splice(n,0,Cf())}),moveLayoutNode:(r,s)=>t().setSchema(n=>{const a=n.layout.length;if(r<0||r>=a)return;const i=Math.max(0,Math.min(s,a-1));if(r===i)return;const l=[...n.layout],[c]=l.splice(r,1);l.splice(i,0,c),n.layout=l}),removeLayoutNode:r=>t().setSchema(s=>{if(r<0||r>=s.layout.length)return;const n=[...s.layout];n.splice(r,1),s.layout=n}),addTabsContainer:()=>t().setSchema(r=>{const s={type:"tabs",tabs:[{key:"tab1",label:"Pestaña 1",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]},{key:"tab2",label:"Pestaña 2",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}]};r.layout.push(s)}),addTabAfter:r=>t().setSchema(s=>{const n=$e(s,r);if(!n)return;const a=s.layout[n.nodeIdx],i="Nueva pestaña",l=new Set(a.tabs.map(f=>f.label));let c=i,d=2;for(;l.has(c);)c=`${i} (${d++})`;const u={key:`tab_${Date.now().toString(36)}`,label:c,sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]};a.tabs.splice(n.tabIdx+1,0,u)}),removeTab:r=>t().setSchema(s=>{const n=$e(s,r);if(!n)return;const a=s.layout[n.nodeIdx];a.tabs.length<=1||a.tabs.splice(n.tabIdx,1)}),renameTab:(r,s)=>t().setSchema(n=>{const a=$e(n,r);if(!a)return;const i=n.layout[a.nodeIdx];i.tabs[a.tabIdx].label=(s??"").trim()||"Pestaña"}),moveTab:(r,s,n)=>e(a=>{const i=[...a.schema.layout],l=i[r];if(!l||l.type!=="tabs")return a;const c=[...l.tabs],[d]=c.splice(s,1),u=Math.max(0,Math.min(n,c.length));return c.splice(u,0,d),i[r]={...l,tabs:c},{schema:{...a.schema,layout:i}}}),moveTabSection:(r,s,n,a)=>e(i=>{const l=[...i.schema.layout],c=l[r];if(!c||c.type!=="tabs")return i;const d=c.tabs.find(g=>g.key===s);if(!d)return i;const u=[...d.sections],[f]=u.splice(n,1),p=Math.max(0,Math.min(a,u.length));u.splice(p,0,f);const b=c.tabs.map(g=>g.key===s?{...g,sections:u}:g);return l[r]={...c,tabs:b},{schema:{...i.schema,layout:l}}}),addSectionToTab:(r,s)=>t().setSchema(n=>{const a=$e(n,r);if(!a)return;n.layout[a.nodeIdx].tabs[a.tabIdx].sections.push({sectionTitle:s??"Nueva sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]})}),addRowToTabSection:(r,s)=>t().setSchema(n=>{var l;const a=$e(n,r);if(!a)return;(l=n.layout[a.nodeIdx].tabs[a.tabIdx].sections[s])==null||l.rows.push({title:"",columns:[{width:"w-full",fields:[]}]})}),renameTabSection:(r,s,n)=>t().setSchema(a=>{const i=$e(a,r);if(!i)return;const c=a.layout[i.nodeIdx].tabs[i.tabIdx].sections[s];c&&(c.sectionTitle=(n??"").trim()||"Sección")}),setTabRowColumns:(r,s,n,a)=>t().setSchema(i=>{var b,g;const l=$e(i,r);if(!l)return;const d=(g=(b=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[s])==null?void 0:b.rows)==null?void 0:g[n];if(!d)return;const u=(d.columns??[]).flatMap(v=>v.fields??[]),f=sn(a),p=Array.from({length:a},(v,x)=>({width:f[x],fields:[]}));u.forEach((v,x)=>p[x%a].fields.push(v)),d.columns=p}),addColumnToTabRow:(r,s,n)=>t().setSchema(a=>{var d,u;const i=$e(a,r);if(!i)return;const c=(u=(d=a.layout[i.nodeIdx].tabs[i.tabIdx].sections[s])==null?void 0:d.rows)==null?void 0:u[n];c&&c.columns.push({width:"w-1/2",fields:[]})}),removeTabColumn:(r,s,n,a)=>t().setSchema(i=>{var g,v;const l=$e(i,r);if(!l)return;const d=(v=(g=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[s])==null?void 0:g.rows)==null?void 0:v[n];if(!d)return;const u=d.columns??[];if(!u[a])return;const f=u[a],p=a>0?a-1:u[a+1]?a+1:-1,b=[...u];b.splice(a,1),p>=0&&b[p]&&(b[p].fields=[...b[p].fields??[],...f.fields??[]]),d.columns=b}),placeFieldInTabColumn:(r,s,n,a,i)=>t().setSchema(l=>{const c=$e(l,s);if(!c)return;const u=l.layout[c.nodeIdx].tabs[c.tabIdx].sections[n].rows[a].columns[i];let f=r;if(ir(l,r)){const p=l.fields.findIndex(b=>b.name===r);if(p>=0){const b=l.fields[p],{baseName:g,baseLabel:v}=Qe(b),x=new Set(l.fields.map(_=>_.name).filter(Boolean)),m=new Set(l.fields.map(_=>_.label??"").filter(Boolean));f=Xe(g,x);const y=ot(v,m),j=JSON.parse(JSON.stringify(b));j.name=f,j.label=y,l.fields.splice(p+1,0,j)}}u.fields=[...u.fields??[],f]}),moveFieldInTab:(r,s)=>t().setSchema(n=>{var b,g,v,x;const a=$e(n,r.tabKey);if(!a)return;const i=n.layout[a.nodeIdx],l=(g=(b=i.tabs[a.tabIdx].sections[r.s])==null?void 0:b.rows[r.r])==null?void 0:g.columns[r.c],c=(x=(v=i.tabs[a.tabIdx].sections[s.s])==null?void 0:v.rows[s.r])==null?void 0:x.columns[s.c];if(!l||!c)return;const d=[...l.fields??[]];if(r.idx<0||r.idx>=d.length)return;const[u]=d.splice(r.idx,1);l.fields=d;const f=[...c.fields??[]],p=s.idx===void 0?f.length:Math.max(0,Math.min(s.idx,f.length));f.splice(p,0,u),c.fields=f}),removeFieldFromTabLayout:r=>t().setSchema(s=>{var c,d;const n=$e(s,r.tabKey);if(!n)return;const i=(d=(c=s.layout[n.nodeIdx].tabs[n.tabIdx].sections[r.s])==null?void 0:c.rows[r.r])==null?void 0:d.columns[r.c];if(!i||!i.fields||r.idx<0||r.idx>=i.fields.length)return;const l=[...i.fields];l.splice(r.idx,1),i.fields=l}),moveRowInSection:(r,s,n)=>t().setSchema(a=>{const i=_e(a);if(!i)return;const l=i.sections[r];if(!l)return;const c=[...l.rows];if(s<0||s>=c.length)return;const d=Math.max(0,Math.min(n,c.length-1));if(s===d)return;const[u]=c.splice(s,1);c.splice(d,0,u),l.rows=c}),duplicateRowInSection:(r,s)=>t().setSchema(n=>{const a=_e(n);if(!a)return;const i=a.sections[r];if(!i)return;const l=i.rows[s];if(!l)return;const c=JSON.parse(JSON.stringify(l));i.rows.splice(s+1,0,c)}),removeRowFromSection:(r,s)=>t().setSchema(n=>{const a=_e(n);if(!a)return;const i=a.sections[r];if(!i)return;const l=[...i.rows];s<0||s>=l.length||(l.splice(s,1),l.length===0&&l.push({title:"",columns:[{width:"w-full",fields:[]}]}),i.rows=l)}),setRowColumnsPreset:(r,s,n)=>t().setSchema(a=>{var d,u;const i=_e(a);if(!i)return;const l=(u=(d=i.sections[r])==null?void 0:d.rows)==null?void 0:u[s];if(!l)return;const c=nn[n];c&&an(l,c)}),setRowResponsive:(r,s,n)=>t().setSchema(a=>{var b,g;const i=_e(a);if(!i)return;const l=(g=(b=i.sections[Number(r)])==null?void 0:b.rows)==null?void 0:g[Number(s)];if(!l)return;const c=Math.max(n.desktop.count??1,n.tablet.count??1,n.mobile.count??1),d=(l.columns??[]).flatMap(v=>v.fields??[]),u=ln(d,c),f=(v,x,m)=>x<(m??0)?dr((v==null?void 0:v[x])??0):null,p=Array.from({length:c},(v,x)=>{const m=f(n.mobile.widths,x,n.mobile.count),y=f(n.tablet.widths,x,n.tablet.count),j=f(n.desktop.widths,x,n.desktop.count);return{width:on(m,y,j),fields:u[x]??[]}});l.columns=p}),setRowColumnsAt:(r,s,n,a)=>t().setSchema(i=>{var p,b;const l=mt(i,r);if(!l)return;const c=(b=(p=l.sections[s])==null?void 0:p.rows)==null?void 0:b[n];if(!c)return;const d=(c.columns??[]).flatMap(g=>g.fields??[]),u=sn(a),f=Array.from({length:a},(g,v)=>({width:u[v],fields:[]}));d.forEach((g,v)=>f[v%a].fields.push(g)),c.columns=f}),addColumnToRowAt:(r,s,n)=>t().setSchema(a=>{var l,c,d,u;const i=mt(a,r);i&&((u=(d=(c=(l=i.sections[s])==null?void 0:l.rows)==null?void 0:c[n])==null?void 0:d.columns)==null||u.push({width:"w-1/2",fields:[]}))}),removeColumnAt:(r,s,n,a)=>t().setSchema(i=>{var b,g;const l=mt(i,r);if(!l)return;const c=(g=(b=l.sections[s])==null?void 0:b.rows)==null?void 0:g[n];if(!c)return;const d=c.columns??[];if(!d[a])return;const u=d[a],f=a>0?a-1:d[a+1]?a+1:-1,p=[...d];p.splice(a,1),f>=0&&p[f]&&(p[f].fields=[...p[f].fields??[],...u.fields??[]]),c.columns=p}),setRowColumnsPresetAt:(r,s,n,a)=>t().setSchema(i=>{var u,f;const l=mt(i,r);if(!l)return;const c=(f=(u=l.sections[s])==null?void 0:u.rows)==null?void 0:f[n];if(!c)return;const d=nn[a];d&&an(c,d)}),setRowResponsiveAt:(r,s,n,a)=>t().setSchema(i=>{var g,v;const l=mt(i,r);if(!l)return;const c=(v=(g=l.sections[Number(s)])==null?void 0:g.rows)==null?void 0:v[Number(n)];if(!c)return;const d=Math.max(a.desktop.count??1,a.tablet.count??1,a.mobile.count??1),u=(x,m,y)=>m<(y??0)?dr((x==null?void 0:x[m])??0):null,f=Tf(c,d),p=f.flatMap(x=>x.fields??[]),b=ln(p,d);for(let x=0;x<d;x++){const m=u(a.mobile.widths,x,a.mobile.count),y=u(a.tablet.widths,x,a.tablet.count),j=u(a.desktop.widths,x,a.desktop.count);f[x].width=on(m,y,j),f[x].fields=b[x]??[]}}),placeFieldInColumnAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var g,v,x,m;const d=mt(c,r);if(!d)return;const u=(m=(x=(v=(g=d.sections[n])==null?void 0:g.rows)==null?void 0:v[a])==null?void 0:x.columns)==null?void 0:m[i];if(!u)return;let f=s;if(ir(c,s)){const y=c.fields.findIndex(j=>j.name===s);if(y>=0){const j=c.fields[y],{baseName:_,baseLabel:k}=Qe(j),A=new Set(c.fields.map(U=>U.name).filter(Boolean)),C=new Set(c.fields.map(U=>U.label??"").filter(Boolean));f=Xe(_,A);const N=ot(k,C),M=JSON.parse(JSON.stringify(j));M.name=f,M.label=N,c.fields.splice(y+1,0,M)}}const p=[...u.fields??[]],b=l===void 0?p.length:Math.max(0,Math.min(l,p.length));p.splice(b,0,f),u.fields=p}),moveFieldAt:(r,s,n,a)=>t().setSchema(i=>{var v,x,m,y,j,_,k,A;const l=mt(i,r),c=mt(i,n);if(!l||!c)return;const d=(y=(m=(x=(v=l.sections[s.s])==null?void 0:v.rows)==null?void 0:x[s.r])==null?void 0:m.columns)==null?void 0:y[s.c],u=(A=(k=(_=(j=c.sections[a.s])==null?void 0:j.rows)==null?void 0:_[a.r])==null?void 0:k.columns)==null?void 0:A[a.c];if(!d||!u)return;const f=[...d.fields??[]];if(s.idx<0||s.idx>=f.length)return;const[p]=f.splice(s.idx,1);d.fields=f;const b=[...u.fields??[]],g=a.idx===void 0?b.length:Math.max(0,Math.min(a.idx,b.length));b.splice(g,0,p),u.fields=b}),removeFieldFromLayoutAt:(r,s)=>t().setSchema(n=>{var c,d,u,f;const a=mt(n,r);if(!a)return;const i=(f=(u=(d=(c=a.sections[s.s])==null?void 0:c.rows)==null?void 0:d[s.r])==null?void 0:u.columns)==null?void 0:f[s.c];if(!i||!i.fields||s.idx<0||s.idx>=i.fields.length)return;const l=[...i.fields];l.splice(s.idx,1),i.fields=l}),insertExistingFieldAtAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var g,v,x,m;const d=mt(c,r);if(!d)return;const u=(m=(x=(v=(g=d.sections[n])==null?void 0:g.rows)==null?void 0:v[a])==null?void 0:x.columns)==null?void 0:m[i];if(!u)return;let f=s;if(ir(c,s)){const y=c.fields.findIndex(j=>j.name===s);if(y>=0){const j=c.fields[y],{baseName:_,baseLabel:k}=Qe(j),A=new Set(c.fields.map(V=>V.name).filter(Boolean)),C=new Set(c.fields.map(V=>V.label??"").filter(Boolean)),N=Xe(_,A),M=ot(k,C),U=JSON.parse(JSON.stringify(j));U.name=N,U.label=M,c.fields.splice(y+1,0,U),f=N}}const p=[...u.fields??[]],b=Math.max(0,Math.min(l,p.length));p.splice(b,0,f),u.fields=p}),addFieldAndPlaceAtAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var _,k,A,C;const{baseName:d,baseLabel:u}=Qe(s),f=new Set(c.fields.map(N=>N.name).filter(Boolean)),p=new Set(c.fields.map(N=>N.label??"").filter(Boolean)),b=Xe(d,f),g=ot(u,p),v=JSON.parse(JSON.stringify(s));v.name=b,v.label||(v.label=g),c.fields.push(v);const x=mt(c,r);if(!x)return;const m=(C=(A=(k=(_=x.sections[n])==null?void 0:_.rows)==null?void 0:k[a])==null?void 0:A.columns)==null?void 0:C[i];if(!m)return;const y=[...m.fields??[]],j=Math.max(0,Math.min(l,y.length));y.splice(j,0,b),m.fields=y}),setTabRowResponsive:(r,s,n,a)=>t().setSchema(i=>{var v,x;const l=$e(i,r);if(!l)return;const d=(x=(v=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[Number(s)])==null?void 0:v.rows)==null?void 0:x[Number(n)];if(!d)return;const u=Math.max(a.desktop.count??1,a.tablet.count??1,a.mobile.count??1),f=(d.columns??[]).flatMap(m=>m.fields??[]),p=ln(f,u),b=(m,y,j)=>y<(j??0)?dr((m==null?void 0:m[y])??0):null,g=Array.from({length:u},(m,y)=>{const j=b(a.mobile.widths,y,a.mobile.count),_=b(a.tablet.widths,y,a.tablet.count),k=b(a.desktop.widths,y,a.desktop.count);return{width:on(j,_,k),fields:p[y]??[]}});d.columns=g}),moveTabRow:(r,s,n,a)=>t().setSchema(i=>{const l=$e(i,r);if(!l)return;const d=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[s];if(!d)return;const u=[...d.rows];if(n<0||n>=u.length)return;const f=Math.max(0,Math.min(a,u.length-1));if(n===f)return;const[p]=u.splice(n,1);u.splice(f,0,p),d.rows=u}),duplicateTabRow:(r,s,n)=>t().setSchema(a=>{const i=$e(a,r);if(!i)return;const c=a.layout[i.nodeIdx].tabs[i.tabIdx].sections[s];if(!c)return;const d=c.rows[n];if(!d)return;const u=JSON.parse(JSON.stringify(d));c.rows.splice(n+1,0,u)}),removeTabRow:(r,s,n)=>t().setSchema(a=>{const i=$e(a,r);if(!i)return;const c=a.layout[i.nodeIdx].tabs[i.tabIdx].sections[s];if(!c)return;const d=[...c.rows];n<0||n>=d.length||(d.splice(n,1),d.length===0&&d.push({title:"",columns:[{width:"w-full",fields:[]}]}),c.rows=d)}),setTabRowColumnsPreset:(r,s,n,a)=>t().setSchema(i=>{var f,p;const l=$e(i,r);if(!l)return;const d=(p=(f=i.layout[l.nodeIdx].tabs[l.tabIdx].sections[s])==null?void 0:f.rows)==null?void 0:p[n];if(!d)return;const u=nn[a];u&&an(d,u)}),addRowToSection:r=>t().setSchema(s=>{const n=_e(s);n&&n.sections[r].rows.push({title:"",columns:[{width:"w-full",fields:[]}]})}),addColumnToRow:(r,s)=>t().setSchema(n=>{const a=_e(n);a&&a.sections[r].rows[s].columns.push({width:"w-1/2",fields:[]})}),setRowColumns:(r,s,n)=>t().setSchema(a=>{const i=_e(a);if(!i)return;const l=i.sections[r].rows[s],c=(l.columns??[]).flatMap(f=>f.fields??[]),d=sn(n),u=Array.from({length:n},(f,p)=>({width:d[p],fields:[]}));c.forEach((f,p)=>u[p%n].fields.push(f)),l.columns=u}),removeColumn:(r,s,n)=>t().setSchema(a=>{const i=_e(a);if(!i)return;const l=i.sections[r].rows[s],c=l.columns??[];if(!c[n])return;const d=c[n],u=n>0?n-1:c[n+1]?n+1:-1,f=[...c];f.splice(n,1),u>=0&&f[u]&&(f[u].fields=[...f[u].fields??[],...d.fields??[]]),l.columns=f}),placeFieldInColumn:(r,s,n,a)=>t().setSchema(i=>{const l=_e(i);if(!l)return;const c=l.sections[s].rows[n].columns[a];let d=r;if(ir(i,r)){const u=i.fields.findIndex(f=>f.name===r);if(u>=0){const f=i.fields[u],{baseName:p,baseLabel:b}=Qe(f),g=new Set(i.fields.map(j=>j.name).filter(Boolean)),v=new Set(i.fields.map(j=>j.label??"").filter(Boolean)),x=Xe(p,g),m=ot(b,v),y=JSON.parse(JSON.stringify(f));y.name=x,y.label=m,i.fields.splice(u+1,0,y),d=x}}c.fields=[...c.fields??[],d]}),moveField:(r,s)=>t().setSchema(n=>{var p,b,g,v;const a=_e(n);if(!a)return;const i=(b=(p=a.sections[r.s])==null?void 0:p.rows[r.r])==null?void 0:b.columns[r.c],l=(v=(g=a.sections[s.s])==null?void 0:g.rows[s.r])==null?void 0:v.columns[s.c];if(!i||!l)return;const c=[...i.fields??[]];if(r.idx<0||r.idx>=c.length)return;const[d]=c.splice(r.idx,1);i.fields=c;const u=[...l.fields??[]],f=s.idx===void 0?u.length:Math.max(0,Math.min(s.idx,u.length));u.splice(f,0,d),l.fields=u}),removeFieldFromLayout:r=>t().setSchema(s=>{var l,c;const n=_e(s);if(!n)return;const a=(c=(l=n.sections[r.s])==null?void 0:l.rows[r.r])==null?void 0:c.columns[r.c];if(!a||!a.fields||r.idx<0||r.idx>=a.fields.length)return;const i=[...a.fields];i.splice(r.idx,1),a.fields=i}),addFieldAndPlace:(r,s,n,a)=>t().setSchema(i=>{const{baseName:l,baseLabel:c}=Qe(r),d=new Set(i.fields.map(x=>x.name).filter(Boolean)),u=new Set(i.fields.map(x=>x.label??"").filter(Boolean)),f=Xe(l,d),p=ot(c,u),b=JSON.parse(JSON.stringify(r));b.name=f,b.label||(b.label=p),i.fields.push(b);const g=_e(i);if(!g)return;const v=g.sections[s].rows[n].columns[a];v.fields=[...v.fields??[],f]}),moveFieldWithinColumn:(r,s,n,a,i)=>t().setSchema(l=>{var b,g,v,x;const c=_e(l);if(!c)return;const d=(x=(v=(g=(b=c.sections[r])==null?void 0:b.rows)==null?void 0:g[s])==null?void 0:v.columns)==null?void 0:x[n];if(!d)return;const u=[...d.fields??[]];if(a<0||a>=u.length)return;const[f]=u.splice(a,1),p=Math.max(0,Math.min(i,u.length));u.splice(p,0,f),d.fields=u}),insertExistingFieldAt:(r,s,n,a,i)=>t().setSchema(l=>{var b,g,v,x;const c=_e(l);if(!c)return;const d=(x=(v=(g=(b=c.sections[s])==null?void 0:b.rows)==null?void 0:g[n])==null?void 0:v.columns)==null?void 0:x[a];if(!d)return;let u=r;if(ir(l,r)){const m=l.fields.findIndex(y=>y.name===r);if(m>=0){const y=l.fields[m],{baseName:j,baseLabel:_}=Qe(y),k=new Set(l.fields.map(U=>U.name).filter(Boolean)),A=new Set(l.fields.map(U=>U.label??"").filter(Boolean)),C=Xe(j,k),N=ot(_,A),M=JSON.parse(JSON.stringify(y));M.name=C,M.label=N,l.fields.splice(m+1,0,M),u=C}}const f=[...d.fields??[]],p=Math.max(0,Math.min(i,f.length));f.splice(p,0,u),d.fields=f}),addFieldAndPlaceAt:(r,s,n,a,i)=>t().setSchema(l=>{var j,_,k,A;const{baseName:c,baseLabel:d}=Qe(r),u=new Set(l.fields.map(C=>C.name).filter(Boolean)),f=new Set(l.fields.map(C=>C.label??"").filter(Boolean)),p=Xe(c,u),b=ot(d,f),g=JSON.parse(JSON.stringify(r));g.name=p,g.label||(g.label=b),l.fields.push(g);const v=_e(l);if(!v)return;const x=(A=(k=(_=(j=v.sections[s])==null?void 0:j.rows)==null?void 0:_[n])==null?void 0:k.columns)==null?void 0:A[a];if(!x)return;const m=[...x.fields??[]],y=Math.max(0,Math.min(i,m.length));m.splice(y,0,p),x.fields=m}),moveFieldWithinTab:(r,s,n,a,i,l)=>t().setSchema(c=>{var g,v,x,m;const d=$e(c,r);if(!d)return;const u=(m=(x=(v=(g=c.layout[d.nodeIdx].tabs[d.tabIdx].sections[s])==null?void 0:g.rows)==null?void 0:v[n])==null?void 0:x.columns)==null?void 0:m[a];if(!u)return;const f=[...u.fields??[]];if(i<0||i>=f.length)return;const[p]=f.splice(i,1),b=Math.max(0,Math.min(l,f.length));f.splice(b,0,p),u.fields=f}),insertExistingFieldInTabAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var g,v,x,m;const d=$e(c,s);if(!d)return;const u=(m=(x=(v=(g=c.layout[d.nodeIdx].tabs[d.tabIdx].sections[n])==null?void 0:g.rows)==null?void 0:v[a])==null?void 0:x.columns)==null?void 0:m[i];if(!u)return;let f=r;if(ir(c,r)){const y=c.fields.findIndex(j=>j.name===r);if(y>=0){const j=c.fields[y],{baseName:_,baseLabel:k}=Qe(j),A=new Set(c.fields.map(V=>V.name).filter(Boolean)),C=new Set(c.fields.map(V=>V.label??"").filter(Boolean)),N=Xe(_,A),M=ot(k,C),U=JSON.parse(JSON.stringify(j));U.name=N,U.label=M,c.fields.splice(y+1,0,U),f=N}}const p=[...u.fields??[]],b=Math.max(0,Math.min(l,p.length));p.splice(b,0,f),u.fields=p}),addFieldAndPlaceInTabAt:(r,s,n,a,i,l)=>t().setSchema(c=>{var _,k,A,C;const d=$e(c,s);if(!d)return;const{baseName:u,baseLabel:f}=Qe(r),p=new Set(c.fields.map(N=>N.name).filter(Boolean)),b=new Set(c.fields.map(N=>N.label??"").filter(Boolean)),g=Xe(u,p),v=ot(f,b),x=JSON.parse(JSON.stringify(r));x.name=g,x.label||(x.label=v),c.fields.push(x);const m=(C=(A=(k=(_=c.layout[d.nodeIdx].tabs[d.tabIdx].sections[n])==null?void 0:_.rows)==null?void 0:k[a])==null?void 0:A.columns)==null?void 0:C[i];if(!m)return;const y=[...m.fields??[]],j=Math.max(0,Math.min(l,y.length));y.splice(j,0,g),m.fields=y}),changeFieldType:(r,s)=>t().setSchema(n=>{const a=n.fields.findIndex(d=>d.name===r);if(a<0)return;const i=n.fields[a],c={...{name:i.name,label:i.label,width:i.width,size:i.size,info:i.info,disabled:i.disabled,visibleWhen:i.visibleWhen,disabledWhen:i.disabledWhen,clearWhen:i.clearWhen,validation:i.validation,placeholder:i.placeholder},type:s};switch(s){case"text":case"email":case"password":case"number":break;case"textarea":c.maxLength=i.maxLength??void 0,c.showCounter=i.showCounter??!1;break;case"select":c.options=Array.isArray(i.options)?i.options:[],c.multiple=!!i.multiple,c.loadOptions=i.loadOptions??void 0;break;case"checkbox":c.defaultValue=!!i.defaultValue,delete c.placeholder;break;case"date":c.showTime=!!i.showTime;break;case"file":c.maxFiles=i.maxFiles??1,c.accept=i.accept??"",delete c.placeholder;break}s!=="select"&&(delete c.options,delete c.multiple,delete c.loadOptions),s!=="textarea"&&(delete c.maxLength,delete c.showCounter),s!=="checkbox"&&delete c.defaultValue,s!=="date"&&delete c.showTime,s!=="file"&&(delete c.maxFiles,delete c.accept),n.fields[a]=c})}));function an(e,t){const r=(e.columns??[]).flatMap(a=>a.fields??[]),s=t.length,n=t.map(a=>({width:a,fields:[]}));r.forEach((a,i)=>n[i%s].fields.push(a)),e.columns=n}function on(e,t,r){const s=[];return e===null?s.push("hidden"):s.push(`w-[${rn(dr(e))}%]`,"block"),t===null?s.push("md:hidden"):s.push(`md:w-[${rn(dr(t))}%]`,"md:block"),r===null?s.push("lg:hidden"):s.push(`lg:w-[${rn(dr(r))}%]`,"lg:block"),s.join(" ")}function Tf(e,t){const r=e.columns??[];if(r.length===t)return r;if(r.length<t){const n=t-r.length,a=[...r];for(let i=0;i<n;i++)a.push({width:"w-[100%]",fields:[]});return e.columns=a,a}const s=r.slice(0,t);for(let n=t;n<r.length;n++)s[t-1].fields=[...s[t-1].fields??[],...r[n].fields??[]];return e.columns=s,s}function ln(e,t){const r=Array.from({length:t},()=>[]);return e.forEach((s,n)=>r[n%t].push(s)),r}const Vs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function br(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ra(e){return"nodeType"in e}function Ye(e){var t,r;return e?br(e)?e:ra(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function sa(e){const{Document:t}=Ye(e);return e instanceof t}function Ur(e){return br(e)?!1:e instanceof Ye(e).HTMLElement}function sl(e){return e instanceof Ye(e).SVGElement}function gr(e){return e?br(e)?e.document:ra(e)?sa(e)?e:Ur(e)||sl(e)?e.ownerDocument:document:document:document}const _t=Vs?h.useLayoutEffect:h.useEffect;function Bs(e){const t=h.useRef(e);return _t(()=>{t.current=e}),h.useCallback(function(){for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t.current==null?void 0:t.current(...s)},[])}function _f(){const e=h.useRef(null),t=h.useCallback((s,n)=>{e.current=setInterval(s,n)},[]),r=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Dr(e,t){t===void 0&&(t=[e]);const r=h.useRef(e);return _t(()=>{r.current!==e&&(r.current=e)},t),r}function qr(e,t){const r=h.useRef();return h.useMemo(()=>{const s=e(r.current);return r.current=s,s},[...t])}function Cs(e){const t=Bs(e),r=h.useRef(null),s=h.useCallback(n=>{n!==r.current&&(t==null||t(n,r.current)),r.current=n},[]);return[r,s]}function As(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let cn={};function Us(e,t){return h.useMemo(()=>{if(t)return t;const r=cn[e]==null?0:cn[e]+1;return cn[e]=r,e+"-"+r},[e,t])}function nl(e){return function(t){for(var r=arguments.length,s=new Array(r>1?r-1:0),n=1;n<r;n++)s[n-1]=arguments[n];return s.reduce((a,i)=>{const l=Object.entries(i);for(const[c,d]of l){const u=a[c];u!=null&&(a[c]=u+e*d)}return a},{...t})}}const ur=nl(1),Ts=nl(-1);function Ff(e){return"clientX"in e&&"clientY"in e}function na(e){if(!e)return!1;const{KeyboardEvent:t}=Ye(e.target);return t&&e instanceof t}function Of(e){if(!e)return!1;const{TouchEvent:t}=Ye(e.target);return t&&e instanceof t}function _s(e){if(Of(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Ff(e)?{x:e.clientX,y:e.clientY}:null}const Mr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Mr.Translate.toString(e),Mr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:s}=e;return t+" "+r+"ms "+s}}}),uo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Rf(e){return e.matches(uo)?e:e.querySelector(uo)}const Df={display:"none"};function Mf(e){let{id:t,value:r}=e;return h.createElement("div",{id:t,style:Df},r)}function $f(e){let{id:t,announcement:r,ariaLiveType:s="assertive"}=e;const n={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h.createElement("div",{id:t,style:n,role:"status","aria-live":s,"aria-atomic":!0},r)}function Lf(){const[e,t]=h.useState("");return{announce:h.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const al=h.createContext(null);function Pf(e){const t=h.useContext(al);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zf(){const[e]=h.useState(()=>new Set),t=h.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[h.useCallback(s=>{let{type:n,event:a}=s;e.forEach(i=>{var l;return(l=i[n])==null?void 0:l.call(i,a)})},[e]),t]}const If={draggable:`
62
62
  To pick up a draggable item, press the space bar.
63
63
  While dragging, use the arrow keys to move the item.
64
64
  Press space again to drop the item in its new position, or press escape to cancel.