@efficiency-point/design-system 0.1.46 → 0.1.48

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 CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),r=require("@tanstack/react-table"),i=require("zustand");var a={badge:`_badge_1tup7_1`,sm:`_sm_1tup7_29`,md:`_md_1tup7_39`,neutral:`_neutral_1tup7_49`,brand:`_brand_1tup7_61`,info:`_info_1tup7_73`,success:`_success_1tup7_85`,warning:`_warning_1tup7_97`,error:`_error_1tup7_109`,dot:`_dot_1tup7_121`,icon:`_icon_1tup7_137`,label:`_label_1tup7_147`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={badge:`_badge_1qsds_1`,sm:`_sm_1qsds_25`,md:`_md_1qsds_37`,neutral:`_neutral_1qsds_51`,brand:`_brand_1qsds_63`,info:`_info_1qsds_75`,success:`_success_1qsds_87`,warning:`_warning_1qsds_99`,error:`_error_1qsds_111`},c=(e,t=99)=>{let n=Math.max(0,Math.floor(e)),r=Math.max(0,Math.floor(t));return n>r?`${r}+`:String(n)},l=({value:t,max:n=99,label:r=`уведомлений`,variant:i=`error`,size:a=`sm`,className:o=``,"aria-label":l,...u})=>{let d=Math.max(0,Math.floor(t));return(0,e.jsx)(`span`,{...u,className:`${s.badge} ${s[i]} ${s[a]} ${o}`,"aria-label":l??`${d} ${r}`,children:c(d,n)})},u={container:`_container_bvxhv_1`,inner:`_inner_bvxhv_21`,line:`_line_bvxhv_39`,primary:`_primary_bvxhv_57`,secondary:`_secondary_bvxhv_65`,outline:`_outline_bvxhv_73`,ghost:`_ghost_bvxhv_81`,empty:`_empty_bvxhv_89`,destructive:`_destructive_bvxhv_97`,destructiveOutline:`_destructiveOutline_bvxhv_105`,grow:`_grow_bvxhv_1`},d=({variant:t=`primary`})=>(0,e.jsx)(`div`,{className:`${u.container} ${u[t]}`,children:(0,e.jsxs)(`div`,{className:`${u.inner} ${u[t]}`,children:[(0,e.jsx)(`div`,{className:`${u.line} ${u[t]}`}),(0,e.jsx)(`div`,{className:`${u.line} ${u[t]}`}),(0,e.jsx)(`div`,{className:`${u.line} ${u[t]}`}),(0,e.jsx)(`div`,{className:`${u.line} ${u[t]}`})]})}),f={button:`_button_1fayv_1`,sm:`_sm_1fayv_59`,md:`_md_1fayv_73`,lg:`_lg_1fayv_87`,primary:`_primary_1fayv_101`,secondary:`_secondary_1fayv_115`,outline:`_outline_1fayv_129`,ghost:`_ghost_1fayv_143`,empty:`_empty_1fayv_157`,destructive:`_destructive_1fayv_171`,destructiveOutline:`_destructiveOutline_1fayv_183`},p=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,disabled:a,type:o=`button`,className:s=``,...c},l)=>(0,e.jsx)(`button`,{ref:l,className:`${f.button} ${f[n]} ${f[r]} ${s}`,disabled:a||i,"aria-busy":i||void 0,...c,type:o,children:i?(0,e.jsx)(d,{variant:n}):t}));p.displayName=`DSButton`;var m={label:`_label_1o819_1`,required:`_required_1o819_23`,error:`_error_1o819_25`,optional:`_optional_1o819_33`,hint:`_hint_1o819_35`,disabled:`_disabled_1o819_47`,message:`_message_1o819_55`,success:`_success_1o819_71`},h=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${m.label} ${i?m.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:m.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:m.optional,children:r})]}),g=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${m.message} ${m[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),_=({width:t=24,height:n=24,color:r,title:i,style:a,children:o,...s})=>(0,e.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:i?`img`:void 0,"aria-hidden":!i||void 0,focusable:`false`,style:r?{...a,color:r}:a,...s,children:[i&&(0,e.jsx)(`title`,{children:i}),o]}),v=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`})}),y=({strokeWidth:t=2,...n})=>(0,e.jsxs)(_,{strokeWidth:t,...n,children:[(0,e.jsx)(`path`,{d:`M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8`}),(0,e.jsx)(`path`,{d:`M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4M12 4v6M2 18h20M5 18v2M19 18v2`})]}),b=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,e.jsx)(`path`,{d:`M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z`}),(0,e.jsx)(`path`,{d:`M8 7h6`}),(0,e.jsx)(`path`,{d:`M8 11h8`})]}),x=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}),(0,e.jsx)(`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}),(0,e.jsx)(`path`,{d:`M10 12h4`})]}),S=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`m5 12 4 4L19 6`})}),C=t=>(0,e.jsx)(_,{viewBox:`0 0 20 20`,...t,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`})}),w=({strokeWidth:t=2,...n})=>(0,e.jsx)(_,{strokeWidth:t,...n,children:(0,e.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),T=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`}),(0,e.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),E=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 20h4L19 9l-4-4L4 16v4z`})}),D=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m15 9-6 6M9 9l6 6`})]}),O=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M3 12s3.5-5 9-5 9 5 9 5-3.5 5-9 5-9-5-9-5Z`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.5`})]}),k=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M3 3l18 18M10.6 10.7a2 2 0 0 0 2.7 2.7M9.9 4.2A10.7 10.7 0 0 1 12 4c5.5 0 9 5.3 9 5.3a14 14 0 0 1-2.3 2.8M6.6 6.6C4.3 8.1 3 10 3 10s3.5 5 9 5c1 0 2-.2 2.8-.5`})}),A=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 10v7m0-10v.01`})}),j=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`M12 16v-4M12 8v.01`})]}),M=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5Z`}),(0,e.jsx)(`polyline`,{points:`14 2 14 8 20 8`}),(0,e.jsx)(`path`,{d:`M16 13H8`}),(0,e.jsx)(`path`,{d:`M16 17H8`}),(0,e.jsx)(`path`,{d:`M10 9H8`})]}),N=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M5 12h14`})}),P=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01`})}),F=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,e.jsx)(`path`,{d:`M3 9h18M9 21V9`})]}),I=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M8 5v14M16 5v14`,strokeWidth:`3`})}),L=({strokeWidth:t=2,...n})=>(0,e.jsx)(_,{strokeWidth:t,...n,children:(0,e.jsx)(`path`,{d:`M12 5v14M5 12h14`})}),R=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M12 22v-5`}),(0,e.jsx)(`path`,{d:`M9 8V2`}),(0,e.jsx)(`path`,{d:`M15 8V2`}),(0,e.jsx)(`path`,{d:`M18 8v5a6 6 0 0 1-12 0V8Z`})]}),ee=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M3 5h18v14H3V5Zm10 7h6v5h-6v-5Z`})}),te=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`m8 5 11 7-11 7V5Z`,fill:`currentColor`,stroke:`none`})}),z=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 7v5h5M5.5 11a7 7 0 1 1 1.3 6.3`})}),ne=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm7.4 5.2.1-1.7-.1-1.7 2-1.5-2-3.4-2.4 1a8 8 0 0 0-2.9-1.7L13.8 2h-3.9l-.4 2.7a8 8 0 0 0-2.8 1.7l-2.5-1-2 3.4 2.1 1.5-.1 1.7.1 1.7-2.1 1.5 2 3.4 2.5-1a8 8 0 0 0 2.8 1.7l.4 2.7h3.9l.3-2.7a8 8 0 0 0 2.9-1.7l2.4 1 2-3.4-2-1.5Z`})}),re=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M9 4H4v5m11-5h5v5M9 20H4v-5m11 5h5v-5`})}),ie=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 9h5V4m6 5h5V4M4 15h5v5m6-5h5v5`})}),ae=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 6h16v12H4V6Zm7 4a2 2 0 1 0 0 4m7-4a2 2 0 1 0 0 4`})}),B=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12-1c1.3 1.5 1.3 4.5 0 6m2.5-8.5c3 3 3 8 0 11`})}),oe=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12 0 4 4m0-4-4 4`})}),se=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M8 17V5m-3 3 3-3 3 3M16 7v12m-3-3 3 3 3-3`})}),V=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),ce=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 5v14m-5-5 5 5 5-5`})}),le=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),ue=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),de=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M12 3.5L21 19H3L12 3.5Z`}),(0,e.jsx)(`path`,{d:`M12 9v4.5M12 16.5v.01`})]}),H=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M3 6h18`}),(0,e.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}),(0,e.jsx)(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}),(0,e.jsx)(`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`}),(0,e.jsx)(`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`})]}),fe=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`m21.4 11.6-8.9 8.9a6 6 0 0 1-8.5-8.5l9.6-9.6a4 4 0 0 1 5.7 5.7l-9.6 9.6a2 2 0 0 1-2.8-2.8l8.9-8.9`})}),pe=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,e.jsx)(`path`,{d:`M22 2 11 13`})]}),me=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`}),(0,e.jsx)(`path`,{d:`M9 9h.01M15 9h.01`})]}),he=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1`,fill:`currentColor`,stroke:`none`})]}),ge=t=>(0,e.jsx)(_,{...t,children:[5,12,19].flatMap(t=>[5,12,19].map(n=>(0,e.jsx)(`circle`,{cx:n,cy:t,r:`1.5`,fill:`currentColor`,stroke:`none`},`${n}-${t}`)))}),U=n=>r=>(0,e.jsx)(_,{...r,children:n.map(([e,n],r)=>(0,t.createElement)(e,{...n,key:n.key??`${e}-${r}`}))}),_e={IconAppsGrid:ge,IconActivity:U([[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),IconArchive:x,IconAlertTriangle:U([[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}],[`path`,{d:`M12 9v4`}],[`path`,{d:`M12 17h.01`}]]),IconArrowDown:U([[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),IconArrowLeft:U([[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),IconArrowRight:U([[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),IconArrowUp:U([[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),IconArrowUpRight:U([[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),IconBarChart3:U([[`path`,{d:`M3 3v18h18`}],[`path`,{d:`M18 17V9`}],[`path`,{d:`M13 17V5`}],[`path`,{d:`M8 17v-3`}]]),IconBedDouble:y,IconBookText:b,IconBell:U([[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),IconBoxes:U([[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),IconBuilding2:U([[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),IconCamera:U([[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),IconChartNoAxesCombined:U([[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14.639V21`,key:`1s85h0`}],[`path`,{d:`M20 10.656V21`,key:`q45596`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18.463V21`,key:`1otddq`}],[`path`,{d:`M8 14.656V21`,key:`1t2idw`}]]),IconChevronRight:U([[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),IconCircleAlert:U([[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),IconClock3:U([[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),IconCopy:T,IconDownload:U([[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),IconExternalLink:U([[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),IconFactory:U([[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M16 16h.01`,key:`1f9h7w`}],[`path`,{d:`M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z`,key:`1iv0i2`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),IconFileText:M,IconGauge:U([[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),IconGripVertical:U([[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),IconLayoutDashboard:U([[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),IconLockKeyhole:U([[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),IconLogOut:U([[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),IconMaximize2:U([[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),IconMenu:U([[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),IconPackageCheck:U([[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),IconRefreshCw:U([[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),IconRotateCw:U([[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),IconSearch:U([[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),IconSettings2:U([[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),IconShieldAlert:U([[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),IconShieldCheck:U([[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),IconSmartphone:U([[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),IconSparkles:U([[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),IconTable2:U([[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),IconThermometer:U([[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]),IconTrendingUp:U([[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),IconUserCheck:U([[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),IconUserRound:U([[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),IconUsers:U([[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),IconUserX:U([[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),IconVideo:U([[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),IconVideoOff:U([[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),IconVolume2:U([[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),IconX:U([[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),IconBasket:v,IconCheck:S,IconChevron:C,IconCross:w,IconEdit:E,IconErrorCircle:D,IconEye:O,IconEyeOff:k,IconInfo:A,IconInfoCircle:j,IconMinus:N,IconMoreVertical:he,IconList:P,IconPanelsTopLeft:F,IconPause:I,IconPaperclip:fe,IconPlus:L,IconPlug:R,IconPictureInPicture:ee,IconPlay:te,IconReplay:z,IconSettings:ne,IconSend:pe,IconSmile:me,IconFullscreen:re,IconFullscreenExit:ie,IconCaptions:ae,IconVolume:B,IconVolumeMuted:oe,IconSort:se,IconSortAscending:V,IconSortDescending:ce,IconSuccessCircle:le,IconUpload:ue,IconWarning:de,IconTrash2:H},ve=Object.freeze(Object.keys(_e)),W=({name:t,...n})=>{let r=_e[t];return(0,e.jsx)(r,{...n})},ye={wrapper:`_wrapper_1seon_1`,label:`_label_1seon_13`,input:`_input_1seon_35`,control:`_control_1seon_49`,disabled:`_disabled_1seon_95`,controlError:`_controlError_1seon_121`},be=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,ariaLabel:p,...m})=>{let h=(0,t.useId)(),_=d??`ds-checkbox-${u??h}`,v=(0,t.useRef)(null),y=a?`${_}-hint`:void 0,b=o?`${_}-error`:void 0;return(0,t.useEffect)(()=>{v.current&&(v.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${ye.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${ye.label} ${s?ye.disabled:``}`,htmlFor:_,children:[(0,e.jsx)(`input`,{ref:v,id:_,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[y,b].filter(Boolean).join(` `)||void 0,"aria-label":p,className:ye.input,onChange:e=>{c||r?.(e.target.checked,e)},...m}),(0,e.jsxs)(`span`,{className:`${ye.control} ${o?ye.controlError:``}`,"aria-hidden":`true`,children:[f&&!n&&(0,e.jsx)(W,{name:`IconMinus`,width:16,height:16}),n&&(0,e.jsx)(W,{name:`IconCheck`,width:16,height:16})]}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(g,{id:y,children:a}),o&&(0,e.jsx)(g,{id:b,variant:`error`,children:o})]})},G={wrapper:`_wrapper_su17c_1`,trigger:`_trigger_su17c_17`,sm:`_sm_su17c_53`,md:`_md_su17c_65`,lg:`_lg_su17c_75`,chevron:`_chevron_su17c_89`,chevronOpen:`_chevronOpen_su17c_115`,nav:`_nav_su17c_127`,day:`_day_su17c_129`,monthSelect:`_monthSelect_su17c_131`,yearInput:`_yearInput_su17c_133`,timeInput:`_timeInput_su17c_135`,dateInput:`_dateInput_su17c_147`,timeValue:`_timeValue_su17c_189`,chevronButton:`_chevronButton_su17c_201`,disabled:`_disabled_su17c_235`,validationTooltip:`_validationTooltip_su17c_249`,"validation-tooltip-lifetime":`_validation-tooltip-lifetime_su17c_1`,value:`_value_su17c_319`,placeholder:`_placeholder_su17c_335`,error:`_error_su17c_343`,panel:`_panel_su17c_351`,calendarHeader:`_calendarHeader_su17c_377`,weekdays:`_weekdays_su17c_467`,days:`_days_su17c_469`,outside:`_outside_su17c_505`,selected:`_selected_su17c_513`,timeLabel:`_timeLabel_su17c_533`,previousMonth:`_previousMonth_su17c_593`,nextMonth:`_nextMonth_su17c_601`},xe=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],Se=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],Ce=e=>String(e).padStart(2,`0`),we=8,Te=`Некорректная дата`,K=e=>e?`${Ce(e.getDate())}.${Ce(e.getMonth()+1)}.${e.getFullYear()}`:``,Ee=e=>{let t=e.replace(/\D/g,``).slice(0,we);return[t.slice(0,2),t.slice(2,4),t.slice(4,8)].filter(Boolean).join(`.`)},De=e=>{if(!e)return!0;let t=Number(e.padEnd(4,`0`));return Number(e.padEnd(4,`9`))>=1800&&t<=2500},Oe=e=>{if(!/^\d{0,8}$/.test(e))return!1;let t=e.slice(0,2),n=e.slice(2,4),r=e.slice(4,8);return t.length===1&&Number(t)>3||t.length===2&&(Number(t)<1||Number(t)>31)||n.length===1&&Number(n)>1||n.length===2&&(Number(n)<1||Number(n)>12)?!1:De(r)},ke=e=>{let t=/^(\d{2})\.(\d{2})\.(\d{4})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]);if(i<1800||i>2500)return null;let a=new Date(i,r,n,12);return a.getFullYear()!==i||a.getMonth()!==r||a.getDate()!==n?null:a},Ae=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),q=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${Ce(e.getMonth()+1)}-${Ce(e.getDate())}`,r=`${Ce(e.getHours())}:${Ce(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},je=(e,t)=>{if(!e)return null;if(t===`time`){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);if(n>23||r>59)return null;let i=new Date;return i.setHours(n,r,0,0),i}if(t===`date`){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]),a=new Date(n,r,i,12);return a.getFullYear()!==n||a.getMonth()!==r||a.getDate()!==i?null:a}let n=new Date(e);return Number.isNaN(n.getTime())?null:n},Me=(e,t)=>{if(!e)return``;let n=`${Ce(e.getDate())}.${Ce(e.getMonth()+1)}.${e.getFullYear()}`,r=`${Ce(e.getHours())}:${Ce(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n} ${r}`},Ne=e=>{let t=new Date(e.getFullYear(),e.getMonth(),1),n=(t.getDay()+6)%7,r=new Date(t);return r.setDate(t.getDate()-n),Array.from({length:42},(e,t)=>{let n=new Date(r);return n.setDate(r.getDate()+t),n})},Pe=(e,t)=>!!(e&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()),Fe=(e,t,n)=>{let r=Ae(e).getTime();return!!(t&&r<Ae(t).getTime()||n&&r>Ae(n).getTime())},J=8,Ie=6,Le=({value:r,onChange:i,mode:a=`date`,label:o,placeholder:s,hint:c,error:l,disabled:u=!1,readOnly:d=!1,required:f=!1,min:p,max:m,size:_=`md`,id:v,name:y,className:b=``})=>{let x=(0,t.useId)(),S=v??`ds-date-time-${y??x}`,C=c?`${S}-hint`:void 0,w=l?`${S}-error`:void 0,T=(0,t.useRef)(null),E=(0,t.useRef)(null),D=(0,t.useRef)(null),O=(0,t.useRef)(null),[k,A]=(0,t.useState)(!1),[j,M]=(0,t.useState)(r??new Date),[N,P]=(0,t.useState)(q(r,`time`)),[F,I]=(0,t.useState)(K(r)),[L,R]=(0,t.useState)(``),[ee,te]=(0,t.useState)(0),[z,ne]=(0,t.useState)(null),re=(0,t.useMemo)(()=>Ne(j),[j]),ie=a!==`time`,ae=a!==`date`;(0,t.useEffect)(()=>{r&&M(r),P(q(r,`time`)),I(K(r))},[r]),(0,t.useEffect)(()=>()=>{O.current&&clearTimeout(O.current)},[]);let B=(0,t.useCallback)(()=>{let e=E.current,t=D.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-J,o=n.top-J,s=a<r.height&&o>a,c=Math.max(120,s?o:a),l=s?Math.max(J,n.top-r.height-Ie):n.bottom+Ie,u=n.left,d=i-r.width-J;ne({top:l,left:Math.max(J,Math.min(u,d)),maxHeight:c})},[]);(0,t.useLayoutEffect)(()=>{if(!k){ne(null);return}return B(),window.addEventListener(`resize`,B),window.addEventListener(`scroll`,B,!0),()=>{window.removeEventListener(`resize`,B),window.removeEventListener(`scroll`,B,!0)}},[k,B,j,N]),(0,t.useEffect)(()=>{if(!k)return;let e=e=>{let t=e.target,n=T.current?.contains(t),r=D.current?.contains(t);!n&&!r&&A(!1)},t=e=>{e.key===`Escape`&&(A(!1),E.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[k]);let oe=e=>{if(Fe(e,p,m))return;let t=a===`date`?je(q(e,`date`),`date`):new Date(e);t&&(a!==`date`&&t.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(t),I(K(t)),a===`date`&&A(!1))},se=()=>{R(Te),te(e=>e+1),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{R(``),O.current=null},3e3)},V=e=>{let t=e.replace(/\D/g,``).slice(0,we);if(!Oe(t)){se();return}let n=Ee(t);if(I(n),!t){i?.(null);return}if(t.length<we)return;let o=ke(n);if(!o||Fe(o,p,m)){se();return}a===`datetime`&&o.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(o),M(o),A(!1),requestAnimationFrame(()=>E.current?.blur())},ce=e=>{if(P(e),!e){i?.(null);return}let t=je(e,`time`);if(!t)return;let n=new Date(a===`datetime`?r??j:new Date);n.setHours(t.getHours(),t.getMinutes(),0,0),!(p&&n<p||m&&n>m)&&i?.(n)},le=s??(a===`date`?`ДД.ММ.ГГГГ`:a===`time`?`ЧЧ:ММ`:`ДД.ММ.ГГГГ ЧЧ:ММ`),ue=L?`${S}-validation`:void 0,de=[C,w,ue].filter(Boolean).join(` `)||void 0,H=k&&!d?(0,e.jsxs)(`div`,{ref:D,className:G.panel,role:`dialog`,"aria-label":o??le,style:z?{top:z.top,left:z.left,maxHeight:z.maxHeight}:{visibility:`hidden`,top:0,left:0},children:[ie&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`div`,{className:G.calendarHeader,children:[(0,e.jsx)(`button`,{type:`button`,className:G.nav,"aria-label":`Предыдущий месяц`,onClick:()=>M(new Date(j.getFullYear(),j.getMonth()-1,1)),children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20,className:G.previousMonth})}),(0,e.jsx)(`select`,{className:G.monthSelect,"aria-label":`Месяц`,value:j.getMonth(),onChange:e=>M(new Date(j.getFullYear(),Number(e.target.value),1)),children:Se.map((t,n)=>(0,e.jsx)(`option`,{value:n,children:t},t))}),(0,e.jsx)(`input`,{className:G.yearInput,type:`number`,"aria-label":`Год`,value:j.getFullYear(),onChange:e=>M(new Date(Number(e.target.value),j.getMonth(),1))}),(0,e.jsx)(`button`,{type:`button`,className:G.nav,"aria-label":`Следующий месяц`,onClick:()=>M(new Date(j.getFullYear(),j.getMonth()+1,1)),children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20,className:G.nextMonth})})]}),(0,e.jsx)(`div`,{className:G.weekdays,children:xe.map(t=>(0,e.jsx)(`span`,{children:t},t))}),(0,e.jsx)(`div`,{className:G.days,children:re.map(t=>{let n=Pe(r,t);return(0,e.jsx)(`button`,{type:`button`,className:`${G.day} ${t.getMonth()===j.getMonth()?``:G.outside} ${n?G.selected:``}`,disabled:Fe(t,p,m),"aria-pressed":n,onClick:()=>oe(t),children:t.getDate()},t.toISOString())})})]}),ae&&(0,e.jsxs)(`label`,{className:G.timeLabel,children:[(0,e.jsx)(`span`,{children:`Время`}),(0,e.jsx)(`input`,{className:G.timeInput,type:`time`,value:N,onChange:e=>ce(e.target.value)})]})]}):null;return(0,e.jsxs)(`div`,{ref:T,className:`${G.wrapper} ${b}`,children:[o&&(0,e.jsx)(h,{htmlFor:S,required:f,disabled:u,children:o}),ie?(0,e.jsxs)(`div`,{className:`${G.trigger} ${G[_]} ${l?G.error:``} ${u?G.disabled:``}`,children:[(0,e.jsx)(`input`,{ref:E,id:S,name:y,className:G.dateInput,value:F,placeholder:le.split(` `)[0],inputMode:`numeric`,autoComplete:`off`,maxLength:10,disabled:u,readOnly:d,"aria-expanded":k,"aria-haspopup":`dialog`,"aria-describedby":de,"aria-invalid":!!(l||L)||void 0,onFocus:()=>{d||A(!0)},onClick:()=>{d||A(!0)},onChange:e=>V(e.target.value)}),a===`datetime`&&N&&(0,e.jsx)(`span`,{className:G.timeValue,children:N}),(0,e.jsx)(`button`,{type:`button`,className:G.chevronButton,disabled:u||d,"aria-label":k?`Закрыть календарь`:`Открыть календарь`,tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:()=>{A(e=>!e),E.current?.focus()},children:(0,e.jsx)(`span`,{className:`${G.chevron} ${H?G.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})})]}):(0,e.jsxs)(`button`,{ref:E,id:S,name:y,type:`button`,className:`${G.trigger} ${G[_]} ${l?G.error:``}`,disabled:u,"aria-readonly":d||void 0,"aria-expanded":k,"aria-haspopup":`dialog`,"aria-describedby":de,onClick:()=>{d||A(e=>!e)},children:[(0,e.jsx)(`span`,{className:r?G.value:G.placeholder,children:Me(r,a)||le}),(0,e.jsx)(`span`,{className:`${G.chevron} ${H?G.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]}),L&&(0,e.jsx)(`span`,{id:ue,className:G.validationTooltip,role:`status`,"aria-live":`polite`,children:L},ee),H&&(0,n.createPortal)(H,document.body),c&&!l&&(0,e.jsx)(g,{id:C,children:c}),l&&(0,e.jsx)(g,{id:w,variant:`error`,children:l})]})},Re={root:`_root_19vq2_1`,range:`_range_19vq2_21`},ze=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),Be=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:p=!1,className:m=``})=>{let h=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),ze(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${Re.root} ${m}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:Re.range,children:[(0,e.jsx)(Le,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:p,error:h,onChange:e=>_({...t,from:e})}),(0,e.jsx)(Le,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:p,error:h,onChange:e=>_({...t,to:e})})]}),s&&!h&&(0,e.jsx)(g,{children:s})]})},Ve={group:`_group_ey6uk_1`,skeleton:`_skeleton_ey6uk_15`,text:`_text_ey6uk_27`,rectangular:`_rectangular_ey6uk_37`,circular:`_circular_ey6uk_47`,animated:`_animated_ey6uk_59`,"ds-skeleton":`_ds-skeleton_ey6uk_1`},He=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${Ve.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(i,o)=>(0,e.jsx)(`span`,{className:`${Ve.skeleton} ${Ve[t]} ${a?Ve.animated:``}`,style:{width:n,height:r}},o))}),Y={wrapper:`_wrapper_1l9o2_1`,container:`_container_1l9o2_17`,trigger:`_trigger_1l9o2_25`,disabledText:`_disabledText_1l9o2_27`,sm:`_sm_1l9o2_53`,md:`_md_1l9o2_67`,lg:`_lg_1l9o2_81`,value:`_value_1l9o2_147`,placeholder:`_placeholder_1l9o2_149`,chevron:`_chevron_1l9o2_205`,chevronOpen:`_chevronOpen_1l9o2_231`,menu:`_menu_1l9o2_239`,option:`_option_1l9o2_269`,selected:`_selected_1l9o2_339`,actionOption:`_actionOption_1l9o2_359`,message:`_message_1l9o2_391`,error:`_error_1l9o2_393`,errorState:`_errorState_1l9o2_419`},Ue=8,We=6,Ge=120,Ke=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},qe=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},Je=({options:r,value:i,onChange:a,placeholder:o=`Выберите опцию`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,hint:f,className:p=``,required:m=!1,name:g,id:_,needMark:v=!0,maxMenuHeight:y})=>{let b=(0,t.useId)(),x=_??`ds-dropdown-${g??b}`,S=`${x}-listbox`,[C,w]=(0,t.useState)(!1),[T,E]=(0,t.useState)(null),D=(0,t.useRef)(null),O=(0,t.useRef)(null),k=(0,t.useRef)(null),A=(0,t.useRef)([]),j=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),M=f?`${x}-hint`:void 0,N=u?`${x}-error`:void 0,P=[M,N].filter(Boolean).join(` `)||void 0,F=s&&c,I=(0,t.useCallback)(()=>{let e=O.current,t=k.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-Ue,o=n.top-Ue,s=a<r.height&&o>a,c=Math.max(Ge,s?o:a),l=qe(y),u=Math.min(c,l),d=n.left,f=i-n.width-Ue,p=Math.max(Ue,Math.min(d,f)),m=s?Math.max(Ue,n.top-r.height-We):n.bottom+We;E({top:m,left:p,width:n.width,maxHeight:u})},[y]);(0,t.useLayoutEffect)(()=>{if(!C){E(null);return}return I(),window.addEventListener(`resize`,I),window.addEventListener(`scroll`,I,!0),()=>{window.removeEventListener(`resize`,I),window.removeEventListener(`scroll`,I,!0)}},[C,I,r.length]),(0,t.useEffect)(()=>{if(!C)return;let e=e=>{let t=e.target,n=D.current?.contains(t),r=k.current?.contains(t);!n&&!r&&w(!1)},t=e=>{e.key===`Escape`&&(w(!1),O.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[C]);let L=(e,t)=>{let n=Ke(r,e,t);if(n===-1)return;let i=A.current[n];i?.focus(),i?.scrollIntoView({block:`nearest`})},R=e=>{e.disabled||(a?.(e.value,e),w(!1),O.current?.focus())},ee=C?(0,e.jsx)(`ul`,{ref:k,id:S,className:Y.menu,role:`listbox`,"aria-label":l,style:T?{position:`fixed`,top:T.top,left:T.left,width:T.width,maxHeight:T.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=t.value===i;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{A.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,"data-option-variant":t.variant??`default`,className:[Y[d],Y.option,t.variant===`action`?Y.actionOption:``,a?Y.selected:``].filter(Boolean).join(` `),onClick:()=>R(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;L(n+t,t)}if(e.key===`Tab`&&w(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;L(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),R(t))},children:[(0,e.jsx)(`span`,{children:t.label}),a&&v&&(0,e.jsx)(W,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:D,className:[Y.wrapper,u?Y.errorState:``,p].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(h,{required:m,disabled:s,htmlFor:F?void 0:x,children:l}),(0,e.jsx)(`div`,{className:Y.container,children:F?(0,e.jsx)(`div`,{id:x,className:Y.disabledText,"aria-describedby":P,children:j?.label??o}):(0,e.jsxs)(`button`,{ref:O,id:x,type:`button`,name:g,className:`${Y.trigger} ${Y[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":C,"aria-controls":S,"aria-describedby":P,"aria-invalid":!!u,onClick:()=>w(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),w(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>{L(e.key===`ArrowDown`?0:r.length-1,t)})}if(e.key===`Enter`&&C){e.preventDefault();let t=r.findIndex(e=>e.value===i);L(t>=0?t:0,1)}},children:[(0,e.jsx)(`span`,{className:`${j?Y.value:Y.placeholder}
2
- ${Y[d]}`,children:j?.label??o}),(0,e.jsx)(`span`,{className:[Y.chevron,C?Y.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]})}),C&&(0,n.createPortal)(ee,document.body),f&&!u&&(0,e.jsx)(`span`,{id:M,className:Y.message,children:f}),u&&(0,e.jsx)(`span`,{id:N,className:Y.error,children:u})]})},Ye=e=>`${e.id}:${e.direction}`,Xe=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:Ye({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:Ye({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(Je,{options:c,value:n?Ye(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},Ze={wrapper:`_wrapper_1khfq_1`,control:`_control_1khfq_15`,input:`_input_1khfq_25`,disabledText:`_disabledText_1khfq_25`,sm:`_sm_1khfq_107`,md:`_md_1khfq_123`,lg:`_lg_1khfq_139`,inputError:`_inputError_1khfq_155`,trailingAction:`_trailingAction_1khfq_163`},Qe=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:f=``,name:p,id:m,size:_=`md`,clearable:v=!0,required:y=!1,selectTextOnFocus:b=!1,isPassword:x=!1,passwordVisibleLabel:S=`Скрыть пароль`,passwordHiddenLabel:C=`Показать пароль`,onFocus:w,...T})=>{let E=(0,t.useId)(),D=m??`ds-input-${p??E}`,O=(0,t.useRef)(null),[k,A]=(0,t.useState)(!1),j=d?`${D}-hint`:void 0,M=u?`${D}-error`:void 0,N=String(n??``),P=[j,M].filter(Boolean).join(` `)||void 0,F=x?k?`text`:`password`:i;return(0,t.useEffect)(()=>{x||A(!1)},[x]),(0,e.jsxs)(`div`,{className:`${Ze.wrapper} ${f}`,children:[l&&(0,e.jsx)(h,{htmlFor:D,required:y,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:D,className:Ze.disabledText,"aria-describedby":P,children:N||a}):(0,e.jsxs)(`div`,{className:Ze.control,children:[(0,e.jsx)(`input`,{ref:O,id:D,name:p,type:F,value:N,placeholder:a,disabled:o,readOnly:s,required:y,"aria-invalid":!!u,"aria-describedby":P,className:`${Ze.input} ${Ze[_]} ${u?Ze.inputError:``}`,onChange:e=>{if(i===`number`&&!x){let t=e.target.value===``?``:Number(e.target.value);r?.(t,e);return}r?.(e.target.value,e)},onFocus:e=>{b&&e.currentTarget.value&&e.currentTarget.select(),w?.(e)},...T}),x&&(0,e.jsx)(`button`,{type:`button`,className:Ze.trailingAction,disabled:o,"aria-label":k?S:C,"aria-pressed":k,onClick:()=>A(e=>!e),children:(0,e.jsx)(W,{name:k?`IconEyeOff`:`IconEye`,width:20,height:20})}),!x&&v&&N&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:Ze.trailingAction,"aria-label":`Очистить поле`,onClick:()=>{let e=O.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]}),d&&!u&&(0,e.jsx)(g,{id:j,children:d}),u&&(0,e.jsx)(g,{id:M,variant:`error`,children:u})]})},$e=8,et=6,tt=120,nt=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},rt=({options:r,value:i,onChange:a,placeholder:o=`Выберите опции`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,required:f=!1,hint:p,className:m=``,name:g,id:_,closeOnSelect:v=!1,needMark:y=!0,maxMenuHeight:b})=>{let x=(0,t.useId)(),S=_??`ds-dropdown-multiple-${g??x}`,C=`${S}-listbox`,[w,T]=(0,t.useState)(!1),[E,D]=(0,t.useState)(null),O=(0,t.useRef)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)([]),M=(0,t.useMemo)(()=>r.filter(e=>i.includes(e.value)),[r,i]).map(e=>e.label).join(`, `),N=p?`${S}-hint`:void 0,P=u?`${S}-error`:void 0,F=[N,P].filter(Boolean).join(` `)||void 0,I=s&&c,L=(0,t.useCallback)(()=>{let e=k.current,t=A.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerHeight-n.bottom-$e,a=n.top-$e,o=i<r.height&&a>i,s=Math.max(tt,o?a:i),c=window.innerWidth-n.width-$e;D({top:o?Math.max($e,n.top-r.height-et):n.bottom+et,left:Math.max($e,Math.min(n.left,c)),width:n.width,maxHeight:Math.min(s,nt(b))})},[b]);(0,t.useLayoutEffect)(()=>{if(!w){D(null);return}return L(),window.addEventListener(`resize`,L),window.addEventListener(`scroll`,L,!0),()=>{window.removeEventListener(`resize`,L),window.removeEventListener(`scroll`,L,!0)}},[w,r.length,L]),(0,t.useEffect)(()=>{if(!w)return;let e=e=>{let t=e.target;!O.current?.contains(t)&&!A.current?.contains(t)&&T(!1)},t=e=>{e.key===`Escape`&&(T(!1),k.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[w]);let R=(e,t)=>{let n=Ke(r,e,t);n!==-1&&(j.current[n]?.focus(),j.current[n]?.scrollIntoView({block:`nearest`}))},ee=e=>{if(e.disabled)return;let t=i.includes(e.value)?i.filter(t=>t!==e.value):[...i,e.value];a?.(t,r.filter(e=>t.includes(e.value))),v&&(T(!1),k.current?.focus())},te=w?(0,e.jsx)(`ul`,{ref:A,id:C,className:Y.menu,role:`listbox`,"aria-label":l,"aria-multiselectable":`true`,style:E?{position:`fixed`,top:E.top,left:E.left,width:E.width,maxHeight:E.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=i.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{j.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,"data-option-variant":t.variant??`default`,className:[Y[d],Y.option,t.variant===`action`?Y.actionOption:``,a?Y.selected:``].filter(Boolean).join(` `),onClick:()=>ee(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;R(n+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;R(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),ee(t)),e.key===`Tab`&&T(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),a&&y&&(0,e.jsx)(W,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:O,className:[Y.wrapper,u?Y.errorState:``,m].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(h,{htmlFor:I?void 0:S,required:f,disabled:s,children:l}),(0,e.jsx)(`div`,{className:Y.container,children:I?(0,e.jsx)(`div`,{id:S,className:`${Y.disabledText} ${Y[d]}`,"aria-describedby":F,children:M||o}):(0,e.jsxs)(`button`,{ref:k,id:S,type:`button`,name:g,className:`${Y.trigger} ${Y[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":w,"aria-controls":C,"aria-describedby":F,"aria-invalid":!!u,onClick:()=>T(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),T(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>R(e.key===`ArrowDown`?0:r.length-1,t))}},children:[(0,e.jsx)(`span`,{className:`${M?Y.value:Y.placeholder} ${Y[d]}`,children:M||o}),(0,e.jsx)(`span`,{className:[Y.chevron,w?Y.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]})}),w&&(0,n.createPortal)(te,document.body),p&&!u&&(0,e.jsx)(`span`,{id:N,className:Y.message,children:p}),u&&(0,e.jsx)(`span`,{id:P,className:Y.error,children:u})]})},it={wrapper:`_wrapper_1jspu_1`,input:`_input_1jspu_21`,switch:`_switch_1jspu_35`,thumb:`_thumb_1jspu_67`,label:`_label_1jspu_113`,disabled:`_disabled_1jspu_125`},at=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${it.wrapper} ${a?it.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:it.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:it.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:it.thumb})}),i&&(0,e.jsx)(`span`,{className:it.label,children:i})]})},X={root:`_root_y4bhr_1`,toolbar:`_toolbar_y4bhr_15`,totalWidget:`_totalWidget_y4bhr_31`,totalLabel:`_totalLabel_y4bhr_53`,totalValue:`_totalValue_y4bhr_63`,srOnly:`_srOnly_y4bhr_77`,bulkActions:`_bulkActions_y4bhr_101`,filterBar:`_filterBar_y4bhr_123`,filterFields:`_filterFields_y4bhr_141`,filterActions:`_filterActions_y4bhr_155`,pageSizePanel:`_pageSizePanel_y4bhr_167`,embedded:`_embedded_y4bhr_167`,pendingChanges:`_pendingChanges_y4bhr_179`,tableWrap:`_tableWrap_y4bhr_191`,table:`_table_y4bhr_191`,compact:`_compact_y4bhr_241`,selectionColumn:`_selectionColumn_y4bhr_279`,expansionColumn:`_expansionColumn_y4bhr_287`,expansionCell:`_expansionCell_y4bhr_289`,expansionIcon:`_expansionIcon_y4bhr_301`,expansionIconOpen:`_expansionIconOpen_y4bhr_311`,detailRow:`_detailRow_y4bhr_321`,stickyColumn:`_stickyColumn_y4bhr_331`,selectionHeaderCell:`_selectionHeaderCell_y4bhr_367`,selectionCell:`_selectionCell_y4bhr_369`,selectionHeaderControls:`_selectionHeaderControls_y4bhr_381`,mobileSelectionControls:`_mobileSelectionControls_y4bhr_383`,cardSelectionControls:`_cardSelectionControls_y4bhr_385`,selectedRow:`_selectedRow_y4bhr_399`,sticky:`_sticky_y4bhr_331`,sortButton:`_sortButton_y4bhr_437`,state:`_state_y4bhr_475`,cards:`_cards_y4bhr_487`,mobileSort:`_mobileSort_y4bhr_487`,card:`_card_y4bhr_385`,spanTwo:`_spanTwo_y4bhr_575`,selectedCard:`_selectedCard_y4bhr_583`,customCardShell:`_customCardShell_y4bhr_617`,clickableRow:`_clickableRow_y4bhr_631`,cardDetail:`_cardDetail_y4bhr_649`,pagination:`_pagination_y4bhr_675`,bottom:`_bottom_y4bhr_723`,pageSizeMain:`_pageSizeMain_y4bhr_737`,pageSizeOptions:`_pageSizeOptions_y4bhr_739`,pageSizeFieldset:`_pageSizeFieldset_y4bhr_751`,pageSizeOption:`_pageSizeOption_y4bhr_739`,pageSizeOptionActive:`_pageSizeOptionActive_y4bhr_829`,pageSizeWarning:`_pageSizeWarning_y4bhr_843`,paginationRange:`_paginationRange_y4bhr_855`,paginationControls:`_paginationControls_y4bhr_867`,pageNumbers:`_pageNumbers_y4bhr_869`,pageButton:`_pageButton_y4bhr_881`,ellipsis:`_ellipsis_y4bhr_891`,previousIcon:`_previousIcon_y4bhr_903`,nextIcon:`_nextIcon_y4bhr_911`,default:`_default_y4bhr_1011`,tableOnMobile:`_tableOnMobile_y4bhr_1011`,wide:`_wide_y4bhr_1041`},ot=(0,r.tableFeatures)({rowSortingFeature:r.rowSortingFeature,sortedRowModel:(0,r.createSortedRowModel)()}),st=[10,30,50,-1];function ct(e,t){return t.includes(e)?e:t.includes(30)?30:t.find(e=>Number.isSafeInteger(e)&&e>0)??30}var lt=({field:n,value:r,setValue:i,disabled:a,error:o})=>{let s=n.type===`multi-select`?n.options:void 0,[c,l]=(0,t.useState)(Array.isArray(s)?s:[]),[u,d]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{if(s===void 0)return;if(Array.isArray(s)){l(s);return}let e=!0;return d(!0),s().then(t=>{e&&l(t)}).finally(()=>{e&&d(!1)}),()=>{e=!1}},[s]),n.type===`multi-select`?(0,e.jsx)(rt,{label:n.label,options:c,value:Array.isArray(r)?r.map(String):[],disabled:a||u,placeholder:u?`Загрузка…`:n.placeholder,error:o,onChange:e=>i(e)}):n.type===`switch`?(0,e.jsx)(at,{label:n.label,checked:!!r,disabled:a,onChange:e=>i(e)}):n.type===`custom`?n.render({value:r,setValue:i,disabled:a,error:o}):(0,e.jsx)(Qe,{label:n.label,type:n.type===`search`?`search`:`text`,value:String(r??``),disabled:a,placeholder:n.placeholder,error:o,onChange:e=>i(e)})},ut=(e,t,n)=>{let r=new Set(e);return t.forEach(e=>{n?r.add(e):r.delete(e)}),Array.from(r)},dt=e=>{if(!(!e||e.width===void 0&&e.minWidth===void 0&&e.maxWidth===void 0))return{width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth}},ft=e=>{if(e?.sticky)return e.sticky===`start`?{insetInlineStart:e.stickyOffset??0}:{insetInlineEnd:e.stickyOffset??0}},pt=(e,t)=>t<=7?Array.from({length:t},(e,t)=>t):e<=3?[0,1,2,3,4,`ellipsis-end`,t-1]:e>=t-4?[0,`ellipsis-start`,t-5,t-4,t-3,t-2,t-1]:[0,`ellipsis-start`,e-1,e,e+1,`ellipsis-end`,t-1],mt=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1){let r=t[n];for(let t of e)if(typeof t.accessor==`string`&&!(t.accessor in r))return`В строке ${n+1} отсутствует колонка «${t.id}»`}return null},ht=(e,t)=>typeof e==`function`?e(t):t[e],gt=e=>{if(e==null||e===``)return null;let t=Date.parse(String(e));return Number.isNaN(t)?null:t},_t=(e,t,n)=>{let r=gt(e.getValue(n)),i=gt(t.getValue(n));return r===null&&i===null?0:r===null?-1:i===null?1:r-i},vt=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(r)-Number(i)},yt=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(!!r)-Number(!!i)},bt=(e,t,n)=>{let r=String(e.getValue(n)??``),i=String(t.getValue(n)??``);return r.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`})},xt=e=>{switch(e){case`date`:return _t;case`number`:return vt;case`boolean`:return yt;case`text`:case void 0:return bt;case`custom`:return}},St=e=>{let t=t=>ht(e.accessor,t),n=e.sortFn??xt(e.dataType),r=e.enableSorting??(e.dataType!==`custom`&&n!==void 0),i={id:e.id,accessorFn:t,header:()=>e.header,cell:t=>{let n=t.getValue();return e.cell?.(t.row.original,n)??String(n??``)},enableSorting:r,sortDescFirst:e.sortDescFirst};return n!==void 0&&(i.sortFn=n),i},Ct=({columns:n,data:i,tableOnMobile:a=!1,mobileView:o,breakpoint:s=`default`,sorting:c,onSortingChange:l,renderMobileCard:u,getRowId:d,getRowClassName:f,getRowStyle:m,toolbarContent:h,totalCountVariant:g=`default`,totalCountLabel:_=`Всего`,caption:v,ariaLabel:y,loading:b=!1,error:x,emptyState:S=`Нет данных`,stickyHeader:C=!1,maxHeight:w,className:T=``,onRowClick:E,selectable:D=!1,selectedRowIds:O,onSelectedRowIdsChange:k,onRowDoubleClick:A,getRowSelectionLabel:j,selectAllRowsLabel:M=`Выбрать все строки на этой странице`,resetSelectionLabel:N=`Сбросить выбор`,openRowLabel:P=`Открыть строку`,pagination:F=!1,paginationMode:I=`client`,page:L=1,pageSize:R=30,onPageSizeChange:ee,pageSizeOptions:te=st,pageSizeDraft:z,onPageSizeDraftChange:ne,pageSizeApplyMode:re=`table`,totalCount:ie,onPageChange:ae,visibleColumnIds:B,density:oe=`comfortable`,renderBulkActions:se,renderExpandedRow:V,expandedRowIds:ce,onExpandedRowIdsChange:le,getRowExpansionLabel:ue,resultsAnnouncement:de,filterBar:H})=>{let[fe,pe]=(0,t.useState)([]),[me,he]=(0,t.useState)([]),[ge,U]=(0,t.useState)([]),[_e,ve]=(0,t.useState)(0),[ye,G]=(0,t.useState)(()=>ct(R,te)),xe=c??fe,Se=xe.map(e=>`${e.id}:${e.desc?`desc`:`asc`}`).join(`|`),Ce=R===-1,we=Ce?Math.max(1,(I===`server`?Number(ie):i.length)||i.length||1):Number.isFinite(R)&&R>0?Math.floor(R):30,Te=F&&I===`server`,K=(0,t.useMemo)(()=>{if(B===void 0)return n;let e=new Set(B);return n.filter(t=>e.has(t.id))},[n,B]),Ee=(0,t.useMemo)(()=>K.length===0?`Должна быть видима хотя бы одна колонка`:mt(K,i),[i,K]),De=(0,t.useMemo)(()=>K.map(St),[K]),Oe=K.some(e=>dt(e)!==void 0),ke=(0,r.useTable)({features:ot,columns:De,data:i,state:{sorting:xe},onSortingChange:e=>{let t=typeof e==`function`?e(xe):e;c===void 0&&pe(t),ve(0),l?.(t)},getRowId:d}),Ae=ke.getRowModel().rows,q=Te&&Number.isFinite(ie)&&Number(ie)>=0?Math.floor(Number(ie)):Ae.length,je=F?Math.max(1,Math.ceil(q/we)):1,Me=Number.isFinite(L)&&L>0?Math.floor(L)-1:0,Ne=Math.min(Te?Me:_e,je-1),Pe=(0,t.useMemo)(()=>F&&!Te?Ae.slice(Ne*we,(Ne+1)*we):Ae,[Te,we,F,Ne,Ae]),Fe=O??me,J=(0,t.useMemo)(()=>new Set(Fe),[Fe]),Ie=ce??ge,Le=(0,t.useMemo)(()=>new Set(Ie),[Ie]),Re=(0,t.useMemo)(()=>Pe.map(e=>e.id),[Pe]),ze=Re.filter(e=>J.has(e)).length,Be=Re.length>0&&ze===Re.length,Ve=ze>0&&!Be,Y=(0,t.useMemo)(()=>K.filter(e=>e.enableSorting??e.dataType!==`custom`).map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),[K]),Ue=(0,t.useMemo)(()=>pt(Ne,je),[je,Ne]),We=o===void 0?a:o===`table`,Ge=[X.root,s===`wide`?X.wide:X.default,We?X.tableOnMobile:``,oe===`compact`?X.compact:``,T].filter(Boolean).join(` `),Ke=Ee??x,qe=F&&!Ce&&!Ke&&q>we&&(!b||Te),Je=F&&!!(ee||ne||H),Ye=z??ye,Ze=H?(typeof H.validation==`function`?H.validation(H.draftValues):H.validation)??{}:{},Qe=H?JSON.stringify(H.draftValues)!==JSON.stringify(H.appliedValues)||Ye!==R:!1,$e=Object.values(Ze).some(Boolean),et=q===0?0:Ne*we+1,tt=Math.min((Ne+1)*we,q),nt=()=>{Ye!==R&&(ve(0),ae?.(1),ee?.(Ye))},rt=(t,n=!1)=>{let r=Ye!==R,i=`ds-data-table-page-size-warning-${t}`;return(0,e.jsxs)(`div`,{className:`${X.pageSizePanel} ${X[t]} ${n?X.embedded:``}`,children:[(0,e.jsxs)(`div`,{className:X.pageSizeMain,children:[(0,e.jsxs)(`fieldset`,{className:X.pageSizeFieldset,disabled:b||H?.applying,children:[(0,e.jsx)(`legend`,{children:`На странице`}),(0,e.jsx)(`div`,{className:X.pageSizeOptions,children:te.map(t=>(0,e.jsx)(`button`,{type:`button`,className:`${X.pageSizeOption} ${Ye===t?X.pageSizeOptionActive:``}`,"aria-pressed":Ye===t,onClick:()=>{z===void 0&&G(t),ne?.(t)},children:t===-1?`Все`:t},t))})]}),re===`table`&&!H&&(0,e.jsx)(p,{size:`sm`,disabled:b||!r,"aria-describedby":Ye===-1&&r&&t===`top`?i:void 0,onClick:nt,children:`Применить`})]}),(0,e.jsxs)(`span`,{className:X.paginationRange,children:[`Показано `,et,`–`,tt,` из `,q]}),Qe&&t===`top`&&(0,e.jsx)(`span`,{className:X.pendingChanges,role:`status`,children:`Есть неприменённые изменения`}),Te&&Ye===-1&&r&&(0,e.jsxs)(`span`,{id:i,className:X.pageSizeWarning,"aria-hidden":t===`bottom`||void 0,children:[`Будут загружены все `,q,` записей`]})]})},it=e=>{let t=Math.max(0,Math.min(je-1,e));if(Te){t!==Ne&&ae?.(t+1);return}ve(t)},at=e=>{let t=Array.from(e);O===void 0&&he(t),k?.(t)},gt=e=>{let t=new Set(J);t.has(e)?t.delete(e):t.add(e),at(t)},_t=()=>{let e=ut(J,Re,!Be);O===void 0&&he(e),k?.(e)},vt=()=>at(new Set),yt=e=>{let t=new Set(Le);t.has(e)?t.delete(e):t.add(e);let n=Array.from(t);ce===void 0&&U(n),le?.(n)},bt=i.filter((e,t)=>J.has(d?.(e,t)??String(t))),xt=de?.({visibleCount:Pe.length,totalCount:q,selectedCount:J.size})??`Показано строк: ${Pe.length} из ${q}. Выбрано: ${J.size}.`;return(0,t.useEffect)(()=>{Te||ve(0)},[i,Te,we,F,Se]),(0,t.useEffect)(()=>{!Te&&_e>=je&&ve(je-1)},[Te,je,_e]),(0,t.useEffect)(()=>{G(ct(R,te))},[R,te]),(0,e.jsxs)(`section`,{className:Ge,"aria-busy":b,children:[(0,e.jsx)(`div`,{className:X.srOnly,"aria-live":`polite`,"aria-atomic":`true`,children:xt}),se&&J.size>0&&(0,e.jsx)(`div`,{className:X.bulkActions,role:`region`,"aria-label":`Действия с выбранными строками`,children:se({selectedRowIds:Array.from(J),selectedRows:bt,clearSelection:vt})}),H&&(0,e.jsxs)(`form`,{className:X.filterBar,role:`search`,"aria-label":`Фильтры таблицы`,onSubmit:e=>{e.preventDefault(),!(!Qe||$e||H.applying||b)&&(ve(0),ae?.(1),H.onApply({filters:H.draftValues,pageSize:Ye}))},children:[(0,e.jsx)(`div`,{className:X.filterFields,children:H.fields.map(t=>(0,e.jsx)(lt,{field:t,value:H.draftValues[t.key],disabled:!!(t.disabled||H.applying||b),error:Ze[t.key],setValue:e=>H.onDraftValuesChange({...H.draftValues,[t.key]:e})},t.key))}),Je&&rt(`top`,!0),(0,e.jsxs)(`div`,{className:X.filterActions,children:[(0,e.jsx)(p,{variant:`empty`,disabled:H.applying||b,onClick:()=>{let e=H.resetValues??H.appliedValues;H.onDraftValuesChange(e);let t=H.resetPageSize??te[0]??30;z===void 0&&G(t),ne?.(t),H.onReset?.({filters:e,pageSize:t})},children:H.resetLabel??`Сбросить`}),(0,e.jsx)(p,{type:`submit`,isLoading:H.applying,disabled:!Qe||$e||b,children:H.applyLabel??`Применить`})]})]}),Je&&!H&&rt(`top`),(g===`highlighted`||h!=null)&&(0,e.jsxs)(`div`,{className:X.toolbar,children:[g===`highlighted`&&(0,e.jsxs)(`div`,{className:X.totalWidget,"aria-label":`${_}: ${q}`,children:[(0,e.jsx)(`span`,{className:X.totalLabel,children:_}),(0,e.jsx)(`strong`,{className:X.totalValue,children:q})]}),h]}),!We&&!b&&!Ke&&Pe.length>0&&Y.length>0&&(0,e.jsx)(Xe,{className:X.mobileSort,options:Y,value:xe[0]?{id:xe[0].id,direction:xe[0].desc?`desc`:`asc`}:null,onChange:e=>ke.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:X.tableWrap,style:{maxHeight:w},children:(0,e.jsxs)(`table`,{className:X.table,"aria-label":y,children:[v&&(0,e.jsx)(`caption`,{children:v}),(Oe||D||!!V)&&(0,e.jsxs)(`colgroup`,{children:[V&&(0,e.jsx)(`col`,{className:X.expansionColumn}),D&&(0,e.jsx)(`col`,{className:X.selectionColumn}),K.map(t=>(0,e.jsx)(`col`,{style:dt(t)},t.id))]}),(0,e.jsx)(`thead`,{className:C?X.sticky:``,children:ke.getHeaderGroups().map(t=>(0,e.jsxs)(`tr`,{children:[V&&(0,e.jsx)(`th`,{className:X.expansionCell,scope:`col`,children:(0,e.jsx)(`span`,{className:X.srOnly,children:`Подробности`})}),D&&(0,e.jsx)(`th`,{className:X.selectionHeaderCell,scope:`col`,children:(0,e.jsxs)(`div`,{className:X.selectionHeaderControls,children:[(0,e.jsx)(be,{checked:Be,indeterminate:Ve,disabled:b||Re.length===0,ariaLabel:M,onChange:_t}),(0,e.jsx)(p,{size:`sm`,variant:`empty`,disabled:J.size===0,"aria-label":N,title:N,onClick:vt,children:(0,e.jsx)(W,{name:`IconX`,width:16,height:16})})]})}),t.headers.map(t=>{let n=t.column.getIsSorted(),r=t.column.getCanSort(),i=t.column.getToggleSortingHandler();return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,className:K.find(e=>e.id===t.column.id)?.sticky?X.stickyColumn:void 0,style:{...dt(K.find(e=>e.id===t.column.id)),...ft(K.find(e=>e.id===t.column.id))},children:(0,e.jsxs)(`button`,{type:`button`,className:X.sortButton,disabled:!r,onClick:i,children:[(0,e.jsx)(ke.FlexRender,{header:t}),(0,e.jsx)(W,{name:n===`asc`?`IconSortAscending`:n===`desc`?`IconSortDescending`:`IconSort`,width:16,height:16})]})},t.id)})]},t.id))}),(0,e.jsx)(`tbody`,{children:b?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:K.length+ +!!D+ +!!V,children:(0,e.jsx)(He,{lines:3,height:65})})}):Ke?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:X.state,colSpan:K.length+ +!!D+ +!!V,children:Ke})}):Pe.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:X.state,colSpan:K.length+ +!!D+ +!!V,children:S})}):Pe.map(n=>{let r=J.has(n.id),i=j?.(n.original)??`Выбрать строку ${n.index+1}`,a=Le.has(n.id);return(0,e.jsxs)(t.Fragment,{children:[(0,e.jsxs)(`tr`,{className:[E||D?X.clickableRow:``,r?X.selectedRow:``,f?.(n.original)].filter(Boolean).join(` `),style:m?.(n.original),"aria-selected":D?r:void 0,onClick:()=>{D?gt(n.id):E?.(n.original)},onDoubleClick:()=>{D&&A?.(n.original)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),D?A?.(n.original):E?.(n.original)):e.key===` `&&D&&(e.preventDefault(),gt(n.id))},tabIndex:E||D||A?0:void 0,role:!D&&E?`button`:void 0,children:[V&&(0,e.jsx)(`td`,{className:X.expansionCell,onClick:e=>e.stopPropagation(),children:(0,e.jsx)(p,{size:`sm`,variant:`empty`,"aria-expanded":a,"aria-label":ue?.(n.original,a)??(a?`Скрыть подробности строки`:`Показать подробности строки`),onClick:()=>yt(n.id),children:(0,e.jsx)(W,{name:`IconChevron`,width:16,height:16,className:a?X.expansionIconOpen:X.expansionIcon})})}),D&&(0,e.jsx)(`td`,{className:X.selectionCell,children:(0,e.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,e.jsx)(be,{checked:r,ariaLabel:i,onChange:()=>gt(n.id)})})}),n.getAllCells().map(t=>(0,e.jsx)(`td`,{className:K.find(e=>e.id===t.column.id)?.sticky?X.stickyColumn:void 0,style:{...dt(K.find(e=>e.id===t.column.id)),...ft(K.find(e=>e.id===t.column.id))},children:(0,e.jsx)(ke.FlexRender,{cell:t})},t.id))]}),a&&V&&(0,e.jsx)(`tr`,{className:X.detailRow,children:(0,e.jsx)(`td`,{colSpan:K.length+ +!!D+1,children:V({row:n.original,rowId:n.id,collapse:()=>yt(n.id)})})})]},n.id)})})]})}),!We&&(0,e.jsxs)(`div`,{className:X.cards,role:`list`,"aria-label":y??v,children:[D&&!b&&!Ke&&Pe.length>0&&(0,e.jsxs)(`div`,{className:X.mobileSelectionControls,children:[(0,e.jsx)(be,{checked:Be,indeterminate:Ve,ariaLabel:M,label:M,onChange:_t}),(0,e.jsx)(p,{size:`sm`,variant:`empty`,disabled:J.size===0,onClick:vt,children:N})]}),b?(0,e.jsx)(He,{lines:4,height:65}):Ke?(0,e.jsx)(`div`,{className:X.state,children:Ke}):Pe.length===0?(0,e.jsx)(`div`,{className:X.state,children:S}):Pe.map(t=>{let n=J.has(t.id),r=Le.has(t.id),i=j?.(t.original)??`Выбрать строку ${t.index+1}`,a=D&&(0,e.jsxs)(`div`,{className:X.cardSelectionControls,onClick:e=>e.stopPropagation(),children:[(0,e.jsx)(be,{checked:n,ariaLabel:i,onChange:()=>gt(t.id)}),A&&(0,e.jsx)(p,{size:`sm`,variant:`empty`,onClick:()=>A(t.original),children:P})]}),o=V&&(0,e.jsx)(p,{size:`sm`,variant:`empty`,"aria-expanded":r,"aria-label":ue?.(t.original,r)??(r?`Скрыть подробности строки`:`Показать подробности строки`),onClick:e=>{e.stopPropagation(),yt(t.id)},children:(0,e.jsx)(W,{name:`IconChevron`,width:16,height:16,className:r?X.expansionIconOpen:X.expansionIcon})});if(u)return(0,e.jsxs)(`div`,{role:`listitem`,className:[X.customCardShell,n?X.selectedCard:``,f?.(t.original)].filter(Boolean).join(` `),style:m?.(t.original),"aria-selected":D?n:void 0,onClick:()=>{D&&gt(t.id)},children:[a,u({row:t.original,columns:K}),o,r&&(0,e.jsx)(`div`,{className:X.cardDetail,children:V?.({row:t.original,rowId:t.id,collapse:()=>yt(t.id)})})]},t.id);let s=K.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),c=s.find(e=>e.mobile?.primary)??s.find(e=>e.mobile?.mobileVariant!==`actions`),l=e=>ht(e.accessor,t.original),d=e=>e.mobile?.renderMobile?.(t.original,l(e))??e.cell?.(t.original,l(e))??String(l(e)??``);return(0,e.jsxs)(`article`,{role:`listitem`,className:[X.card,n?X.selectedCard:``,f?.(t.original)].filter(Boolean).join(` `),style:m?.(t.original),"aria-selected":D?n:void 0,onClick:()=>{D&&gt(t.id)},children:[a,o,(0,e.jsx)(`h3`,{children:c?d(c):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:s.filter(e=>e!==c&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?X.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:d(t)})]},t.id))}),s.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:d(t)},t.id)),r&&(0,e.jsx)(`div`,{className:X.cardDetail,children:V?.({row:t.original,rowId:t.id,collapse:()=>yt(t.id)})})]},t.id)})]}),(qe||Je&&!b&&!Ke&&Pe.length>0)&&(0,e.jsxs)(`nav`,{className:X.pagination,"aria-label":`Пагинация таблицы`,children:[Je?rt(`bottom`):(0,e.jsxs)(`span`,{className:X.paginationRange,"aria-live":`polite`,children:[et,`–`,tt,` из `,q]}),qe&&(0,e.jsxs)(`div`,{className:X.paginationControls,children:[(0,e.jsxs)(p,{variant:`empty`,size:`md`,disabled:b||Ne===0,"aria-label":`Предыдущая страница`,onClick:()=>{it(Ne-1)},children:[(0,e.jsx)(W,{name:`IconChevron`,width:18,height:18,className:X.previousIcon}),(0,e.jsx)(`span`,{className:X.paginationButtonLabel,children:`Назад`})]}),(0,e.jsx)(`div`,{className:X.pageNumbers,children:Ue.map(t=>typeof t==`number`?(0,e.jsx)(p,{variant:t===Ne?`secondary`:`empty`,size:`md`,className:X.pageButton,"aria-label":`Перейти на страницу ${t+1}`,"aria-current":t===Ne?`page`:void 0,disabled:b,onClick:()=>{it(t)},children:t+1},t):(0,e.jsx)(`span`,{className:X.ellipsis,"aria-hidden":`true`,children:`…`},t))}),(0,e.jsxs)(p,{variant:`empty`,size:`md`,disabled:b||Ne===je-1,"aria-label":`Следующая страница`,onClick:()=>{it(Ne+1)},children:[(0,e.jsx)(`span`,{className:X.paginationButtonLabel,children:`Вперёд`}),(0,e.jsx)(W,{name:`IconChevron`,width:18,height:18,className:X.nextIcon})]})]})]})]})},wt=(e,t)=>{let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.value.toLocaleLowerCase().includes(n)):e},Tt=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},Z={wrapper:`_wrapper_1os84_1`,control:`_control_1os84_17`,inputHost:`_inputHost_1os84_25`,sm:`_sm_1os84_41`,md:`_md_1os84_57`,lg:`_lg_1os84_71`,errorState:`_errorState_1os84_85`,disabledText:`_disabledText_1os84_93`,chevron:`_chevron_1os84_163`,chevronOpen:`_chevronOpen_1os84_197`,menu:`_menu_1os84_205`,menuEmpty:`_menuEmpty_1os84_233`,option:`_option_1os84_241`,empty:`_empty_1os84_241`,selected:`_selected_1os84_321`,active:`_active_1os84_321`,actionOption:`_actionOption_1os84_341`,visuallyHidden:`_visuallyHidden_1os84_375`},Et=8,Dt=6,Ot=5,kt=10,At={sm:30,md:40,lg:50},jt=({options:r,value:i,onChange:a,placeholder:o=`Начните вводить`,noResultsText:s=`Ничего не найдено`,disabled:c=!1,readOnly:l=!1,stringWhileDisabled:u=!1,label:d,error:f,hint:p,size:m=`md`,required:_=!1,className:v=``,name:y,id:b,needMark:x=!0})=>{let S=(0,t.useId)(),C=b??`ds-search-dropdown-${y??S}`,w=`${C}-listbox`,T=`${C}-status`,E=p?`${C}-hint`:void 0,D=f?`${C}-error`:void 0,O=[T,E,D].filter(Boolean).join(` `),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)([]),[M,N]=(0,t.useState)(!1),[P,F]=(0,t.useState)(``),[I,L]=(0,t.useState)(-1),[R,ee]=(0,t.useState)(null),te=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),z=(0,t.useMemo)(()=>wt(r,P),[r,P]),ne=c&&u,re=I>=0?z[I]:void 0;(0,t.useEffect)(()=>F(te?.label??``),[te?.label,i]);let ie=(0,t.useCallback)(()=>k.current?.querySelector(`input`)??null,[]),ae=(0,t.useCallback)((e,t)=>Tt(z,e,t),[z]),B=(0,t.useCallback)(e=>{L(e),!(e<0)&&requestAnimationFrame(()=>j.current[e]?.scrollIntoView({block:`nearest`}))},[]),oe=(0,t.useCallback)(()=>{let e=ie();if(!e)return;let t=e.getBoundingClientRect(),n=Math.max(1,Math.min(z.length,Ot))*At[m]+kt,r=window.innerHeight-t.bottom-Et,i=t.top-Et,a=r<n&&i>r,o=a?i:r,s=Math.max(At[m]+kt,Math.min(n,o)),c=window.innerWidth-t.width-Et,l=Math.max(Et,Math.min(t.left,c)),u=a?Math.max(Et,t.top-s-Dt):t.bottom+Dt;ee({top:u,left:l,width:t.width,maxHeight:s})},[z.length,ie,m]);(0,t.useLayoutEffect)(()=>{if(!M){ee(null);return}return oe(),window.addEventListener(`resize`,oe),window.addEventListener(`scroll`,oe,!0),()=>{window.removeEventListener(`resize`,oe),window.removeEventListener(`scroll`,oe,!0)}},[M,oe]),(0,t.useEffect)(()=>{if(!M)return;let e=e=>{let t=e.target;!k.current?.contains(t)&&!A.current?.contains(t)&&(N(!1),L(-1))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[M]);let se=()=>{c||l||(N(!0),L(ae(0,1)))},V=e=>{e.disabled||(F(e.label),N(!1),L(-1),a?.(e.value,e),ie()?.focus())},ce=M?(0,e.jsx)(`ul`,{ref:A,id:w,className:`${Z.menu} ${z.length===0?Z.menuEmpty:``}`,role:`listbox`,"aria-label":d,style:R?{top:R.top,left:R.left,width:R.width,maxHeight:R.maxHeight}:{top:0,left:0,visibility:`hidden`,maxHeight:0},children:z.length===0?(0,e.jsx)(`li`,{className:`${Z.empty} ${Z[m]}`,children:s}):z.map((t,n)=>{let r=t.value===i,a=n===I;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{j.current[n]=e},id:`${C}-option-${n}`,type:`button`,role:`option`,tabIndex:-1,disabled:t.disabled,"aria-disabled":t.disabled,"aria-selected":r,"data-option-variant":t.variant??`default`,className:[Z.option,Z[m],t.variant===`action`?Z.actionOption:``,r?Z.selected:``,a?Z.active:``].filter(Boolean).join(` `),onPointerMove:()=>{t.disabled||L(n)},onClick:()=>V(t),children:[(0,e.jsx)(`span`,{children:t.label}),r&&x&&(0,e.jsx)(W,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:k,className:[Z.wrapper,f?Z.errorState:``,v].filter(Boolean).join(` `),children:[d&&(0,e.jsx)(h,{htmlFor:ne?void 0:C,required:_,disabled:c,children:d}),ne?(0,e.jsx)(`div`,{className:`${Z.disabledText} ${Z[m]}`,children:te?.label??o}):(0,e.jsxs)(`div`,{className:Z.control,children:[(0,e.jsx)(Qe,{id:C,name:y,value:P,placeholder:o,disabled:c,readOnly:l,required:_,size:m,clearable:!1,autoComplete:`off`,className:`${Z.inputHost} ${Z[m]}`,onFocus:se,onChange:e=>{let t=String(e),n=wt(r,t);F(t),N(!0),L(Tt(n,0,1))},role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":M,"aria-controls":w,"aria-activedescendant":re?`${C}-option-${I}`:void 0,"aria-invalid":!!f,"aria-describedby":O,onClick:se,onKeyDown:e=>{if(!(c||l)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=I>=0?I+t:t===1?0:z.length-1;N(!0),B(ae(n,t))}else if(e.key===`Home`||e.key===`End`){if(!M)return;e.preventDefault();let t=e.key===`Home`?1:-1;B(ae(e.key===`Home`?0:z.length-1,t))}else e.key===`Enter`&&M&&re?(e.preventDefault(),V(re)):e.key===`Escape`&&M?(e.preventDefault(),N(!1),L(-1)):e.key===`Tab`&&(N(!1),L(-1))}}}),(0,e.jsx)(`span`,{className:`${Z.chevron} ${M?Z.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]}),M&&typeof document<`u`&&(0,n.createPortal)(ce,document.body),(0,e.jsxs)(`span`,{id:T,className:Z.visuallyHidden,"aria-live":`polite`,children:[`Найдено вариантов: `,z.length]}),p&&!f&&(0,e.jsx)(g,{id:E,children:p}),f&&(0,e.jsx)(g,{id:D,variant:`error`,children:f})]})},Mt={root:`_root_11adi_1`,header:`_header_11adi_21`,title:`_title_11adi_41`,dismiss:`_dismiss_11adi_55`,content:`_content_11adi_65`},Nt=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${Mt.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:Mt.header,children:[(0,e.jsx)(s,{id:l,className:Mt.title,children:n}),i&&(0,e.jsx)(p,{className:Mt.dismiss,variant:`empty`,onClick:a,"aria-label":o,children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]}),(0,e.jsx)(`div`,{className:Mt.content,children:r})]})},Pt={root:`_root_1ecm3_1`,grid:`_grid_1ecm3_13`,actions:`_actions_1ecm3_27`},Ft=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let u=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${Pt.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:Pt.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`){let n={label:t.label,hint:t.hint,placeholder:t.placeholder,disabled:r};return t.inputType===`number`?(0,e.jsx)(Qe,{...n,type:`number`,value:i??``,onChange:e=>u(t.id,e)},t.id):(0,e.jsx)(Qe,{...n,type:`text`,value:String(i??``),onChange:e=>u(t.id,e)},t.id)}if(t.type===`dropdown`)return(0,e.jsx)(Je,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>u(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(rt,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>u(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(be,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>u(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(at,{label:t.label,checked:!!i,disabled:r,onChange:e=>u(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(Be,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>u(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:Pt.actions,children:[a&&(0,e.jsx)(p,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(p,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},It={grid:`_grid_1q540_1`,comfortable:`_comfortable_1q540_11`,compact:`_compact_1q540_19`,columns1:`_columns1_1q540_27`,columns2:`_columns2_1q540_35`,columns3:`_columns3_1q540_43`,columns4:`_columns4_1q540_51`,item:`_item_1q540_59`,span1:`_span1_1q540_67`,span2:`_span2_1q540_75`,span3:`_span3_1q540_83`,span4:`_span4_1q540_91`,spanfull:`_spanfull_1q540_93`,summary:`_summary_1q540_101`,summaryTitle:`_summaryTitle_1q540_137`,summaryList:`_summaryList_1q540_145`},Lt=({columns:t=2,density:n=`comfortable`,className:r=``,...i})=>(0,e.jsx)(`div`,{...i,className:`${It.grid} ${It[`columns${t}`]} ${It[n]} ${r}`}),Rt=({span:t=1,className:n=``,...r})=>(0,e.jsx)(`div`,{...r,className:`${It.item} ${It[`span${t}`]} ${n}`}),zt=({title:t=`Проверьте заполнение формы`,items:n,focusField:r,className:i=``,...a})=>n.length===0?null:(0,e.jsxs)(`div`,{...a,className:`${It.summary} ${i}`,role:`alert`,"aria-atomic":`true`,tabIndex:-1,children:[(0,e.jsx)(`strong`,{className:It.summaryTitle,children:t}),(0,e.jsx)(`ul`,{className:It.summaryList,children:n.map(t=>(0,e.jsx)(`li`,{children:t.fieldId?(0,e.jsx)(`a`,{href:`#${t.fieldId}`,onClick:e=>{r&&(e.preventDefault(),r(t.fieldId))},children:t.message}):t.message},t.id))})]}),Bt={wrapper:`_wrapper_i20hz_1`,dropzone:`_dropzone_i20hz_15`,dragActive:`_dragActive_i20hz_45`,disabled:`_disabled_i20hz_59`,error:`_error_i20hz_69`,nativeInput:`_nativeInput_i20hz_77`,empty:`_empty_i20hz_95`,uploadIcon:`_uploadIcon_i20hz_111`,files:`_files_i20hz_133`,file:`_file_i20hz_133`,fileName:`_fileName_i20hz_175`,fileSize:`_fileSize_i20hz_187`},Vt=e=>`${e.name}:${e.size}:${e.lastModified}`,Ht=e=>e<1024?`${e} Б`:e<1048576?`${(e/1024).toFixed(1)} КБ`:`${(e/1024/1024).toFixed(1)} МБ`,Ut=(e,t)=>!t||t.split(`,`).map(e=>e.trim().toLowerCase()).some(t=>t.startsWith(`.`)?e.name.toLowerCase().endsWith(t):t.endsWith(`/*`)?e.type.startsWith(t.slice(0,-1)):e.type.toLowerCase()===t),Wt=({value:n,onChange:r,multiple:i=!1,accept:a,maxSize:o,maxFiles:s,label:c,hint:l,error:u,required:d=!1,disabled:f=!1,readOnly:m=!1,name:_,id:v,className:y=``,dropLabel:b=`Перетащите файлы в эту область`,browseLabel:x=`Выбрать файлы`,addMoreLabel:S=`Добавить ещё`,onReject:C})=>{let w=(0,t.useId)(),T=v??`ds-file-input-${_??w}`,E=(0,t.useRef)(null),D=(0,t.useRef)(0),[O,k]=(0,t.useState)(!1),A=l?`${T}-hint`:void 0,j=u?`${T}-error`:void 0,M=[A,j].filter(Boolean).join(` `)||void 0,N=!f&&!m,P=e=>{let t=[],c=new Set(n.map(Vt)),l=e.filter(e=>Ut(e,a)?o!==void 0&&e.size>o?(t.push({file:e,reason:`maxSize`}),!1):!c.has(Vt(e))&&(c.add(Vt(e)),!0):(t.push({file:e,reason:`accept`}),!1)),u=i?s:1,d=i?[...n,...l]:l.slice(-1);u!==void 0&&d.length>u&&(d.slice(u).forEach(e=>t.push({file:e,reason:`maxFiles`})),d=d.slice(0,u)),t.length&&C?.(t),l.length&&r?.(d),E.current&&(E.current.value=``)};return(0,e.jsxs)(`div`,{className:`${Bt.wrapper} ${y}`,children:[c&&(0,e.jsx)(h,{htmlFor:T,required:d,disabled:f,children:c}),(0,e.jsxs)(`div`,{className:`${Bt.dropzone} ${O?Bt.dragActive:``} ${f?Bt.disabled:``} ${u?Bt.error:``}`,onDragEnter:e=>{e.preventDefault(),N&&++D.current===1&&k(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.preventDefault(),--D.current<=0&&(D.current=0,k(!1))},onDrop:e=>{e.preventDefault(),D.current=0,k(!1),N&&P(Array.from(e.dataTransfer.files))},children:[(0,e.jsx)(`input`,{ref:E,id:T,name:_,className:Bt.nativeInput,type:`file`,multiple:i,accept:a,required:d&&n.length===0,disabled:!N,"aria-describedby":M,"aria-invalid":!!u,onChange:e=>P(Array.from(e.target.files??[]))}),n.length?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`ul`,{className:Bt.files,"aria-live":`polite`,children:n.map((t,i)=>(0,e.jsxs)(`li`,{className:Bt.file,children:[(0,e.jsx)(`span`,{className:Bt.fileName,title:t.name,children:t.name}),(0,e.jsx)(`span`,{className:Bt.fileSize,children:Ht(t.size)}),N&&(0,e.jsx)(p,{variant:`empty`,size:`sm`,"aria-label":`Удалить файл ${t.name}`,onClick:()=>r?.(n.filter((e,t)=>t!==i)),children:(0,e.jsx)(W,{name:`IconCross`,width:16,height:16})})]},Vt(t)))}),N&&(i||n.length===0)&&(0,e.jsx)(p,{className:Bt.browseButton,size:`sm`,onClick:()=>E.current?.click(),children:S}),N&&!i&&(0,e.jsx)(p,{className:Bt.browseButton,size:`sm`,onClick:()=>E.current?.click(),children:x})]}):(0,e.jsxs)(`div`,{className:Bt.empty,children:[(0,e.jsx)(`span`,{className:Bt.uploadIcon,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconUpload`,width:24,height:24})}),(0,e.jsx)(`strong`,{children:O?`Отпустите файлы здесь`:b}),!O&&N&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`span`,{children:`или`}),(0,e.jsx)(p,{onClick:()=>E.current?.click(),children:x})]})]})]}),l&&!u&&(0,e.jsx)(g,{id:A,children:l}),u&&(0,e.jsx)(g,{id:j,variant:`error`,live:!0,children:u})]})},Gt=({children:e,containerId:r=`overlay-root`})=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=document.getElementById(r);if(e){a(e);return}let t=document.createElement(`div`);return t.id=r,document.body.appendChild(t),a(t),()=>{t.childElementCount===0&&t.parentElement&&t.remove()}},[r]),i?(0,n.createPortal)(e,i):null},Kt=typeof window>`u`?t.useEffect:t.useLayoutEffect,qt=({anchorRef:n,children:r,matchAnchorWidth:i=!1,offset:a=4,className:o})=>{let[s,c]=(0,t.useState)(null),[l,u]=(0,t.useState)({position:`fixed`,visibility:`hidden`,zIndex:1100}),d=(0,t.useCallback)(()=>{let e=n.current,t=s;if(!e||!t)return;let r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),c=window.innerHeight-r.bottom-8,l=r.top-8,d=(c>=o.height||c>=l?`bottom`:`top`)==`bottom`?r.bottom+a:r.top-o.height-a,f=r.left,p=window.innerWidth-o.width-8,m=Math.max(8,Math.min(f,p)),h={position:`fixed`,top:Math.max(8,Math.min(d,window.innerHeight-o.height-8)),left:m,...i?{width:r.width}:{},zIndex:1100,visibility:`visible`};u(e=>e.top===h.top&&e.left===h.left&&e.width===h.width&&e.visibility===h.visibility?e:h)},[n,i,s,a]);return Kt(()=>{if(!s)return;d(),window.addEventListener(`resize`,d),window.addEventListener(`scroll`,d,!0);let e=typeof ResizeObserver>`u`?null:new ResizeObserver(d);return e?.observe(s),n.current&&e?.observe(n.current),()=>{window.removeEventListener(`resize`,d),window.removeEventListener(`scroll`,d,!0),e?.disconnect()}},[n,s,d]),(0,e.jsx)(Gt,{children:(0,e.jsx)(`div`,{ref:c,className:o,style:l,children:r})})},Jt={wrapper:`_wrapper_x2gki_1`,control:`_control_x2gki_15`,textarea:`_textarea_x2gki_25`,disabledText:`_disabledText_x2gki_27`,sm:`_sm_x2gki_103`,md:`_md_x2gki_117`,lg:`_lg_x2gki_131`,autoResize:`_autoResize_x2gki_145`,manualResize:`_manualResize_x2gki_155`,textareaError:`_textareaError_x2gki_163`,clearAction:`_clearAction_x2gki_171`,messages:`_messages_x2gki_251`,counter:`_counter_x2gki_265`},Yt=2;function Xt(e){let t=window.getComputedStyle(e),n=Number.parseFloat(t.lineHeight);return Number.isFinite(n)?n:Number.parseFloat(t.fontSize)*1.4}function Zt({value:n,onChange:r,placeholder:i=``,disabled:a=!1,readOnly:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:f,id:p,size:m=`md`,clearable:_=!1,required:v=!1,maxLength:y,showCount:b=!1,minRows:x=Yt,maxRows:S,autoResize:C=!0,...w}){let T=(0,t.useId)(),E=p??`ds-textarea-${f??T}`,D=(0,t.useRef)(null),O=u?`${E}-hint`:void 0,k=l?`${E}-error`:void 0,A=b&&y?`${E}-count`:void 0,j=[O,k,A].filter(Boolean).join(` `)||void 0,M=Math.max(1,x),N=S===void 0?void 0:Math.max(M,S),P=(0,t.useCallback)(()=>{let e=D.current;if(!e||!C)return;let t=window.getComputedStyle(e),n=Xt(e),r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom)+Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth),i=n*M+r,a=N===void 0?1/0:n*N+r;e.style.height=`auto`;let o=Math.min(Math.max(e.scrollHeight,i),a);e.style.height=`${o}px`,e.style.overflowY=e.scrollHeight>a?`auto`:`hidden`},[C,N,M]);(0,t.useEffect)(()=>{P()},[P,n]),(0,t.useEffect)(()=>{if(!C)return;window.addEventListener(`resize`,P);let e=D.current?.parentElement,t;if(e&&typeof ResizeObserver<`u`){let n=e.getBoundingClientRect().width;t=new ResizeObserver(([e])=>{!e||e.contentRect.width===n||(n=e.contentRect.width,P())}),t.observe(e)}return()=>{window.removeEventListener(`resize`,P),t?.disconnect()}},[C,P]);let F=e=>{r?.(e.target.value,e),P()},I=()=>{let e=D.current;e&&((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus(),P())},L={"--ds-textarea-min-rows":M};return(0,e.jsxs)(`div`,{className:`${Jt.wrapper} ${d}`,children:[c&&(0,e.jsx)(h,{htmlFor:E,required:v,disabled:a,children:c}),a&&s?(0,e.jsx)(`div`,{id:E,className:`${Jt.disabledText} ${Jt[m]}`,style:L,"aria-describedby":j,children:n||i}):(0,e.jsxs)(`div`,{className:Jt.control,children:[(0,e.jsx)(`textarea`,{ref:D,id:E,name:f,value:n,placeholder:i,disabled:a,readOnly:o,required:v,maxLength:y,rows:M,style:L,"aria-invalid":!!l,"aria-describedby":j,className:`${Jt.textarea} ${Jt[m]} ${C?Jt.autoResize:Jt.manualResize} ${l?Jt.textareaError:``}`,onChange:F,...w}),_&&n&&!a&&!o&&(0,e.jsx)(`button`,{type:`button`,className:Jt.clearAction,"aria-label":`Очистить поле`,onClick:I,children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]}),(u||l||A)&&(0,e.jsxs)(`div`,{className:Jt.messages,children:[u&&!l&&(0,e.jsx)(g,{id:O,children:u}),l&&(0,e.jsx)(g,{id:k,variant:`error`,children:l}),A&&(0,e.jsxs)(`span`,{id:A,className:Jt.counter,children:[n.length,` / `,y]})]})]})}var Qt=0,$t=(0,i.create)((e,t)=>({modals:[],openModal:(t,n={},r={})=>{Qt+=1;let i=`ds-modal-${Qt}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,title:r.title,description:r.description,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0,onClose:r.onClose}]})),i},closeModal:n=>{let r=t().modals.find(e=>e.id===n);r&&(e(e=>({modals:e.modals.filter(e=>e.id!==n)})),r.onClose?.())},closeTopModal:()=>{let n=t().modals.at(-1);n&&(e(e=>({modals:e.modals.slice(0,-1)})),n.onClose?.())},closeAllModals:()=>{let n=t().modals;n.length&&(e({modals:[]}),n.forEach(e=>e.onClose?.()))}})),en=()=>{$t.getState().closeAllModals(),Qt=0},tn=8,nn=96,rn=.55;function an(e,t,n){return{startX:e,startY:t,startTime:n,intent:`pending`}}function on(e,t,n){let r=t-e.startX,i=n-e.startY;return e.intent===`pending`&&Math.max(Math.abs(r),Math.abs(i))>=tn&&(e.intent=Math.abs(i)>Math.abs(r)?`vertical`:`horizontal`),e.intent===`vertical`?Math.max(0,i):0}function sn(e,t,n){if(e.intent!==`vertical`)return!1;let r=Math.max(0,t-e.startY),i=Math.max(1,n-e.startTime);return r>=nn||r>=32&&r/i>=rn}var cn={layer:`_layer_w9isk_1`,backdrop:`_backdrop_w9isk_15`,"backdrop-enter":`_backdrop-enter_w9isk_1`,panel:`_panel_w9isk_47`,"modal-enter":`_modal-enter_w9isk_1`,header:`_header_w9isk_89`,title:`_title_w9isk_107`,description:`_description_w9isk_119`,content:`_content_w9isk_133`,close:`_close_w9isk_141`,dragHandle:`_dragHandle_w9isk_149`,"sheet-enter":`_sheet-enter_w9isk_1`},ln=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,un=(0,t.createContext)({});function dn(e){if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(ln));if(!t.length){e.preventDefault();return}let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}var fn=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useContext)(un),u=r??l.title,d=i??l.description,f=(0,t.useId)(),m=(0,t.useId)(),h=(0,t.useRef)(null),g=(0,t.useRef)(null),_=(0,t.useRef)(null),[v,y]=(0,t.useState)(0),[b,x]=(0,t.useState)(!1),S=$t(e=>e.closeModal),C=l.requestClose??(()=>S(a)),w=u!=null,T=d!=null;(0,t.useEffect)(()=>{let e=document.activeElement,t=h.current;return(t?.querySelector(ln)??t)?.focus(),()=>e?.focus()},[]);let E=e=>{e&&_.current!==null&&e.hasPointerCapture(_.current)&&e.releasePointerCapture(_.current),g.current=null,_.current=null,x(!1),y(0)};return(0,e.jsxs)(`div`,{ref:h,className:`${cn.panel} ${s}`,"data-closing":l.closing||void 0,"data-dragging":b||void 0,style:{"--ds-modal-drag-offset":`${v}px`},role:c,"aria-modal":`true`,"aria-labelledby":w?f:void 0,"aria-describedby":T?m:void 0,tabIndex:-1,onKeyDown:dn,children:[(0,e.jsx)(`button`,{type:`button`,className:cn.dragHandle,"aria-label":`Потяните вниз, чтобы закрыть модальное окно`,onPointerDown:e=>{(e.pointerType!==`mouse`||e.button===0)&&(_.current=e.pointerId,g.current=an(e.clientX,e.clientY,e.timeStamp),e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{if(e.pointerId!==_.current||!g.current)return;let t=on(g.current,e.clientX,e.clientY);g.current.intent===`vertical`&&(e.preventDefault(),x(!0),y(t))},onPointerUp:e=>{if(e.pointerId!==_.current||!g.current)return;let t=sn(g.current,e.clientY,e.timeStamp);E(e.currentTarget),t&&C()},onPointerCancel:e=>E(e.currentTarget),children:(0,e.jsx)(`span`,{})}),(w||o)&&(0,e.jsxs)(`header`,{className:cn.header,children:[w&&(0,e.jsx)(`h2`,{id:f,className:cn.title,children:u}),(0,e.jsx)(p,{className:cn.close,variant:`empty`,size:`sm`,"aria-label":o,onClick:C,children:(0,e.jsx)(W,{name:`IconCross`,width:24,height:24})})]}),T&&(0,e.jsx)(`p`,{id:m,className:cn.description,children:d}),(0,e.jsx)(`div`,{className:cn.content,children:n})]})},pn=({registry:r})=>{let i=$t(e=>e.modals),a=$t(e=>e.closeModal),[o,s]=(0,t.useState)(()=>new Set),c=(0,t.useRef)(new Map),l=e=>{if(c.current.has(e))return;s(t=>new Set(t).add(e));let t=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;c.current.set(e,window.setTimeout(()=>{c.current.delete(e),a(e),s(t=>{let n=new Set(t);return n.delete(e),n})},t?0:220))};return(0,t.useEffect)(()=>{let e=c.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]),(0,t.useEffect)(()=>{let e=e=>{let t=$t.getState().modals.at(-1);e.key===`Escape`&&t?.closeOnEscape&&l(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,t.useEffect)(()=>{i.forEach(e=>{r[e.name]||a(e.id)})},[a,i,r]),!i.length||typeof document>`u`?null:(0,n.createPortal)((0,e.jsx)(`div`,{className:cn.layer,"aria-label":`Модальные окна`,children:i.map((t,n)=>{let a=r[t.name];if(!a)return null;let s=o.has(t.id);return(0,e.jsx)(`div`,{className:cn.backdrop,"data-closing":s||void 0,"aria-hidden":n!==i.length-1||void 0,inert:n!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&l(t.id)},children:(0,e.jsx)(un.Provider,{value:{title:t.title??t.payload.title,description:t.description??t.payload.description,closing:s,requestClose:()=>l(t.id)},children:(0,e.jsx)(a,{...t.payload,modalId:t.id,close:()=>l(t.id),closeAll:()=>i.forEach(({id:e})=>l(e))})})},t.id)})}),document.body)},mn=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=$t(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)(pn,{registry:n})]})},hn=e=>e,gn={message:`_message_c23ie_1`,actions:`_actions_c23ie_13`},_n=new Map,vn=0,yn=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{_n.get(c)?.(e),_n.delete(c),n()};return(0,e.jsxs)(fn,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:gn.message,children:i}),(0,e.jsxs)(`div`,{className:gn.actions,children:[(0,e.jsx)(p,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(p,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},bn=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)(fn,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:gn.message,children:i}),(0,e.jsx)(`div`,{className:gn.actions,children:(0,e.jsx)(p,{onClick:n,children:a})})]}),xn=hn({ConfirmModal:yn,ErrorModal:bn}),Sn=()=>{let e=$t(e=>e.openModal);return(t={})=>new Promise(n=>{vn+=1;let r=`confirm-${vn}`;_n.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1,onClose:()=>{_n.get(r)?.(!1),_n.delete(r)}})})},Cn=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,wn=()=>{let e=$t(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:Cn(t)})}},Tn=(0,i.create)(()=>({})),En=(0,i.create)(()=>({})),Dn=()=>{let e=$t(e=>e.modals),n=$t(e=>e.openModal),r=$t(e=>e.closeModal),i=$t(e=>e.closeTopModal),a=$t(e=>e.closeAllModals),o=(0,t.useCallback)((e,t={},r)=>n(e,t,r),[n]),s=(0,t.useCallback)(t=>e.some(e=>e.name===t),[e]);return(0,t.useMemo)(()=>({openModal:o,closeModal:r,closeTopModal:i,closeAllModals:a,isOpen:s,count:e.length}),[a,r,i,s,e.length,o])},On={layer:`_layer_ct7yp_1`,backdrop:`_backdrop_ct7yp_13`,panel:`_panel_ct7yp_27`,right:`_right_ct7yp_59`,left:`_left_ct7yp_73`,bottom:`_bottom_ct7yp_87`,fullscreen:`_fullscreen_ct7yp_101`,sm:`_sm_ct7yp_113`,md:`_md_ct7yp_121`,lg:`_lg_ct7yp_129`,xl:`_xl_ct7yp_137`,header:`_header_ct7yp_145`,heading:`_heading_ct7yp_163`,headerActions:`_headerActions_ct7yp_203`,content:`_content_ct7yp_215`,footer:`_footer_ct7yp_227`,"enter-right":`_enter-right_ct7yp_1`,"enter-left":`_enter-left_ct7yp_1`,"enter-bottom":`_enter-bottom_ct7yp_1`},kn=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,An=(0,t.createContext)(null),jn=e=>{if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(kn));if(!t.length){e.preventDefault();return}let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())},Mn=()=>(0,t.useContext)(An),Nn=({open:r,onCloseRequest:i,children:a,title:o,description:s,headerActions:c,footer:l,placement:u=`right`,size:d=`md`,closeOnEscape:f=!0,closeOnBackdrop:m=!0,preventClose:h=!1,closeLabel:g=`Закрыть`,initialFocusRef:_,returnFocusRef:v,className:y=``})=>{let b=(0,t.useRef)(null),x=(0,t.useId)(),S=(0,t.useId)(),C=e=>{h||i(e)};return(0,t.useEffect)(()=>{if(!r||typeof document>`u`)return;let e=document.activeElement,t=v?.current,n=document.body.style.overflow;document.body.style.overflow=`hidden`;let a=b.current;(_?.current??a?.querySelector(kn)??a)?.focus();let o=e=>{e.key===`Escape`&&f&&!h&&i(`escape`)};return document.addEventListener(`keydown`,o),()=>{document.removeEventListener(`keydown`,o),document.body.style.overflow=n,(t??e)?.focus()}},[f,_,i,r,h,v]),!r||typeof document>`u`?null:(0,n.createPortal)((0,e.jsx)(`div`,{className:On.layer,children:(0,e.jsx)(`div`,{className:On.backdrop,onMouseDown:e=>{e.target===e.currentTarget&&m&&C(`backdrop`)},children:(0,e.jsx)(An.Provider,{value:{requestClose:C},children:(0,e.jsxs)(`section`,{ref:b,className:`${On.panel} ${On[u]} ${On[d]} ${y}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o?x:void 0,"aria-describedby":s?S:void 0,tabIndex:-1,onKeyDown:jn,children:[(0,e.jsxs)(`header`,{className:On.header,children:[(0,e.jsxs)(`div`,{className:On.heading,children:[o&&(0,e.jsx)(`h2`,{id:x,children:o}),s&&(0,e.jsx)(`p`,{id:S,children:s})]}),c&&(0,e.jsx)(`div`,{className:On.headerActions,children:c}),(0,e.jsx)(p,{variant:`empty`,size:`sm`,"aria-label":g,disabled:h,onClick:()=>C(`close-button`),children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]}),(0,e.jsx)(`div`,{className:On.content,children:a}),l&&(0,e.jsx)(`footer`,{className:On.footer,children:l})]})})})}),document.body)},Pn=({placement:t=`right`,...n})=>(0,e.jsx)(Nn,{...n,placement:t}),Fn=t=>(0,e.jsx)(Nn,{...t,placement:`bottom`}),In=t=>(0,e.jsx)(Nn,{...t,placement:`fullscreen`,size:`xl`}),Ln={wrapper:`_wrapper_1hyyy_1`,container:`_container_1hyyy_15`,inner:`_inner_1hyyy_35`,cube:`_cube_1hyyy_53`,jump:`_jump_1hyyy_1`,cube__inner:`_cube__inner_1hyyy_67`,morph:`_morph_1hyyy_1`,primary:`_primary_1hyyy_121`,secondary:`_secondary_1hyyy_129`,outline:`_outline_1hyyy_137`,ghost:`_ghost_1hyyy_145`,empty:`_empty_1hyyy_153`,destructive:`_destructive_1hyyy_161`,destructiveOutline:`_destructiveOutline_1hyyy_169`},Rn=({variant:t=`primary`})=>(0,e.jsx)(`div`,{className:Ln.wrapper,children:(0,e.jsx)(`div`,{className:Ln.container,children:(0,e.jsxs)(`div`,{className:Ln.inner,children:[(0,e.jsx)(`div`,{className:Ln.cube,children:(0,e.jsx)(`div`,{className:`${Ln.cube__inner} ${Ln[t]}`})}),(0,e.jsx)(`div`,{className:Ln.cube,children:(0,e.jsx)(`div`,{className:`${Ln.cube__inner} ${Ln[t]}`})}),(0,e.jsx)(`div`,{className:Ln.cube,children:(0,e.jsx)(`div`,{className:`${Ln.cube__inner} ${Ln[t]}`})})]})})}),zn={viewport:`_viewport_bu4eh_1`,"top-right":`_top-right_bu4eh_21`,"top-left":`_top-left_bu4eh_31`,"bottom-right":`_bottom-right_bu4eh_41`,"bottom-left":`_bottom-left_bu4eh_51`,toast:`_toast_bu4eh_61`,"toast-enter":`_toast-enter_bu4eh_1`,body:`_body_bu4eh_97`,icon:`_icon_bu4eh_117`,title:`_title_bu4eh_129`,message:`_message_bu4eh_141`,info:`_info_bu4eh_187`,success:`_success_bu4eh_195`,warning:`_warning_bu4eh_203`,error:`_error_bu4eh_211`},Bn={info:`IconInfoCircle`,success:`IconSuccessCircle`,warning:`IconWarning`,error:`IconWarning`},Vn=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(()=>typeof document<`u`&&document.hidden),c=(0,t.useRef)(n.duration),l=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||o||n.duration<=0)return;l.current=Date.now();let e=setTimeout(()=>r(n.id),c.current);return()=>{clearTimeout(e),c.current=Math.max(0,c.current-(Date.now()-l.current))}},[o,r,i,n.duration,n.id]),(0,t.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>s(document.hidden);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,e.jsxs)(`article`,{className:`${zn.toast} ${zn[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(`div`,{className:zn.icon,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:Bn[n.variant],color:`var(--ds-toast-accent)`,width:20,height:20})}),(0,e.jsxs)(`div`,{className:zn.body,children:[n.title&&(0,e.jsx)(`strong`,{className:zn.title,children:n.title}),(0,e.jsx)(`div`,{className:zn.message,children:n.message}),n.action&&(0,e.jsx)(p,{variant:`empty`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(p,{variant:`empty`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]})},Hn=0,Un=(0,i.create)((e,t)=>({toasts:[],showToast:n=>{if(n.dedupeKey){let e=t().toasts.find(e=>e.dedupeKey===n.dedupeKey);if(e)return e.id}Hn+=1;let r=`ds-toast-${Hn}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...n,id:r}]})),r},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),Wn=()=>Un.setState({toasts:[]}),Gn=({position:t=`top-right`,maxVisible:n})=>{let r=Un(e=>e.toasts),i=Un(e=>e.removeToast),a=n===void 0?r:r.slice(0,Math.max(0,Math.floor(n)));return(0,e.jsx)(`div`,{className:`${zn.viewport} ${zn[t]}`,"aria-label":`Уведомления`,children:a.map(t=>(0,e.jsx)(Vn,{toast:t,onClose:i},t.id))})},Kn=()=>{let e=Un(e=>e.showToast),n=Un(e=>e.removeToast),r=Un(e=>e.clearToasts),i=(0,t.useCallback)(t=>e({...t,variant:`info`}),[e]),a=(0,t.useCallback)(t=>e({...t,variant:`success`}),[e]),o=(0,t.useCallback)(t=>e({...t,variant:`warning`}),[e]),s=(0,t.useCallback)(t=>e({...t,variant:`error`}),[e]);return(0,t.useMemo)(()=>({showToast:e,infoToast:i,successToast:a,warningToast:o,errorToast:s,removeToast:n,clearToasts:r}),[r,s,i,n,e,a,o])},qn={root:`_root_ncmxp_1`,tooltip:`_tooltip_ncmxp_11`,"ds-tooltip-in":`_ds-tooltip-in_ncmxp_1`},Jn=8,Yn=16,Xn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Zn=(e,t,n)=>e===`top`?t.top>=n.height+Jn+Yn:e===`bottom`?window.innerHeight-t.bottom>=n.height+Jn+Yn:e===`left`?t.left>=n.width+Jn+Yn:window.innerWidth-t.right>=n.width+Jn+Yn,Qn=(e,t,n)=>{if(!(t.bottom>0&&t.right>0&&t.top<window.innerHeight&&t.left<window.innerWidth))return null;let r=Zn(e,t,n)?e:Zn(Xn[e],t,n)?Xn[e]:e,i=t.left+(t.width-n.width)/2,a=t.top+(t.height-n.height)/2;return r===`top`&&(a=t.top-n.height-Jn),r===`bottom`&&(a=t.bottom+Jn),r===`left`&&(i=t.left-n.width-Jn),r===`right`&&(i=t.right+Jn),i=Math.min(Math.max(i,Yn),Math.max(Yn,window.innerWidth-n.width-Yn)),a=Math.min(Math.max(a,Yn),Math.max(Yn,window.innerHeight-n.height-Yn)),{left:i,top:a,visibility:`visible`}},$n=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),[f,p]=(0,t.useState)({visibility:`hidden`}),[m,h]=(0,t.useState)(null),g=(0,t.useRef)(null),_=(0,t.useRef)(null),v=(0,t.useCallback)(()=>{g.current&&clearTimeout(g.current),g.current=null,d(!1)},[]),y=(0,t.useCallback)(()=>{o||!n||(g.current&&clearTimeout(g.current),g.current=setTimeout(()=>d(!0),a))},[n,a,o]);if((0,t.useEffect)(()=>{if(!u){p({visibility:`hidden`});return}let e=()=>{let e=_.current;if(!e||!m)return;let t=Qn(i,e.getBoundingClientRect(),m.getBoundingClientRect());if(!t){v();return}p(t)};e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0);let t=typeof ResizeObserver>`u`?null:new ResizeObserver(e);return _.current&&t?.observe(_.current),m&&t?.observe(m),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0),t?.disconnect()}},[v,u,i,m]),(0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&v()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),g.current&&clearTimeout(g.current)}},[v]),!(0,t.isValidElement)(r))return r;let b={...f,"--ds-tooltip-max-width":typeof s==`number`?`${s}px`:s},x=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:y,onMouseLeave:v,onFocus:y,onBlur:v});return(0,e.jsxs)(`span`,{ref:_,className:`${qn.root} ${c}`,onPointerDown:u?v:y,children:[x,u&&(0,e.jsx)(Gt,{children:(0,e.jsx)(`span`,{ref:h,id:l,role:`tooltip`,className:qn.tooltip,style:b,children:n})})]})},er={root:`_root_bs28m_1`,tabList:`_tabList_bs28m_11`,tab:`_tab_bs28m_11`,panels:`_panels_bs28m_127`,panel:`_panel_bs28m_127`},tr=({items:n,value:r,onChange:i,ariaLabel:a=`Вкладки`,disabled:o=!1,loading:s=!1,className:c=``})=>{let l=`ds-tabs-${(0,t.useId)().replace(/:/g,``)}`,u=(0,t.useRef)([]),d=o||s,f=n.findIndex(e=>e.id===r),p=n.findIndex(e=>!e.disabled),m=f>=0&&!n[f]?.disabled?f:p,h=e=>{let t=n[e];!t||t.disabled||d||(i(t.id),u.current[e]?.focus(),u.current[e]?.scrollIntoView({block:`nearest`,inline:`nearest`}))},g=(e,t)=>{if(d)return;let r=n.map((e,t)=>e.disabled?-1:t).filter(e=>e>=0);if(r.length===0)return;let i=r.indexOf(t),a;switch(e.key){case`ArrowRight`:a=r[(i+1)%r.length];break;case`ArrowLeft`:a=r[(i-1+r.length)%r.length];break;case`Home`:a=r[0];break;case`End`:a=r[r.length-1];break;default:return}e.preventDefault(),h(a)};return(0,e.jsxs)(`div`,{className:`${er.root} ${c}`,"aria-busy":s||void 0,children:[(0,e.jsx)(`div`,{className:er.tabList,role:`tablist`,"aria-label":a,"aria-orientation":`horizontal`,"aria-disabled":d||void 0,children:n.map((t,n)=>{let i=t.id===r,a=`${l}-tab-${n}`,o=`${l}-panel-${n}`;return(0,e.jsx)(`button`,{ref:e=>{u.current[n]=e},id:a,className:er.tab,type:`button`,role:`tab`,"aria-selected":i,"aria-controls":o,disabled:d||t.disabled,tabIndex:n===m?0:-1,onClick:()=>h(n),onKeyDown:e=>g(e,n),children:t.label},t.id)})}),(0,e.jsx)(`div`,{className:er.panels,children:n.map((t,n)=>{let i=t.id===r;return(0,e.jsx)(`div`,{id:`${l}-panel-${n}`,className:er.panel,role:`tabpanel`,"aria-labelledby":`${l}-tab-${n}`,tabIndex:0,hidden:!i,children:t.content},t.id)})})]})},nr=e=>{if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`;return n?`${n}:${a}`:a},Q={root:`_root_14cqp_1`,frame:`_frame_14cqp_35`,video:`_video_14cqp_65`,overlay:`_overlay_14cqp_81`,state:`_state_14cqp_83`,buffering:`_buffering_14cqp_85`,loaderViewport:`_loaderViewport_14cqp_145`,loaderScale:`_loaderScale_14cqp_157`,stateIcon:`_stateIcon_14cqp_171`,empty:`_empty_14cqp_203`,error:`_error_14cqp_213`,replay:`_replay_14cqp_225`,controlsLayer:`_controlsLayer_14cqp_261`,controlsVisible:`_controlsVisible_14cqp_287`,controls:`_controls_14cqp_261`,controlGroup:`_controlGroup_14cqp_311`,controlButton:`_controlButton_14cqp_337`,settingsAction:`_settingsAction_14cqp_369`,timeline:`_timeline_14cqp_401`,volume:`_volume_14cqp_403`,settings:`_settings_14cqp_369`,playButton:`_playButton_14cqp_417`,volumeGroup:`_volumeGroup_14cqp_431`,timelineGroup:`_timelineGroup_14cqp_455`,time:`_time_14cqp_401`,settingsActionLabel:`_settingsActionLabel_14cqp_693`,caption:`_caption_14cqp_705`,fullscreen:`_fullscreen_14cqp_719`},rr=2500,ir=5,ar=.05,or=[.5,.75,1,1.25,1.5,2],sr=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:c,fallback:l,className:u=``,controls:f=!0,playsInline:m=!0,...h})=>{let g=(0,t.useRef)(null),_=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(void 0),[b,x]=(0,t.useState)(!1),[S,C]=(0,t.useState)(n.length>0),[w,T]=(0,t.useState)(!1),[E,D]=(0,t.useState)(!1),[O,k]=(0,t.useState)(!1),[A,j]=(0,t.useState)(0),[M,N]=(0,t.useState)(0),[P,F]=(0,t.useState)(0),[I,L]=(0,t.useState)(1),[R,ee]=(0,t.useState)(!!h.muted),[te,z]=(0,t.useState)(1),[ne,re]=(0,t.useState)(!!h.loop),[ie,ae]=(0,t.useState)(-1),[B,oe]=(0,t.useState)(!1),[se,V]=(0,t.useState)(!0),[ce,le]=(0,t.useState)(!1),[ue,de]=(0,t.useState)(!1),H=n.map(({src:e,type:t})=>`${e}:${t??``}`).join(`|`),fe=r.map((e,t)=>({track:e,index:t})).filter(({track:e})=>e.kind===`captions`||e.kind===`subtitles`),pe=c??(b?`Не удалось воспроизвести видео`:void 0),me=s||S&&!pe&&n.length>0,he=!me&&!pe&&n.length===0,ge=typeof document<`u`&&`pictureInPictureEnabled`in document&&document.pictureInPictureEnabled,U=(0,t.useCallback)(()=>{V(!0),window.clearTimeout(y.current),E&&!B&&(y.current=window.setTimeout(()=>V(!1),rr))},[E,B]);(0,t.useEffect)(()=>{x(!1),C(n.length>0),T(!1),D(!1),k(!1),j(0),N(0),F(0)},[H,n.length]),(0,t.useEffect)(()=>(U(),()=>window.clearTimeout(y.current)),[U]),(0,t.useEffect)(()=>{let e=()=>le(document.fullscreenElement===_.current),t=()=>de(document.pictureInPictureElement===v.current);return document.addEventListener(`fullscreenchange`,e),document.addEventListener(`enterpictureinpicture`,t),document.addEventListener(`leavepictureinpicture`,t),()=>{document.removeEventListener(`fullscreenchange`,e),document.removeEventListener(`enterpictureinpicture`,t),document.removeEventListener(`leavepictureinpicture`,t)}},[]),(0,t.useEffect)(()=>{if(!B)return;let e=e=>{g.current?.contains(e.target)||oe(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[B]);let _e=async()=>{let e=v.current;if(!(!e||pe||me)){if(e.paused||e.ended){e.ended&&(e.currentTime=0);try{await e.play()}catch{x(!0)}}else e.pause()}},ve=()=>{let e=v.current;e&&(e.muted=!e.muted)},ye=e=>{let t=v.current;t&&(t.volume=Math.min(1,Math.max(0,e)),t.muted=t.volume===0)},be=e=>{let t=v.current;!t||!M||(t.currentTime=Math.min(M,Math.max(0,e)),j(t.currentTime))},G=async()=>{if(_.current)try{document.fullscreenElement?await document.exitFullscreen():await _.current.requestFullscreen()}catch{le(!1)}},xe=async()=>{let e=v.current;if(!(!e||!ge))try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{de(!1)}},Se=e=>{let t=v.current;t&&(Array.from(t.textTracks).forEach((t,n)=>{t.mode=n===e?`showing`:`disabled`}),ae(e))},Ce=e=>{let t=e.target;if(/^(INPUT|SELECT|BUTTON)$/.test(t.tagName))return;let n=e.key.toLowerCase();n===` `||n===`k`?(e.preventDefault(),_e()):n===`m`?(e.preventDefault(),ve()):n===`f`?(e.preventDefault(),G()):n===`c`&&fe.length?(e.preventDefault(),Se(ie===-1?fe[0].index:-1)):e.key===`ArrowLeft`||e.key===`ArrowRight`?(e.preventDefault(),be(A+(e.key===`ArrowRight`?ir:-5))):e.key===`ArrowUp`||e.key===`ArrowDown`?(e.preventDefault(),ye(I+(e.key===`ArrowUp`?ar:-.05))):e.key===`Escape`&&oe(!1),U()},we=()=>{let e=v.current;x(!1),C(!0),e?.load()},Te={"--video-progress":`${M?A/M*100:0}%`,"--video-buffered":`${P*100}%`};return(0,e.jsxs)(`figure`,{ref:g,className:`${Q.root} ${u}`,onKeyDown:Ce,children:[(0,e.jsxs)(`div`,{ref:_,className:`${Q.frame} ${ce?Q.fullscreen:``}`,style:{aspectRatio:a},"aria-busy":me||void 0,tabIndex:f&&n.length?0:void 0,onPointerMove:U,onPointerDown:U,onFocusCapture:U,onMouseLeave:()=>{E&&!B&&V(!1)},children:[n.length>0&&(0,e.jsxs)(`video`,{...h,ref:v,"aria-label":i,controls:!1,playsInline:m,loop:ne,className:Q.video,style:{objectFit:o},onClick:e=>{h.onClick?.(e),_e()},onDoubleClick:e=>{h.onDoubleClick?.(e),G()},onLoadStart:e=>{C(!0),h.onLoadStart?.(e)},onLoadedMetadata:e=>{N(e.currentTarget.duration||0);let t=fe.find(({track:e})=>e.default);Se(t?.index??-1),h.onLoadedMetadata?.(e)},onDurationChange:e=>{N(e.currentTarget.duration||0),h.onDurationChange?.(e)},onTimeUpdate:e=>{j(e.currentTarget.currentTime),h.onTimeUpdate?.(e)},onProgress:e=>{let t=e.currentTarget;t.duration&&t.buffered.length&&F(t.buffered.end(t.buffered.length-1)/t.duration),h.onProgress?.(e)},onLoadedData:e=>{C(!1),T(!1),h.onLoadedData?.(e)},onCanPlay:e=>{C(!1),T(!1),h.onCanPlay?.(e)},onWaiting:e=>{T(!0),h.onWaiting?.(e)},onPlaying:e=>{D(!0),k(!1),T(!1),h.onPlaying?.(e)},onPlay:e=>{D(!0),h.onPlay?.(e)},onPause:e=>{D(!1),h.onPause?.(e)},onEnded:e=>{D(!1),k(!0),V(!0),h.onEnded?.(e)},onVolumeChange:e=>{L(e.currentTarget.volume),ee(e.currentTarget.muted),h.onVolumeChange?.(e)},onRateChange:e=>{z(e.currentTarget.playbackRate),h.onRateChange?.(e)},onError:e=>{C(!1),T(!1),x(!0),h.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),me&&(0,e.jsxs)(`div`,{className:Q.overlay,role:`status`,"aria-live":`polite`,children:[(0,e.jsx)(`div`,{className:Q.loaderViewport,"aria-hidden":`true`,children:(0,e.jsx)(`div`,{className:Q.loaderScale,children:(0,e.jsx)(Rn,{})})}),(0,e.jsx)(`span`,{children:`Загрузка видео`})]}),!me&&w&&!pe&&(0,e.jsx)(`div`,{className:Q.buffering,role:`status`,"aria-label":`Буферизация видео`,children:(0,e.jsx)(d,{variant:`primary`})}),he&&(0,e.jsxs)(`div`,{className:`${Q.state} ${Q.empty}`,role:`status`,children:[(0,e.jsx)(W,{name:`IconInfoCircle`,className:Q.stateIcon,width:40,height:40}),(0,e.jsx)(`strong`,{children:`Видео отсутствует`}),l??(0,e.jsx)(`span`,{children:`Источник видео не указан`})]}),!me&&pe&&(0,e.jsxs)(`div`,{className:`${Q.state} ${Q.error}`,role:`alert`,children:[(0,e.jsx)(W,{name:`IconWarning`,className:Q.stateIcon,width:40,height:40}),l??(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`strong`,{children:`Видео недоступно`}),(0,e.jsx)(`span`,{children:pe})]}),n.length>0&&(0,e.jsx)(p,{size:`sm`,variant:`secondary`,onClick:we,children:`Повторить`})]}),!me&&!pe&&O&&(0,e.jsx)(`button`,{type:`button`,className:Q.replay,"aria-label":`Воспроизвести заново`,onClick:()=>void _e(),children:(0,e.jsx)(W,{name:`IconReplay`,width:28,height:28})}),f&&n.length>0&&!me&&!pe&&(0,e.jsxs)(`div`,{className:`${Q.controlsLayer} ${se||!E?Q.controlsVisible:``}`,onClick:e=>e.stopPropagation(),children:[B&&(0,e.jsxs)(`div`,{className:Q.settings,role:`dialog`,"aria-label":`Настройки видео`,children:[(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Скорость`}),(0,e.jsx)(`select`,{value:te,onChange:e=>{let t=Number(e.target.value);v.current&&(v.current.playbackRate=t)},children:or.map(t=>(0,e.jsxs)(`option`,{value:t,children:[t,`×`]},t))})]}),fe.length>0&&(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Субтитры`}),(0,e.jsxs)(`select`,{value:ie,onChange:e=>Se(Number(e.target.value)),children:[(0,e.jsx)(`option`,{value:-1,children:`Выключены`}),fe.map(({track:t,index:n})=>(0,e.jsx)(`option`,{value:n,children:t.label},`${t.srcLang}-${t.label}`))]})]}),(0,e.jsxs)(`button`,{type:`button`,className:Q.settingsAction,"aria-pressed":ne,onClick:()=>re(e=>!e),children:[(0,e.jsx)(`span`,{children:`Повтор`}),(0,e.jsx)(`span`,{children:ne?`Вкл.`:`Выкл.`})]}),ge&&(0,e.jsx)(`button`,{type:`button`,className:Q.settingsAction,"aria-pressed":ue,onClick:()=>void xe(),children:(0,e.jsxs)(`span`,{className:Q.settingsActionLabel,children:[(0,e.jsx)(W,{name:`IconPictureInPicture`,width:18,height:18}),`Картинка в картинке`]})})]}),(0,e.jsxs)(`div`,{className:Q.controls,children:[(0,e.jsx)(`div`,{className:Q.controlGroup,children:(0,e.jsx)(`button`,{type:`button`,className:`${Q.controlButton} ${Q.playButton}`,"aria-label":E?`Пауза`:`Воспроизвести`,title:E?`Пауза (K)`:`Воспроизвести (K)`,onClick:()=>void _e(),children:(0,e.jsx)(W,{name:E?`IconPause`:`IconPlay`,width:24,height:24})})}),(0,e.jsxs)(`div`,{className:`${Q.controlGroup} ${Q.volumeGroup}`,children:[(0,e.jsx)(`button`,{type:`button`,className:Q.controlButton,"aria-label":R?`Включить звук`:`Выключить звук`,"aria-pressed":R,title:`Звук (M)`,onClick:ve,children:(0,e.jsx)(W,{name:R||I===0?`IconVolumeMuted`:`IconVolume`,width:22,height:22})}),(0,e.jsx)(`input`,{className:Q.volume,type:`range`,min:0,max:1,step:.05,value:R?0:I,"aria-label":`Громкость`,"aria-valuetext":`${Math.round((R?0:I)*100)}%`,onChange:e=>ye(Number(e.target.value))})]}),(0,e.jsxs)(`div`,{className:`${Q.controlGroup} ${Q.timelineGroup}`,children:[(0,e.jsx)(`span`,{className:Q.time,children:nr(A)}),(0,e.jsx)(`input`,{className:Q.timeline,style:Te,type:`range`,min:0,max:M||0,step:.01,value:Math.min(A,M||0),"aria-label":`Позиция воспроизведения`,"aria-valuetext":`${nr(A)} из ${nr(M)}`,onChange:e=>be(Number(e.target.value))}),(0,e.jsx)(`span`,{className:Q.time,children:nr(M)})]}),(0,e.jsxs)(`div`,{className:Q.controlGroup,children:[(0,e.jsx)(`button`,{type:`button`,className:Q.controlButton,"aria-label":`Настройки`,"aria-expanded":B,title:`Настройки`,onClick:()=>oe(e=>!e),children:(0,e.jsx)(W,{name:`IconSettings`,width:22,height:22})}),(0,e.jsx)(`button`,{type:`button`,className:Q.controlButton,"aria-label":ce?`Выйти из полноэкранного режима`:`Полноэкранный режим`,title:`Полноэкранный режим (F)`,onClick:()=>void G(),children:(0,e.jsx)(W,{name:ce?`IconFullscreenExit`:`IconFullscreen`,width:22,height:22})})]})]})]})]}),(0,e.jsx)(`figcaption`,{className:Q.caption,children:i})]})},cr={root:`_root_ymidq_1`,trigger:`_trigger_ymidq_15`,heading:`_heading_ymidq_41`,title:`_title_ymidq_51`,subtitle:`_subtitle_ymidq_59`,icon:`_icon_ymidq_69`,open:`_open_ymidq_91`,content:`_content_ymidq_99`,contentInner:`_contentInner_ymidq_119`},lr=(e,t,n,r=16)=>{if(t>Math.max(0,n-r*2)){let t=e-r;return Math.abs(t)<=1?{alignment:`none`,delta:0}:{alignment:`start`,delta:t}}let i=e+t,a=n-r;return i>a?{alignment:`end`,delta:i-a}:e<r?{alignment:`start`,delta:e-r}:{alignment:`none`,delta:0}},ur=({title:n,subtitle:r,children:i,defaultOpen:a=!1,open:o,onOpenChange:s,autoScrollOnOpen:c=!0,scrollOffset:l=16,className:u=``})=>{let d=(0,t.useId)(),[f,p]=(0,t.useState)(a),m=o??f,h=(0,t.useRef)(null),g=(0,t.useRef)(null),_=(0,t.useRef)(m);return(0,t.useEffect)(()=>{let e=_.current;if(_.current=m,!m||e||!c)return;let t=h.current,n=g.current;if(!t||!n||typeof window>`u`)return;let r=!1,i=()=>{if(r)return;r=!0;let e=t.getBoundingClientRect(),n=lr(e.top,e.height,window.innerHeight,l);if(n.alignment===`none`)return;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;window.scrollBy({top:n.delta,behavior:i?`auto`:`smooth`})},a=e=>{e.target===n&&e.propertyName===`grid-template-rows`&&i()};n.addEventListener(`transitionend`,a);let o=window.setTimeout(i,280);return()=>{n.removeEventListener(`transitionend`,a),window.clearTimeout(o)}},[c,m,l]),(0,e.jsxs)(`section`,{ref:h,className:`${cr.root} ${m?cr.open:``} ${u}`,children:[(0,e.jsxs)(`button`,{type:`button`,className:cr.trigger,"aria-expanded":m,"aria-controls":d,onClick:()=>{let e=!m;o===void 0&&p(e),s?.(e)},children:[(0,e.jsxs)(`span`,{className:cr.heading,children:[(0,e.jsx)(`span`,{className:cr.title,children:n}),r&&(0,e.jsx)(`span`,{className:cr.subtitle,children:r})]}),(0,e.jsx)(`span`,{className:cr.icon,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]}),(0,e.jsx)(`div`,{ref:g,id:d,className:cr.content,"aria-hidden":!m,children:(0,e.jsx)(`div`,{className:cr.contentInner,children:i})})]})},$={root:`_root_14ewt_1`,topSlot:`_topSlot_14ewt_29`,searchSlot:`_searchSlot_14ewt_31`,bottomSlot:`_bottomSlot_14ewt_33`,groups:`_groups_14ewt_59`,group:`_group_14ewt_59`,groupLabel:`_groupLabel_14ewt_85`,list:`_list_14ewt_107`,item:`_item_14ewt_123`,link:`_link_14ewt_131`,current:`_current_14ewt_183`,icon:`_icon_14ewt_205`,copy:`_copy_14ewt_219`,label:`_label_14ewt_233`,description:`_description_14ewt_235`,badge:`_badge_14ewt_269`,empty:`_empty_14ewt_281`},dr=(e,t,n)=>{if(e.length===0)return-1;for(let r=1;r<=e.length;r+=1){let i=(t+n*r+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},fr=({groups:n,currentItemId:r,ariaLabel:i=`Основная навигация`,searchSlot:a,topSlot:o,bottomSlot:s,emptyState:c,renderLink:l,onItemSelect:u,className:d=``})=>{let f=(0,t.useId)(),p=(0,t.useRef)(null),m=(0,t.useRef)({value:``,time:0}),h=n.flatMap(e=>e.items),g=h.filter(e=>!e.disabled),_=g.some(e=>e.id===r)?r:g[0]?.id,v=e=>{if(!e)return;let t=p.current?.querySelectorAll(`[data-ds-navigation-item]`),n=h.findIndex(t=>t.id===e.id);t?.[n]?.focus()},y=(e,t)=>{let n=h.findIndex(e=>e.id===t.id);if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=dr(h,n,e.key===`ArrowDown`?1:-1);v(h[t]);return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),v(e.key===`Home`?g[0]:g.at(-1));return}if(e.key.length!==1||e.altKey||e.ctrlKey||e.metaKey)return;let r=Date.now(),i=m.current,a=`${r-i.time>700?``:i.value}${e.key}`.toLocaleLowerCase();m.current={value:a,time:r};let o=[...h.slice(n+1),...h.slice(0,n+1)];v(o.find(e=>!e.disabled&&e.label.toLocaleLowerCase().startsWith(a)))},b=t=>{let n=t.id===r,i={children:(0,e.jsxs)(e.Fragment,{children:[t.icon&&(0,e.jsx)(`span`,{className:$.icon,"aria-hidden":`true`,children:t.icon}),(0,e.jsxs)(`span`,{className:$.copy,children:[(0,e.jsx)(`span`,{className:$.label,children:t.label}),t.description&&(0,e.jsx)(`span`,{className:$.description,children:t.description})]}),t.badge&&(0,e.jsx)(`span`,{className:$.badge,children:t.badge})]}),className:`${$.link} ${n?$.current:``}`,tabIndex:t.id===_?0:-1,"aria-current":n?`page`:void 0,"aria-disabled":t.disabled?!0:void 0,"data-ds-navigation-item":t.id,onClick:e=>{if(t.disabled){e.preventDefault();return}u?.(t)},onFocus:()=>void 0,onKeyDown:e=>y(e,t)};return(0,e.jsx)(`li`,{className:$.item,children:l?l(t,i):t.href?(0,e.jsx)(`a`,{href:t.href,...i,children:i.children}):(0,e.jsx)(`button`,{type:`button`,disabled:t.disabled,...i,children:i.children})},t.id)};return(0,e.jsxs)(`nav`,{ref:p,className:`${$.root} ${d}`,"aria-label":i,children:[o&&(0,e.jsx)(`div`,{className:$.topSlot,children:o}),a&&(0,e.jsx)(`div`,{className:$.searchSlot,children:a}),(0,e.jsxs)(`div`,{className:$.groups,children:[n.map(t=>{let n=`${f}-${t.id}`;return(0,e.jsxs)(`section`,{className:$.group,"aria-labelledby":t.label?n:void 0,children:[t.label&&(0,e.jsx)(`div`,{id:n,className:$.groupLabel,children:t.label}),(0,e.jsx)(`ul`,{className:$.list,children:t.items.map(b)})]},t.id)}),h.length===0&&c&&(0,e.jsx)(`div`,{className:$.empty,children:c})]}),s&&(0,e.jsx)(`div`,{className:$.bottomSlot,children:s})]})},pr={root:`_root_2mdgb_1`,list:`_list_2mdgb_19`,item:`_item_2mdgb_37`,link:`_link_2mdgb_45`,current:`_current_2mdgb_103`,visual:`_visual_2mdgb_125`,icon:`_icon_2mdgb_141`,badge:`_badge_2mdgb_149`,label:`_label_2mdgb_163`},mr=({items:n,currentItemId:r,ariaLabel:i=`Мобильная навигация`,renderLink:a,onItemSelect:o,className:s=``})=>{let c=(0,t.useRef)(null),l=n.filter(e=>!e.disabled),u=l.some(e=>e.id===r)?r:l[0]?.id,d=e=>{c.current?.querySelectorAll(`[data-ds-navigation-item]`)[e]?.focus()},f=(e,t)=>{let r=n.findIndex(e=>e.id===t.id),i=r;if(e.key===`Home`)i=0;else if(e.key===`End`)i=n.length-1;else if(e.key===`ArrowRight`)i=(r+1)%n.length;else if(e.key===`ArrowLeft`)i=(r-1+n.length)%n.length;else return;e.preventDefault();let a=e.key===`ArrowLeft`||e.key===`End`?-1:1;for(;n[i]?.disabled&&i!==r;)i=(i+a+n.length)%n.length;d(i)};return(0,e.jsx)(`nav`,{ref:c,className:`${pr.root} ${s}`,"aria-label":i,children:(0,e.jsx)(`ul`,{className:pr.list,children:n.map(t=>{let n=t.id===r,i={children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`span`,{className:pr.visual,children:[t.icon&&(0,e.jsx)(`span`,{className:pr.icon,"aria-hidden":`true`,children:t.icon}),t.badge&&(0,e.jsx)(`span`,{className:pr.badge,children:t.badge})]}),(0,e.jsx)(`span`,{className:pr.label,children:t.label})]}),className:`${pr.link} ${n?pr.current:``}`,tabIndex:t.id===u?0:-1,"aria-current":n?`page`:void 0,"aria-disabled":t.disabled?!0:void 0,"data-ds-navigation-item":t.id,onClick:e=>{if(t.disabled){e.preventDefault();return}o?.(t)},onFocus:()=>void 0,onKeyDown:e=>f(e,t)};return(0,e.jsx)(`li`,{className:pr.item,children:a?a(t,i):t.href?(0,e.jsx)(`a`,{href:t.href,...i,children:i.children}):(0,e.jsx)(`button`,{type:`button`,disabled:t.disabled,...i,children:i.children})},t.id)})})})};exports.ConfirmModal=yn,exports.DSAccordion=ur,exports.DSBadge=o,exports.DSBottomNavigation=mr,exports.DSBottomSheet=Fn,exports.DSButton=p,exports.DSCheckbox=be,exports.DSCounterBadge=l,exports.DSDataTable=Ct,exports.DSDateRange=Be,exports.DSDateTimePicker=Le,exports.DSDrawer=Pn,exports.DSDropDown=Je,exports.DSDropDownMultiple=rt,exports.DSFieldLabel=h,exports.DSFieldMessage=g,exports.DSFileInput=Wt,exports.DSFilters=Ft,exports.DSFloatingMenu=qt,exports.DSFormGrid=Lt,exports.DSFormGridItem=Rt,exports.DSFullscreenDialog=In,exports.DSIcon=W,exports.DSIconNames=ve,exports.DSInfoBlock=Nt,exports.DSInput=Qe,exports.DSLoader=d,exports.DSModal=pn,exports.DSModalFrame=fn,exports.DSNavigationSurface=fr,exports.DSOverlay=Nn,exports.DSPageLoader=Rn,exports.DSPortal=Gt,exports.DSRadioButton=at,exports.DSSearchDropDown=jt,exports.DSSkeleton=He,exports.DSSort=Xe,exports.DSTabs=tr,exports.DSTextarea=Zt,exports.DSToast=Vn,exports.DSToastProvider=Gn,exports.DSTooltip=$n,exports.DSValidationSummary=zt,exports.DSVideoPlayerFrame=sr,exports.ErrorModal=bn,exports.ModalSystemProvider=mn,exports.builtInModalRegistry=xn,exports.defineModalRegistry=hn,exports.formatDSCounterValue=c,exports.formatDateInputValue=K,exports.formatDateTimeLocalValue=q,exports.getDSAccordionScrollTarget=lr,exports.getDSDataTableColumnStyle=dt,exports.getDSDataTablePaginationItems=pt,exports.getDSDataTableStickyColumnStyle=ft,exports.getErrorMessage=Cn,exports.getNextDSDataTablePageSelection=ut,exports.getNextEnabledOptionIndex=Ke,exports.isValidDateInputPrefix=Oe,exports.isValidDateRange=ze,exports.maskDateInputValue=Ee,exports.parseDateInputValue=ke,exports.parseDateTimeLocalValue=je,exports.resetModalStore=en,exports.resetToastStore=Wn,exports.useConfirmModal=Sn,exports.useConfirmModalStore=Tn,exports.useDSOverlay=Mn,exports.useErrorModal=wn,exports.useErrorModalStore=En,exports.useModals=Dn,exports.useModalsStore=$t,exports.useToast=Kn,exports.useToastStore=Un,exports.validateDSDataTableData=mt;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),r=require("@tanstack/react-table"),i=require("zustand");var a={badge:`_badge_1tup7_1`,sm:`_sm_1tup7_29`,md:`_md_1tup7_39`,neutral:`_neutral_1tup7_49`,brand:`_brand_1tup7_61`,info:`_info_1tup7_73`,success:`_success_1tup7_85`,warning:`_warning_1tup7_97`,error:`_error_1tup7_109`,dot:`_dot_1tup7_121`,icon:`_icon_1tup7_137`,label:`_label_1tup7_147`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={badge:`_badge_1qsds_1`,sm:`_sm_1qsds_25`,md:`_md_1qsds_37`,neutral:`_neutral_1qsds_51`,brand:`_brand_1qsds_63`,info:`_info_1qsds_75`,success:`_success_1qsds_87`,warning:`_warning_1qsds_99`,error:`_error_1qsds_111`},c=(e,t=99)=>{let n=Math.max(0,Math.floor(e)),r=Math.max(0,Math.floor(t));return n>r?`${r}+`:String(n)},l=({value:t,max:n=99,label:r=`уведомлений`,variant:i=`error`,size:a=`sm`,className:o=``,"aria-label":l,...u})=>{let d=Math.max(0,Math.floor(t));return(0,e.jsx)(`span`,{...u,className:`${s.badge} ${s[i]} ${s[a]} ${o}`,"aria-label":l??`${d} ${r}`,children:c(d,n)})},u={container:`_container_bvxhv_1`,inner:`_inner_bvxhv_21`,line:`_line_bvxhv_39`,primary:`_primary_bvxhv_57`,secondary:`_secondary_bvxhv_65`,outline:`_outline_bvxhv_73`,ghost:`_ghost_bvxhv_81`,empty:`_empty_bvxhv_89`,destructive:`_destructive_bvxhv_97`,destructiveOutline:`_destructiveOutline_bvxhv_105`,grow:`_grow_bvxhv_1`},d=({variant:t=`primary`})=>(0,e.jsx)(`div`,{className:`${u.container} ${u[t]}`,children:(0,e.jsxs)(`div`,{className:`${u.inner} ${u[t]}`,children:[(0,e.jsx)(`div`,{className:`${u.line} ${u[t]}`}),(0,e.jsx)(`div`,{className:`${u.line} ${u[t]}`}),(0,e.jsx)(`div`,{className:`${u.line} ${u[t]}`}),(0,e.jsx)(`div`,{className:`${u.line} ${u[t]}`})]})}),f={button:`_button_1fayv_1`,sm:`_sm_1fayv_59`,md:`_md_1fayv_73`,lg:`_lg_1fayv_87`,primary:`_primary_1fayv_101`,secondary:`_secondary_1fayv_115`,outline:`_outline_1fayv_129`,ghost:`_ghost_1fayv_143`,empty:`_empty_1fayv_157`,destructive:`_destructive_1fayv_171`,destructiveOutline:`_destructiveOutline_1fayv_183`},p=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,disabled:a,type:o=`button`,className:s=``,...c},l)=>(0,e.jsx)(`button`,{ref:l,className:`${f.button} ${f[n]} ${f[r]} ${s}`,disabled:a||i,"aria-busy":i||void 0,...c,type:o,children:i?(0,e.jsx)(d,{variant:n}):t}));p.displayName=`DSButton`;var m={label:`_label_1o819_1`,required:`_required_1o819_23`,error:`_error_1o819_25`,optional:`_optional_1o819_33`,hint:`_hint_1o819_35`,disabled:`_disabled_1o819_47`,message:`_message_1o819_55`,success:`_success_1o819_71`},h=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${m.label} ${i?m.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:m.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:m.optional,children:r})]}),g=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${m.message} ${m[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),_=({width:t=24,height:n=24,color:r,title:i,style:a,children:o,...s})=>(0,e.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:i?`img`:void 0,"aria-hidden":!i||void 0,focusable:`false`,style:r?{...a,color:r}:a,...s,children:[i&&(0,e.jsx)(`title`,{children:i}),o]}),v=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`})}),y=({strokeWidth:t=2,...n})=>(0,e.jsxs)(_,{strokeWidth:t,...n,children:[(0,e.jsx)(`path`,{d:`M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8`}),(0,e.jsx)(`path`,{d:`M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4M12 4v6M2 18h20M5 18v2M19 18v2`})]}),b=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,e.jsx)(`path`,{d:`M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z`}),(0,e.jsx)(`path`,{d:`M8 7h6`}),(0,e.jsx)(`path`,{d:`M8 11h8`})]}),x=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}),(0,e.jsx)(`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}),(0,e.jsx)(`path`,{d:`M10 12h4`})]}),S=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`m5 12 4 4L19 6`})}),C=t=>(0,e.jsx)(_,{viewBox:`0 0 20 20`,...t,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`})}),w=({strokeWidth:t=2,...n})=>(0,e.jsx)(_,{strokeWidth:t,...n,children:(0,e.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),T=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`}),(0,e.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),E=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 20h4L19 9l-4-4L4 16v4z`})}),D=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m15 9-6 6M9 9l6 6`})]}),O=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M3 12s3.5-5 9-5 9 5 9 5-3.5 5-9 5-9-5-9-5Z`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.5`})]}),k=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M3 3l18 18M10.6 10.7a2 2 0 0 0 2.7 2.7M9.9 4.2A10.7 10.7 0 0 1 12 4c5.5 0 9 5.3 9 5.3a14 14 0 0 1-2.3 2.8M6.6 6.6C4.3 8.1 3 10 3 10s3.5 5 9 5c1 0 2-.2 2.8-.5`})}),A=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 10v7m0-10v.01`})}),j=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`M12 16v-4M12 8v.01`})]}),M=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5Z`}),(0,e.jsx)(`polyline`,{points:`14 2 14 8 20 8`}),(0,e.jsx)(`path`,{d:`M16 13H8`}),(0,e.jsx)(`path`,{d:`M16 17H8`}),(0,e.jsx)(`path`,{d:`M10 9H8`})]}),N=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M5 12h14`})}),P=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01`})}),ee=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,e.jsx)(`path`,{d:`M3 9h18M9 21V9`})]}),F=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M8 5v14M16 5v14`,strokeWidth:`3`})}),I=({strokeWidth:t=2,...n})=>(0,e.jsx)(_,{strokeWidth:t,...n,children:(0,e.jsx)(`path`,{d:`M12 5v14M5 12h14`})}),L=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M12 22v-5`}),(0,e.jsx)(`path`,{d:`M9 8V2`}),(0,e.jsx)(`path`,{d:`M15 8V2`}),(0,e.jsx)(`path`,{d:`M18 8v5a6 6 0 0 1-12 0V8Z`})]}),R=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M3 5h18v14H3V5Zm10 7h6v5h-6v-5Z`})}),te=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`m8 5 11 7-11 7V5Z`,fill:`currentColor`,stroke:`none`})}),z=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 7v5h5M5.5 11a7 7 0 1 1 1.3 6.3`})}),ne=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm7.4 5.2.1-1.7-.1-1.7 2-1.5-2-3.4-2.4 1a8 8 0 0 0-2.9-1.7L13.8 2h-3.9l-.4 2.7a8 8 0 0 0-2.8 1.7l-2.5-1-2 3.4 2.1 1.5-.1 1.7.1 1.7-2.1 1.5 2 3.4 2.5-1a8 8 0 0 0 2.8 1.7l.4 2.7h3.9l.3-2.7a8 8 0 0 0 2.9-1.7l2.4 1 2-3.4-2-1.5Z`})}),re=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M9 4H4v5m11-5h5v5M9 20H4v-5m11 5h5v-5`})}),ie=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 9h5V4m6 5h5V4M4 15h5v5m6-5h5v5`})}),ae=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M4 6h16v12H4V6Zm7 4a2 2 0 1 0 0 4m7-4a2 2 0 1 0 0 4`})}),B=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12-1c1.3 1.5 1.3 4.5 0 6m2.5-8.5c3 3 3 8 0 11`})}),oe=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12 0 4 4m0-4-4 4`})}),se=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M8 17V5m-3 3 3-3 3 3M16 7v12m-3-3 3 3 3-3`})}),ce=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),V=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 5v14m-5-5 5 5 5-5`})}),le=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),ue=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),de=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M12 3.5L21 19H3L12 3.5Z`}),(0,e.jsx)(`path`,{d:`M12 9v4.5M12 16.5v.01`})]}),fe=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`M3 6h18`}),(0,e.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}),(0,e.jsx)(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}),(0,e.jsx)(`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`}),(0,e.jsx)(`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`})]}),H=t=>(0,e.jsx)(_,{...t,children:(0,e.jsx)(`path`,{d:`m21.4 11.6-8.9 8.9a6 6 0 0 1-8.5-8.5l9.6-9.6a4 4 0 0 1 5.7 5.7l-9.6 9.6a2 2 0 0 1-2.8-2.8l8.9-8.9`})}),pe=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,e.jsx)(`path`,{d:`M22 2 11 13`})]}),me=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`}),(0,e.jsx)(`path`,{d:`M9 9h.01M15 9h.01`})]}),he=t=>(0,e.jsxs)(_,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`,fill:`currentColor`,stroke:`none`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1`,fill:`currentColor`,stroke:`none`})]}),ge=t=>(0,e.jsx)(_,{...t,children:[5,12,19].flatMap(t=>[5,12,19].map(n=>(0,e.jsx)(`circle`,{cx:n,cy:t,r:`1.5`,fill:`currentColor`,stroke:`none`},`${n}-${t}`)))}),U=n=>r=>(0,e.jsx)(_,{...r,children:n.map(([e,n],r)=>(0,t.createElement)(e,{...n,key:n.key??`${e}-${r}`}))}),_e={IconAppsGrid:ge,IconActivity:U([[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),IconArchive:x,IconAlertTriangle:U([[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}],[`path`,{d:`M12 9v4`}],[`path`,{d:`M12 17h.01`}]]),IconArrowDown:U([[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),IconArrowLeft:U([[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),IconArrowRight:U([[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),IconArrowUp:U([[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),IconArrowUpRight:U([[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),IconBarChart3:U([[`path`,{d:`M3 3v18h18`}],[`path`,{d:`M18 17V9`}],[`path`,{d:`M13 17V5`}],[`path`,{d:`M8 17v-3`}]]),IconBedDouble:y,IconBookText:b,IconBell:U([[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),IconBoxes:U([[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),IconBuilding2:U([[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),IconCamera:U([[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),IconChartNoAxesCombined:U([[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14.639V21`,key:`1s85h0`}],[`path`,{d:`M20 10.656V21`,key:`q45596`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18.463V21`,key:`1otddq`}],[`path`,{d:`M8 14.656V21`,key:`1t2idw`}]]),IconChevronRight:U([[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),IconCircleAlert:U([[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),IconClock3:U([[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),IconCopy:T,IconDownload:U([[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),IconExternalLink:U([[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),IconFactory:U([[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M16 16h.01`,key:`1f9h7w`}],[`path`,{d:`M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z`,key:`1iv0i2`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),IconFileText:M,IconGauge:U([[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),IconGripVertical:U([[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),IconLayoutDashboard:U([[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),IconLockKeyhole:U([[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),IconLogOut:U([[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),IconMaximize2:U([[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),IconMenu:U([[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),IconPackageCheck:U([[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),IconRefreshCw:U([[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),IconRotateCw:U([[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),IconSearch:U([[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),IconSettings2:U([[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),IconShieldAlert:U([[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),IconShieldCheck:U([[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),IconSmartphone:U([[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),IconSparkles:U([[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),IconTable2:U([[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),IconThermometer:U([[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]),IconTrendingUp:U([[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),IconUserCheck:U([[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),IconUserRound:U([[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),IconUsers:U([[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),IconUserX:U([[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),IconVideo:U([[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),IconVideoOff:U([[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),IconVolume2:U([[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),IconX:U([[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),IconBasket:v,IconCheck:S,IconChevron:C,IconCross:w,IconEdit:E,IconErrorCircle:D,IconEye:O,IconEyeOff:k,IconInfo:A,IconInfoCircle:j,IconMinus:N,IconMoreVertical:he,IconList:P,IconPanelsTopLeft:ee,IconPause:F,IconPaperclip:H,IconPlus:I,IconPlug:L,IconPictureInPicture:R,IconPlay:te,IconReplay:z,IconSettings:ne,IconSend:pe,IconSmile:me,IconFullscreen:re,IconFullscreenExit:ie,IconCaptions:ae,IconVolume:B,IconVolumeMuted:oe,IconSort:se,IconSortAscending:ce,IconSortDescending:V,IconSuccessCircle:le,IconUpload:ue,IconWarning:de,IconTrash2:fe},ve=Object.freeze(Object.keys(_e)),W=({name:t,...n})=>{let r=_e[t];return(0,e.jsx)(r,{...n})},ye={wrapper:`_wrapper_1seon_1`,label:`_label_1seon_13`,input:`_input_1seon_35`,control:`_control_1seon_49`,disabled:`_disabled_1seon_95`,controlError:`_controlError_1seon_121`},be=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,ariaLabel:p,...m})=>{let h=(0,t.useId)(),_=d??`ds-checkbox-${u??h}`,v=(0,t.useRef)(null),y=a?`${_}-hint`:void 0,b=o?`${_}-error`:void 0;return(0,t.useEffect)(()=>{v.current&&(v.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${ye.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${ye.label} ${s?ye.disabled:``}`,htmlFor:_,children:[(0,e.jsx)(`input`,{ref:v,id:_,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[y,b].filter(Boolean).join(` `)||void 0,"aria-label":p,className:ye.input,onChange:e=>{c||r?.(e.target.checked,e)},...m}),(0,e.jsxs)(`span`,{className:`${ye.control} ${o?ye.controlError:``}`,"aria-hidden":`true`,children:[f&&!n&&(0,e.jsx)(W,{name:`IconMinus`,width:16,height:16}),n&&(0,e.jsx)(W,{name:`IconCheck`,width:16,height:16})]}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(g,{id:y,children:a}),o&&(0,e.jsx)(g,{id:b,variant:`error`,children:o})]})},G={wrapper:`_wrapper_su17c_1`,trigger:`_trigger_su17c_17`,sm:`_sm_su17c_53`,md:`_md_su17c_65`,lg:`_lg_su17c_75`,chevron:`_chevron_su17c_89`,chevronOpen:`_chevronOpen_su17c_115`,nav:`_nav_su17c_127`,day:`_day_su17c_129`,monthSelect:`_monthSelect_su17c_131`,yearInput:`_yearInput_su17c_133`,timeInput:`_timeInput_su17c_135`,dateInput:`_dateInput_su17c_147`,timeValue:`_timeValue_su17c_189`,chevronButton:`_chevronButton_su17c_201`,disabled:`_disabled_su17c_235`,validationTooltip:`_validationTooltip_su17c_249`,"validation-tooltip-lifetime":`_validation-tooltip-lifetime_su17c_1`,value:`_value_su17c_319`,placeholder:`_placeholder_su17c_335`,error:`_error_su17c_343`,panel:`_panel_su17c_351`,calendarHeader:`_calendarHeader_su17c_377`,weekdays:`_weekdays_su17c_467`,days:`_days_su17c_469`,outside:`_outside_su17c_505`,selected:`_selected_su17c_513`,timeLabel:`_timeLabel_su17c_533`,previousMonth:`_previousMonth_su17c_593`,nextMonth:`_nextMonth_su17c_601`},xe=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],Se=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],K=e=>String(e).padStart(2,`0`),Ce=8,we=`Некорректная дата`,Te=e=>e?`${K(e.getDate())}.${K(e.getMonth()+1)}.${e.getFullYear()}`:``,Ee=e=>{let t=e.replace(/\D/g,``).slice(0,Ce);return[t.slice(0,2),t.slice(2,4),t.slice(4,8)].filter(Boolean).join(`.`)},q=e=>{if(!e)return!0;let t=Number(e.padEnd(4,`0`));return Number(e.padEnd(4,`9`))>=1800&&t<=2500},De=e=>{if(!/^\d{0,8}$/.test(e))return!1;let t=e.slice(0,2),n=e.slice(2,4),r=e.slice(4,8);return t.length===1&&Number(t)>3||t.length===2&&(Number(t)<1||Number(t)>31)||n.length===1&&Number(n)>1||n.length===2&&(Number(n)<1||Number(n)>12)?!1:q(r)},Oe=e=>{let t=/^(\d{2})\.(\d{2})\.(\d{4})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]);if(i<1800||i>2500)return null;let a=new Date(i,r,n,12);return a.getFullYear()!==i||a.getMonth()!==r||a.getDate()!==n?null:a},ke=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Ae=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${K(e.getMonth()+1)}-${K(e.getDate())}`,r=`${K(e.getHours())}:${K(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},je=(e,t)=>{if(!e)return null;if(t===`time`){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);if(n>23||r>59)return null;let i=new Date;return i.setHours(n,r,0,0),i}if(t===`date`){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]),a=new Date(n,r,i,12);return a.getFullYear()!==n||a.getMonth()!==r||a.getDate()!==i?null:a}let n=new Date(e);return Number.isNaN(n.getTime())?null:n},Me=(e,t)=>{if(!e)return``;let n=`${K(e.getDate())}.${K(e.getMonth()+1)}.${e.getFullYear()}`,r=`${K(e.getHours())}:${K(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n} ${r}`},Ne=e=>{let t=new Date(e.getFullYear(),e.getMonth(),1),n=(t.getDay()+6)%7,r=new Date(t);return r.setDate(t.getDate()-n),Array.from({length:42},(e,t)=>{let n=new Date(r);return n.setDate(r.getDate()+t),n})},Pe=(e,t)=>!!(e&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()),J=(e,t,n)=>{let r=ke(e).getTime();return!!(t&&r<ke(t).getTime()||n&&r>ke(n).getTime())},Y=8,Fe=6,Ie=({value:r,onChange:i,mode:a=`date`,label:o,placeholder:s,hint:c,error:l,disabled:u=!1,readOnly:d=!1,required:f=!1,min:p,max:m,size:_=`md`,id:v,name:y,className:b=``})=>{let x=(0,t.useId)(),S=v??`ds-date-time-${y??x}`,C=c?`${S}-hint`:void 0,w=l?`${S}-error`:void 0,T=(0,t.useRef)(null),E=(0,t.useRef)(null),D=(0,t.useRef)(null),O=(0,t.useRef)(null),[k,A]=(0,t.useState)(!1),[j,M]=(0,t.useState)(r??new Date),[N,P]=(0,t.useState)(Ae(r,`time`)),[ee,F]=(0,t.useState)(Te(r)),[I,L]=(0,t.useState)(``),[R,te]=(0,t.useState)(0),[z,ne]=(0,t.useState)(null),re=(0,t.useMemo)(()=>Ne(j),[j]),ie=a!==`time`,ae=a!==`date`;(0,t.useEffect)(()=>{r&&M(r),P(Ae(r,`time`)),F(Te(r))},[r]),(0,t.useEffect)(()=>()=>{O.current&&clearTimeout(O.current)},[]);let B=(0,t.useCallback)(()=>{let e=E.current,t=D.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-Y,o=n.top-Y,s=a<r.height&&o>a,c=Math.max(120,s?o:a),l=s?Math.max(Y,n.top-r.height-Fe):n.bottom+Fe,u=n.left,d=i-r.width-Y;ne({top:l,left:Math.max(Y,Math.min(u,d)),maxHeight:c})},[]);(0,t.useLayoutEffect)(()=>{if(!k){ne(null);return}return B(),window.addEventListener(`resize`,B),window.addEventListener(`scroll`,B,!0),()=>{window.removeEventListener(`resize`,B),window.removeEventListener(`scroll`,B,!0)}},[k,B,j,N]),(0,t.useEffect)(()=>{if(!k)return;let e=e=>{let t=e.target,n=T.current?.contains(t),r=D.current?.contains(t);!n&&!r&&A(!1)},t=e=>{e.key===`Escape`&&(A(!1),E.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[k]);let oe=e=>{if(J(e,p,m))return;let t=a===`date`?je(Ae(e,`date`),`date`):new Date(e);t&&(a!==`date`&&t.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(t),F(Te(t)),a===`date`&&A(!1))},se=()=>{L(we),te(e=>e+1),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{L(``),O.current=null},3e3)},ce=e=>{let t=e.replace(/\D/g,``).slice(0,Ce);if(!De(t)){se();return}let n=Ee(t);if(F(n),!t){i?.(null);return}if(t.length<Ce)return;let o=Oe(n);if(!o||J(o,p,m)){se();return}a===`datetime`&&o.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(o),M(o),A(!1),requestAnimationFrame(()=>E.current?.blur())},V=e=>{if(P(e),!e){i?.(null);return}let t=je(e,`time`);if(!t)return;let n=new Date(a===`datetime`?r??j:new Date);n.setHours(t.getHours(),t.getMinutes(),0,0),!(p&&n<p||m&&n>m)&&i?.(n)},le=s??(a===`date`?`ДД.ММ.ГГГГ`:a===`time`?`ЧЧ:ММ`:`ДД.ММ.ГГГГ ЧЧ:ММ`),ue=I?`${S}-validation`:void 0,de=[C,w,ue].filter(Boolean).join(` `)||void 0,fe=k&&!d?(0,e.jsxs)(`div`,{ref:D,className:G.panel,role:`dialog`,"aria-label":o??le,style:z?{top:z.top,left:z.left,maxHeight:z.maxHeight}:{visibility:`hidden`,top:0,left:0},children:[ie&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`div`,{className:G.calendarHeader,children:[(0,e.jsx)(`button`,{type:`button`,className:G.nav,"aria-label":`Предыдущий месяц`,onClick:()=>M(new Date(j.getFullYear(),j.getMonth()-1,1)),children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20,className:G.previousMonth})}),(0,e.jsx)(`select`,{className:G.monthSelect,"aria-label":`Месяц`,value:j.getMonth(),onChange:e=>M(new Date(j.getFullYear(),Number(e.target.value),1)),children:Se.map((t,n)=>(0,e.jsx)(`option`,{value:n,children:t},t))}),(0,e.jsx)(`input`,{className:G.yearInput,type:`number`,"aria-label":`Год`,value:j.getFullYear(),onChange:e=>M(new Date(Number(e.target.value),j.getMonth(),1))}),(0,e.jsx)(`button`,{type:`button`,className:G.nav,"aria-label":`Следующий месяц`,onClick:()=>M(new Date(j.getFullYear(),j.getMonth()+1,1)),children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20,className:G.nextMonth})})]}),(0,e.jsx)(`div`,{className:G.weekdays,children:xe.map(t=>(0,e.jsx)(`span`,{children:t},t))}),(0,e.jsx)(`div`,{className:G.days,children:re.map(t=>{let n=Pe(r,t);return(0,e.jsx)(`button`,{type:`button`,className:`${G.day} ${t.getMonth()===j.getMonth()?``:G.outside} ${n?G.selected:``}`,disabled:J(t,p,m),"aria-pressed":n,onClick:()=>oe(t),children:t.getDate()},t.toISOString())})})]}),ae&&(0,e.jsxs)(`label`,{className:G.timeLabel,children:[(0,e.jsx)(`span`,{children:`Время`}),(0,e.jsx)(`input`,{className:G.timeInput,type:`time`,value:N,onChange:e=>V(e.target.value)})]})]}):null;return(0,e.jsxs)(`div`,{ref:T,className:`${G.wrapper} ${b}`,children:[o&&(0,e.jsx)(h,{htmlFor:S,required:f,disabled:u,children:o}),ie?(0,e.jsxs)(`div`,{className:`${G.trigger} ${G[_]} ${l?G.error:``} ${u?G.disabled:``}`,children:[(0,e.jsx)(`input`,{ref:E,id:S,name:y,className:G.dateInput,value:ee,placeholder:le.split(` `)[0],inputMode:`numeric`,autoComplete:`off`,maxLength:10,disabled:u,readOnly:d,"aria-expanded":k,"aria-haspopup":`dialog`,"aria-describedby":de,"aria-invalid":!!(l||I)||void 0,onFocus:()=>{d||A(!0)},onClick:()=>{d||A(!0)},onChange:e=>ce(e.target.value)}),a===`datetime`&&N&&(0,e.jsx)(`span`,{className:G.timeValue,children:N}),(0,e.jsx)(`button`,{type:`button`,className:G.chevronButton,disabled:u||d,"aria-label":k?`Закрыть календарь`:`Открыть календарь`,tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:()=>{A(e=>!e),E.current?.focus()},children:(0,e.jsx)(`span`,{className:`${G.chevron} ${fe?G.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})})]}):(0,e.jsxs)(`button`,{ref:E,id:S,name:y,type:`button`,className:`${G.trigger} ${G[_]} ${l?G.error:``}`,disabled:u,"aria-readonly":d||void 0,"aria-expanded":k,"aria-haspopup":`dialog`,"aria-describedby":de,onClick:()=>{d||A(e=>!e)},children:[(0,e.jsx)(`span`,{className:r?G.value:G.placeholder,children:Me(r,a)||le}),(0,e.jsx)(`span`,{className:`${G.chevron} ${fe?G.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]}),I&&(0,e.jsx)(`span`,{id:ue,className:G.validationTooltip,role:`status`,"aria-live":`polite`,children:I},R),fe&&(0,n.createPortal)(fe,document.body),c&&!l&&(0,e.jsx)(g,{id:C,children:c}),l&&(0,e.jsx)(g,{id:w,variant:`error`,children:l})]})},Le={root:`_root_19vq2_1`,range:`_range_19vq2_21`},Re=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),ze=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:p=!1,className:m=``})=>{let h=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),Re(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${Le.root} ${m}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:Le.range,children:[(0,e.jsx)(Ie,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:p,error:h,onChange:e=>_({...t,from:e})}),(0,e.jsx)(Ie,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:p,error:h,onChange:e=>_({...t,to:e})})]}),s&&!h&&(0,e.jsx)(g,{children:s})]})},Be={group:`_group_ey6uk_1`,skeleton:`_skeleton_ey6uk_15`,text:`_text_ey6uk_27`,rectangular:`_rectangular_ey6uk_37`,circular:`_circular_ey6uk_47`,animated:`_animated_ey6uk_59`,"ds-skeleton":`_ds-skeleton_ey6uk_1`},Ve=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${Be.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(i,o)=>(0,e.jsx)(`span`,{className:`${Be.skeleton} ${Be[t]} ${a?Be.animated:``}`,style:{width:n,height:r}},o))}),X={wrapper:`_wrapper_1l9o2_1`,container:`_container_1l9o2_17`,trigger:`_trigger_1l9o2_25`,disabledText:`_disabledText_1l9o2_27`,sm:`_sm_1l9o2_53`,md:`_md_1l9o2_67`,lg:`_lg_1l9o2_81`,value:`_value_1l9o2_147`,placeholder:`_placeholder_1l9o2_149`,chevron:`_chevron_1l9o2_205`,chevronOpen:`_chevronOpen_1l9o2_231`,menu:`_menu_1l9o2_239`,option:`_option_1l9o2_269`,selected:`_selected_1l9o2_339`,actionOption:`_actionOption_1l9o2_359`,message:`_message_1l9o2_391`,error:`_error_1l9o2_393`,errorState:`_errorState_1l9o2_419`},He=8,Ue=6,We=120,Ge=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},Ke=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},qe=({options:r,value:i,onChange:a,placeholder:o=`Выберите опцию`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,hint:f,className:p=``,required:m=!1,name:g,id:_,needMark:v=!0,maxMenuHeight:y})=>{let b=(0,t.useId)(),x=_??`ds-dropdown-${g??b}`,S=`${x}-listbox`,[C,w]=(0,t.useState)(!1),[T,E]=(0,t.useState)(null),D=(0,t.useRef)(null),O=(0,t.useRef)(null),k=(0,t.useRef)(null),A=(0,t.useRef)([]),j=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),M=f?`${x}-hint`:void 0,N=u?`${x}-error`:void 0,P=[M,N].filter(Boolean).join(` `)||void 0,ee=s&&c,F=(0,t.useCallback)(()=>{let e=O.current,t=k.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-He,o=n.top-He,s=a<r.height&&o>a,c=Math.max(We,s?o:a),l=Ke(y),u=Math.min(c,l),d=n.left,f=i-n.width-He,p=Math.max(He,Math.min(d,f)),m=s?Math.max(He,n.top-r.height-Ue):n.bottom+Ue;E({top:m,left:p,width:n.width,maxHeight:u})},[y]);(0,t.useLayoutEffect)(()=>{if(!C){E(null);return}return F(),window.addEventListener(`resize`,F),window.addEventListener(`scroll`,F,!0),()=>{window.removeEventListener(`resize`,F),window.removeEventListener(`scroll`,F,!0)}},[C,F,r.length]),(0,t.useEffect)(()=>{if(!C)return;let e=e=>{let t=e.target,n=D.current?.contains(t),r=k.current?.contains(t);!n&&!r&&w(!1)},t=e=>{e.key===`Escape`&&(w(!1),O.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[C]);let I=(e,t)=>{let n=Ge(r,e,t);if(n===-1)return;let i=A.current[n];i?.focus(),i?.scrollIntoView({block:`nearest`})},L=e=>{e.disabled||(a?.(e.value,e),w(!1),O.current?.focus())},R=C?(0,e.jsx)(`ul`,{ref:k,id:S,className:X.menu,role:`listbox`,"aria-label":l,style:T?{position:`fixed`,top:T.top,left:T.left,width:T.width,maxHeight:T.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=t.value===i;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{A.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,"data-option-variant":t.variant??`default`,className:[X[d],X.option,t.variant===`action`?X.actionOption:``,a?X.selected:``].filter(Boolean).join(` `),onClick:()=>L(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;I(n+t,t)}if(e.key===`Tab`&&w(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;I(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),L(t))},children:[(0,e.jsx)(`span`,{children:t.label}),a&&v&&(0,e.jsx)(W,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:D,className:[X.wrapper,u?X.errorState:``,p].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(h,{required:m,disabled:s,htmlFor:ee?void 0:x,children:l}),(0,e.jsx)(`div`,{className:X.container,children:ee?(0,e.jsx)(`div`,{id:x,className:X.disabledText,"aria-describedby":P,children:j?.label??o}):(0,e.jsxs)(`button`,{ref:O,id:x,type:`button`,name:g,className:`${X.trigger} ${X[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":C,"aria-controls":S,"aria-describedby":P,"aria-invalid":!!u,onClick:()=>w(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),w(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>{I(e.key===`ArrowDown`?0:r.length-1,t)})}if(e.key===`Enter`&&C){e.preventDefault();let t=r.findIndex(e=>e.value===i);I(t>=0?t:0,1)}},children:[(0,e.jsx)(`span`,{className:`${j?X.value:X.placeholder}
2
+ ${X[d]}`,children:j?.label??o}),(0,e.jsx)(`span`,{className:[X.chevron,C?X.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]})}),C&&(0,n.createPortal)(R,document.body),f&&!u&&(0,e.jsx)(`span`,{id:M,className:X.message,children:f}),u&&(0,e.jsx)(`span`,{id:N,className:X.error,children:u})]})},Je=e=>`${e.id}:${e.direction}`,Ye=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:Je({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:Je({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(qe,{options:c,value:n?Je(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},Xe={wrapper:`_wrapper_1khfq_1`,control:`_control_1khfq_15`,input:`_input_1khfq_25`,disabledText:`_disabledText_1khfq_25`,sm:`_sm_1khfq_107`,md:`_md_1khfq_123`,lg:`_lg_1khfq_139`,inputError:`_inputError_1khfq_155`,trailingAction:`_trailingAction_1khfq_163`},Ze=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:f=``,name:p,id:m,size:_=`md`,clearable:v=!0,required:y=!1,selectTextOnFocus:b=!1,isPassword:x=!1,passwordVisibleLabel:S=`Скрыть пароль`,passwordHiddenLabel:C=`Показать пароль`,onFocus:w,...T})=>{let E=(0,t.useId)(),D=m??`ds-input-${p??E}`,O=(0,t.useRef)(null),[k,A]=(0,t.useState)(!1),j=d?`${D}-hint`:void 0,M=u?`${D}-error`:void 0,N=String(n??``),P=[j,M].filter(Boolean).join(` `)||void 0,ee=x?k?`text`:`password`:i;return(0,t.useEffect)(()=>{x||A(!1)},[x]),(0,e.jsxs)(`div`,{className:`${Xe.wrapper} ${f}`,children:[l&&(0,e.jsx)(h,{htmlFor:D,required:y,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:D,className:Xe.disabledText,"aria-describedby":P,children:N||a}):(0,e.jsxs)(`div`,{className:Xe.control,children:[(0,e.jsx)(`input`,{ref:O,id:D,name:p,type:ee,value:N,placeholder:a,disabled:o,readOnly:s,required:y,"aria-invalid":!!u,"aria-describedby":P,className:`${Xe.input} ${Xe[_]} ${u?Xe.inputError:``}`,onChange:e=>{if(i===`number`&&!x){let t=e.target.value===``?``:Number(e.target.value);r?.(t,e);return}r?.(e.target.value,e)},onFocus:e=>{b&&e.currentTarget.value&&e.currentTarget.select(),w?.(e)},...T}),x&&(0,e.jsx)(`button`,{type:`button`,className:Xe.trailingAction,disabled:o,"aria-label":k?S:C,"aria-pressed":k,onClick:()=>A(e=>!e),children:(0,e.jsx)(W,{name:k?`IconEyeOff`:`IconEye`,width:20,height:20})}),!x&&v&&N&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:Xe.trailingAction,"aria-label":`Очистить поле`,onClick:()=>{let e=O.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]}),d&&!u&&(0,e.jsx)(g,{id:j,children:d}),u&&(0,e.jsx)(g,{id:M,variant:`error`,children:u})]})},Qe=8,$e=6,et=120,tt=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},nt=({options:r,value:i,onChange:a,placeholder:o=`Выберите опции`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,required:f=!1,hint:p,className:m=``,name:g,id:_,closeOnSelect:v=!1,needMark:y=!0,maxMenuHeight:b})=>{let x=(0,t.useId)(),S=_??`ds-dropdown-multiple-${g??x}`,C=`${S}-listbox`,[w,T]=(0,t.useState)(!1),[E,D]=(0,t.useState)(null),O=(0,t.useRef)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)([]),M=(0,t.useMemo)(()=>r.filter(e=>i.includes(e.value)),[r,i]).map(e=>e.label).join(`, `),N=p?`${S}-hint`:void 0,P=u?`${S}-error`:void 0,ee=[N,P].filter(Boolean).join(` `)||void 0,F=s&&c,I=(0,t.useCallback)(()=>{let e=k.current,t=A.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerHeight-n.bottom-Qe,a=n.top-Qe,o=i<r.height&&a>i,s=Math.max(et,o?a:i),c=window.innerWidth-n.width-Qe;D({top:o?Math.max(Qe,n.top-r.height-$e):n.bottom+$e,left:Math.max(Qe,Math.min(n.left,c)),width:n.width,maxHeight:Math.min(s,tt(b))})},[b]);(0,t.useLayoutEffect)(()=>{if(!w){D(null);return}return I(),window.addEventListener(`resize`,I),window.addEventListener(`scroll`,I,!0),()=>{window.removeEventListener(`resize`,I),window.removeEventListener(`scroll`,I,!0)}},[w,r.length,I]),(0,t.useEffect)(()=>{if(!w)return;let e=e=>{let t=e.target;!O.current?.contains(t)&&!A.current?.contains(t)&&T(!1)},t=e=>{e.key===`Escape`&&(T(!1),k.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[w]);let L=(e,t)=>{let n=Ge(r,e,t);n!==-1&&(j.current[n]?.focus(),j.current[n]?.scrollIntoView({block:`nearest`}))},R=e=>{if(e.disabled)return;let t=i.includes(e.value)?i.filter(t=>t!==e.value):[...i,e.value];a?.(t,r.filter(e=>t.includes(e.value))),v&&(T(!1),k.current?.focus())},te=w?(0,e.jsx)(`ul`,{ref:A,id:C,className:X.menu,role:`listbox`,"aria-label":l,"aria-multiselectable":`true`,style:E?{position:`fixed`,top:E.top,left:E.left,width:E.width,maxHeight:E.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=i.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{j.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,"data-option-variant":t.variant??`default`,className:[X[d],X.option,t.variant===`action`?X.actionOption:``,a?X.selected:``].filter(Boolean).join(` `),onClick:()=>R(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;L(n+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;L(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),R(t)),e.key===`Tab`&&T(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),a&&y&&(0,e.jsx)(W,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:O,className:[X.wrapper,u?X.errorState:``,m].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(h,{htmlFor:F?void 0:S,required:f,disabled:s,children:l}),(0,e.jsx)(`div`,{className:X.container,children:F?(0,e.jsx)(`div`,{id:S,className:`${X.disabledText} ${X[d]}`,"aria-describedby":ee,children:M||o}):(0,e.jsxs)(`button`,{ref:k,id:S,type:`button`,name:g,className:`${X.trigger} ${X[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":w,"aria-controls":C,"aria-describedby":ee,"aria-invalid":!!u,onClick:()=>T(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),T(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>L(e.key===`ArrowDown`?0:r.length-1,t))}},children:[(0,e.jsx)(`span`,{className:`${M?X.value:X.placeholder} ${X[d]}`,children:M||o}),(0,e.jsx)(`span`,{className:[X.chevron,w?X.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]})}),w&&(0,n.createPortal)(te,document.body),p&&!u&&(0,e.jsx)(`span`,{id:N,className:X.message,children:p}),u&&(0,e.jsx)(`span`,{id:P,className:X.error,children:u})]})},rt={wrapper:`_wrapper_1jspu_1`,input:`_input_1jspu_21`,switch:`_switch_1jspu_35`,thumb:`_thumb_1jspu_67`,label:`_label_1jspu_113`,disabled:`_disabled_1jspu_125`},it=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${rt.wrapper} ${a?rt.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:rt.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:rt.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:rt.thumb})}),i&&(0,e.jsx)(`span`,{className:rt.label,children:i})]})},Z={root:`_root_y4bhr_1`,toolbar:`_toolbar_y4bhr_15`,totalWidget:`_totalWidget_y4bhr_31`,totalLabel:`_totalLabel_y4bhr_53`,totalValue:`_totalValue_y4bhr_63`,srOnly:`_srOnly_y4bhr_77`,bulkActions:`_bulkActions_y4bhr_101`,filterBar:`_filterBar_y4bhr_123`,filterFields:`_filterFields_y4bhr_141`,filterActions:`_filterActions_y4bhr_155`,pageSizePanel:`_pageSizePanel_y4bhr_167`,embedded:`_embedded_y4bhr_167`,pendingChanges:`_pendingChanges_y4bhr_179`,tableWrap:`_tableWrap_y4bhr_191`,table:`_table_y4bhr_191`,compact:`_compact_y4bhr_241`,selectionColumn:`_selectionColumn_y4bhr_279`,expansionColumn:`_expansionColumn_y4bhr_287`,expansionCell:`_expansionCell_y4bhr_289`,expansionIcon:`_expansionIcon_y4bhr_301`,expansionIconOpen:`_expansionIconOpen_y4bhr_311`,detailRow:`_detailRow_y4bhr_321`,stickyColumn:`_stickyColumn_y4bhr_331`,selectionHeaderCell:`_selectionHeaderCell_y4bhr_367`,selectionCell:`_selectionCell_y4bhr_369`,selectionHeaderControls:`_selectionHeaderControls_y4bhr_381`,mobileSelectionControls:`_mobileSelectionControls_y4bhr_383`,cardSelectionControls:`_cardSelectionControls_y4bhr_385`,selectedRow:`_selectedRow_y4bhr_399`,sticky:`_sticky_y4bhr_331`,sortButton:`_sortButton_y4bhr_437`,state:`_state_y4bhr_475`,cards:`_cards_y4bhr_487`,mobileSort:`_mobileSort_y4bhr_487`,card:`_card_y4bhr_385`,spanTwo:`_spanTwo_y4bhr_575`,selectedCard:`_selectedCard_y4bhr_583`,customCardShell:`_customCardShell_y4bhr_617`,clickableRow:`_clickableRow_y4bhr_631`,cardDetail:`_cardDetail_y4bhr_649`,pagination:`_pagination_y4bhr_675`,bottom:`_bottom_y4bhr_723`,pageSizeMain:`_pageSizeMain_y4bhr_737`,pageSizeOptions:`_pageSizeOptions_y4bhr_739`,pageSizeFieldset:`_pageSizeFieldset_y4bhr_751`,pageSizeOption:`_pageSizeOption_y4bhr_739`,pageSizeOptionActive:`_pageSizeOptionActive_y4bhr_829`,pageSizeWarning:`_pageSizeWarning_y4bhr_843`,paginationRange:`_paginationRange_y4bhr_855`,paginationControls:`_paginationControls_y4bhr_867`,pageNumbers:`_pageNumbers_y4bhr_869`,pageButton:`_pageButton_y4bhr_881`,ellipsis:`_ellipsis_y4bhr_891`,previousIcon:`_previousIcon_y4bhr_903`,nextIcon:`_nextIcon_y4bhr_911`,default:`_default_y4bhr_1011`,tableOnMobile:`_tableOnMobile_y4bhr_1011`,wide:`_wide_y4bhr_1041`},at=(0,r.tableFeatures)({rowSortingFeature:r.rowSortingFeature,sortedRowModel:(0,r.createSortedRowModel)()}),ot=[10,30,50,-1],st=30,ct=8;function lt(e,t){return t.includes(e)?e:t.includes(30)?30:t.find(e=>Number.isSafeInteger(e)&&e>0)??30}function ut(e){return e===void 0||!Number.isFinite(e)||e<=0?st:Math.max(1,Math.floor(e))}var dt=({field:n,value:r,setValue:i,disabled:a,error:o})=>{let s=n.type===`multi-select`?n.options:void 0,[c,l]=(0,t.useState)(Array.isArray(s)?s:[]),[u,d]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{if(s===void 0)return;if(Array.isArray(s)){l(s);return}let e=!0;return d(!0),s().then(t=>{e&&l(t)}).finally(()=>{e&&d(!1)}),()=>{e=!1}},[s]),n.type===`multi-select`?(0,e.jsx)(nt,{label:n.label,options:c,value:Array.isArray(r)?r.map(String):[],disabled:a||u,placeholder:u?`Загрузка…`:n.placeholder,error:o,onChange:e=>i(e)}):n.type===`switch`?(0,e.jsx)(it,{label:n.label,checked:!!r,disabled:a,onChange:e=>i(e)}):n.type===`custom`?n.render({value:r,setValue:i,disabled:a,error:o}):(0,e.jsx)(Ze,{label:n.label,type:n.type===`search`?`search`:`text`,value:String(r??``),disabled:a,placeholder:n.placeholder,error:o,onChange:e=>i(e)})},ft=(e,t,n)=>{let r=new Set(e);return t.forEach(e=>{n?r.add(e):r.delete(e)}),Array.from(r)},pt=e=>{if(!(!e||e.width===void 0&&e.minWidth===void 0&&e.maxWidth===void 0))return{width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth}},mt=e=>{if(e?.sticky)return e.sticky===`start`?{insetInlineStart:e.stickyOffset??0}:{insetInlineEnd:e.stickyOffset??0}},ht=(e,t)=>t<=7?Array.from({length:t},(e,t)=>t):e<=3?[0,1,2,3,4,`ellipsis-end`,t-1]:e>=t-4?[0,`ellipsis-start`,t-5,t-4,t-3,t-2,t-1]:[0,`ellipsis-start`,e-1,e,e+1,`ellipsis-end`,t-1],gt=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1){let r=t[n];for(let t of e)if(typeof t.accessor==`string`&&!(t.accessor in r))return`В строке ${n+1} отсутствует колонка «${t.id}»`}return null},_t=(e,t)=>typeof e==`function`?e(t):t[e],vt=e=>{if(e==null||e===``)return null;let t=Date.parse(String(e));return Number.isNaN(t)?null:t},yt=(e,t,n)=>{let r=vt(e.getValue(n)),i=vt(t.getValue(n));return r===null&&i===null?0:r===null?-1:i===null?1:r-i},bt=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(r)-Number(i)},xt=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(!!r)-Number(!!i)},St=(e,t,n)=>{let r=String(e.getValue(n)??``),i=String(t.getValue(n)??``);return r.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`})},Ct=e=>{switch(e){case`date`:return yt;case`number`:return bt;case`boolean`:return xt;case`text`:case void 0:return St;case`custom`:return}},wt=e=>{let t=t=>_t(e.accessor,t),n=e.sortFn??Ct(e.dataType),r=e.enableSorting??(e.dataType!==`custom`&&n!==void 0),i={id:e.id,accessorFn:t,header:()=>e.header,cell:t=>{let n=t.getValue();return e.cell?.(t.row.original,n)??String(n??``)},enableSorting:r,sortDescFirst:e.sortDescFirst};return n!==void 0&&(i.sortFn=n),i},Tt=({columns:n,data:i,virtualizationThreshold:a=st,tableOnMobile:o=!1,mobileView:s,breakpoint:c=`default`,sorting:l,onSortingChange:u,renderMobileCard:d,getRowId:f,getRowClassName:m,getRowStyle:h,toolbarContent:g,totalCountVariant:_=`default`,totalCountLabel:v=`Всего`,caption:y,ariaLabel:b,loading:x=!1,error:S,emptyState:C=`Нет данных`,stickyHeader:w=!1,maxHeight:T,className:E=``,onRowClick:D,selectable:O=!1,selectedRowIds:k,onSelectedRowIdsChange:A,onRowDoubleClick:j,getRowSelectionLabel:M,selectAllRowsLabel:N=`Выбрать все строки на этой странице`,resetSelectionLabel:P=`Сбросить выбор`,openRowLabel:ee=`Открыть строку`,pagination:F=!1,paginationMode:I=`client`,page:L=1,pageSize:R=30,onPageSizeChange:te,pageSizeOptions:z=ot,pageSizeDraft:ne,onPageSizeDraftChange:re,pageSizeApplyMode:ie=`table`,totalCount:ae,onPageChange:B,visibleColumnIds:oe,density:se=`comfortable`,renderBulkActions:ce,renderExpandedRow:V,expandedRowIds:le,onExpandedRowIdsChange:ue,getRowExpansionLabel:de,resultsAnnouncement:fe,filterBar:H})=>{let[pe,me]=(0,t.useState)([]),[he,ge]=(0,t.useState)([]),[U,_e]=(0,t.useState)([]),[ve,ye]=(0,t.useState)(0),[G,xe]=(0,t.useState)(()=>lt(R,z)),Se=ut(a),K=l??pe,Ce=K.map(e=>`${e.id}:${e.desc?`desc`:`asc`}`).join(`|`),we=R===-1,Te=we?Math.max(1,(I===`server`?Number(ae):i.length)||i.length||1):Number.isFinite(R)&&R>0?Math.floor(R):30,Ee=F&&I===`server`,q=(0,t.useMemo)(()=>{if(oe===void 0)return n;let e=new Set(oe);return n.filter(t=>e.has(t.id))},[n,oe]),De=(0,t.useMemo)(()=>q.length===0?`Должна быть видима хотя бы одна колонка`:gt(q,i),[i,q]),Oe=(0,t.useMemo)(()=>q.map(wt),[q]),ke=q.some(e=>pt(e)!==void 0),Ae=(0,r.useTable)({features:at,columns:Oe,data:i,state:{sorting:K},onSortingChange:e=>{let t=typeof e==`function`?e(K):e;l===void 0&&me(t),ye(0),u?.(t)},getRowId:f}),je=Ae.getRowModel().rows,Me=Ee&&Number.isFinite(ae)&&Number(ae)>=0?Math.floor(Number(ae)):je.length,Ne=F?Math.max(1,Math.ceil(Me/Te)):1,Pe=Number.isFinite(L)&&L>0?Math.floor(L)-1:0,J=Math.min(Ee?Pe:ve,Ne-1),Y=(0,t.useMemo)(()=>F&&!Ee?je.slice(J*Te,(J+1)*Te):je,[Ee,Te,F,J,je]),Fe=Y.length>Se,Ie=(0,t.useMemo)(()=>({data:i,sortingKey:Ce,safePageIndex:J,normalizedPageSize:Te,pagination:F,isServerPagination:Ee,normalizedVirtualizationThreshold:Se}),[i,Ce,J,Te,F,Ee,Se]),[Le,Re]=(0,t.useState)({context:Ie,count:Se}),ze=Le.context===Ie?Le.count:Se;Le.context!==Ie&&Re({context:Ie,count:Se});let Be=(0,t.useMemo)(()=>Y.slice(0,ze),[Y,ze]),X=Fe&&ze<Y.length,He=X?Math.max(0,Be.length-ct):-1,Ue=(0,t.useRef)(new Map),We=(0,t.useRef)(new Map);(0,t.useEffect)(()=>{if(!X||x||De||S)return;let e=[...Ue.current.values(),...We.current.values()],t=!0,n=new IntersectionObserver(e=>{!t||!e.some(e=>e.isIntersecting)||(t=!1,n.disconnect(),Re(e=>e.context===Ie?{context:Ie,count:Math.min(e.count+Se,Y.length)}:e))},{root:null,threshold:0});return e.forEach(e=>{e&&n.observe(e)}),()=>{t=!1,n.disconnect()}},[Ie,ze,Se,Y.length,X,x,De,S,s,o,d]);let Ge=k??he,Ke=(0,t.useMemo)(()=>new Set(Ge),[Ge]),qe=le??U,Je=(0,t.useMemo)(()=>new Set(qe),[qe]),Xe=(0,t.useMemo)(()=>Y.map(e=>e.id),[Y]),Ze=Xe.filter(e=>Ke.has(e)).length,Qe=Xe.length>0&&Ze===Xe.length,$e=Ze>0&&!Qe,et=(0,t.useMemo)(()=>q.filter(e=>e.enableSorting??e.dataType!==`custom`).map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),[q]),tt=(0,t.useMemo)(()=>ht(J,Ne),[Ne,J]),nt=s===void 0?o:s===`table`,rt=[Z.root,c===`wide`?Z.wide:Z.default,nt?Z.tableOnMobile:``,se===`compact`?Z.compact:``,E].filter(Boolean).join(` `),it=De??S,vt=F&&!we&&!it&&Me>Te&&(!x||Ee),yt=F&&!!(te||re||H),bt=ne??G,xt=H?(typeof H.validation==`function`?H.validation(H.draftValues):H.validation)??{}:{},St=H?JSON.stringify(H.draftValues)!==JSON.stringify(H.appliedValues)||bt!==R:!1,Ct=Object.values(xt).some(Boolean),Tt=Me===0?0:J*Te+1,Et=Math.min((J+1)*Te,Me),Dt=()=>{bt!==R&&(ye(0),B?.(1),te?.(bt))},Q=(t,n=!1)=>{let r=bt!==R,i=`ds-data-table-page-size-warning-${t}`;return(0,e.jsxs)(`div`,{className:`${Z.pageSizePanel} ${Z[t]} ${n?Z.embedded:``}`,children:[(0,e.jsxs)(`div`,{className:Z.pageSizeMain,children:[(0,e.jsxs)(`fieldset`,{className:Z.pageSizeFieldset,disabled:x||H?.applying,children:[(0,e.jsx)(`legend`,{children:`На странице`}),(0,e.jsx)(`div`,{className:Z.pageSizeOptions,children:z.map(t=>(0,e.jsx)(`button`,{type:`button`,className:`${Z.pageSizeOption} ${bt===t?Z.pageSizeOptionActive:``}`,"aria-pressed":bt===t,onClick:()=>{ne===void 0&&xe(t),re?.(t)},children:t===-1?`Все`:t},t))})]}),ie===`table`&&!H&&(0,e.jsx)(p,{size:`sm`,disabled:x||!r,"aria-describedby":bt===-1&&r&&t===`top`?i:void 0,onClick:Dt,children:`Применить`})]}),(0,e.jsxs)(`span`,{className:Z.paginationRange,children:[`Показано `,Tt,`–`,Et,` из`,` `,Me]}),St&&t===`top`&&(0,e.jsx)(`span`,{className:Z.pendingChanges,role:`status`,children:`Есть неприменённые изменения`}),Ee&&bt===-1&&r&&(0,e.jsxs)(`span`,{id:i,className:Z.pageSizeWarning,"aria-hidden":t===`bottom`||void 0,children:[`Будут загружены все`,` `,Me,` `,`записей`]})]})},Ot=e=>{let t=Math.max(0,Math.min(Ne-1,e));if(Ee){t!==J&&B?.(t+1);return}ye(t)},kt=e=>{let t=Array.from(e);k===void 0&&ge(t),A?.(t)},At=e=>{let t=new Set(Ke);t.has(e)?t.delete(e):t.add(e),kt(t)},jt=()=>{let e=ft(Ke,Xe,!Qe);k===void 0&&ge(e),A?.(e)},Mt=()=>kt(new Set),Nt=e=>{let t=new Set(Je);t.has(e)?t.delete(e):t.add(e);let n=Array.from(t);le===void 0&&_e(n),ue?.(n)},Pt=i.filter((e,t)=>Ke.has(f?.(e,t)??String(t))),Ft=fe?.({visibleCount:Y.length,totalCount:Me,selectedCount:Ke.size})??`Показано строк: ${Y.length} из ${Me}. Выбрано: ${Ke.size}.`;return(0,t.useEffect)(()=>{Ee||ye(0)},[i,Ee,Te,F,Ce]),(0,t.useEffect)(()=>{!Ee&&ve>=Ne&&ye(Ne-1)},[Ee,Ne,ve]),(0,t.useEffect)(()=>{xe(lt(R,z))},[R,z]),(0,e.jsxs)(`section`,{className:rt,"aria-busy":x,children:[(0,e.jsx)(`div`,{className:Z.srOnly,"aria-live":`polite`,"aria-atomic":`true`,children:Ft}),ce&&Ke.size>0&&(0,e.jsx)(`div`,{className:Z.bulkActions,role:`region`,"aria-label":`Действия с выбранными строками`,children:ce({selectedRowIds:Array.from(Ke),selectedRows:Pt,clearSelection:Mt})}),H&&(0,e.jsxs)(`form`,{className:Z.filterBar,role:`search`,"aria-label":`Фильтры таблицы`,onSubmit:e=>{e.preventDefault(),!(!St||Ct||H.applying||x)&&(ye(0),B?.(1),H.onApply({filters:H.draftValues,pageSize:bt}))},children:[(0,e.jsx)(`div`,{className:Z.filterFields,children:H.fields.map(t=>(0,e.jsx)(dt,{field:t,value:H.draftValues[t.key],disabled:!!(t.disabled||H.applying||x),error:xt[t.key],setValue:e=>H.onDraftValuesChange({...H.draftValues,[t.key]:e})},t.key))}),yt&&Q(`top`,!0),(0,e.jsxs)(`div`,{className:Z.filterActions,children:[(0,e.jsx)(p,{variant:`empty`,disabled:H.applying||x,onClick:()=>{let e=H.resetValues??H.appliedValues;H.onDraftValuesChange(e);let t=H.resetPageSize??z[0]??30;ne===void 0&&xe(t),re?.(t),H.onReset?.({filters:e,pageSize:t})},children:H.resetLabel??`Сбросить`}),(0,e.jsx)(p,{type:`submit`,isLoading:H.applying,disabled:!St||Ct||x,children:H.applyLabel??`Применить`})]})]}),yt&&!H&&Q(`top`),(_===`highlighted`||g!=null)&&(0,e.jsxs)(`div`,{className:Z.toolbar,children:[_===`highlighted`&&(0,e.jsxs)(`div`,{className:Z.totalWidget,"aria-label":`${v}: ${Me}`,children:[(0,e.jsx)(`span`,{className:Z.totalLabel,children:v}),(0,e.jsx)(`strong`,{className:Z.totalValue,children:Me})]}),g]}),!nt&&!x&&!it&&Y.length>0&&et.length>0&&(0,e.jsx)(Ye,{className:Z.mobileSort,options:et,value:K[0]?{id:K[0].id,direction:K[0].desc?`desc`:`asc`}:null,onChange:e=>Ae.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:Z.tableWrap,style:{maxHeight:T},children:(0,e.jsxs)(`table`,{className:Z.table,"aria-label":b,children:[y&&(0,e.jsx)(`caption`,{children:y}),(ke||O||!!V)&&(0,e.jsxs)(`colgroup`,{children:[V&&(0,e.jsx)(`col`,{className:Z.expansionColumn}),O&&(0,e.jsx)(`col`,{className:Z.selectionColumn}),q.map(t=>(0,e.jsx)(`col`,{style:pt(t)},t.id))]}),(0,e.jsx)(`thead`,{className:w?Z.sticky:``,children:Ae.getHeaderGroups().map(t=>(0,e.jsxs)(`tr`,{children:[V&&(0,e.jsx)(`th`,{className:Z.expansionCell,scope:`col`,children:(0,e.jsx)(`span`,{className:Z.srOnly,children:`Подробности`})}),O&&(0,e.jsx)(`th`,{className:Z.selectionHeaderCell,scope:`col`,children:(0,e.jsxs)(`div`,{className:Z.selectionHeaderControls,children:[(0,e.jsx)(be,{checked:Qe,indeterminate:$e,disabled:x||Xe.length===0,ariaLabel:N,onChange:jt}),(0,e.jsx)(p,{size:`sm`,variant:`empty`,disabled:Ke.size===0,"aria-label":P,title:P,onClick:Mt,children:(0,e.jsx)(W,{name:`IconX`,width:16,height:16})})]})}),t.headers.map(t=>{let n=t.column.getIsSorted(),r=t.column.getCanSort(),i=t.column.getToggleSortingHandler(),a=q.find(e=>e.id===t.column.id);return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,className:a?.sticky?Z.stickyColumn:void 0,style:{...pt(a),...mt(a)},children:(0,e.jsxs)(`button`,{type:`button`,className:Z.sortButton,disabled:!r,onClick:i,children:[(0,e.jsx)(Ae.FlexRender,{header:t}),(0,e.jsx)(W,{name:n===`asc`?`IconSortAscending`:n===`desc`?`IconSortDescending`:`IconSort`,width:16,height:16})]})},t.id)})]},t.id))}),(0,e.jsx)(`tbody`,{children:x?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:q.length+ +!!O+ +!!V,children:(0,e.jsx)(Ve,{lines:3,height:65})})}):it?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:Z.state,colSpan:q.length+ +!!O+ +!!V,children:it})}):Y.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:Z.state,colSpan:q.length+ +!!O+ +!!V,children:C})}):(0,e.jsx)(e.Fragment,{children:Be.map((n,r)=>{let i=Ke.has(n.id),a=M?.(n.original)??`Выбрать строку ${n.index+1}`,o=Je.has(n.id);return(0,e.jsxs)(t.Fragment,{children:[(0,e.jsxs)(`tr`,{ref:He>=0&&r>=He?e=>{e?Ue.current.set(r,e):Ue.current.delete(r)}:void 0,className:[D||O?Z.clickableRow:``,i?Z.selectedRow:``,m?.(n.original)].filter(Boolean).join(` `),style:h?.(n.original),"aria-selected":O?i:void 0,onClick:()=>{O?At(n.id):D?.(n.original)},onDoubleClick:()=>{O&&j?.(n.original)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),O?j?.(n.original):D?.(n.original)):e.key===` `&&O&&(e.preventDefault(),At(n.id))},tabIndex:D||O||j?0:void 0,role:!O&&D?`button`:void 0,children:[V&&(0,e.jsx)(`td`,{className:Z.expansionCell,onClick:e=>e.stopPropagation(),children:(0,e.jsx)(p,{size:`sm`,variant:`empty`,"aria-expanded":o,"aria-label":de?.(n.original,o)??(o?`Скрыть подробности строки`:`Показать подробности строки`),onClick:()=>Nt(n.id),children:(0,e.jsx)(W,{name:`IconChevron`,width:16,height:16,className:o?Z.expansionIconOpen:Z.expansionIcon})})}),O&&(0,e.jsx)(`td`,{className:Z.selectionCell,children:(0,e.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,e.jsx)(be,{checked:i,ariaLabel:a,onChange:()=>At(n.id)})})}),n.getAllCells().map(t=>{let n=q.find(e=>e.id===t.column.id);return(0,e.jsx)(`td`,{className:n?.sticky?Z.stickyColumn:void 0,style:{...pt(n),...mt(n)},children:(0,e.jsx)(Ae.FlexRender,{cell:t})},t.id)})]}),o&&V&&(0,e.jsx)(`tr`,{className:Z.detailRow,children:(0,e.jsx)(`td`,{colSpan:q.length+ +!!O+1,children:V({row:n.original,rowId:n.id,collapse:()=>Nt(n.id)})})})]},n.id)})})})]})}),!nt&&(0,e.jsxs)(`div`,{className:Z.cards,role:`list`,"aria-label":b??y,children:[O&&!x&&!it&&Y.length>0&&(0,e.jsxs)(`div`,{className:Z.mobileSelectionControls,children:[(0,e.jsx)(be,{checked:Qe,indeterminate:$e,ariaLabel:N,label:N,onChange:jt}),(0,e.jsx)(p,{size:`sm`,variant:`empty`,disabled:Ke.size===0,onClick:Mt,children:P})]}),x?(0,e.jsx)(Ve,{lines:4,height:65}):it?(0,e.jsx)(`div`,{className:Z.state,children:it}):Y.length===0?(0,e.jsx)(`div`,{className:Z.state,children:C}):(0,e.jsx)(e.Fragment,{children:Be.map((t,n)=>{let r=Ke.has(t.id),i=Je.has(t.id),a=M?.(t.original)??`Выбрать строку ${t.index+1}`,o=O&&(0,e.jsxs)(`div`,{className:Z.cardSelectionControls,onClick:e=>e.stopPropagation(),children:[(0,e.jsx)(be,{checked:r,ariaLabel:a,onChange:()=>At(t.id)}),j&&(0,e.jsx)(p,{size:`sm`,variant:`empty`,onClick:()=>j(t.original),children:ee})]}),s=V&&(0,e.jsx)(p,{size:`sm`,variant:`empty`,"aria-expanded":i,"aria-label":de?.(t.original,i)??(i?`Скрыть подробности строки`:`Показать подробности строки`),onClick:e=>{e.stopPropagation(),Nt(t.id)},children:(0,e.jsx)(W,{name:`IconChevron`,width:16,height:16,className:i?Z.expansionIconOpen:Z.expansionIcon})});if(d)return(0,e.jsxs)(`div`,{ref:He>=0&&n>=He?e=>{e?We.current.set(n,e):We.current.delete(n)}:void 0,role:`listitem`,className:[Z.customCardShell,r?Z.selectedCard:``,m?.(t.original)].filter(Boolean).join(` `),style:h?.(t.original),"aria-selected":O?r:void 0,onClick:()=>{O&&At(t.id)},children:[o,d({row:t.original,columns:q}),s,i&&(0,e.jsx)(`div`,{className:Z.cardDetail,children:V?.({row:t.original,rowId:t.id,collapse:()=>Nt(t.id)})})]},t.id);let c=q.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),l=c.find(e=>e.mobile?.primary)??c.find(e=>e.mobile?.mobileVariant!==`actions`),u=e=>_t(e.accessor,t.original),f=e=>e.mobile?.renderMobile?.(t.original,u(e))??e.cell?.(t.original,u(e))??String(u(e)??``);return(0,e.jsxs)(`article`,{ref:He>=0&&n>=He?e=>{e?We.current.set(n,e):We.current.delete(n)}:void 0,role:`listitem`,className:[Z.card,r?Z.selectedCard:``,m?.(t.original)].filter(Boolean).join(` `),style:h?.(t.original),"aria-selected":O?r:void 0,onClick:()=>{O&&At(t.id)},children:[o,s,(0,e.jsx)(`h3`,{children:l?f(l):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:c.filter(e=>e!==l&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?Z.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:f(t)})]},t.id))}),c.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:f(t)},t.id)),i&&(0,e.jsx)(`div`,{className:Z.cardDetail,children:V?.({row:t.original,rowId:t.id,collapse:()=>Nt(t.id)})})]},t.id)})})]}),(vt||yt&&!x&&!it&&Y.length>0)&&(0,e.jsxs)(`nav`,{className:Z.pagination,"aria-label":`Пагинация таблицы`,children:[yt?Q(`bottom`):(0,e.jsxs)(`span`,{className:Z.paginationRange,"aria-live":`polite`,children:[Tt,`–`,Et,` из`,` `,Me]}),vt&&(0,e.jsxs)(`div`,{className:Z.paginationControls,children:[(0,e.jsxs)(p,{variant:`empty`,size:`md`,disabled:x||J===0,"aria-label":`Предыдущая страница`,onClick:()=>{Ot(J-1)},children:[(0,e.jsx)(W,{name:`IconChevron`,width:18,height:18,className:Z.previousIcon}),(0,e.jsx)(`span`,{className:Z.paginationButtonLabel,children:`Назад`})]}),(0,e.jsx)(`div`,{className:Z.pageNumbers,children:tt.map(t=>typeof t==`number`?(0,e.jsx)(p,{variant:t===J?`secondary`:`empty`,size:`md`,className:Z.pageButton,"aria-label":`Перейти на страницу ${t+1}`,"aria-current":t===J?`page`:void 0,disabled:x,onClick:()=>{Ot(t)},children:t+1},t):(0,e.jsx)(`span`,{className:Z.ellipsis,"aria-hidden":`true`,children:`…`},t))}),(0,e.jsxs)(p,{variant:`empty`,size:`md`,disabled:x||J===Ne-1,"aria-label":`Следующая страница`,onClick:()=>{Ot(J+1)},children:[(0,e.jsx)(`span`,{className:Z.paginationButtonLabel,children:`Вперёд`}),(0,e.jsx)(W,{name:`IconChevron`,width:18,height:18,className:Z.nextIcon})]})]})]})]})},Et=(e,t)=>{let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.value.toLocaleLowerCase().includes(n)):e},Dt=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},Q={wrapper:`_wrapper_1os84_1`,control:`_control_1os84_17`,inputHost:`_inputHost_1os84_25`,sm:`_sm_1os84_41`,md:`_md_1os84_57`,lg:`_lg_1os84_71`,errorState:`_errorState_1os84_85`,disabledText:`_disabledText_1os84_93`,chevron:`_chevron_1os84_163`,chevronOpen:`_chevronOpen_1os84_197`,menu:`_menu_1os84_205`,menuEmpty:`_menuEmpty_1os84_233`,option:`_option_1os84_241`,empty:`_empty_1os84_241`,selected:`_selected_1os84_321`,active:`_active_1os84_321`,actionOption:`_actionOption_1os84_341`,visuallyHidden:`_visuallyHidden_1os84_375`},Ot=8,kt=6,At=5,jt=10,Mt={sm:30,md:40,lg:50},Nt=({options:r,value:i,onChange:a,placeholder:o=`Начните вводить`,noResultsText:s=`Ничего не найдено`,disabled:c=!1,readOnly:l=!1,stringWhileDisabled:u=!1,label:d,error:f,hint:p,size:m=`md`,required:_=!1,className:v=``,name:y,id:b,needMark:x=!0})=>{let S=(0,t.useId)(),C=b??`ds-search-dropdown-${y??S}`,w=`${C}-listbox`,T=`${C}-status`,E=p?`${C}-hint`:void 0,D=f?`${C}-error`:void 0,O=[T,E,D].filter(Boolean).join(` `),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)([]),[M,N]=(0,t.useState)(!1),[P,ee]=(0,t.useState)(``),[F,I]=(0,t.useState)(-1),[L,R]=(0,t.useState)(null),te=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),z=(0,t.useMemo)(()=>Et(r,P),[r,P]),ne=c&&u,re=F>=0?z[F]:void 0;(0,t.useEffect)(()=>ee(te?.label??``),[te?.label,i]);let ie=(0,t.useCallback)(()=>k.current?.querySelector(`input`)??null,[]),ae=(0,t.useCallback)((e,t)=>Dt(z,e,t),[z]),B=(0,t.useCallback)(e=>{I(e),!(e<0)&&requestAnimationFrame(()=>j.current[e]?.scrollIntoView({block:`nearest`}))},[]),oe=(0,t.useCallback)(()=>{let e=ie();if(!e)return;let t=e.getBoundingClientRect(),n=Math.max(1,Math.min(z.length,At))*Mt[m]+jt,r=window.innerHeight-t.bottom-Ot,i=t.top-Ot,a=r<n&&i>r,o=a?i:r,s=Math.max(Mt[m]+jt,Math.min(n,o)),c=window.innerWidth-t.width-Ot,l=Math.max(Ot,Math.min(t.left,c)),u=a?Math.max(Ot,t.top-s-kt):t.bottom+kt;R({top:u,left:l,width:t.width,maxHeight:s})},[z.length,ie,m]);(0,t.useLayoutEffect)(()=>{if(!M){R(null);return}return oe(),window.addEventListener(`resize`,oe),window.addEventListener(`scroll`,oe,!0),()=>{window.removeEventListener(`resize`,oe),window.removeEventListener(`scroll`,oe,!0)}},[M,oe]),(0,t.useEffect)(()=>{if(!M)return;let e=e=>{let t=e.target;!k.current?.contains(t)&&!A.current?.contains(t)&&(N(!1),I(-1))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[M]);let se=()=>{c||l||(N(!0),I(ae(0,1)))},ce=e=>{e.disabled||(ee(e.label),N(!1),I(-1),a?.(e.value,e),ie()?.focus())},V=M?(0,e.jsx)(`ul`,{ref:A,id:w,className:`${Q.menu} ${z.length===0?Q.menuEmpty:``}`,role:`listbox`,"aria-label":d,style:L?{top:L.top,left:L.left,width:L.width,maxHeight:L.maxHeight}:{top:0,left:0,visibility:`hidden`,maxHeight:0},children:z.length===0?(0,e.jsx)(`li`,{className:`${Q.empty} ${Q[m]}`,children:s}):z.map((t,n)=>{let r=t.value===i,a=n===F;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{j.current[n]=e},id:`${C}-option-${n}`,type:`button`,role:`option`,tabIndex:-1,disabled:t.disabled,"aria-disabled":t.disabled,"aria-selected":r,"data-option-variant":t.variant??`default`,className:[Q.option,Q[m],t.variant===`action`?Q.actionOption:``,r?Q.selected:``,a?Q.active:``].filter(Boolean).join(` `),onPointerMove:()=>{t.disabled||I(n)},onClick:()=>ce(t),children:[(0,e.jsx)(`span`,{children:t.label}),r&&x&&(0,e.jsx)(W,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:k,className:[Q.wrapper,f?Q.errorState:``,v].filter(Boolean).join(` `),children:[d&&(0,e.jsx)(h,{htmlFor:ne?void 0:C,required:_,disabled:c,children:d}),ne?(0,e.jsx)(`div`,{className:`${Q.disabledText} ${Q[m]}`,children:te?.label??o}):(0,e.jsxs)(`div`,{className:Q.control,children:[(0,e.jsx)(Ze,{id:C,name:y,value:P,placeholder:o,disabled:c,readOnly:l,required:_,size:m,clearable:!1,autoComplete:`off`,className:`${Q.inputHost} ${Q[m]}`,onFocus:se,onChange:e=>{let t=String(e),n=Et(r,t);ee(t),N(!0),I(Dt(n,0,1))},role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":M,"aria-controls":w,"aria-activedescendant":re?`${C}-option-${F}`:void 0,"aria-invalid":!!f,"aria-describedby":O,onClick:se,onKeyDown:e=>{if(!(c||l)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=F>=0?F+t:t===1?0:z.length-1;N(!0),B(ae(n,t))}else if(e.key===`Home`||e.key===`End`){if(!M)return;e.preventDefault();let t=e.key===`Home`?1:-1;B(ae(e.key===`Home`?0:z.length-1,t))}else e.key===`Enter`&&M&&re?(e.preventDefault(),ce(re)):e.key===`Escape`&&M?(e.preventDefault(),N(!1),I(-1)):e.key===`Tab`&&(N(!1),I(-1))}}}),(0,e.jsx)(`span`,{className:`${Q.chevron} ${M?Q.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]}),M&&typeof document<`u`&&(0,n.createPortal)(V,document.body),(0,e.jsxs)(`span`,{id:T,className:Q.visuallyHidden,"aria-live":`polite`,children:[`Найдено вариантов: `,z.length]}),p&&!f&&(0,e.jsx)(g,{id:E,children:p}),f&&(0,e.jsx)(g,{id:D,variant:`error`,children:f})]})},Pt={root:`_root_11adi_1`,header:`_header_11adi_21`,title:`_title_11adi_41`,dismiss:`_dismiss_11adi_55`,content:`_content_11adi_65`},Ft=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${Pt.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:Pt.header,children:[(0,e.jsx)(s,{id:l,className:Pt.title,children:n}),i&&(0,e.jsx)(p,{className:Pt.dismiss,variant:`empty`,onClick:a,"aria-label":o,children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]}),(0,e.jsx)(`div`,{className:Pt.content,children:r})]})},It={root:`_root_1ecm3_1`,grid:`_grid_1ecm3_13`,actions:`_actions_1ecm3_27`},Lt=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let u=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${It.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:It.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`){let n={label:t.label,hint:t.hint,placeholder:t.placeholder,disabled:r};return t.inputType===`number`?(0,e.jsx)(Ze,{...n,type:`number`,value:i??``,onChange:e=>u(t.id,e)},t.id):(0,e.jsx)(Ze,{...n,type:`text`,value:String(i??``),onChange:e=>u(t.id,e)},t.id)}if(t.type===`dropdown`)return(0,e.jsx)(qe,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>u(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(nt,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>u(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(be,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>u(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(it,{label:t.label,checked:!!i,disabled:r,onChange:e=>u(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(ze,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>u(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:It.actions,children:[a&&(0,e.jsx)(p,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(p,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},Rt={grid:`_grid_1q540_1`,comfortable:`_comfortable_1q540_11`,compact:`_compact_1q540_19`,columns1:`_columns1_1q540_27`,columns2:`_columns2_1q540_35`,columns3:`_columns3_1q540_43`,columns4:`_columns4_1q540_51`,item:`_item_1q540_59`,span1:`_span1_1q540_67`,span2:`_span2_1q540_75`,span3:`_span3_1q540_83`,span4:`_span4_1q540_91`,spanfull:`_spanfull_1q540_93`,summary:`_summary_1q540_101`,summaryTitle:`_summaryTitle_1q540_137`,summaryList:`_summaryList_1q540_145`},zt=({columns:t=2,density:n=`comfortable`,className:r=``,...i})=>(0,e.jsx)(`div`,{...i,className:`${Rt.grid} ${Rt[`columns${t}`]} ${Rt[n]} ${r}`}),Bt=({span:t=1,className:n=``,...r})=>(0,e.jsx)(`div`,{...r,className:`${Rt.item} ${Rt[`span${t}`]} ${n}`}),Vt=({title:t=`Проверьте заполнение формы`,items:n,focusField:r,className:i=``,...a})=>n.length===0?null:(0,e.jsxs)(`div`,{...a,className:`${Rt.summary} ${i}`,role:`alert`,"aria-atomic":`true`,tabIndex:-1,children:[(0,e.jsx)(`strong`,{className:Rt.summaryTitle,children:t}),(0,e.jsx)(`ul`,{className:Rt.summaryList,children:n.map(t=>(0,e.jsx)(`li`,{children:t.fieldId?(0,e.jsx)(`a`,{href:`#${t.fieldId}`,onClick:e=>{r&&(e.preventDefault(),r(t.fieldId))},children:t.message}):t.message},t.id))})]}),Ht={wrapper:`_wrapper_i20hz_1`,dropzone:`_dropzone_i20hz_15`,dragActive:`_dragActive_i20hz_45`,disabled:`_disabled_i20hz_59`,error:`_error_i20hz_69`,nativeInput:`_nativeInput_i20hz_77`,empty:`_empty_i20hz_95`,uploadIcon:`_uploadIcon_i20hz_111`,files:`_files_i20hz_133`,file:`_file_i20hz_133`,fileName:`_fileName_i20hz_175`,fileSize:`_fileSize_i20hz_187`},Ut=e=>`${e.name}:${e.size}:${e.lastModified}`,Wt=e=>e<1024?`${e} Б`:e<1048576?`${(e/1024).toFixed(1)} КБ`:`${(e/1024/1024).toFixed(1)} МБ`,Gt=(e,t)=>!t||t.split(`,`).map(e=>e.trim().toLowerCase()).some(t=>t.startsWith(`.`)?e.name.toLowerCase().endsWith(t):t.endsWith(`/*`)?e.type.startsWith(t.slice(0,-1)):e.type.toLowerCase()===t),Kt=({value:n,onChange:r,multiple:i=!1,accept:a,maxSize:o,maxFiles:s,label:c,hint:l,error:u,required:d=!1,disabled:f=!1,readOnly:m=!1,name:_,id:v,className:y=``,dropLabel:b=`Перетащите файлы в эту область`,browseLabel:x=`Выбрать файлы`,addMoreLabel:S=`Добавить ещё`,onReject:C})=>{let w=(0,t.useId)(),T=v??`ds-file-input-${_??w}`,E=(0,t.useRef)(null),D=(0,t.useRef)(0),[O,k]=(0,t.useState)(!1),A=l?`${T}-hint`:void 0,j=u?`${T}-error`:void 0,M=[A,j].filter(Boolean).join(` `)||void 0,N=!f&&!m,P=e=>{let t=[],c=new Set(n.map(Ut)),l=e.filter(e=>Gt(e,a)?o!==void 0&&e.size>o?(t.push({file:e,reason:`maxSize`}),!1):!c.has(Ut(e))&&(c.add(Ut(e)),!0):(t.push({file:e,reason:`accept`}),!1)),u=i?s:1,d=i?[...n,...l]:l.slice(-1);u!==void 0&&d.length>u&&(d.slice(u).forEach(e=>t.push({file:e,reason:`maxFiles`})),d=d.slice(0,u)),t.length&&C?.(t),l.length&&r?.(d),E.current&&(E.current.value=``)};return(0,e.jsxs)(`div`,{className:`${Ht.wrapper} ${y}`,children:[c&&(0,e.jsx)(h,{htmlFor:T,required:d,disabled:f,children:c}),(0,e.jsxs)(`div`,{className:`${Ht.dropzone} ${O?Ht.dragActive:``} ${f?Ht.disabled:``} ${u?Ht.error:``}`,onDragEnter:e=>{e.preventDefault(),N&&++D.current===1&&k(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.preventDefault(),--D.current<=0&&(D.current=0,k(!1))},onDrop:e=>{e.preventDefault(),D.current=0,k(!1),N&&P(Array.from(e.dataTransfer.files))},children:[(0,e.jsx)(`input`,{ref:E,id:T,name:_,className:Ht.nativeInput,type:`file`,multiple:i,accept:a,required:d&&n.length===0,disabled:!N,"aria-describedby":M,"aria-invalid":!!u,onChange:e=>P(Array.from(e.target.files??[]))}),n.length?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`ul`,{className:Ht.files,"aria-live":`polite`,children:n.map((t,i)=>(0,e.jsxs)(`li`,{className:Ht.file,children:[(0,e.jsx)(`span`,{className:Ht.fileName,title:t.name,children:t.name}),(0,e.jsx)(`span`,{className:Ht.fileSize,children:Wt(t.size)}),N&&(0,e.jsx)(p,{variant:`empty`,size:`sm`,"aria-label":`Удалить файл ${t.name}`,onClick:()=>r?.(n.filter((e,t)=>t!==i)),children:(0,e.jsx)(W,{name:`IconCross`,width:16,height:16})})]},Ut(t)))}),N&&(i||n.length===0)&&(0,e.jsx)(p,{className:Ht.browseButton,size:`sm`,onClick:()=>E.current?.click(),children:S}),N&&!i&&(0,e.jsx)(p,{className:Ht.browseButton,size:`sm`,onClick:()=>E.current?.click(),children:x})]}):(0,e.jsxs)(`div`,{className:Ht.empty,children:[(0,e.jsx)(`span`,{className:Ht.uploadIcon,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconUpload`,width:24,height:24})}),(0,e.jsx)(`strong`,{children:O?`Отпустите файлы здесь`:b}),!O&&N&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`span`,{children:`или`}),(0,e.jsx)(p,{onClick:()=>E.current?.click(),children:x})]})]})]}),l&&!u&&(0,e.jsx)(g,{id:A,children:l}),u&&(0,e.jsx)(g,{id:j,variant:`error`,live:!0,children:u})]})},qt=({children:e,containerId:r=`overlay-root`})=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=document.getElementById(r);if(e){a(e);return}let t=document.createElement(`div`);return t.id=r,document.body.appendChild(t),a(t),()=>{t.childElementCount===0&&t.parentElement&&t.remove()}},[r]),i?(0,n.createPortal)(e,i):null},Jt=typeof window>`u`?t.useEffect:t.useLayoutEffect,Yt=({anchorRef:n,children:r,matchAnchorWidth:i=!1,offset:a=4,className:o})=>{let[s,c]=(0,t.useState)(null),[l,u]=(0,t.useState)({position:`fixed`,visibility:`hidden`,zIndex:1100}),d=(0,t.useCallback)(()=>{let e=n.current,t=s;if(!e||!t)return;let r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),c=window.innerHeight-r.bottom-8,l=r.top-8,d=(c>=o.height||c>=l?`bottom`:`top`)==`bottom`?r.bottom+a:r.top-o.height-a,f=r.left,p=window.innerWidth-o.width-8,m=Math.max(8,Math.min(f,p)),h={position:`fixed`,top:Math.max(8,Math.min(d,window.innerHeight-o.height-8)),left:m,...i?{width:r.width}:{},zIndex:1100,visibility:`visible`};u(e=>e.top===h.top&&e.left===h.left&&e.width===h.width&&e.visibility===h.visibility?e:h)},[n,i,s,a]);return Jt(()=>{if(!s)return;d(),window.addEventListener(`resize`,d),window.addEventListener(`scroll`,d,!0);let e=typeof ResizeObserver>`u`?null:new ResizeObserver(d);return e?.observe(s),n.current&&e?.observe(n.current),()=>{window.removeEventListener(`resize`,d),window.removeEventListener(`scroll`,d,!0),e?.disconnect()}},[n,s,d]),(0,e.jsx)(qt,{children:(0,e.jsx)(`div`,{ref:c,className:o,style:l,children:r})})},Xt={wrapper:`_wrapper_x2gki_1`,control:`_control_x2gki_15`,textarea:`_textarea_x2gki_25`,disabledText:`_disabledText_x2gki_27`,sm:`_sm_x2gki_103`,md:`_md_x2gki_117`,lg:`_lg_x2gki_131`,autoResize:`_autoResize_x2gki_145`,manualResize:`_manualResize_x2gki_155`,textareaError:`_textareaError_x2gki_163`,clearAction:`_clearAction_x2gki_171`,messages:`_messages_x2gki_251`,counter:`_counter_x2gki_265`},Zt=2;function Qt(e){let t=window.getComputedStyle(e),n=Number.parseFloat(t.lineHeight);return Number.isFinite(n)?n:Number.parseFloat(t.fontSize)*1.4}function $t({value:n,onChange:r,placeholder:i=``,disabled:a=!1,readOnly:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:f,id:p,size:m=`md`,clearable:_=!1,required:v=!1,maxLength:y,showCount:b=!1,minRows:x=Zt,maxRows:S,autoResize:C=!0,...w}){let T=(0,t.useId)(),E=p??`ds-textarea-${f??T}`,D=(0,t.useRef)(null),O=u?`${E}-hint`:void 0,k=l?`${E}-error`:void 0,A=b&&y?`${E}-count`:void 0,j=[O,k,A].filter(Boolean).join(` `)||void 0,M=Math.max(1,x),N=S===void 0?void 0:Math.max(M,S),P=(0,t.useCallback)(()=>{let e=D.current;if(!e||!C)return;let t=window.getComputedStyle(e),n=Qt(e),r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom)+Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth),i=n*M+r,a=N===void 0?1/0:n*N+r;e.style.height=`auto`;let o=Math.min(Math.max(e.scrollHeight,i),a);e.style.height=`${o}px`,e.style.overflowY=e.scrollHeight>a?`auto`:`hidden`},[C,N,M]);(0,t.useEffect)(()=>{P()},[P,n]),(0,t.useEffect)(()=>{if(!C)return;window.addEventListener(`resize`,P);let e=D.current?.parentElement,t;if(e&&typeof ResizeObserver<`u`){let n=e.getBoundingClientRect().width;t=new ResizeObserver(([e])=>{!e||e.contentRect.width===n||(n=e.contentRect.width,P())}),t.observe(e)}return()=>{window.removeEventListener(`resize`,P),t?.disconnect()}},[C,P]);let ee=e=>{r?.(e.target.value,e),P()},F=()=>{let e=D.current;e&&((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus(),P())},I={"--ds-textarea-min-rows":M};return(0,e.jsxs)(`div`,{className:`${Xt.wrapper} ${d}`,children:[c&&(0,e.jsx)(h,{htmlFor:E,required:v,disabled:a,children:c}),a&&s?(0,e.jsx)(`div`,{id:E,className:`${Xt.disabledText} ${Xt[m]}`,style:I,"aria-describedby":j,children:n||i}):(0,e.jsxs)(`div`,{className:Xt.control,children:[(0,e.jsx)(`textarea`,{ref:D,id:E,name:f,value:n,placeholder:i,disabled:a,readOnly:o,required:v,maxLength:y,rows:M,style:I,"aria-invalid":!!l,"aria-describedby":j,className:`${Xt.textarea} ${Xt[m]} ${C?Xt.autoResize:Xt.manualResize} ${l?Xt.textareaError:``}`,onChange:ee,...w}),_&&n&&!a&&!o&&(0,e.jsx)(`button`,{type:`button`,className:Xt.clearAction,"aria-label":`Очистить поле`,onClick:F,children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]}),(u||l||A)&&(0,e.jsxs)(`div`,{className:Xt.messages,children:[u&&!l&&(0,e.jsx)(g,{id:O,children:u}),l&&(0,e.jsx)(g,{id:k,variant:`error`,children:l}),A&&(0,e.jsxs)(`span`,{id:A,className:Xt.counter,children:[n.length,` / `,y]})]})]})}var en=0,tn=(0,i.create)((e,t)=>({modals:[],openModal:(t,n={},r={})=>{en+=1;let i=`ds-modal-${en}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,title:r.title,description:r.description,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0,onClose:r.onClose}]})),i},closeModal:n=>{let r=t().modals.find(e=>e.id===n);r&&(e(e=>({modals:e.modals.filter(e=>e.id!==n)})),r.onClose?.())},closeTopModal:()=>{let n=t().modals.at(-1);n&&(e(e=>({modals:e.modals.slice(0,-1)})),n.onClose?.())},closeAllModals:()=>{let n=t().modals;n.length&&(e({modals:[]}),n.forEach(e=>e.onClose?.()))}})),nn=()=>{tn.getState().closeAllModals(),en=0},rn=8,an=96,on=.55;function sn(e,t,n){return{startX:e,startY:t,startTime:n,intent:`pending`}}function cn(e,t,n){let r=t-e.startX,i=n-e.startY;return e.intent===`pending`&&Math.max(Math.abs(r),Math.abs(i))>=rn&&(e.intent=Math.abs(i)>Math.abs(r)?`vertical`:`horizontal`),e.intent===`vertical`?Math.max(0,i):0}function ln(e,t,n){if(e.intent!==`vertical`)return!1;let r=Math.max(0,t-e.startY),i=Math.max(1,n-e.startTime);return r>=an||r>=32&&r/i>=on}var un={layer:`_layer_w9isk_1`,backdrop:`_backdrop_w9isk_15`,"backdrop-enter":`_backdrop-enter_w9isk_1`,panel:`_panel_w9isk_47`,"modal-enter":`_modal-enter_w9isk_1`,header:`_header_w9isk_89`,title:`_title_w9isk_107`,description:`_description_w9isk_119`,content:`_content_w9isk_133`,close:`_close_w9isk_141`,dragHandle:`_dragHandle_w9isk_149`,"sheet-enter":`_sheet-enter_w9isk_1`},dn=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,fn=(0,t.createContext)({});function pn(e){if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(dn));if(!t.length){e.preventDefault();return}let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}var mn=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useContext)(fn),u=r??l.title,d=i??l.description,f=(0,t.useId)(),m=(0,t.useId)(),h=(0,t.useRef)(null),g=(0,t.useRef)(null),_=(0,t.useRef)(null),[v,y]=(0,t.useState)(0),[b,x]=(0,t.useState)(!1),S=tn(e=>e.closeModal),C=l.requestClose??(()=>S(a)),w=u!=null,T=d!=null;(0,t.useEffect)(()=>{let e=document.activeElement,t=h.current;return(t?.querySelector(dn)??t)?.focus(),()=>e?.focus()},[]);let E=e=>{e&&_.current!==null&&e.hasPointerCapture(_.current)&&e.releasePointerCapture(_.current),g.current=null,_.current=null,x(!1),y(0)};return(0,e.jsxs)(`div`,{ref:h,className:`${un.panel} ${s}`,"data-closing":l.closing||void 0,"data-dragging":b||void 0,style:{"--ds-modal-drag-offset":`${v}px`},role:c,"aria-modal":`true`,"aria-labelledby":w?f:void 0,"aria-describedby":T?m:void 0,tabIndex:-1,onKeyDown:pn,children:[(0,e.jsx)(`button`,{type:`button`,className:un.dragHandle,"aria-label":`Потяните вниз, чтобы закрыть модальное окно`,onPointerDown:e=>{(e.pointerType!==`mouse`||e.button===0)&&(_.current=e.pointerId,g.current=sn(e.clientX,e.clientY,e.timeStamp),e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{if(e.pointerId!==_.current||!g.current)return;let t=cn(g.current,e.clientX,e.clientY);g.current.intent===`vertical`&&(e.preventDefault(),x(!0),y(t))},onPointerUp:e=>{if(e.pointerId!==_.current||!g.current)return;let t=ln(g.current,e.clientY,e.timeStamp);E(e.currentTarget),t&&C()},onPointerCancel:e=>E(e.currentTarget),children:(0,e.jsx)(`span`,{})}),(w||o)&&(0,e.jsxs)(`header`,{className:un.header,children:[w&&(0,e.jsx)(`h2`,{id:f,className:un.title,children:u}),(0,e.jsx)(p,{className:un.close,variant:`empty`,size:`sm`,"aria-label":o,onClick:C,children:(0,e.jsx)(W,{name:`IconCross`,width:24,height:24})})]}),T&&(0,e.jsx)(`p`,{id:m,className:un.description,children:d}),(0,e.jsx)(`div`,{className:un.content,children:n})]})},hn=({registry:r})=>{let i=tn(e=>e.modals),a=tn(e=>e.closeModal),[o,s]=(0,t.useState)(()=>new Set),c=(0,t.useRef)(new Map),l=e=>{if(c.current.has(e))return;s(t=>new Set(t).add(e));let t=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;c.current.set(e,window.setTimeout(()=>{c.current.delete(e),a(e),s(t=>{let n=new Set(t);return n.delete(e),n})},t?0:220))};return(0,t.useEffect)(()=>{let e=c.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]),(0,t.useEffect)(()=>{let e=e=>{let t=tn.getState().modals.at(-1);e.key===`Escape`&&t?.closeOnEscape&&l(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,t.useEffect)(()=>{i.forEach(e=>{r[e.name]||a(e.id)})},[a,i,r]),!i.length||typeof document>`u`?null:(0,n.createPortal)((0,e.jsx)(`div`,{className:un.layer,"aria-label":`Модальные окна`,children:i.map((t,n)=>{let a=r[t.name];if(!a)return null;let s=o.has(t.id);return(0,e.jsx)(`div`,{className:un.backdrop,"data-closing":s||void 0,"aria-hidden":n!==i.length-1||void 0,inert:n!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&l(t.id)},children:(0,e.jsx)(fn.Provider,{value:{title:t.title??t.payload.title,description:t.description??t.payload.description,closing:s,requestClose:()=>l(t.id)},children:(0,e.jsx)(a,{...t.payload,modalId:t.id,close:()=>l(t.id),closeAll:()=>i.forEach(({id:e})=>l(e))})})},t.id)})}),document.body)},gn=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=tn(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)(hn,{registry:n})]})},_n=e=>e,vn={message:`_message_c23ie_1`,actions:`_actions_c23ie_13`},yn=new Map,bn=0,xn=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{yn.get(c)?.(e),yn.delete(c),n()};return(0,e.jsxs)(mn,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:vn.message,children:i}),(0,e.jsxs)(`div`,{className:vn.actions,children:[(0,e.jsx)(p,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(p,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},Sn=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)(mn,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:vn.message,children:i}),(0,e.jsx)(`div`,{className:vn.actions,children:(0,e.jsx)(p,{onClick:n,children:a})})]}),Cn=_n({ConfirmModal:xn,ErrorModal:Sn}),wn=()=>{let e=tn(e=>e.openModal);return(t={})=>new Promise(n=>{bn+=1;let r=`confirm-${bn}`;yn.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1,onClose:()=>{yn.get(r)?.(!1),yn.delete(r)}})})},Tn=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,En=()=>{let e=tn(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:Tn(t)})}},Dn=(0,i.create)(()=>({})),On=(0,i.create)(()=>({})),kn=()=>{let e=tn(e=>e.modals),n=tn(e=>e.openModal),r=tn(e=>e.closeModal),i=tn(e=>e.closeTopModal),a=tn(e=>e.closeAllModals),o=(0,t.useCallback)((e,t={},r)=>n(e,t,r),[n]),s=(0,t.useCallback)(t=>e.some(e=>e.name===t),[e]);return(0,t.useMemo)(()=>({openModal:o,closeModal:r,closeTopModal:i,closeAllModals:a,isOpen:s,count:e.length}),[a,r,i,s,e.length,o])},An={layer:`_layer_ct7yp_1`,backdrop:`_backdrop_ct7yp_13`,panel:`_panel_ct7yp_27`,right:`_right_ct7yp_59`,left:`_left_ct7yp_73`,bottom:`_bottom_ct7yp_87`,fullscreen:`_fullscreen_ct7yp_101`,sm:`_sm_ct7yp_113`,md:`_md_ct7yp_121`,lg:`_lg_ct7yp_129`,xl:`_xl_ct7yp_137`,header:`_header_ct7yp_145`,heading:`_heading_ct7yp_163`,headerActions:`_headerActions_ct7yp_203`,content:`_content_ct7yp_215`,footer:`_footer_ct7yp_227`,"enter-right":`_enter-right_ct7yp_1`,"enter-left":`_enter-left_ct7yp_1`,"enter-bottom":`_enter-bottom_ct7yp_1`},jn=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,Mn=(0,t.createContext)(null),Nn=e=>{if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(jn));if(!t.length){e.preventDefault();return}let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())},Pn=()=>(0,t.useContext)(Mn),Fn=({open:r,onCloseRequest:i,children:a,title:o,description:s,headerActions:c,footer:l,placement:u=`right`,size:d=`md`,closeOnEscape:f=!0,closeOnBackdrop:m=!0,preventClose:h=!1,closeLabel:g=`Закрыть`,initialFocusRef:_,returnFocusRef:v,className:y=``})=>{let b=(0,t.useRef)(null),x=(0,t.useId)(),S=(0,t.useId)(),C=e=>{h||i(e)};return(0,t.useEffect)(()=>{if(!r||typeof document>`u`)return;let e=document.activeElement,t=v?.current,n=document.body.style.overflow;document.body.style.overflow=`hidden`;let a=b.current;(_?.current??a?.querySelector(jn)??a)?.focus();let o=e=>{e.key===`Escape`&&f&&!h&&i(`escape`)};return document.addEventListener(`keydown`,o),()=>{document.removeEventListener(`keydown`,o),document.body.style.overflow=n,(t??e)?.focus()}},[f,_,i,r,h,v]),!r||typeof document>`u`?null:(0,n.createPortal)((0,e.jsx)(`div`,{className:An.layer,children:(0,e.jsx)(`div`,{className:An.backdrop,onMouseDown:e=>{e.target===e.currentTarget&&m&&C(`backdrop`)},children:(0,e.jsx)(Mn.Provider,{value:{requestClose:C},children:(0,e.jsxs)(`section`,{ref:b,className:`${An.panel} ${An[u]} ${An[d]} ${y}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o?x:void 0,"aria-describedby":s?S:void 0,tabIndex:-1,onKeyDown:Nn,children:[(0,e.jsxs)(`header`,{className:An.header,children:[(0,e.jsxs)(`div`,{className:An.heading,children:[o&&(0,e.jsx)(`h2`,{id:x,children:o}),s&&(0,e.jsx)(`p`,{id:S,children:s})]}),c&&(0,e.jsx)(`div`,{className:An.headerActions,children:c}),(0,e.jsx)(p,{variant:`empty`,size:`sm`,"aria-label":g,disabled:h,onClick:()=>C(`close-button`),children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]}),(0,e.jsx)(`div`,{className:An.content,children:a}),l&&(0,e.jsx)(`footer`,{className:An.footer,children:l})]})})})}),document.body)},In=({placement:t=`right`,...n})=>(0,e.jsx)(Fn,{...n,placement:t}),Ln=t=>(0,e.jsx)(Fn,{...t,placement:`bottom`}),Rn=t=>(0,e.jsx)(Fn,{...t,placement:`fullscreen`,size:`xl`}),zn={wrapper:`_wrapper_1hyyy_1`,container:`_container_1hyyy_15`,inner:`_inner_1hyyy_35`,cube:`_cube_1hyyy_53`,jump:`_jump_1hyyy_1`,cube__inner:`_cube__inner_1hyyy_67`,morph:`_morph_1hyyy_1`,primary:`_primary_1hyyy_121`,secondary:`_secondary_1hyyy_129`,outline:`_outline_1hyyy_137`,ghost:`_ghost_1hyyy_145`,empty:`_empty_1hyyy_153`,destructive:`_destructive_1hyyy_161`,destructiveOutline:`_destructiveOutline_1hyyy_169`},Bn=({variant:t=`primary`})=>(0,e.jsx)(`div`,{className:zn.wrapper,children:(0,e.jsx)(`div`,{className:zn.container,children:(0,e.jsxs)(`div`,{className:zn.inner,children:[(0,e.jsx)(`div`,{className:zn.cube,children:(0,e.jsx)(`div`,{className:`${zn.cube__inner} ${zn[t]}`})}),(0,e.jsx)(`div`,{className:zn.cube,children:(0,e.jsx)(`div`,{className:`${zn.cube__inner} ${zn[t]}`})}),(0,e.jsx)(`div`,{className:zn.cube,children:(0,e.jsx)(`div`,{className:`${zn.cube__inner} ${zn[t]}`})})]})})}),Vn={viewport:`_viewport_bu4eh_1`,"top-right":`_top-right_bu4eh_21`,"top-left":`_top-left_bu4eh_31`,"bottom-right":`_bottom-right_bu4eh_41`,"bottom-left":`_bottom-left_bu4eh_51`,toast:`_toast_bu4eh_61`,"toast-enter":`_toast-enter_bu4eh_1`,body:`_body_bu4eh_97`,icon:`_icon_bu4eh_117`,title:`_title_bu4eh_129`,message:`_message_bu4eh_141`,info:`_info_bu4eh_187`,success:`_success_bu4eh_195`,warning:`_warning_bu4eh_203`,error:`_error_bu4eh_211`},Hn={info:`IconInfoCircle`,success:`IconSuccessCircle`,warning:`IconWarning`,error:`IconWarning`},Un=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(()=>typeof document<`u`&&document.hidden),c=(0,t.useRef)(n.duration),l=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||o||n.duration<=0)return;l.current=Date.now();let e=setTimeout(()=>r(n.id),c.current);return()=>{clearTimeout(e),c.current=Math.max(0,c.current-(Date.now()-l.current))}},[o,r,i,n.duration,n.id]),(0,t.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>s(document.hidden);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,e.jsxs)(`article`,{className:`${Vn.toast} ${Vn[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(`div`,{className:Vn.icon,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:Hn[n.variant],color:`var(--ds-toast-accent)`,width:20,height:20})}),(0,e.jsxs)(`div`,{className:Vn.body,children:[n.title&&(0,e.jsx)(`strong`,{className:Vn.title,children:n.title}),(0,e.jsx)(`div`,{className:Vn.message,children:n.message}),n.action&&(0,e.jsx)(p,{variant:`empty`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(p,{variant:`empty`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:(0,e.jsx)(W,{name:`IconCross`,width:20,height:20})})]})},Wn=0,Gn=(0,i.create)((e,t)=>({toasts:[],showToast:n=>{if(n.dedupeKey){let e=t().toasts.find(e=>e.dedupeKey===n.dedupeKey);if(e)return e.id}Wn+=1;let r=`ds-toast-${Wn}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...n,id:r}]})),r},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),Kn=()=>Gn.setState({toasts:[]}),qn=({position:t=`top-right`,maxVisible:n})=>{let r=Gn(e=>e.toasts),i=Gn(e=>e.removeToast),a=n===void 0?r:r.slice(0,Math.max(0,Math.floor(n)));return(0,e.jsx)(`div`,{className:`${Vn.viewport} ${Vn[t]}`,"aria-label":`Уведомления`,children:a.map(t=>(0,e.jsx)(Un,{toast:t,onClose:i},t.id))})},Jn=()=>{let e=Gn(e=>e.showToast),n=Gn(e=>e.removeToast),r=Gn(e=>e.clearToasts),i=(0,t.useCallback)(t=>e({...t,variant:`info`}),[e]),a=(0,t.useCallback)(t=>e({...t,variant:`success`}),[e]),o=(0,t.useCallback)(t=>e({...t,variant:`warning`}),[e]),s=(0,t.useCallback)(t=>e({...t,variant:`error`}),[e]);return(0,t.useMemo)(()=>({showToast:e,infoToast:i,successToast:a,warningToast:o,errorToast:s,removeToast:n,clearToasts:r}),[r,s,i,n,e,a,o])},Yn={root:`_root_ncmxp_1`,tooltip:`_tooltip_ncmxp_11`,"ds-tooltip-in":`_ds-tooltip-in_ncmxp_1`},Xn=8,Zn=16,Qn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},$n=(e,t,n)=>e===`top`?t.top>=n.height+Xn+Zn:e===`bottom`?window.innerHeight-t.bottom>=n.height+Xn+Zn:e===`left`?t.left>=n.width+Xn+Zn:window.innerWidth-t.right>=n.width+Xn+Zn,er=(e,t,n)=>{if(!(t.bottom>0&&t.right>0&&t.top<window.innerHeight&&t.left<window.innerWidth))return null;let r=$n(e,t,n)?e:$n(Qn[e],t,n)?Qn[e]:e,i=t.left+(t.width-n.width)/2,a=t.top+(t.height-n.height)/2;return r===`top`&&(a=t.top-n.height-Xn),r===`bottom`&&(a=t.bottom+Xn),r===`left`&&(i=t.left-n.width-Xn),r===`right`&&(i=t.right+Xn),i=Math.min(Math.max(i,Zn),Math.max(Zn,window.innerWidth-n.width-Zn)),a=Math.min(Math.max(a,Zn),Math.max(Zn,window.innerHeight-n.height-Zn)),{left:i,top:a,visibility:`visible`}},tr=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),[f,p]=(0,t.useState)({visibility:`hidden`}),[m,h]=(0,t.useState)(null),g=(0,t.useRef)(null),_=(0,t.useRef)(null),v=(0,t.useCallback)(()=>{g.current&&clearTimeout(g.current),g.current=null,d(!1)},[]),y=(0,t.useCallback)(()=>{o||!n||(g.current&&clearTimeout(g.current),g.current=setTimeout(()=>d(!0),a))},[n,a,o]);if((0,t.useEffect)(()=>{if(!u){p({visibility:`hidden`});return}let e=()=>{let e=_.current;if(!e||!m)return;let t=er(i,e.getBoundingClientRect(),m.getBoundingClientRect());if(!t){v();return}p(t)};e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0);let t=typeof ResizeObserver>`u`?null:new ResizeObserver(e);return _.current&&t?.observe(_.current),m&&t?.observe(m),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0),t?.disconnect()}},[v,u,i,m]),(0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&v()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),g.current&&clearTimeout(g.current)}},[v]),!(0,t.isValidElement)(r))return r;let b={...f,"--ds-tooltip-max-width":typeof s==`number`?`${s}px`:s},x=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:y,onMouseLeave:v,onFocus:y,onBlur:v});return(0,e.jsxs)(`span`,{ref:_,className:`${Yn.root} ${c}`,onPointerDown:u?v:y,children:[x,u&&(0,e.jsx)(qt,{children:(0,e.jsx)(`span`,{ref:h,id:l,role:`tooltip`,className:Yn.tooltip,style:b,children:n})})]})},nr={root:`_root_bs28m_1`,tabList:`_tabList_bs28m_11`,tab:`_tab_bs28m_11`,panels:`_panels_bs28m_127`,panel:`_panel_bs28m_127`},rr=({items:n,value:r,onChange:i,ariaLabel:a=`Вкладки`,disabled:o=!1,loading:s=!1,className:c=``})=>{let l=`ds-tabs-${(0,t.useId)().replace(/:/g,``)}`,u=(0,t.useRef)([]),d=o||s,f=n.findIndex(e=>e.id===r),p=n.findIndex(e=>!e.disabled),m=f>=0&&!n[f]?.disabled?f:p,h=e=>{let t=n[e];!t||t.disabled||d||(i(t.id),u.current[e]?.focus(),u.current[e]?.scrollIntoView({block:`nearest`,inline:`nearest`}))},g=(e,t)=>{if(d)return;let r=n.map((e,t)=>e.disabled?-1:t).filter(e=>e>=0);if(r.length===0)return;let i=r.indexOf(t),a;switch(e.key){case`ArrowRight`:a=r[(i+1)%r.length];break;case`ArrowLeft`:a=r[(i-1+r.length)%r.length];break;case`Home`:a=r[0];break;case`End`:a=r[r.length-1];break;default:return}e.preventDefault(),h(a)};return(0,e.jsxs)(`div`,{className:`${nr.root} ${c}`,"aria-busy":s||void 0,children:[(0,e.jsx)(`div`,{className:nr.tabList,role:`tablist`,"aria-label":a,"aria-orientation":`horizontal`,"aria-disabled":d||void 0,children:n.map((t,n)=>{let i=t.id===r,a=`${l}-tab-${n}`,o=`${l}-panel-${n}`;return(0,e.jsx)(`button`,{ref:e=>{u.current[n]=e},id:a,className:nr.tab,type:`button`,role:`tab`,"aria-selected":i,"aria-controls":o,disabled:d||t.disabled,tabIndex:n===m?0:-1,onClick:()=>h(n),onKeyDown:e=>g(e,n),children:t.label},t.id)})}),(0,e.jsx)(`div`,{className:nr.panels,children:n.map((t,n)=>{let i=t.id===r;return(0,e.jsx)(`div`,{id:`${l}-panel-${n}`,className:nr.panel,role:`tabpanel`,"aria-labelledby":`${l}-tab-${n}`,tabIndex:0,hidden:!i,children:t.content},t.id)})})]})},ir=e=>{if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`;return n?`${n}:${a}`:a},$={root:`_root_14cqp_1`,frame:`_frame_14cqp_35`,video:`_video_14cqp_65`,overlay:`_overlay_14cqp_81`,state:`_state_14cqp_83`,buffering:`_buffering_14cqp_85`,loaderViewport:`_loaderViewport_14cqp_145`,loaderScale:`_loaderScale_14cqp_157`,stateIcon:`_stateIcon_14cqp_171`,empty:`_empty_14cqp_203`,error:`_error_14cqp_213`,replay:`_replay_14cqp_225`,controlsLayer:`_controlsLayer_14cqp_261`,controlsVisible:`_controlsVisible_14cqp_287`,controls:`_controls_14cqp_261`,controlGroup:`_controlGroup_14cqp_311`,controlButton:`_controlButton_14cqp_337`,settingsAction:`_settingsAction_14cqp_369`,timeline:`_timeline_14cqp_401`,volume:`_volume_14cqp_403`,settings:`_settings_14cqp_369`,playButton:`_playButton_14cqp_417`,volumeGroup:`_volumeGroup_14cqp_431`,timelineGroup:`_timelineGroup_14cqp_455`,time:`_time_14cqp_401`,settingsActionLabel:`_settingsActionLabel_14cqp_693`,caption:`_caption_14cqp_705`,fullscreen:`_fullscreen_14cqp_719`},ar=2500,or=5,sr=.05,cr=[.5,.75,1,1.25,1.5,2],lr=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:c,fallback:l,className:u=``,controls:f=!0,playsInline:m=!0,...h})=>{let g=(0,t.useRef)(null),_=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(void 0),[b,x]=(0,t.useState)(!1),[S,C]=(0,t.useState)(n.length>0),[w,T]=(0,t.useState)(!1),[E,D]=(0,t.useState)(!1),[O,k]=(0,t.useState)(!1),[A,j]=(0,t.useState)(0),[M,N]=(0,t.useState)(0),[P,ee]=(0,t.useState)(0),[F,I]=(0,t.useState)(1),[L,R]=(0,t.useState)(!!h.muted),[te,z]=(0,t.useState)(1),[ne,re]=(0,t.useState)(!!h.loop),[ie,ae]=(0,t.useState)(-1),[B,oe]=(0,t.useState)(!1),[se,ce]=(0,t.useState)(!0),[V,le]=(0,t.useState)(!1),[ue,de]=(0,t.useState)(!1),fe=n.map(({src:e,type:t})=>`${e}:${t??``}`).join(`|`),H=r.map((e,t)=>({track:e,index:t})).filter(({track:e})=>e.kind===`captions`||e.kind===`subtitles`),pe=c??(b?`Не удалось воспроизвести видео`:void 0),me=s||S&&!pe&&n.length>0,he=!me&&!pe&&n.length===0,ge=typeof document<`u`&&`pictureInPictureEnabled`in document&&document.pictureInPictureEnabled,U=(0,t.useCallback)(()=>{ce(!0),window.clearTimeout(y.current),E&&!B&&(y.current=window.setTimeout(()=>ce(!1),ar))},[E,B]);(0,t.useEffect)(()=>{x(!1),C(n.length>0),T(!1),D(!1),k(!1),j(0),N(0),ee(0)},[fe,n.length]),(0,t.useEffect)(()=>(U(),()=>window.clearTimeout(y.current)),[U]),(0,t.useEffect)(()=>{let e=()=>le(document.fullscreenElement===_.current),t=()=>de(document.pictureInPictureElement===v.current);return document.addEventListener(`fullscreenchange`,e),document.addEventListener(`enterpictureinpicture`,t),document.addEventListener(`leavepictureinpicture`,t),()=>{document.removeEventListener(`fullscreenchange`,e),document.removeEventListener(`enterpictureinpicture`,t),document.removeEventListener(`leavepictureinpicture`,t)}},[]),(0,t.useEffect)(()=>{if(!B)return;let e=e=>{g.current?.contains(e.target)||oe(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[B]);let _e=async()=>{let e=v.current;if(!(!e||pe||me)){if(e.paused||e.ended){e.ended&&(e.currentTime=0);try{await e.play()}catch{x(!0)}}else e.pause()}},ve=()=>{let e=v.current;e&&(e.muted=!e.muted)},ye=e=>{let t=v.current;t&&(t.volume=Math.min(1,Math.max(0,e)),t.muted=t.volume===0)},be=e=>{let t=v.current;!t||!M||(t.currentTime=Math.min(M,Math.max(0,e)),j(t.currentTime))},G=async()=>{if(_.current)try{document.fullscreenElement?await document.exitFullscreen():await _.current.requestFullscreen()}catch{le(!1)}},xe=async()=>{let e=v.current;if(!(!e||!ge))try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{de(!1)}},Se=e=>{let t=v.current;t&&(Array.from(t.textTracks).forEach((t,n)=>{t.mode=n===e?`showing`:`disabled`}),ae(e))},K=e=>{let t=e.target;if(/^(INPUT|SELECT|BUTTON)$/.test(t.tagName))return;let n=e.key.toLowerCase();n===` `||n===`k`?(e.preventDefault(),_e()):n===`m`?(e.preventDefault(),ve()):n===`f`?(e.preventDefault(),G()):n===`c`&&H.length?(e.preventDefault(),Se(ie===-1?H[0].index:-1)):e.key===`ArrowLeft`||e.key===`ArrowRight`?(e.preventDefault(),be(A+(e.key===`ArrowRight`?or:-5))):e.key===`ArrowUp`||e.key===`ArrowDown`?(e.preventDefault(),ye(F+(e.key===`ArrowUp`?sr:-.05))):e.key===`Escape`&&oe(!1),U()},Ce=()=>{let e=v.current;x(!1),C(!0),e?.load()},we={"--video-progress":`${M?A/M*100:0}%`,"--video-buffered":`${P*100}%`};return(0,e.jsxs)(`figure`,{ref:g,className:`${$.root} ${u}`,onKeyDown:K,children:[(0,e.jsxs)(`div`,{ref:_,className:`${$.frame} ${V?$.fullscreen:``}`,style:{aspectRatio:a},"aria-busy":me||void 0,tabIndex:f&&n.length?0:void 0,onPointerMove:U,onPointerDown:U,onFocusCapture:U,onMouseLeave:()=>{E&&!B&&ce(!1)},children:[n.length>0&&(0,e.jsxs)(`video`,{...h,ref:v,"aria-label":i,controls:!1,playsInline:m,loop:ne,className:$.video,style:{objectFit:o},onClick:e=>{h.onClick?.(e),_e()},onDoubleClick:e=>{h.onDoubleClick?.(e),G()},onLoadStart:e=>{C(!0),h.onLoadStart?.(e)},onLoadedMetadata:e=>{N(e.currentTarget.duration||0);let t=H.find(({track:e})=>e.default);Se(t?.index??-1),h.onLoadedMetadata?.(e)},onDurationChange:e=>{N(e.currentTarget.duration||0),h.onDurationChange?.(e)},onTimeUpdate:e=>{j(e.currentTarget.currentTime),h.onTimeUpdate?.(e)},onProgress:e=>{let t=e.currentTarget;t.duration&&t.buffered.length&&ee(t.buffered.end(t.buffered.length-1)/t.duration),h.onProgress?.(e)},onLoadedData:e=>{C(!1),T(!1),h.onLoadedData?.(e)},onCanPlay:e=>{C(!1),T(!1),h.onCanPlay?.(e)},onWaiting:e=>{T(!0),h.onWaiting?.(e)},onPlaying:e=>{D(!0),k(!1),T(!1),h.onPlaying?.(e)},onPlay:e=>{D(!0),h.onPlay?.(e)},onPause:e=>{D(!1),h.onPause?.(e)},onEnded:e=>{D(!1),k(!0),ce(!0),h.onEnded?.(e)},onVolumeChange:e=>{I(e.currentTarget.volume),R(e.currentTarget.muted),h.onVolumeChange?.(e)},onRateChange:e=>{z(e.currentTarget.playbackRate),h.onRateChange?.(e)},onError:e=>{C(!1),T(!1),x(!0),h.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),me&&(0,e.jsxs)(`div`,{className:$.overlay,role:`status`,"aria-live":`polite`,children:[(0,e.jsx)(`div`,{className:$.loaderViewport,"aria-hidden":`true`,children:(0,e.jsx)(`div`,{className:$.loaderScale,children:(0,e.jsx)(Bn,{})})}),(0,e.jsx)(`span`,{children:`Загрузка видео`})]}),!me&&w&&!pe&&(0,e.jsx)(`div`,{className:$.buffering,role:`status`,"aria-label":`Буферизация видео`,children:(0,e.jsx)(d,{variant:`primary`})}),he&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.empty}`,role:`status`,children:[(0,e.jsx)(W,{name:`IconInfoCircle`,className:$.stateIcon,width:40,height:40}),(0,e.jsx)(`strong`,{children:`Видео отсутствует`}),l??(0,e.jsx)(`span`,{children:`Источник видео не указан`})]}),!me&&pe&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.error}`,role:`alert`,children:[(0,e.jsx)(W,{name:`IconWarning`,className:$.stateIcon,width:40,height:40}),l??(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`strong`,{children:`Видео недоступно`}),(0,e.jsx)(`span`,{children:pe})]}),n.length>0&&(0,e.jsx)(p,{size:`sm`,variant:`secondary`,onClick:Ce,children:`Повторить`})]}),!me&&!pe&&O&&(0,e.jsx)(`button`,{type:`button`,className:$.replay,"aria-label":`Воспроизвести заново`,onClick:()=>void _e(),children:(0,e.jsx)(W,{name:`IconReplay`,width:28,height:28})}),f&&n.length>0&&!me&&!pe&&(0,e.jsxs)(`div`,{className:`${$.controlsLayer} ${se||!E?$.controlsVisible:``}`,onClick:e=>e.stopPropagation(),children:[B&&(0,e.jsxs)(`div`,{className:$.settings,role:`dialog`,"aria-label":`Настройки видео`,children:[(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Скорость`}),(0,e.jsx)(`select`,{value:te,onChange:e=>{let t=Number(e.target.value);v.current&&(v.current.playbackRate=t)},children:cr.map(t=>(0,e.jsxs)(`option`,{value:t,children:[t,`×`]},t))})]}),H.length>0&&(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Субтитры`}),(0,e.jsxs)(`select`,{value:ie,onChange:e=>Se(Number(e.target.value)),children:[(0,e.jsx)(`option`,{value:-1,children:`Выключены`}),H.map(({track:t,index:n})=>(0,e.jsx)(`option`,{value:n,children:t.label},`${t.srcLang}-${t.label}`))]})]}),(0,e.jsxs)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":ne,onClick:()=>re(e=>!e),children:[(0,e.jsx)(`span`,{children:`Повтор`}),(0,e.jsx)(`span`,{children:ne?`Вкл.`:`Выкл.`})]}),ge&&(0,e.jsx)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":ue,onClick:()=>void xe(),children:(0,e.jsxs)(`span`,{className:$.settingsActionLabel,children:[(0,e.jsx)(W,{name:`IconPictureInPicture`,width:18,height:18}),`Картинка в картинке`]})})]}),(0,e.jsxs)(`div`,{className:$.controls,children:[(0,e.jsx)(`div`,{className:$.controlGroup,children:(0,e.jsx)(`button`,{type:`button`,className:`${$.controlButton} ${$.playButton}`,"aria-label":E?`Пауза`:`Воспроизвести`,title:E?`Пауза (K)`:`Воспроизвести (K)`,onClick:()=>void _e(),children:(0,e.jsx)(W,{name:E?`IconPause`:`IconPlay`,width:24,height:24})})}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.volumeGroup}`,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":L?`Включить звук`:`Выключить звук`,"aria-pressed":L,title:`Звук (M)`,onClick:ve,children:(0,e.jsx)(W,{name:L||F===0?`IconVolumeMuted`:`IconVolume`,width:22,height:22})}),(0,e.jsx)(`input`,{className:$.volume,type:`range`,min:0,max:1,step:.05,value:L?0:F,"aria-label":`Громкость`,"aria-valuetext":`${Math.round((L?0:F)*100)}%`,onChange:e=>ye(Number(e.target.value))})]}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.timelineGroup}`,children:[(0,e.jsx)(`span`,{className:$.time,children:ir(A)}),(0,e.jsx)(`input`,{className:$.timeline,style:we,type:`range`,min:0,max:M||0,step:.01,value:Math.min(A,M||0),"aria-label":`Позиция воспроизведения`,"aria-valuetext":`${ir(A)} из ${ir(M)}`,onChange:e=>be(Number(e.target.value))}),(0,e.jsx)(`span`,{className:$.time,children:ir(M)})]}),(0,e.jsxs)(`div`,{className:$.controlGroup,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":`Настройки`,"aria-expanded":B,title:`Настройки`,onClick:()=>oe(e=>!e),children:(0,e.jsx)(W,{name:`IconSettings`,width:22,height:22})}),(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":V?`Выйти из полноэкранного режима`:`Полноэкранный режим`,title:`Полноэкранный режим (F)`,onClick:()=>void G(),children:(0,e.jsx)(W,{name:V?`IconFullscreenExit`:`IconFullscreen`,width:22,height:22})})]})]})]})]}),(0,e.jsx)(`figcaption`,{className:$.caption,children:i})]})},ur={root:`_root_ymidq_1`,trigger:`_trigger_ymidq_15`,heading:`_heading_ymidq_41`,title:`_title_ymidq_51`,subtitle:`_subtitle_ymidq_59`,icon:`_icon_ymidq_69`,open:`_open_ymidq_91`,content:`_content_ymidq_99`,contentInner:`_contentInner_ymidq_119`},dr=(e,t,n,r=16)=>{if(t>Math.max(0,n-r*2)){let t=e-r;return Math.abs(t)<=1?{alignment:`none`,delta:0}:{alignment:`start`,delta:t}}let i=e+t,a=n-r;return i>a?{alignment:`end`,delta:i-a}:e<r?{alignment:`start`,delta:e-r}:{alignment:`none`,delta:0}},fr=({title:n,subtitle:r,children:i,defaultOpen:a=!1,open:o,onOpenChange:s,autoScrollOnOpen:c=!0,scrollOffset:l=16,className:u=``})=>{let d=(0,t.useId)(),[f,p]=(0,t.useState)(a),m=o??f,h=(0,t.useRef)(null),g=(0,t.useRef)(null),_=(0,t.useRef)(m);return(0,t.useEffect)(()=>{let e=_.current;if(_.current=m,!m||e||!c)return;let t=h.current,n=g.current;if(!t||!n||typeof window>`u`)return;let r=!1,i=()=>{if(r)return;r=!0;let e=t.getBoundingClientRect(),n=dr(e.top,e.height,window.innerHeight,l);if(n.alignment===`none`)return;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;window.scrollBy({top:n.delta,behavior:i?`auto`:`smooth`})},a=e=>{e.target===n&&e.propertyName===`grid-template-rows`&&i()};n.addEventListener(`transitionend`,a);let o=window.setTimeout(i,280);return()=>{n.removeEventListener(`transitionend`,a),window.clearTimeout(o)}},[c,m,l]),(0,e.jsxs)(`section`,{ref:h,className:`${ur.root} ${m?ur.open:``} ${u}`,children:[(0,e.jsxs)(`button`,{type:`button`,className:ur.trigger,"aria-expanded":m,"aria-controls":d,onClick:()=>{let e=!m;o===void 0&&p(e),s?.(e)},children:[(0,e.jsxs)(`span`,{className:ur.heading,children:[(0,e.jsx)(`span`,{className:ur.title,children:n}),r&&(0,e.jsx)(`span`,{className:ur.subtitle,children:r})]}),(0,e.jsx)(`span`,{className:ur.icon,"aria-hidden":`true`,children:(0,e.jsx)(W,{name:`IconChevron`,width:20,height:20})})]}),(0,e.jsx)(`div`,{ref:g,id:d,className:ur.content,"aria-hidden":!m,children:(0,e.jsx)(`div`,{className:ur.contentInner,children:i})})]})},pr={root:`_root_14ewt_1`,topSlot:`_topSlot_14ewt_29`,searchSlot:`_searchSlot_14ewt_31`,bottomSlot:`_bottomSlot_14ewt_33`,groups:`_groups_14ewt_59`,group:`_group_14ewt_59`,groupLabel:`_groupLabel_14ewt_85`,list:`_list_14ewt_107`,item:`_item_14ewt_123`,link:`_link_14ewt_131`,current:`_current_14ewt_183`,icon:`_icon_14ewt_205`,copy:`_copy_14ewt_219`,label:`_label_14ewt_233`,description:`_description_14ewt_235`,badge:`_badge_14ewt_269`,empty:`_empty_14ewt_281`},mr=(e,t,n)=>{if(e.length===0)return-1;for(let r=1;r<=e.length;r+=1){let i=(t+n*r+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},hr=({groups:n,currentItemId:r,ariaLabel:i=`Основная навигация`,searchSlot:a,topSlot:o,bottomSlot:s,emptyState:c,renderLink:l,onItemSelect:u,className:d=``})=>{let f=(0,t.useId)(),p=(0,t.useRef)(null),m=(0,t.useRef)({value:``,time:0}),h=n.flatMap(e=>e.items),g=h.filter(e=>!e.disabled),_=g.some(e=>e.id===r)?r:g[0]?.id,v=e=>{if(!e)return;let t=p.current?.querySelectorAll(`[data-ds-navigation-item]`),n=h.findIndex(t=>t.id===e.id);t?.[n]?.focus()},y=(e,t)=>{let n=h.findIndex(e=>e.id===t.id);if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=mr(h,n,e.key===`ArrowDown`?1:-1);v(h[t]);return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),v(e.key===`Home`?g[0]:g.at(-1));return}if(e.key.length!==1||e.altKey||e.ctrlKey||e.metaKey)return;let r=Date.now(),i=m.current,a=`${r-i.time>700?``:i.value}${e.key}`.toLocaleLowerCase();m.current={value:a,time:r};let o=[...h.slice(n+1),...h.slice(0,n+1)];v(o.find(e=>!e.disabled&&e.label.toLocaleLowerCase().startsWith(a)))},b=t=>{let n=t.id===r,i={children:(0,e.jsxs)(e.Fragment,{children:[t.icon&&(0,e.jsx)(`span`,{className:pr.icon,"aria-hidden":`true`,children:t.icon}),(0,e.jsxs)(`span`,{className:pr.copy,children:[(0,e.jsx)(`span`,{className:pr.label,children:t.label}),t.description&&(0,e.jsx)(`span`,{className:pr.description,children:t.description})]}),t.badge&&(0,e.jsx)(`span`,{className:pr.badge,children:t.badge})]}),className:`${pr.link} ${n?pr.current:``}`,tabIndex:t.id===_?0:-1,"aria-current":n?`page`:void 0,"aria-disabled":t.disabled?!0:void 0,"data-ds-navigation-item":t.id,onClick:e=>{if(t.disabled){e.preventDefault();return}u?.(t)},onFocus:()=>void 0,onKeyDown:e=>y(e,t)};return(0,e.jsx)(`li`,{className:pr.item,children:l?l(t,i):t.href?(0,e.jsx)(`a`,{href:t.href,...i,children:i.children}):(0,e.jsx)(`button`,{type:`button`,disabled:t.disabled,...i,children:i.children})},t.id)};return(0,e.jsxs)(`nav`,{ref:p,className:`${pr.root} ${d}`,"aria-label":i,children:[o&&(0,e.jsx)(`div`,{className:pr.topSlot,children:o}),a&&(0,e.jsx)(`div`,{className:pr.searchSlot,children:a}),(0,e.jsxs)(`div`,{className:pr.groups,children:[n.map(t=>{let n=`${f}-${t.id}`;return(0,e.jsxs)(`section`,{className:pr.group,"aria-labelledby":t.label?n:void 0,children:[t.label&&(0,e.jsx)(`div`,{id:n,className:pr.groupLabel,children:t.label}),(0,e.jsx)(`ul`,{className:pr.list,children:t.items.map(b)})]},t.id)}),h.length===0&&c&&(0,e.jsx)(`div`,{className:pr.empty,children:c})]}),s&&(0,e.jsx)(`div`,{className:pr.bottomSlot,children:s})]})},gr={root:`_root_2mdgb_1`,list:`_list_2mdgb_19`,item:`_item_2mdgb_37`,link:`_link_2mdgb_45`,current:`_current_2mdgb_103`,visual:`_visual_2mdgb_125`,icon:`_icon_2mdgb_141`,badge:`_badge_2mdgb_149`,label:`_label_2mdgb_163`},_r=({items:n,currentItemId:r,ariaLabel:i=`Мобильная навигация`,renderLink:a,onItemSelect:o,className:s=``})=>{let c=(0,t.useRef)(null),l=n.filter(e=>!e.disabled),u=l.some(e=>e.id===r)?r:l[0]?.id,d=e=>{c.current?.querySelectorAll(`[data-ds-navigation-item]`)[e]?.focus()},f=(e,t)=>{let r=n.findIndex(e=>e.id===t.id),i=r;if(e.key===`Home`)i=0;else if(e.key===`End`)i=n.length-1;else if(e.key===`ArrowRight`)i=(r+1)%n.length;else if(e.key===`ArrowLeft`)i=(r-1+n.length)%n.length;else return;e.preventDefault();let a=e.key===`ArrowLeft`||e.key===`End`?-1:1;for(;n[i]?.disabled&&i!==r;)i=(i+a+n.length)%n.length;d(i)};return(0,e.jsx)(`nav`,{ref:c,className:`${gr.root} ${s}`,"aria-label":i,children:(0,e.jsx)(`ul`,{className:gr.list,children:n.map(t=>{let n=t.id===r,i={children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`span`,{className:gr.visual,children:[t.icon&&(0,e.jsx)(`span`,{className:gr.icon,"aria-hidden":`true`,children:t.icon}),t.badge&&(0,e.jsx)(`span`,{className:gr.badge,children:t.badge})]}),(0,e.jsx)(`span`,{className:gr.label,children:t.label})]}),className:`${gr.link} ${n?gr.current:``}`,tabIndex:t.id===u?0:-1,"aria-current":n?`page`:void 0,"aria-disabled":t.disabled?!0:void 0,"data-ds-navigation-item":t.id,onClick:e=>{if(t.disabled){e.preventDefault();return}o?.(t)},onFocus:()=>void 0,onKeyDown:e=>f(e,t)};return(0,e.jsx)(`li`,{className:gr.item,children:a?a(t,i):t.href?(0,e.jsx)(`a`,{href:t.href,...i,children:i.children}):(0,e.jsx)(`button`,{type:`button`,disabled:t.disabled,...i,children:i.children})},t.id)})})})};exports.ConfirmModal=xn,exports.DSAccordion=fr,exports.DSBadge=o,exports.DSBottomNavigation=_r,exports.DSBottomSheet=Ln,exports.DSButton=p,exports.DSCheckbox=be,exports.DSCounterBadge=l,exports.DSDataTable=Tt,exports.DSDateRange=ze,exports.DSDateTimePicker=Ie,exports.DSDrawer=In,exports.DSDropDown=qe,exports.DSDropDownMultiple=nt,exports.DSFieldLabel=h,exports.DSFieldMessage=g,exports.DSFileInput=Kt,exports.DSFilters=Lt,exports.DSFloatingMenu=Yt,exports.DSFormGrid=zt,exports.DSFormGridItem=Bt,exports.DSFullscreenDialog=Rn,exports.DSIcon=W,exports.DSIconNames=ve,exports.DSInfoBlock=Ft,exports.DSInput=Ze,exports.DSLoader=d,exports.DSModal=hn,exports.DSModalFrame=mn,exports.DSNavigationSurface=hr,exports.DSOverlay=Fn,exports.DSPageLoader=Bn,exports.DSPortal=qt,exports.DSRadioButton=it,exports.DSSearchDropDown=Nt,exports.DSSkeleton=Ve,exports.DSSort=Ye,exports.DSTabs=rr,exports.DSTextarea=$t,exports.DSToast=Un,exports.DSToastProvider=qn,exports.DSTooltip=tr,exports.DSValidationSummary=Vt,exports.DSVideoPlayerFrame=lr,exports.ErrorModal=Sn,exports.ModalSystemProvider=gn,exports.builtInModalRegistry=Cn,exports.defineModalRegistry=_n,exports.formatDSCounterValue=c,exports.formatDateInputValue=Te,exports.formatDateTimeLocalValue=Ae,exports.getDSAccordionScrollTarget=dr,exports.getDSDataTableColumnStyle=pt,exports.getDSDataTablePaginationItems=ht,exports.getDSDataTableStickyColumnStyle=mt,exports.getErrorMessage=Tn,exports.getNextDSDataTablePageSelection=ft,exports.getNextEnabledOptionIndex=Ge,exports.isValidDateInputPrefix=De,exports.isValidDateRange=Re,exports.maskDateInputValue=Ee,exports.parseDateInputValue=Oe,exports.parseDateTimeLocalValue=je,exports.resetModalStore=nn,exports.resetToastStore=Kn,exports.useConfirmModal=wn,exports.useConfirmModalStore=Dn,exports.useDSOverlay=Pn,exports.useErrorModal=En,exports.useErrorModalStore=On,exports.useModals=kn,exports.useModalsStore=tn,exports.useToast=Jn,exports.useToastStore=Gn,exports.validateDSDataTableData=gt;