@ryuzaki13/react-foundation-lib 2.31.1 → 2.31.3

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.
Files changed (487) hide show
  1. package/README.md +17 -5
  2. package/dist/analytical-table/definition/analyticalDefinitionConstants.d.ts +17 -0
  3. package/dist/analytical-table/definition/analyticalDefinitionConstants.d.ts.map +1 -0
  4. package/dist/analytical-table/definition/compileAnalyticalTableDefinition.d.ts.map +1 -1
  5. package/dist/analytical-table/definition/types.d.ts +6 -5
  6. package/dist/analytical-table/definition/types.d.ts.map +1 -1
  7. package/dist/analytical-table/dynamic-columns/analyticalDateColumnConstants.d.ts +7 -0
  8. package/dist/analytical-table/dynamic-columns/analyticalDateColumnConstants.d.ts.map +1 -0
  9. package/dist/analytical-table/dynamic-columns/dateColumns.d.ts.map +1 -1
  10. package/dist/analytical-table/dynamic-columns/types.d.ts +2 -1
  11. package/dist/analytical-table/dynamic-columns/types.d.ts.map +1 -1
  12. package/dist/analytical-table/index.js +124 -114
  13. package/dist/analytical-table/index.js.map +1 -1
  14. package/dist/analytical-table/projections/analyticalExportConstants.d.ts +7 -0
  15. package/dist/analytical-table/projections/analyticalExportConstants.d.ts.map +1 -0
  16. package/dist/analytical-table/projections/expansion.d.ts +2 -1
  17. package/dist/analytical-table/projections/expansion.d.ts.map +1 -1
  18. package/dist/analytical-table/projections/exportProjection.d.ts.map +1 -1
  19. package/dist/analytical-table/projections/types.d.ts +3 -2
  20. package/dist/analytical-table/projections/types.d.ts.map +1 -1
  21. package/dist/analytical-table/runtime/aggregation.d.ts.map +1 -1
  22. package/dist/analytical-table/runtime/analyticalRowConstants.d.ts +4 -0
  23. package/dist/analytical-table/runtime/analyticalRowConstants.d.ts.map +1 -0
  24. package/dist/analytical-table/runtime/analyticalViewConstants.d.ts +16 -0
  25. package/dist/analytical-table/runtime/analyticalViewConstants.d.ts.map +1 -0
  26. package/dist/analytical-table/runtime/buildGroupedModel.d.ts.map +1 -1
  27. package/dist/analytical-table/runtime/filtering.d.ts.map +1 -1
  28. package/dist/analytical-table/runtime/grouping.d.ts.map +1 -1
  29. package/dist/analytical-table/runtime/hierarchy.d.ts +2 -1
  30. package/dist/analytical-table/runtime/hierarchy.d.ts.map +1 -1
  31. package/dist/analytical-table/runtime/totals.d.ts +2 -2
  32. package/dist/analytical-table/runtime/totals.d.ts.map +1 -1
  33. package/dist/analytical-table/runtime/types.d.ts +5 -3
  34. package/dist/analytical-table/runtime/types.d.ts.map +1 -1
  35. package/dist/analytical-table/runtime/valueComparison.d.ts.map +1 -1
  36. package/dist/array/index.js +1 -1
  37. package/dist/array/reorder.d.ts +6 -1
  38. package/dist/array/reorder.d.ts.map +1 -1
  39. package/dist/async-task-runner/createCoalescingTaskRunner.d.ts.map +1 -1
  40. package/dist/async-task-runner/createDeadlineTimer.d.ts.map +1 -1
  41. package/dist/async-task-runner/index.js +39 -36
  42. package/dist/async-task-runner/index.js.map +1 -1
  43. package/dist/async-task-runner/nativeTimerConstants.d.ts +3 -0
  44. package/dist/async-task-runner/nativeTimerConstants.d.ts.map +1 -0
  45. package/dist/binary/base64Constants.d.ts +6 -0
  46. package/dist/binary/base64Constants.d.ts.map +1 -0
  47. package/dist/binary/binaryToBlob.d.ts.map +1 -1
  48. package/dist/binary/getBase64DecodedSize.d.ts.map +1 -1
  49. package/dist/binary/index.js +95 -70
  50. package/dist/binary/index.js.map +1 -1
  51. package/dist/browser-notifications/browserNotificationConstants.d.ts +3 -0
  52. package/dist/browser-notifications/browserNotificationConstants.d.ts.map +1 -0
  53. package/dist/browser-notifications/browserNotificationTypes.d.ts +2 -1
  54. package/dist/browser-notifications/browserNotificationTypes.d.ts.map +1 -1
  55. package/dist/browser-notifications/createBrowserNotificationPresenter.d.ts.map +1 -1
  56. package/dist/browser-notifications/index.js +38 -37
  57. package/dist/browser-notifications/index.js.map +1 -1
  58. package/dist/chunks/{array-D-_yMMUK.js → array-bd7LYFto.js} +1 -3
  59. package/dist/chunks/{array-D-_yMMUK.js.map → array-bd7LYFto.js.map} +1 -1
  60. package/dist/chunks/{dom-BK22UmgF.js → dom-ZSeWZ0Gg.js} +103 -98
  61. package/dist/chunks/dom-ZSeWZ0Gg.js.map +1 -0
  62. package/dist/chunks/formatDate-CNPcfNte.js +133 -0
  63. package/dist/chunks/formatDate-CNPcfNte.js.map +1 -0
  64. package/dist/chunks/{formatters-rxriDRPk.js → formatters-CO40zvVB.js} +496 -497
  65. package/dist/chunks/formatters-CO40zvVB.js.map +1 -0
  66. package/dist/chunks/{formulas-BXT_XBWI.js → formulas-Y0HOcFhe.js} +90 -86
  67. package/dist/chunks/formulas-Y0HOcFhe.js.map +1 -0
  68. package/dist/chunks/hasSignatureBytes-D2wO_Myl.js +11 -0
  69. package/dist/chunks/hasSignatureBytes-D2wO_Myl.js.map +1 -0
  70. package/dist/chunks/keyboardConstants-BZKskWsm.js +6 -0
  71. package/dist/chunks/keyboardConstants-BZKskWsm.js.map +1 -0
  72. package/dist/chunks/media-imBOXWwa.js +192 -0
  73. package/dist/chunks/media-imBOXWwa.js.map +1 -0
  74. package/dist/chunks/mimeTypeConstants-BzONV-b1.js +6 -0
  75. package/dist/chunks/mimeTypeConstants-BzONV-b1.js.map +1 -0
  76. package/dist/chunks/{query-client-CVRfrYZM.js → query-client-D0HQZ84w.js} +142 -142
  77. package/dist/chunks/query-client-D0HQZ84w.js.map +1 -0
  78. package/dist/chunks/scalarTypeClassification-D4YcGxtQ.js +766 -0
  79. package/dist/chunks/scalarTypeClassification-D4YcGxtQ.js.map +1 -0
  80. package/dist/chunks/scalarTypeConstants-CnSsjpGO.js +6 -0
  81. package/dist/chunks/scalarTypeConstants-CnSsjpGO.js.map +1 -0
  82. package/dist/chunks/utils-DW0Yso1Q.js +210 -0
  83. package/dist/chunks/utils-DW0Yso1Q.js.map +1 -0
  84. package/dist/chunks/{uuid-CUJPAbRY.js → uuid-izDzLv18.js} +1 -2
  85. package/dist/chunks/uuid-izDzLv18.js.map +1 -0
  86. package/dist/chunks/validate-8URYKKly.js +613 -0
  87. package/dist/chunks/validate-8URYKKly.js.map +1 -0
  88. package/dist/copy/index.js +5 -5
  89. package/dist/copy/index.js.map +1 -1
  90. package/dist/copy/useCopyFeedback.d.ts.map +1 -1
  91. package/dist/crypto/hashString.d.ts.map +1 -1
  92. package/dist/crypto/hexadecimalConstants.d.ts +3 -0
  93. package/dist/crypto/hexadecimalConstants.d.ts.map +1 -0
  94. package/dist/crypto/index.js +25 -24
  95. package/dist/crypto/index.js.map +1 -1
  96. package/dist/crypto/uuid.d.ts.map +1 -1
  97. package/dist/date-segments/index.js +81 -81
  98. package/dist/date-segments/index.js.map +1 -1
  99. package/dist/date-segments/mask.d.ts +13 -3
  100. package/dist/date-segments/mask.d.ts.map +1 -1
  101. package/dist/decimal/decimalConstants.d.ts +3 -0
  102. package/dist/decimal/decimalConstants.d.ts.map +1 -0
  103. package/dist/decimal/index.js +0 -2
  104. package/dist/decimal/index.js.map +1 -1
  105. package/dist/decimal/normalizeDecimal.d.ts.map +1 -1
  106. package/dist/decimal/normalizeDecimalLiteral.d.ts.map +1 -1
  107. package/dist/decimal/resolveDecimalMaxLength.d.ts.map +1 -1
  108. package/dist/decimal/sumDecimals.d.ts.map +1 -1
  109. package/dist/decimal/writeDecimalParts.d.ts.map +1 -1
  110. package/dist/dom/document-scroll/acquireDocumentScrollLock.d.ts.map +1 -1
  111. package/dist/dom/document-scroll/attachDocumentTouchScrollGuard.d.ts.map +1 -1
  112. package/dist/dom/document-scroll/canConsumeVerticalTouchScroll.d.ts.map +1 -1
  113. package/dist/dom/domEventConstants.d.ts +4 -0
  114. package/dist/dom/domEventConstants.d.ts.map +1 -0
  115. package/dist/dom/domScrollConstants.d.ts +3 -0
  116. package/dist/dom/domScrollConstants.d.ts.map +1 -0
  117. package/dist/dom/index.js +1 -1
  118. package/dist/dom/installFaviconOverride.d.ts.map +1 -1
  119. package/dist/dom/overlayFocusConstants.d.ts +4 -0
  120. package/dist/dom/overlayFocusConstants.d.ts.map +1 -0
  121. package/dist/dom/scroll-anchor/captureScrollAnchor.d.ts.map +1 -1
  122. package/dist/dom/useClickOutside.d.ts +1 -1
  123. package/dist/dom/useClickOutside.d.ts.map +1 -1
  124. package/dist/dom/useEscapeDismiss.d.ts +1 -1
  125. package/dist/dom/useEscapeDismiss.d.ts.map +1 -1
  126. package/dist/dom/useFocusTrap.d.ts.map +1 -1
  127. package/dist/dom/useIsTouchDevice.d.ts.map +1 -1
  128. package/dist/dom/useOverlayFocus.d.ts +3 -2
  129. package/dist/dom/useOverlayFocus.d.ts.map +1 -1
  130. package/dist/dom/visual-viewport/attachVisualViewportFrame.d.ts.map +1 -1
  131. package/dist/error-report/breadcrumbs.d.ts.map +1 -1
  132. package/dist/error-report/capture.d.ts.map +1 -1
  133. package/dist/error-report/captureOptions.d.ts +3 -2
  134. package/dist/error-report/captureOptions.d.ts.map +1 -1
  135. package/dist/error-report/capturePolicyConstants.d.ts +4 -0
  136. package/dist/error-report/capturePolicyConstants.d.ts.map +1 -0
  137. package/dist/error-report/dataPreview.d.ts.map +1 -1
  138. package/dist/error-report/diagnostics.d.ts.map +1 -1
  139. package/dist/error-report/drafts.d.ts.map +1 -1
  140. package/dist/error-report/environment.d.ts.map +1 -1
  141. package/dist/error-report/errorInfo.d.ts.map +1 -1
  142. package/dist/error-report/errorReportCaptureLimits.d.ts +26 -0
  143. package/dist/error-report/errorReportCaptureLimits.d.ts.map +1 -0
  144. package/dist/error-report/errorReportContractConstants.d.ts +32 -0
  145. package/dist/error-report/errorReportContractConstants.d.ts.map +1 -0
  146. package/dist/error-report/index.js +586 -587
  147. package/dist/error-report/index.js.map +1 -1
  148. package/dist/error-report/payload.d.ts.map +1 -1
  149. package/dist/error-report/queue.d.ts.map +1 -1
  150. package/dist/error-report/queueContract.d.ts +7 -6
  151. package/dist/error-report/queueContract.d.ts.map +1 -1
  152. package/dist/error-report/queueRecord.d.ts.map +1 -1
  153. package/dist/error-report/queueResultConstants.d.ts +14 -0
  154. package/dist/error-report/queueResultConstants.d.ts.map +1 -0
  155. package/dist/error-report/runtimeDeduplication.d.ts +2 -1
  156. package/dist/error-report/runtimeDeduplication.d.ts.map +1 -1
  157. package/dist/error-report/safeValue.d.ts.map +1 -1
  158. package/dist/error-report/safeValueMarkerConstants.d.ts +16 -0
  159. package/dist/error-report/safeValueMarkerConstants.d.ts.map +1 -0
  160. package/dist/error-report/schema.d.ts.map +1 -1
  161. package/dist/error-report/types.d.ts +10 -8
  162. package/dist/error-report/types.d.ts.map +1 -1
  163. package/dist/error-report-source-maps/archive.d.ts.map +1 -1
  164. package/dist/error-report-source-maps/artifact.d.ts.map +1 -1
  165. package/dist/error-report-source-maps/index.js +238 -238
  166. package/dist/error-report-source-maps/index.js.map +1 -1
  167. package/dist/error-report-source-maps/manifest.d.ts.map +1 -1
  168. package/dist/error-report-source-maps/package.d.ts.map +1 -1
  169. package/dist/error-report-source-maps/sourceMapArtifactConstants.d.ts +11 -0
  170. package/dist/error-report-source-maps/sourceMapArtifactConstants.d.ts.map +1 -0
  171. package/dist/error-report-source-maps/symbolicate.d.ts.map +1 -1
  172. package/dist/error-report-source-maps/symbolicationResultConstants.d.ts +6 -0
  173. package/dist/error-report-source-maps/symbolicationResultConstants.d.ts.map +1 -0
  174. package/dist/error-report-source-maps/types.d.ts +4 -2
  175. package/dist/error-report-source-maps/types.d.ts.map +1 -1
  176. package/dist/excel/excel.d.ts.map +1 -1
  177. package/dist/excel/excelWorkbookConstants.d.ts +6 -0
  178. package/dist/excel/excelWorkbookConstants.d.ts.map +1 -0
  179. package/dist/excel/index.js +117 -116
  180. package/dist/excel/index.js.map +1 -1
  181. package/dist/excel/matrixWorkbook.d.ts +6 -1
  182. package/dist/excel/matrixWorkbook.d.ts.map +1 -1
  183. package/dist/excel/tableExport.d.ts.map +1 -1
  184. package/dist/file/checkFileSignature.d.ts.map +1 -1
  185. package/dist/file/contentDisposition.d.ts.map +1 -1
  186. package/dist/file/fileSignatureConstants.d.ts +14 -18
  187. package/dist/file/fileSignatureConstants.d.ts.map +1 -1
  188. package/dist/file/fileSignatureTypes.d.ts +3 -3
  189. package/dist/file/fileSignatureTypes.d.ts.map +1 -1
  190. package/dist/file/image/imageReadConstants.d.ts +3 -0
  191. package/dist/file/image/imageReadConstants.d.ts.map +1 -0
  192. package/dist/file/image/readImageFile.d.ts +3 -2
  193. package/dist/file/image/readImageFile.d.ts.map +1 -1
  194. package/dist/file/image/types.d.ts +5 -3
  195. package/dist/file/image/types.d.ts.map +1 -1
  196. package/dist/file/index.js +139 -165
  197. package/dist/file/index.js.map +1 -1
  198. package/dist/file/mimeType.d.ts.map +1 -1
  199. package/dist/file/mimeTypeConstants.d.ts +18 -0
  200. package/dist/file/mimeTypeConstants.d.ts.map +1 -0
  201. package/dist/file/read-file/assert.d.ts.map +1 -1
  202. package/dist/file/read-file/readFile.d.ts +3 -11
  203. package/dist/file/read-file/readFile.d.ts.map +1 -1
  204. package/dist/file/read-file/readFileConstants.d.ts +13 -0
  205. package/dist/file/read-file/readFileConstants.d.ts.map +1 -0
  206. package/dist/file/read-file/types.d.ts +7 -6
  207. package/dist/file/read-file/types.d.ts.map +1 -1
  208. package/dist/file/signature/checkArchiveSignature.d.ts.map +1 -1
  209. package/dist/file-system/fileSystemConstants.d.ts +5 -0
  210. package/dist/file-system/fileSystemConstants.d.ts.map +1 -0
  211. package/dist/file-system/fileSystemTypes.d.ts +2 -1
  212. package/dist/file-system/fileSystemTypes.d.ts.map +1 -1
  213. package/dist/file-system/index.js +11 -10
  214. package/dist/file-system/index.js.map +1 -1
  215. package/dist/file-system/resolvePathInsideRoot.d.ts.map +1 -1
  216. package/dist/formatters/boolean/parseAbapBoolean.d.ts.map +1 -1
  217. package/dist/formatters/boolean/toAbapBoolean.d.ts.map +1 -1
  218. package/dist/formatters/date/calendarDate.d.ts.map +1 -1
  219. package/dist/formatters/date/calendarDateConstants.d.ts +13 -0
  220. package/dist/formatters/date/calendarDateConstants.d.ts.map +1 -0
  221. package/dist/formatters/date/calendarPeriod.d.ts +11 -2
  222. package/dist/formatters/date/calendarPeriod.d.ts.map +1 -1
  223. package/dist/formatters/date/dateFormatConstants.d.ts +17 -0
  224. package/dist/formatters/date/dateFormatConstants.d.ts.map +1 -0
  225. package/dist/formatters/date/datePatternConstants.d.ts +16 -0
  226. package/dist/formatters/date/datePatternConstants.d.ts.map +1 -0
  227. package/dist/formatters/date/datePresetNameConstants.d.ts +27 -0
  228. package/dist/formatters/date/datePresetNameConstants.d.ts.map +1 -0
  229. package/dist/formatters/date/dateRange.d.ts +3 -1
  230. package/dist/formatters/date/dateRange.d.ts.map +1 -1
  231. package/dist/formatters/date/dateValueConstants.d.ts +15 -0
  232. package/dist/formatters/date/dateValueConstants.d.ts.map +1 -0
  233. package/dist/formatters/date/educationDate.d.ts.map +1 -1
  234. package/dist/formatters/date/formatDate.d.ts.map +1 -1
  235. package/dist/formatters/date/formatInstantDateTime.d.ts.map +1 -1
  236. package/dist/formatters/date/parseDate.d.ts.map +1 -1
  237. package/dist/formatters/date/pattern.d.ts.map +1 -1
  238. package/dist/formatters/date/presets.d.ts.map +1 -1
  239. package/dist/formatters/date/types.d.ts +8 -6
  240. package/dist/formatters/date/types.d.ts.map +1 -1
  241. package/dist/formatters/formatDurationMinutes.d.ts.map +1 -1
  242. package/dist/formatters/formatFileSize.d.ts.map +1 -1
  243. package/dist/formatters/formatPhone.d.ts.map +1 -1
  244. package/dist/formatters/index.js +6 -6
  245. package/dist/formatters/normalizeLeadingZeros.d.ts.map +1 -1
  246. package/dist/formatters/number/compact.d.ts.map +1 -1
  247. package/dist/formatters/number/formatCompactNumber.d.ts.map +1 -1
  248. package/dist/formatters/number/formatNumber.d.ts.map +1 -1
  249. package/dist/formatters/number/numberFormatConstants.d.ts +11 -0
  250. package/dist/formatters/number/numberFormatConstants.d.ts.map +1 -0
  251. package/dist/formatters/number/numberPresetNameConstants.d.ts +16 -0
  252. package/dist/formatters/number/numberPresetNameConstants.d.ts.map +1 -0
  253. package/dist/formatters/number/parseNumber.d.ts.map +1 -1
  254. package/dist/formatters/number/presets.d.ts.map +1 -1
  255. package/dist/formatters/number/types.d.ts +2 -1
  256. package/dist/formatters/number/types.d.ts.map +1 -1
  257. package/dist/formatters/pipeline/clone.d.ts.map +1 -1
  258. package/dist/formatters/pipeline/definitions.d.ts.map +1 -1
  259. package/dist/formatters/pipeline/dependencies.d.ts.map +1 -1
  260. package/dist/formatters/pipeline/execute.d.ts +4 -1
  261. package/dist/formatters/pipeline/execute.d.ts.map +1 -1
  262. package/dist/formatters/pipeline/formattersPipelineConstants.d.ts +19 -0
  263. package/dist/formatters/pipeline/formattersPipelineConstants.d.ts.map +1 -0
  264. package/dist/formatters/pipeline/normalize.d.ts.map +1 -1
  265. package/dist/formatters/pipeline/pipelineValidationConstants.d.ts +40 -0
  266. package/dist/formatters/pipeline/pipelineValidationConstants.d.ts.map +1 -0
  267. package/dist/formatters/pipeline/registry.d.ts +1 -1
  268. package/dist/formatters/pipeline/registry.d.ts.map +1 -1
  269. package/dist/formatters/pipeline/rekey.d.ts.map +1 -1
  270. package/dist/formatters/pipeline/runtime.d.ts.map +1 -1
  271. package/dist/formatters/pipeline/types.d.ts +24 -21
  272. package/dist/formatters/pipeline/types.d.ts.map +1 -1
  273. package/dist/formatters/pipeline/validate.d.ts +2 -1
  274. package/dist/formatters/pipeline/validate.d.ts.map +1 -1
  275. package/dist/formatters/strings/spaceCharacterConstants.d.ts +5 -0
  276. package/dist/formatters/strings/spaceCharacterConstants.d.ts.map +1 -0
  277. package/dist/formatters/strings/stripInnerSpaces.d.ts.map +1 -1
  278. package/dist/formatters/strings/stripLeadingZeros.d.ts.map +1 -1
  279. package/dist/formatters/valueState/fixedValueStateResolver.d.ts.map +1 -1
  280. package/dist/formatters/valueState/presentation.d.ts.map +1 -1
  281. package/dist/formatters/valueState/resolveValueStateClassName.d.ts.map +1 -1
  282. package/dist/formatters/valueState/thresholdValueStateResolver.d.ts.map +1 -1
  283. package/dist/formatters/valueState/types.d.ts +2 -1
  284. package/dist/formatters/valueState/types.d.ts.map +1 -1
  285. package/dist/formatters/valueState/valueStateRegistry.d.ts.map +1 -1
  286. package/dist/formatters/valueState/valueStateResolverConstants.d.ts +6 -0
  287. package/dist/formatters/valueState/valueStateResolverConstants.d.ts.map +1 -0
  288. package/dist/formulas/execute.d.ts +3 -2
  289. package/dist/formulas/execute.d.ts.map +1 -1
  290. package/dist/formulas/index.js +1 -1
  291. package/dist/formulas/isTableFormulaDependency.d.ts.map +1 -1
  292. package/dist/formulas/tableFormulaConstants.d.ts +12 -0
  293. package/dist/formulas/tableFormulaConstants.d.ts.map +1 -0
  294. package/dist/formulas/types.d.ts +2 -1
  295. package/dist/formulas/types.d.ts.map +1 -1
  296. package/dist/formulas/validate.d.ts +2 -1
  297. package/dist/formulas/validate.d.ts.map +1 -1
  298. package/dist/hooks/index.js +110 -107
  299. package/dist/hooks/index.js.map +1 -1
  300. package/dist/hooks/useBlockBrowserZoom.d.ts.map +1 -1
  301. package/dist/hooks/useDndSortableSensors.d.ts.map +1 -1
  302. package/dist/hooks/useFloatingListbox.d.ts +15 -33
  303. package/dist/hooks/useFloatingListbox.d.ts.map +1 -1
  304. package/dist/http/index.js +8 -7
  305. package/dist/http/index.js.map +1 -1
  306. package/dist/http/textResponse.d.ts.map +1 -1
  307. package/dist/indexed-records/createIndexedRecordsSchema.d.ts.map +1 -1
  308. package/dist/indexed-records/schema.js +24 -23
  309. package/dist/indexed-records/schema.js.map +1 -1
  310. package/dist/media/breakpointConstants.d.ts +5 -0
  311. package/dist/media/breakpointConstants.d.ts.map +1 -0
  312. package/dist/media/breakpoints.d.ts +2 -1
  313. package/dist/media/breakpoints.d.ts.map +1 -1
  314. package/dist/media/createNotificationTonePlayer.d.ts.map +1 -1
  315. package/dist/media/getCurrentFontSize.d.ts.map +1 -1
  316. package/dist/media/index.js +1 -1
  317. package/dist/media/mediaQueryConstants.d.ts +3 -0
  318. package/dist/media/mediaQueryConstants.d.ts.map +1 -0
  319. package/dist/media/responsive.d.ts +1 -1
  320. package/dist/media/responsive.d.ts.map +1 -1
  321. package/dist/media/useMatchMedia.d.ts.map +1 -1
  322. package/dist/media/useMediaQuery.d.ts.map +1 -1
  323. package/dist/metadata/baseMetaTypes.d.ts.map +1 -1
  324. package/dist/metadata/metadataTypes.d.ts +8 -7
  325. package/dist/metadata/metadataTypes.d.ts.map +1 -1
  326. package/dist/metadata/scalarTypeClassification.d.ts.map +1 -1
  327. package/dist/metadata/scalarTypeConstants.d.ts +21 -0
  328. package/dist/metadata/scalarTypeConstants.d.ts.map +1 -0
  329. package/dist/notifications/index.js +62 -62
  330. package/dist/notifications/index.js.map +1 -1
  331. package/dist/notifications/notificationTypeConstants.d.ts +6 -0
  332. package/dist/notifications/notificationTypeConstants.d.ts.map +1 -0
  333. package/dist/notifications/notify.d.ts.map +1 -1
  334. package/dist/notifications/store.d.ts.map +1 -1
  335. package/dist/notifications/types.d.ts +2 -1
  336. package/dist/notifications/types.d.ts.map +1 -1
  337. package/dist/number-scale/index.js +47 -46
  338. package/dist/number-scale/index.js.map +1 -1
  339. package/dist/number-scale/marksPositionConstants.d.ts +4 -0
  340. package/dist/number-scale/marksPositionConstants.d.ts.map +1 -0
  341. package/dist/number-scale/numberScale.d.ts +1 -1
  342. package/dist/number-scale/numberScale.d.ts.map +1 -1
  343. package/dist/number-scale/types.d.ts +2 -1
  344. package/dist/number-scale/types.d.ts.map +1 -1
  345. package/dist/odata-service/builder.d.ts.map +1 -1
  346. package/dist/odata-service/columns.d.ts.map +1 -1
  347. package/dist/odata-service/entityOperationConstants.d.ts +4 -0
  348. package/dist/odata-service/entityOperationConstants.d.ts.map +1 -0
  349. package/dist/odata-service/filterDefinitionConstants.d.ts +24 -0
  350. package/dist/odata-service/filterDefinitionConstants.d.ts.map +1 -0
  351. package/dist/odata-service/filterDefinitions.d.ts +19 -17
  352. package/dist/odata-service/filterDefinitions.d.ts.map +1 -1
  353. package/dist/odata-service/filterOperationConstants.d.ts +14 -0
  354. package/dist/odata-service/filterOperationConstants.d.ts.map +1 -0
  355. package/dist/odata-service/filters.d.ts.map +1 -1
  356. package/dist/odata-service/formatters.d.ts.map +1 -1
  357. package/dist/odata-service/index.js +439 -433
  358. package/dist/odata-service/index.js.map +1 -1
  359. package/dist/odata-service/odataMetadataConstants.d.ts +8 -0
  360. package/dist/odata-service/odataMetadataConstants.d.ts.map +1 -0
  361. package/dist/odata-service/parser.d.ts +1 -3
  362. package/dist/odata-service/parser.d.ts.map +1 -1
  363. package/dist/odata-service/schema.d.ts.map +1 -1
  364. package/dist/odata-service/sorts.d.ts.map +1 -1
  365. package/dist/odata-service/sqlFilters.d.ts +10 -5
  366. package/dist/odata-service/sqlFilters.d.ts.map +1 -1
  367. package/dist/odata-service/types.d.ts +5 -3
  368. package/dist/odata-service/types.d.ts.map +1 -1
  369. package/dist/pwa/index.js +72 -71
  370. package/dist/pwa/index.js.map +1 -1
  371. package/dist/pwa/sw-cache-policy.js +47 -47
  372. package/dist/pwa/sw-cache-policy.js.map +1 -1
  373. package/dist/pwa/swCachePolicy.d.ts +5 -1
  374. package/dist/pwa/swCachePolicy.d.ts.map +1 -1
  375. package/dist/pwa/useBrowserOnlineStatus.d.ts.map +1 -1
  376. package/dist/query-client/broadcast.d.ts +4 -3
  377. package/dist/query-client/broadcast.d.ts.map +1 -1
  378. package/dist/query-client/createQueryRestoreSchedulerGuard.d.ts.map +1 -1
  379. package/dist/query-client/createQueryRestoreStorage.d.ts.map +1 -1
  380. package/dist/query-client/index.js +1 -1
  381. package/dist/query-client/invalidationBroadcast.d.ts +2 -1
  382. package/dist/query-client/invalidationBroadcast.d.ts.map +1 -1
  383. package/dist/query-client/persistence.d.ts +9 -6
  384. package/dist/query-client/persistence.d.ts.map +1 -1
  385. package/dist/query-client/queryCacheEventConstants.d.ts +11 -0
  386. package/dist/query-client/queryCacheEventConstants.d.ts.map +1 -0
  387. package/dist/query-client/queryClient.d.ts +2 -1
  388. package/dist/query-client/queryClient.d.ts.map +1 -1
  389. package/dist/query-client/queryMeta.d.ts.map +1 -1
  390. package/dist/query-client/sessionPersistenceConstants.d.ts +5 -0
  391. package/dist/query-client/sessionPersistenceConstants.d.ts.map +1 -0
  392. package/dist/query-client/sessionScoped.d.ts.map +1 -1
  393. package/dist/query-client/sessionScopedResetConstants.d.ts +4 -0
  394. package/dist/query-client/sessionScopedResetConstants.d.ts.map +1 -0
  395. package/dist/query-client/sessionScopedResetLifecycleTypes.d.ts +2 -1
  396. package/dist/query-client/sessionScopedResetLifecycleTypes.d.ts.map +1 -1
  397. package/dist/seo/index.js +0 -1
  398. package/dist/seo/index.js.map +1 -1
  399. package/dist/seo/seo.d.ts +3 -2
  400. package/dist/seo/seo.d.ts.map +1 -1
  401. package/dist/seo/seoContentTypeConstants.d.ts +6 -0
  402. package/dist/seo/seoContentTypeConstants.d.ts.map +1 -0
  403. package/dist/seo/types.d.ts +2 -1
  404. package/dist/seo/types.d.ts.map +1 -1
  405. package/dist/session-storage/index.js +1 -1
  406. package/dist/table/cellSelection.d.ts.map +1 -1
  407. package/dist/table/index.js +83 -79
  408. package/dist/table/index.js.map +1 -1
  409. package/dist/table/odataAdapter.d.ts +3 -3
  410. package/dist/table/odataAdapter.d.ts.map +1 -1
  411. package/dist/table/selection.d.ts +2 -2
  412. package/dist/table/selection.d.ts.map +1 -1
  413. package/dist/table/tableColumnConstants.d.ts +5 -0
  414. package/dist/table/tableColumnConstants.d.ts.map +1 -0
  415. package/dist/table/tableSelectionConstants.d.ts +8 -0
  416. package/dist/table/tableSelectionConstants.d.ts.map +1 -0
  417. package/dist/table/tanStackFeatures.d.ts +8 -8
  418. package/dist/table/types.d.ts +5 -3
  419. package/dist/table/types.d.ts.map +1 -1
  420. package/dist/table/useTableRowSelection.d.ts +2 -2
  421. package/dist/table/useTableRowSelection.d.ts.map +1 -1
  422. package/dist/table-document/index.js +88 -87
  423. package/dist/table-document/index.js.map +1 -1
  424. package/dist/table-document/insertTableDocumentAxis.d.ts +2 -1
  425. package/dist/table-document/insertTableDocumentAxis.d.ts.map +1 -1
  426. package/dist/table-document/tableDocument.d.ts +2 -1
  427. package/dist/table-document/tableDocument.d.ts.map +1 -1
  428. package/dist/table-document/tableDocumentAxisGroups.d.ts +4 -3
  429. package/dist/table-document/tableDocumentAxisGroups.d.ts.map +1 -1
  430. package/dist/table-document/tableDocumentConstants.d.ts +8 -0
  431. package/dist/table-document/tableDocumentConstants.d.ts.map +1 -0
  432. package/dist/table-document/tableDocumentGeometry.d.ts.map +1 -1
  433. package/dist/three-scene/index.js +32 -32
  434. package/dist/three-scene/index.js.map +1 -1
  435. package/dist/three-scene/threeSceneAvailability.d.ts +4 -3
  436. package/dist/three-scene/threeSceneAvailability.d.ts.map +1 -1
  437. package/dist/three-scene/threeSceneConstants.d.ts +14 -0
  438. package/dist/three-scene/threeSceneConstants.d.ts.map +1 -0
  439. package/dist/three-scene/useThreeSceneAvailability.d.ts.map +1 -1
  440. package/dist/tree-table/index.js +1 -1
  441. package/dist/types/abapBooleanConstants.d.ts +4 -0
  442. package/dist/types/abapBooleanConstants.d.ts.map +1 -0
  443. package/dist/types/index.js.map +1 -1
  444. package/dist/types/types.d.ts +4 -2
  445. package/dist/types/types.d.ts.map +1 -1
  446. package/dist/types/valueStateConstants.d.ts +8 -0
  447. package/dist/types/valueStateConstants.d.ts.map +1 -0
  448. package/dist/utils/cloneFunctionStrategyConstants.d.ts +4 -0
  449. package/dist/utils/cloneFunctionStrategyConstants.d.ts.map +1 -0
  450. package/dist/utils/createLazyComponent.d.ts.map +1 -1
  451. package/dist/utils/deepCloneWithoutFunctions.d.ts +2 -1
  452. package/dist/utils/deepCloneWithoutFunctions.d.ts.map +1 -1
  453. package/dist/utils/deepCopyWithoutFunctions.d.ts +2 -1
  454. package/dist/utils/deepCopyWithoutFunctions.d.ts.map +1 -1
  455. package/dist/utils/index.js +2 -209
  456. package/dist/utils/keyboard.d.ts +2 -1
  457. package/dist/utils/keyboard.d.ts.map +1 -1
  458. package/dist/utils/keyboardConstants.d.ts +16 -0
  459. package/dist/utils/keyboardConstants.d.ts.map +1 -0
  460. package/dist/validators/index.js +3 -3
  461. package/dist/validators/index.js.map +1 -1
  462. package/dist/validators/validateUrl.d.ts.map +1 -1
  463. package/dist/value-transformers/execute.d.ts.map +1 -1
  464. package/dist/value-transformers/index.js +9 -6
  465. package/dist/value-transformers/index.js.map +1 -1
  466. package/dist/value-transformers/types.d.ts +3 -2
  467. package/dist/value-transformers/types.d.ts.map +1 -1
  468. package/dist/value-transformers/valueTransformerConstants.d.ts +4 -0
  469. package/dist/value-transformers/valueTransformerConstants.d.ts.map +1 -0
  470. package/package.json +6 -5
  471. package/src/binary/README.mdx +1 -1
  472. package/src/dom/README.mdx +1 -1
  473. package/src/query-client/README.mdx +4 -4
  474. package/dist/chunks/dom-BK22UmgF.js.map +0 -1
  475. package/dist/chunks/formatDate-BUvpRI7H.js +0 -133
  476. package/dist/chunks/formatDate-BUvpRI7H.js.map +0 -1
  477. package/dist/chunks/formatters-rxriDRPk.js.map +0 -1
  478. package/dist/chunks/formulas-BXT_XBWI.js.map +0 -1
  479. package/dist/chunks/media-WK38KtMl.js +0 -191
  480. package/dist/chunks/media-WK38KtMl.js.map +0 -1
  481. package/dist/chunks/query-client-CVRfrYZM.js.map +0 -1
  482. package/dist/chunks/scalarTypeClassification-BZcFmIyR.js +0 -764
  483. package/dist/chunks/scalarTypeClassification-BZcFmIyR.js.map +0 -1
  484. package/dist/chunks/uuid-CUJPAbRY.js.map +0 -1
  485. package/dist/chunks/validate-DsUR-bFF.js +0 -608
  486. package/dist/chunks/validate-DsUR-bFF.js.map +0 -1
  487. package/dist/utils/index.js.map +0 -1
@@ -1,64 +1,65 @@
1
1
  import { i as e } from "../chunks/isRecord-DXDTW-jA.js";
2
- import { t } from "../chunks/uuid-CUJPAbRY.js";
3
- //#region src/browser-notifications/createBrowserNotificationPresenter.ts
4
- function n({ onOpen: n, onError: r }) {
5
- let i = /* @__PURE__ */ new Set(), a = !1, o = () => typeof window < "u" && window.isSecureContext && typeof Notification < "u" ? Notification.permission : "unsupported";
2
+ import { t } from "../chunks/uuid-izDzLv18.js";
3
+ //#region src/browser-notifications/browserNotificationConstants.ts
4
+ var n = "unsupported", r = "granted";
5
+ function i({ onOpen: i, onError: a }) {
6
+ let o = /* @__PURE__ */ new Set(), s = !1, c = () => typeof window < "u" && window.isSecureContext && typeof Notification < "u" ? Notification.permission : n;
6
7
  return {
7
- permission: o,
8
+ permission: c,
8
9
  async requestPermission() {
9
- let e = o();
10
- if (a || e !== "default") return e;
10
+ let e = c();
11
+ if (s || e !== "default") return e;
11
12
  try {
12
13
  return await Notification.requestPermission();
13
14
  } catch (e) {
14
- return r(e), o();
15
+ return a(e), c();
15
16
  }
16
17
  },
17
- show(s) {
18
- if (a || o() !== "granted") return () => void 0;
19
- let c = new URL(s.url, window.location.href);
20
- if (c.origin !== window.location.origin) throw Error("URL уведомления должен принадлежать текущему origin.");
21
- let l = !1, u = t(), d = () => void 0, f = () => {
22
- l || (l = !0, i.delete(f), d());
18
+ show(n) {
19
+ if (s || c() !== r) return () => void 0;
20
+ let l = new URL(n.url, window.location.href);
21
+ if (l.origin !== window.location.origin) throw Error("URL уведомления должен принадлежать текущему origin.");
22
+ let u = !1, d = t(), f = () => void 0, p = () => {
23
+ u || (u = !0, o.delete(p), f());
23
24
  };
24
- return i.add(f), (async () => {
25
+ return o.add(p), (async () => {
25
26
  let t = "serviceWorker" in navigator ? await navigator.serviceWorker.getRegistration() : void 0;
26
- if (l || a || o() !== "granted") return;
27
- let i = {
28
- body: s.body,
29
- tag: s.tag,
30
- icon: s.icon,
27
+ if (u || s || c() !== r) return;
28
+ let o = {
29
+ body: n.body,
30
+ tag: n.tag,
31
+ icon: n.icon,
31
32
  data: {
32
- url: c.href,
33
- publicationId: u
33
+ url: l.href,
34
+ publicationId: d
34
35
  },
35
36
  silent: !0
36
37
  };
37
38
  if (t?.active) {
38
- await t.showNotification(s.title, i);
39
- let n = (await t.getNotifications({ tag: s.tag })).filter((t) => e(t.data) && t.data.publicationId === u);
40
- d = () => {
41
- for (let e of n) e.close();
42
- }, (l || a) && d();
39
+ await t.showNotification(n.title, o);
40
+ let r = (await t.getNotifications({ tag: n.tag })).filter((t) => e(t.data) && t.data.publicationId === d);
41
+ f = () => {
42
+ for (let e of r) e.close();
43
+ }, (u || s) && f();
43
44
  return;
44
45
  }
45
- let p = new Notification(s.title, i);
46
- d = () => p.close(), p.addEventListener("click", () => {
47
- l || a || (f(), window.focus(), n(c.href));
48
- }), p.addEventListener("error", () => {
49
- !l && !a && r(/* @__PURE__ */ Error("Браузер не смог показать системное уведомление."));
46
+ let m = new Notification(n.title, o);
47
+ f = () => m.close(), m.addEventListener("click", () => {
48
+ u || s || (p(), window.focus(), i(l.href));
49
+ }), m.addEventListener("error", () => {
50
+ !u && !s && a(/* @__PURE__ */ Error("Браузер не смог показать системное уведомление."));
50
51
  });
51
52
  })().catch((e) => {
52
- !l && !a && r(e), f();
53
- }), f;
53
+ !u && !s && a(e), p();
54
+ }), p;
54
55
  },
55
56
  dispose() {
56
- a = !0;
57
- for (let e of [...i]) e();
57
+ s = !0;
58
+ for (let e of [...o]) e();
58
59
  }
59
60
  };
60
61
  }
61
62
  //#endregion
62
- export { n as createBrowserNotificationPresenter };
63
+ export { i as createBrowserNotificationPresenter };
63
64
 
64
65
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/browser-notifications/createBrowserNotificationPresenter.ts"],"sourcesContent":["import { uuidv4 } from \"../crypto/uuid\";\nimport { isRecord } from \"../validators/isRecord\";\n\nimport {\n\ttype BrowserNotificationPermission,\n\ttype BrowserNotificationPresenter,\n\ttype BrowserNotificationPresenterOptions\n} from \"./browserNotificationTypes\";\n\n/**\n * Без I/O до команды. Предпочитает действующий SW для мобильных браузеров,\n * но не регистрирует новый worker и не ожидает бесконечно navigator.ready.\n */\nexport function createBrowserNotificationPresenter({ onOpen, onError }: BrowserNotificationPresenterOptions): BrowserNotificationPresenter {\n\tconst releases = new Set<() => void>();\n\tlet disposed = false;\n\tconst permission = (): BrowserNotificationPermission =>\n\t\ttypeof window !== \"undefined\" && window.isSecureContext && typeof Notification !== \"undefined\"\n\t\t\t? Notification.permission\n\t\t\t: \"unsupported\";\n\treturn {\n\t\tpermission,\n\t\tasync requestPermission() {\n\t\t\tconst current = permission();\n\t\t\tif (disposed || current !== \"default\") return current;\n\t\t\ttry {\n\t\t\t\treturn await Notification.requestPermission();\n\t\t\t} catch (error: unknown) {\n\t\t\t\tonError(error);\n\t\t\t\treturn permission();\n\t\t\t}\n\t\t},\n\t\tshow(request) {\n\t\t\tif (disposed || permission() !== \"granted\") return () => undefined;\n\t\t\tconst url = new URL(request.url, window.location.href);\n\t\t\tif (url.origin !== window.location.origin) throw new Error(\"URL уведомления должен принадлежать текущему origin.\");\n\t\t\tlet released = false;\n\t\t\tconst publicationId = uuidv4();\n\t\t\tlet close = () => undefined as void;\n\t\t\tconst release = () => {\n\t\t\t\tif (released) return;\n\t\t\t\treleased = true;\n\t\t\t\treleases.delete(release);\n\t\t\t\tclose();\n\t\t\t};\n\t\t\treleases.add(release);\n\t\t\tconst deliver = async () => {\n\t\t\t\tconst registration = \"serviceWorker\" in navigator ? await navigator.serviceWorker.getRegistration() : undefined;\n\t\t\t\tif (released || disposed || permission() !== \"granted\") return;\n\t\t\t\tconst options: NotificationOptions = {\n\t\t\t\t\tbody: request.body,\n\t\t\t\t\ttag: request.tag,\n\t\t\t\t\ticon: request.icon,\n\t\t\t\t\tdata: { url: url.href, publicationId },\n\t\t\t\t\t// Звуком управляет вызывающий сценарий; ОС не должна удваивать собственный сигнал.\n\t\t\t\t\tsilent: true\n\t\t\t\t};\n\t\t\t\tif (registration?.active) {\n\t\t\t\t\tawait registration.showNotification(request.title, options);\n\t\t\t\t\tconst notifications = (await registration.getNotifications({ tag: request.tag })).filter(\n\t\t\t\t\t\t(notification) => isRecord(notification.data) && notification.data.publicationId === publicationId\n\t\t\t\t\t);\n\t\t\t\t\tclose = () => {\n\t\t\t\t\t\tfor (const notification of notifications) notification.close();\n\t\t\t\t\t};\n\t\t\t\t\tif (released || disposed) close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst notification = new Notification(request.title, options);\n\t\t\t\tclose = () => notification.close();\n\t\t\t\tnotification.addEventListener(\"click\", () => {\n\t\t\t\t\tif (released || disposed) return;\n\t\t\t\t\trelease();\n\t\t\t\t\twindow.focus();\n\t\t\t\t\tonOpen(url.href);\n\t\t\t\t});\n\t\t\t\tnotification.addEventListener(\"error\", () => {\n\t\t\t\t\tif (!released && !disposed) onError(new Error(\"Браузер не смог показать системное уведомление.\"));\n\t\t\t\t});\n\t\t\t};\n\t\t\tvoid deliver().catch((error: unknown) => {\n\t\t\t\tif (!released && !disposed) onError(error);\n\t\t\t\trelease();\n\t\t\t});\n\t\t\treturn release;\n\t\t},\n\t\tdispose() {\n\t\t\tdisposed = true;\n\t\t\tfor (const release of [...releases]) release();\n\t\t}\n\t};\n}\n"],"mappings":";;;AAaA,SAAgB,EAAmC,EAAE,WAAQ,cAA8E;CAC1I,IAAM,oBAAW,IAAI,IAAgB,GACjC,IAAW,IACT,UACL,OAAO,SAAW,OAAe,OAAO,mBAAmB,OAAO,eAAiB,MAChF,aAAa,aACb;CACJ,OAAO;EACN;EACA,MAAM,oBAAoB;GACzB,IAAM,IAAU,EAAW;GAC3B,IAAI,KAAY,MAAY,WAAW,OAAO;GAC9C,IAAI;IACH,OAAO,MAAM,aAAa,kBAAkB;GAC7C,SAAS,GAAgB;IAExB,OADA,EAAQ,CAAK,GACN,EAAW;GACnB;EACD;EACA,KAAK,GAAS;GACb,IAAI,KAAY,EAAW,MAAM,WAAW,aAAa,KAAA;GACzD,IAAM,IAAM,IAAI,IAAI,EAAQ,KAAK,OAAO,SAAS,IAAI;GACrD,IAAI,EAAI,WAAW,OAAO,SAAS,QAAQ,MAAU,MAAM,sDAAsD;GACjH,IAAI,I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D;AACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/browser-notifications/browserNotificationConstants.ts","../../src/browser-notifications/createBrowserNotificationPresenter.ts"],"sourcesContent":["/** Отдельный результат capability-проверки, не заменяющий browser permission. */\nexport const BROWSER_NOTIFICATION_UNSUPPORTED = \"unsupported\";\n","import { uuidv4 } from \"../crypto/uuid\";\nimport { isRecord } from \"../validators/isRecord\";\n\nimport { BROWSER_NOTIFICATION_UNSUPPORTED } from \"./browserNotificationConstants\";\nimport {\n\ttype BrowserNotificationPermission,\n\ttype BrowserNotificationPresenter,\n\ttype BrowserNotificationPresenterOptions\n} from \"./browserNotificationTypes\";\n\nconst NOTIFICATION_PERMISSION_GRANTED = \"granted\";\n\n/**\n * Без I/O до команды. Предпочитает действующий SW для мобильных браузеров,\n * но не регистрирует новый worker и не ожидает бесконечно navigator.ready.\n */\nexport function createBrowserNotificationPresenter({ onOpen, onError }: BrowserNotificationPresenterOptions): BrowserNotificationPresenter {\n\tconst releases = new Set<() => void>();\n\tlet disposed = false;\n\tconst permission = (): BrowserNotificationPermission =>\n\t\ttypeof window !== \"undefined\" && window.isSecureContext && typeof Notification !== \"undefined\"\n\t\t\t? Notification.permission\n\t\t\t: BROWSER_NOTIFICATION_UNSUPPORTED;\n\treturn {\n\t\tpermission,\n\t\tasync requestPermission() {\n\t\t\tconst current = permission();\n\t\t\tif (disposed || current !== \"default\") return current;\n\t\t\ttry {\n\t\t\t\treturn await Notification.requestPermission();\n\t\t\t} catch (error: unknown) {\n\t\t\t\tonError(error);\n\t\t\t\treturn permission();\n\t\t\t}\n\t\t},\n\t\tshow(request) {\n\t\t\tif (disposed || permission() !== NOTIFICATION_PERMISSION_GRANTED) return () => undefined;\n\t\t\tconst url = new URL(request.url, window.location.href);\n\t\t\tif (url.origin !== window.location.origin) throw new Error(\"URL уведомления должен принадлежать текущему origin.\");\n\t\t\tlet released = false;\n\t\t\tconst publicationId = uuidv4();\n\t\t\tlet close = () => undefined as void;\n\t\t\tconst release = () => {\n\t\t\t\tif (released) return;\n\t\t\t\treleased = true;\n\t\t\t\treleases.delete(release);\n\t\t\t\tclose();\n\t\t\t};\n\t\t\treleases.add(release);\n\t\t\tconst deliver = async () => {\n\t\t\t\tconst registration = \"serviceWorker\" in navigator ? await navigator.serviceWorker.getRegistration() : undefined;\n\t\t\t\tif (released || disposed || permission() !== NOTIFICATION_PERMISSION_GRANTED) return;\n\t\t\t\tconst options: NotificationOptions = {\n\t\t\t\t\tbody: request.body,\n\t\t\t\t\ttag: request.tag,\n\t\t\t\t\ticon: request.icon,\n\t\t\t\t\tdata: { url: url.href, publicationId },\n\t\t\t\t\t// Звуком управляет вызывающий сценарий; ОС не должна удваивать собственный сигнал.\n\t\t\t\t\tsilent: true\n\t\t\t\t};\n\t\t\t\tif (registration?.active) {\n\t\t\t\t\tawait registration.showNotification(request.title, options);\n\t\t\t\t\tconst notifications = (await registration.getNotifications({ tag: request.tag })).filter(\n\t\t\t\t\t\t(notification) => isRecord(notification.data) && notification.data.publicationId === publicationId\n\t\t\t\t\t);\n\t\t\t\t\tclose = () => {\n\t\t\t\t\t\tfor (const notification of notifications) notification.close();\n\t\t\t\t\t};\n\t\t\t\t\tif (released || disposed) close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst notification = new Notification(request.title, options);\n\t\t\t\tclose = () => notification.close();\n\t\t\t\tnotification.addEventListener(\"click\", () => {\n\t\t\t\t\tif (released || disposed) return;\n\t\t\t\t\trelease();\n\t\t\t\t\twindow.focus();\n\t\t\t\t\tonOpen(url.href);\n\t\t\t\t});\n\t\t\t\tnotification.addEventListener(\"error\", () => {\n\t\t\t\t\tif (!released && !disposed) onError(new Error(\"Браузер не смог показать системное уведомление.\"));\n\t\t\t\t});\n\t\t\t};\n\t\t\tvoid deliver().catch((error: unknown) => {\n\t\t\t\tif (!released && !disposed) onError(error);\n\t\t\t\trelease();\n\t\t\t});\n\t\t\treturn release;\n\t\t},\n\t\tdispose() {\n\t\t\td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AAG,QAChF,MAAiB,EAAS,EAAa,IAAI,KAAK,EAAa,KAAK,kBAAkB,CACtF;KAIA,AAHA,UAAc;MACb,KAAK,IAAM,KAAgB,GAAe,EAAa,MAAM;KAC9D,IACI,KAAY,MAAU,EAAM;KAChC;IACD;IACA,IAAM,IAAe,IAAI,aAAa,EAAQ,OAAO,CAAO;IAQ5D,AAPA,UAAc,EAAa,MAAM,GACjC,EAAa,iBAAiB,eAAe;KACxC,KAAY,MAChB,EAAQ,GACR,OAAO,MAAM,GACb,EAAO,EAAI,IAAI;IAChB,CAAC,GACD,EAAa,iBAAiB,eAAe;KAC5C,AAAI,CAAC,KAAY,CAAC,KAAU,EAAQ,gBAAI,MAAM,iDAAiD,CAAC;IACjG,CAAC;GACF,EACK,CAAQ,CAAC,CAAC,OAAO,MAAmB;IAExC,AADI,CAAC,KAAY,CAAC,KAAU,EAAQ,CAAK,GACzC,EAAQ;GACT,CAAC,GACM;EACR;EACA,UAAU;GACT,IAAW;GACX,KAAK,IAAM,KAAW,CAAC,GAAG,CAAQ,GAAG,EAAQ;EAC9C;CACD;AACD"}
@@ -111,8 +111,6 @@ function y(e, t, n) {
111
111
  let r = n?.trim();
112
112
  !r || t.has(r) || (t.add(r), e.push(r));
113
113
  }
114
- //#endregion
115
- //#region src/array/reorder.ts
116
114
  function b(e) {
117
115
  let { index: t, size: n, action: r } = e;
118
116
  switch (r) {
@@ -143,4 +141,4 @@ function S(e, t, n) {
143
141
  //#endregion
144
142
  export { e as _, d as a, t as b, c, f as d, g as f, n as g, m as h, p as i, u as l, v as m, x as n, s as o, _ as p, y as r, l as s, S as t, h as u, o as v, i as x, r as y };
145
143
 
146
- //# sourceMappingURL=array-D-_yMMUK.js.map
144
+ //# sourceMappingURL=array-bd7LYFto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"array-D-_yMMUK.js","names":[],"sources":["../../src/formatters/strings/normalizeText.ts","../../src/array/array.ts","../../src/array/reorder.ts"],"sourcesContent":["export function normalizeText(value: unknown): string | undefined {\n\tif (typeof value !== \"string\") return undefined;\n\n\tconst normalized = value.trim();\n\treturn normalized.length > 0 ? normalized : undefined;\n}\n\nexport function normalizeTextWithFallback(value: unknown, fallback = \"\") {\n\treturn normalizeText(value) ?? fallback;\n}\n\nexport function normalizeRequiredText(value: unknown) {\n\treturn normalizeTextWithFallback(value);\n}\n\nexport function normalizeTextToLower(value: unknown): string {\n\tconst normalized = normalizeText(value);\n\treturn normalized ? normalized.toLowerCase() : \"\";\n}\n\nexport function toSafeString(value: unknown): string {\n\treturn value == null ? \"\" : String(value);\n}\n\nconst STRING_SPACES_PATTERN = /[\\s\\u00a0\\u202f]+/gu;\n\n/**\n * Нормализует пользовательский текст: убирает пробелы по краям\n * и сворачивает любые подряд идущие пробельные символы в один обычный пробел.\n */\nexport function normalizeTextSpaces(value: unknown): string {\n\treturn normalizeRequiredText(value).replace(STRING_SPACES_PATTERN, \" \");\n}\n","import { normalizeText } from \"../formatters/strings\";\n\nexport function arrayGroupBy<T>(array: readonly T[], key: keyof T): Record<string, T[]> {\n\treturn array.reduce<Record<string, T[]>>((acc, item) => {\n\t\tconst groupKey = String(item[key]);\n\t\t(acc[groupKey] ||= []).push(item);\n\t\treturn acc;\n\t}, {});\n}\n\nexport function arrayToMap<T>(array: readonly T[], key: keyof T): Record<string, T> {\n\treturn array.reduce<Record<string, T>>((acc, item) => {\n\t\tconst groupKey = String(item[key]);\n\t\tif (!acc[groupKey]) {\n\t\t\tacc[groupKey] = item;\n\t\t}\n\t\treturn acc;\n\t}, {});\n}\n\nexport function arrayGroupByToArray<T>(array: readonly T[], key: keyof T): Array<{ key: string; items: T[] }> {\n\tconst grouped = array.reduce<Record<string, T[]>>((acc, item) => {\n\t\tconst groupKey = String(item[key]);\n\t\t(acc[groupKey] ||= []).push(item);\n\t\treturn acc;\n\t}, {});\n\n\treturn Object.entries(grouped).map(([key, items]) => ({\n\t\tkey,\n\t\titems\n\t}));\n}\n\nexport function arrayUniqueBy<T>(array: readonly T[], key: keyof T): T[] {\n\tconst seen = new Set<string>();\n\treturn array.filter((item) => {\n\t\tconst value = String(item[key]);\n\t\tif (seen.has(value)) return false;\n\t\tseen.add(value);\n\t\treturn true;\n\t});\n}\n\n/**\n * Удаляет дубликаты из массива с сохранением первого вхождения.\n *\n * Нужна для нормализации списков примитивных значений перед передачей\n * в кеш-ключи, SQL-запросы и другие слои, где повторные элементы не несут смысла.\n */\nexport function arrayDeduplicate<T>(array: readonly T[]): T[] {\n\tconst out: T[] = [];\n\tconst seen = new Set<T>();\n\n\tfor (const item of array) {\n\t\tif (seen.has(item)) continue;\n\n\t\tseen.add(item);\n\t\tout.push(item);\n\t}\n\n\treturn out;\n}\n\n/**\n * Фильтрует массив идентификаторов: оставляет только присутствующие в `allowedIds`,\n * удаляет дубликаты, исключает пустые строки.\n *\n * Зачем: унификация нормализации пользовательских списков ID\n * (grouped columns, locked visible columns и т.п.) перед вычислением layout.\n */\nexport function filterAndDeduplicateIds<TId extends string>(ids: readonly string[] | undefined, allowedIds: readonly TId[]): TId[] {\n\tconst known = new Map<string, TId>(allowedIds.map((id) => [id, id]));\n\tconst out: TId[] = [];\n\tconst seen = new Set<string>();\n\n\tfor (const id of ids ?? []) {\n\t\tif (!id || seen.has(id)) continue;\n\t\tconst knownId = known.get(id);\n\t\tif (!knownId) continue;\n\t\tseen.add(id);\n\t\tout.push(knownId);\n\t}\n\n\treturn out;\n}\n\nexport function appendMissingIds<TId extends string>(baseIds: readonly TId[], idsToAppend: readonly TId[]): TId[] {\n\tconst out = [...baseIds];\n\tconst seen = new Set(baseIds);\n\n\tfor (const id of idsToAppend) {\n\t\tif (!id || seen.has(id)) continue;\n\t\tseen.add(id);\n\t\tout.push(id);\n\t}\n\n\treturn out;\n}\n\nexport function pickExistingMapValues<TKey, TValue>(keys: readonly TKey[], valuesByKey: ReadonlyMap<TKey, TValue>): TValue[] {\n\tconst out: TValue[] = [];\n\n\tfor (const key of keys) {\n\t\tconst value = valuesByKey.get(key);\n\n\t\tif (value !== undefined) {\n\t\t\tout.push(value);\n\t\t}\n\t}\n\n\treturn out;\n}\n\nexport function arraysEqual<T>(left: readonly T[], right: readonly T[]): boolean {\n\tif (left.length !== right.length) return false;\n\n\tfor (let index = 0; index < left.length; index++) {\n\t\tif (left[index] !== right[index]) return false;\n\t}\n\n\treturn true;\n}\n\nexport function moveItem<T>(items: readonly T[], from: number, to: number): T[] {\n\tif (from === to) return [...items];\n\tif (from < 0 || to < 0 || from >= items.length || to >= items.length) return [...items];\n\n\tconst next = [...items];\n\tconst [item] = next.splice(from, 1);\n\tif (item === undefined) return [...items];\n\tnext.splice(to, 0, item);\n\n\treturn next;\n}\n\nexport function normalizeObjects<T, K extends keyof T, O = T>(\n\titems: readonly T[] | undefined,\n\tkey: K,\n\tcopyist?: ((item: T, key: T[K]) => O) | false\n): O[] | undefined {\n\tif (!items) return undefined;\n\n\tconst out: O[] = [];\n\tconst seen = new Set<T[K]>();\n\tconst copyFn = (() => {\n\t\tif (typeof copyist === \"boolean\" && copyist === false) {\n\t\t\treturn (item: T): O => item as unknown as O;\n\t\t}\n\t\tif (typeof copyist === \"function\") {\n\t\t\treturn copyist;\n\t\t}\n\t\treturn (item: T): O => ({ ...item }) as unknown as O;\n\t})();\n\n\tfor (const item of items) {\n\t\tconst normalizedKey = normalizeText(item[key]) as T[K];\n\t\tif (!normalizedKey || seen.has(normalizedKey)) continue;\n\t\tseen.add(normalizedKey);\n\t\tout.push(copyFn(item, normalizedKey));\n\t}\n\n\treturn out.length ? out : undefined;\n}\n\nexport function normalizeStringArray(items: readonly string[] | undefined): string[] | undefined {\n\tif (!items?.length) return undefined;\n\n\tconst out: string[] = [];\n\tconst seen = new Set<string>();\n\n\tfor (const item of items) {\n\t\tconst value = item.trim();\n\t\tif (!value || seen.has(value)) continue;\n\n\t\tseen.add(value);\n\t\tout.push(value);\n\t}\n\n\treturn out.length ? out : undefined;\n}\n\nexport function addUnique(target: string[], seen: Set<string>, fieldId: string | undefined): void {\n\tconst normalizedId = fieldId?.trim();\n\tif (!normalizedId || seen.has(normalizedId)) return;\n\tseen.add(normalizedId);\n\ttarget.push(normalizedId);\n}\n","export type ReorderAction = \"start\" | \"end\" | \"up\" | \"down\";\n\nfunction resolveTargetIndex(args: { index: number; size: number; action: ReorderAction }): number {\n\tconst { index, size, action } = args;\n\n\tswitch (action) {\n\t\tcase \"start\":\n\t\t\treturn 0;\n\t\tcase \"end\":\n\t\t\treturn size - 1;\n\t\tcase \"up\":\n\t\t\treturn index - 1;\n\t\tcase \"down\":\n\t\t\treturn index + 1;\n\t}\n}\n\n/**\n * Перемещает элемент списка по одному из предопределённых действий.\n */\nexport function moveArrayItemByIndex<T>(items: readonly T[], index: number, action: ReorderAction): T[] {\n\tconst nextItems = [...items];\n\tif (index < 0 || index >= nextItems.length) return nextItems;\n\n\tconst targetIndex = resolveTargetIndex({\n\t\tindex,\n\t\tsize: nextItems.length,\n\t\taction\n\t});\n\tif (targetIndex < 0 || targetIndex >= nextItems.length || targetIndex === index) return nextItems;\n\n\tconst [item] = nextItems.splice(index, 1);\n\n\tif (item === undefined) return nextItems;\n\n\tnextItems.splice(targetIndex, 0, item);\n\treturn nextItems;\n}\n\n/**\n * Перемещает элемент списка из одного индекса в другой.\n */\nexport function moveArrayItem<T>(items: readonly T[], fromIndex: number, toIndex: number): T[] {\n\tconst nextItems = [...items];\n\n\tif (fromIndex < 0 || fromIndex >= nextItems.length || toIndex < 0 || toIndex >= nextItems.length || fromIndex === toIndex) {\n\t\treturn nextItems;\n\t}\n\n\tconst [item] = nextItems.splice(fromIndex, 1);\n\n\tif (item === undefined) {\n\t\treturn nextItems;\n\t}\n\n\tnextItems.splice(toIndex, 0, item);\n\treturn nextItems;\n}\n"],"mappings":";AAAA,SAAgB,EAAc,GAAoC;CACjE,IAAI,OAAO,KAAU,UAAU;CAE/B,IAAM,IAAa,EAAM,KAAK;CAC9B,OAAO,EAAW,SAAS,IAAI,IAAa,KAAA;AAC7C;AAEA,SAAgB,EAA0B,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B;;;ACxLA,SAAS,EAAmB,GAAsE;CACjG,IAAM,EAAE,UAAO,SAAM,cAAW;CAEhC,QAAQ,GAAR;EACC,KAAK,SACJ,OAAO;EACR,KAAK,OACJ,OAAO,IAAO;EACf,KAAK,MACJ,OAAO,IAAQ;EAChB,KAAK,QACJ,OAAO,IAAQ;CACjB;AACD;AAKA,SAAgB,EAAwB,GAAqB,GAAe,GAA4B;CACvG,IAAM,IAAY,CAAC,GAAG,CAAK;CAC3B,IAAI,IAAQ,KAAK,KAAS,EAAU,QAAQ,OAAO;CAEnD,IAAM,IAAc,EAAmB;EACtC;EACA,MAAM,EAAU;EAChB;CACD,CAAC;CACD,IAAI,IAAc,KAAK,KAAe,EAAU,UAAU,MAAgB,GAAO,OAAO;CAExF,IAAM,CAAC,KAAQ,EAAU,OAAO,GAAO,CAAC;CAKxC,OAHI,MAAS,KAAA,KAEb,EAAU,OAAO,GAAa,GAAG,CAAI,GAFN;AAIhC;AAKA,SAAgB,EAAiB,GAAqB,GAAmB,GAAsB;CAC9F,IAAM,IAAY,CAAC,GAAG,CAAK;CAE3B,IAAI,IAAY,KAAK,KAAa,EAAU,UAAU,IAAU,KAAK,KAAW,EAAU,UAAU,MAAc,GACjH,OAAO;CAGR,IAAM,CAAC,KAAQ,EAAU,OAAO,GAAW,CAAC;CAO5C,OALI,MAAS,KAAA,KAIb,EAAU,OAAO,GAAS,GAAG,CAAI,GAHzB;AAKT"}
1
+ {"version":3,"file":"array-bd7LYFto.js","names":[],"sources":["../../src/formatters/strings/normalizeText.ts","../../src/array/array.ts","../../src/array/reorder.ts"],"sourcesContent":["export function normalizeText(value: unknown): string | undefined {\n\tif (typeof value !== \"string\") return undefined;\n\n\tconst normalized = value.trim();\n\treturn normalized.length > 0 ? normalized : undefined;\n}\n\nexport function normalizeTextWithFallback(value: unknown, fallback = \"\") {\n\treturn normalizeText(value) ?? fallback;\n}\n\nexport function normalizeRequiredText(value: unknown) {\n\treturn normalizeTextWithFallback(value);\n}\n\nexport function normalizeTextToLower(value: unknown): string {\n\tconst normalized = normalizeText(value);\n\treturn normalized ? normalized.toLowerCase() : \"\";\n}\n\nexport function toSafeString(value: unknown): string {\n\treturn value == null ? \"\" : String(value);\n}\n\nconst STRING_SPACES_PATTERN = /[\\s\\u00a0\\u202f]+/gu;\n\n/**\n * Нормализует пользовательский текст: убирает пробелы по краям\n * и сворачивает любые подряд идущие пробельные символы в один обычный пробел.\n */\nexport function normalizeTextSpaces(value: unknown): string {\n\treturn normalizeRequiredText(value).replace(STRING_SPACES_PATTERN, \" \");\n}\n","import { normalizeText } from \"../formatters/strings\";\n\nexport function arrayGroupBy<T>(array: readonly T[], key: keyof T): Record<string, T[]> {\n\treturn array.reduce<Record<string, T[]>>((acc, item) => {\n\t\tconst groupKey = String(item[key]);\n\t\t(acc[groupKey] ||= []).push(item);\n\t\treturn acc;\n\t}, {});\n}\n\nexport function arrayToMap<T>(array: readonly T[], key: keyof T): Record<string, T> {\n\treturn array.reduce<Record<string, T>>((acc, item) => {\n\t\tconst groupKey = String(item[key]);\n\t\tif (!acc[groupKey]) {\n\t\t\tacc[groupKey] = item;\n\t\t}\n\t\treturn acc;\n\t}, {});\n}\n\nexport function arrayGroupByToArray<T>(array: readonly T[], key: keyof T): Array<{ key: string; items: T[] }> {\n\tconst grouped = array.reduce<Record<string, T[]>>((acc, item) => {\n\t\tconst groupKey = String(item[key]);\n\t\t(acc[groupKey] ||= []).push(item);\n\t\treturn acc;\n\t}, {});\n\n\treturn Object.entries(grouped).map(([key, items]) => ({\n\t\tkey,\n\t\titems\n\t}));\n}\n\nexport function arrayUniqueBy<T>(array: readonly T[], key: keyof T): T[] {\n\tconst seen = new Set<string>();\n\treturn array.filter((item) => {\n\t\tconst value = String(item[key]);\n\t\tif (seen.has(value)) return false;\n\t\tseen.add(value);\n\t\treturn true;\n\t});\n}\n\n/**\n * Удаляет дубликаты из массива с сохранением первого вхождения.\n *\n * Нужна для нормализации списков примитивных значений перед передачей\n * в кеш-ключи, SQL-запросы и другие слои, где повторные элементы не несут смысла.\n */\nexport function arrayDeduplicate<T>(array: readonly T[]): T[] {\n\tconst out: T[] = [];\n\tconst seen = new Set<T>();\n\n\tfor (const item of array) {\n\t\tif (seen.has(item)) continue;\n\n\t\tseen.add(item);\n\t\tout.push(item);\n\t}\n\n\treturn out;\n}\n\n/**\n * Фильтрует массив идентификаторов: оставляет только присутствующие в `allowedIds`,\n * удаляет дубликаты, исключает пустые строки.\n *\n * Зачем: унификация нормализации пользовательских списков ID\n * (grouped columns, locked visible columns и т.п.) перед вычислением layout.\n */\nexport function filterAndDeduplicateIds<TId extends string>(ids: readonly string[] | undefined, allowedIds: readonly TId[]): TId[] {\n\tconst known = new Map<string, TId>(allowedIds.map((id) => [id, id]));\n\tconst out: TId[] = [];\n\tconst seen = new Set<string>();\n\n\tfor (const id of ids ?? []) {\n\t\tif (!id || seen.has(id)) continue;\n\t\tconst knownId = known.get(id);\n\t\tif (!knownId) continue;\n\t\tseen.add(id);\n\t\tout.push(knownId);\n\t}\n\n\treturn out;\n}\n\nexport function appendMissingIds<TId extends string>(baseIds: readonly TId[], idsToAppend: readonly TId[]): TId[] {\n\tconst out = [...baseIds];\n\tconst seen = new Set(baseIds);\n\n\tfor (const id of idsToAppend) {\n\t\tif (!id || seen.has(id)) continue;\n\t\tseen.add(id);\n\t\tout.push(id);\n\t}\n\n\treturn out;\n}\n\nexport function pickExistingMapValues<TKey, TValue>(keys: readonly TKey[], valuesByKey: ReadonlyMap<TKey, TValue>): TValue[] {\n\tconst out: TValue[] = [];\n\n\tfor (const key of keys) {\n\t\tconst value = valuesByKey.get(key);\n\n\t\tif (value !== undefined) {\n\t\t\tout.push(value);\n\t\t}\n\t}\n\n\treturn out;\n}\n\nexport function arraysEqual<T>(left: readonly T[], right: readonly T[]): boolean {\n\tif (left.length !== right.length) return false;\n\n\tfor (let index = 0; index < left.length; index++) {\n\t\tif (left[index] !== right[index]) return false;\n\t}\n\n\treturn true;\n}\n\nexport function moveItem<T>(items: readonly T[], from: number, to: number): T[] {\n\tif (from === to) return [...items];\n\tif (from < 0 || to < 0 || from >= items.length || to >= items.length) return [...items];\n\n\tconst next = [...items];\n\tconst [item] = next.splice(from, 1);\n\tif (item === undefined) return [...items];\n\tnext.splice(to, 0, item);\n\n\treturn next;\n}\n\nexport function normalizeObjects<T, K extends keyof T, O = T>(\n\titems: readonly T[] | undefined,\n\tkey: K,\n\tcopyist?: ((item: T, key: T[K]) => O) | false\n): O[] | undefined {\n\tif (!items) return undefined;\n\n\tconst out: O[] = [];\n\tconst seen = new Set<T[K]>();\n\tconst copyFn = (() => {\n\t\tif (typeof copyist === \"boolean\" && copyist === false) {\n\t\t\treturn (item: T): O => item as unknown as O;\n\t\t}\n\t\tif (typeof copyist === \"function\") {\n\t\t\treturn copyist;\n\t\t}\n\t\treturn (item: T): O => ({ ...item }) as unknown as O;\n\t})();\n\n\tfor (const item of items) {\n\t\tconst normalizedKey = normalizeText(item[key]) as T[K];\n\t\tif (!normalizedKey || seen.has(normalizedKey)) continue;\n\t\tseen.add(normalizedKey);\n\t\tout.push(copyFn(item, normalizedKey));\n\t}\n\n\treturn out.length ? out : undefined;\n}\n\nexport function normalizeStringArray(items: readonly string[] | undefined): string[] | undefined {\n\tif (!items?.length) return undefined;\n\n\tconst out: string[] = [];\n\tconst seen = new Set<string>();\n\n\tfor (const item of items) {\n\t\tconst value = item.trim();\n\t\tif (!value || seen.has(value)) continue;\n\n\t\tseen.add(value);\n\t\tout.push(value);\n\t}\n\n\treturn out.length ? out : undefined;\n}\n\nexport function addUnique(target: string[], seen: Set<string>, fieldId: string | undefined): void {\n\tconst normalizedId = fieldId?.trim();\n\tif (!normalizedId || seen.has(normalizedId)) return;\n\tseen.add(normalizedId);\n\ttarget.push(normalizedId);\n}\n","// Тип действия и его обработка используют одни значения направления перестановки.\nconst REORDER_ACTION_START = \"start\";\nconst REORDER_ACTION_END = \"end\";\nconst REORDER_ACTION_UP = \"up\";\nconst REORDER_ACTION_DOWN = \"down\";\n\nexport type ReorderAction = typeof REORDER_ACTION_START | typeof REORDER_ACTION_END | typeof REORDER_ACTION_UP | typeof REORDER_ACTION_DOWN;\n\nfunction resolveTargetIndex(args: { index: number; size: number; action: ReorderAction }): number {\n\tconst { index, size, action } = args;\n\n\tswitch (action) {\n\t\tcase REORDER_ACTION_START:\n\t\t\treturn 0;\n\t\tcase REORDER_ACTION_END:\n\t\t\treturn size - 1;\n\t\tcase REORDER_ACTION_UP:\n\t\t\treturn index - 1;\n\t\tcase REORDER_ACTION_DOWN:\n\t\t\treturn index + 1;\n\t}\n}\n\n/**\n * Перемещает элемент списка по одному из предопределённых действий.\n */\nexport function moveArrayItemByIndex<T>(items: readonly T[], index: number, action: ReorderAction): T[] {\n\tconst nextItems = [...items];\n\tif (index < 0 || index >= nextItems.length) return nextItems;\n\n\tconst targetIndex = resolveTargetIndex({\n\t\tindex,\n\t\tsize: nextItems.length,\n\t\taction\n\t});\n\tif (targetIndex < 0 || targetIndex >= nextItems.length || targetIndex === index) return nextItems;\n\n\tconst [item] = nextItems.splice(index, 1);\n\n\tif (item === undefined) return nextItems;\n\n\tnextItems.splice(targetIndex, 0, item);\n\treturn nextItems;\n}\n\n/**\n * Перемещает элемент списка из одного индекса в другой.\n */\nexport function moveArrayItem<T>(items: readonly T[], fromIndex: number, toIndex: number): T[] {\n\tconst nextItems = [...items];\n\n\tif (fromIndex < 0 || fromIndex >= nextItems.length || toIndex < 0 || toIndex >= nextItems.length || fromIndex === toIndex) {\n\t\treturn nextItems;\n\t}\n\n\tconst [item] = nextItems.splice(fromIndex, 1);\n\n\tif (item === undefined) {\n\t\treturn nextItems;\n\t}\n\n\tnextItems.splice(toIndex, 0, item);\n\treturn nextItems;\n}\n"],"mappings":";AAAA,SAAgB,EAAc,GAAoC;CACjE,IAAI,OAAO,KAAU,UAAU;CAE/B,IAAM,IAAa,EAAM,KAAK;CAC9B,OAAO,EAAW,SAAS,IAAI,IAAa,KAAA;AAC7C;AAEA,SAAgB,EA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