odant-work 1.0.91 → 1.0.93

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 (732) hide show
  1. package/#system/certs/russian_trusted_root_ca.pem +32 -32
  2. package/#system/mail.json.example +9 -9
  3. package/#system/package-manifest.json +635 -685
  4. package/#system/settings.json.example +3 -3
  5. package/{models/$ai → $server}/$folder/$class/$ai/class.js +11 -11
  6. package/{models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → $server/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js} +384 -430
  7. package/$server/$folder/$class/$data/handlers/pages/form/objects/$handler/class.js +2158 -0
  8. package/$server/$folder/$class/$data/handlers/pages/form/objects/object/$handler/class.js +1377 -0
  9. package/$server/$folder/$class/$domain/class.js +4 -4
  10. package/$server/$folder/$class/$domain/handlers/methods/restore/$handler/class.js +5 -5
  11. package/$server/$folder/$class/$domain/readme.md +1 -1
  12. package/$server/$folder/$class/$handler/$trigger/class.js +3 -3
  13. package/$server/$folder/$class/$handler/class.js +9 -9
  14. package/$server/$folder/$class/$handler/handlers/pages/editor/$handler/class.js +5 -5
  15. package/$server/$folder/$class/$handler/readme.md +23 -23
  16. package/$server/$folder/$class/$module/$mcp/class.js +342 -0
  17. package/$server/$folder/$class/$module/$mcp/handlers/pages/form/system/mcp/$handler/class.js +158 -0
  18. package/{models/$ai/$folder/$class → $server/$folder/$class/$module}/$provider/class.js +1 -1
  19. package/{models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → $server/$folder/$class/$module/$provider/handlers/pages/form/system/ai/$handler/class.js} +156 -166
  20. package/$server/$folder/$class/$module/$provider/readme.md +16 -0
  21. package/$server/$folder/$class/$module/class.js +7 -399
  22. package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/modules → modules}/$handler/class.js +1 -0
  23. package/$server/$folder/$class/$structure/$project/$folder/$class/$structure/$project/class.js +4 -0
  24. package/$server/$folder/$class/$structure/{$organization → $project}/$folder/$class/$structure/class.js +1 -1
  25. package/$server/$folder/$class/$structure/$project/class.js +11 -8
  26. package/$server/$folder/$class/$structure/{$organization/handlers/pages/site/$handler/site.js → $project/handlers/pages/site/$handler/class.js} +352 -365
  27. package/$server/$folder/$class/$structure/$project/readme.md +3 -11
  28. package/$server/$folder/$class/$structure/$server/handlers/methods/distro/$handler/class.js +1 -1
  29. package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/license/$handler/license.js → license/$handler/class.js} +104 -103
  30. package/$server/$folder/$class/$structure/$server/handlers/pages/site/$handler/{site.js → class.js} +45 -30
  31. package/$server/$folder/$class/$structure/$user/class.js +2 -2
  32. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +3 -0
  33. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/messengers/$handler/class.js +3 -0
  34. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/modules/$handler/class.js +3 -0
  35. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/{$handler/tabs/profile/$handler/profile.js → profile/$handler/class.js} +6 -2
  36. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/skills/$handler/class.js +3 -0
  37. package/$server/$folder/$class/$structure/ai/system.md +1 -1
  38. package/$server/$folder/$class/$structure/class.js +39 -1
  39. package/$server/$folder/$class/$structure/handlers/methods/archive/$handler/class.js +3 -3
  40. package/$server/$folder/$class/$structure/handlers/pages/data/$handler/class.js +308 -5
  41. package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/class.js +14 -3
  42. package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/class.js +1281 -7
  43. package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/readme.md +40 -40
  44. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +2216 -6
  45. package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/class.js +1304 -6
  46. package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/class.js +305 -5
  47. package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/agent/$handler/agent.js → agent/$handler/class.js} +329 -320
  48. package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/database/$handler/database.js → database/$handler/class.js} +510 -577
  49. package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/messengers/$handler/messengers.js → messengers/$handler/class.js} +143 -144
  50. package/$server/$folder/$class/$structure/handlers/pages/form/system/modules/$handler/class.js +270 -0
  51. package/$server/$folder/$class/$structure/handlers/pages/form/system/skills/$handler/class.js +256 -0
  52. package/$server/$folder/$class/$structure/handlers/pages/form/system/staff/$handler/class.js +2114 -0
  53. package/$server/$folder/$class/$structure/handlers/pages/site/$handler/class.js +229 -4
  54. package/$server/$folder/$class/$structure/handlers/pages/site/$handler/readme.md +1 -1
  55. package/$server/$folder/$class/$structure/readme.md +4 -4
  56. package/$server/$folder/$class/ai/agents/builder.md +2 -2
  57. package/$server/$folder/$class/ai/agents/org-architect.md +5 -5
  58. package/$server/$folder/$class/ai/agents/readme.md +2 -2
  59. package/$server/$folder/$class/ai/agents/schema-validator.md +2 -2
  60. package/$server/$folder/$class/ai/config.js +19 -19
  61. package/$server/$folder/$class/ai/prompt/$method/class.js +41 -41
  62. package/$server/$folder/$class/ai/readme.md +1 -1
  63. package/$server/$folder/$class/ai/skills/accounting-design.md +1 -1
  64. package/$server/$folder/$class/ai/skills/approval-flow.md +14 -14
  65. package/$server/$folder/$class/ai/skills/backup-check.md +13 -13
  66. package/$server/$folder/$class/ai/skills/computer.md +27 -27
  67. package/$server/$folder/$class/ai/skills/data-modeling.md +1 -1
  68. package/$server/$folder/$class/ai/skills/delegate-task.md +15 -15
  69. package/$server/$folder/$class/ai/skills/external-signup.md +14 -14
  70. package/$server/$folder/$class/ai/skills/import-table.md +1 -1
  71. package/$server/$folder/$class/ai/skills/onboarding.md +15 -15
  72. package/$server/$folder/$class/ai/skills/orchestration.md +41 -41
  73. package/$server/$folder/$class/ai/skills/org-structure.md +1 -1
  74. package/$server/$folder/$class/ai/skills/work-scenarios.md +9 -9
  75. package/$server/$folder/$class/ai/system.md +36 -36
  76. package/$server/$folder/$class/class.js +0 -3
  77. package/$server/$folder/$class/handlers/pages/form/folder/$handler/class.js +3 -0
  78. package/$server/$folder/$class/handlers/pages/form/system/$handler/class.js +2 -4
  79. package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/files → files}/$handler/class.js +2 -0
  80. package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/requisites/$handler/requisites.js → requisites/$handler/class.js} +43 -36
  81. package/$server/$folder/$class/handlers/pages/storage/$handler/class.js +25 -6
  82. package/$server/$folder/$file/$audio/handlers/preview/$handler/class.js +3 -3
  83. package/$server/$folder/$file/$audio/handlers/preview/$handler/preview.js +88 -88
  84. package/$server/$folder/$file/$call/class.js +10 -10
  85. package/$server/$folder/$file/$call/handlers/preview/$handler/class.js +4 -4
  86. package/$server/$folder/$file/$call/triggers/on_save/$trigger/class.js +48 -48
  87. package/$server/$folder/$file/$data/class.js +16 -16
  88. package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/class.js +31 -4
  89. package/$server/$folder/$file/$devs/$js/class.js +2 -2
  90. package/$server/$folder/$file/$devs/$json/class.js +2 -2
  91. package/$server/$folder/$file/$devs/$ts/class.js +2 -2
  92. package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/class.js +30 -2
  93. package/$server/$folder/$file/$eml/class.js +17 -17
  94. package/$server/$folder/$file/$ics/class.js +44 -44
  95. package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/class.js +10 -2
  96. package/$server/$folder/$file/$ics/handlers/preview/$handler/class.js +3 -3
  97. package/$server/$folder/$file/$ics/handlers/preview/$handler/preview.js +67 -67
  98. package/$server/$folder/$file/$ics/readme.md +21 -21
  99. package/$server/$folder/$file/$image/$svg/class.js +11 -11
  100. package/$server/$folder/$file/$image/handlers/preview/$handler/class.js +3 -3
  101. package/$server/$folder/$file/$image/handlers/preview/$handler/preview.js +33 -33
  102. package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/class.js +82 -2
  103. package/$server/$folder/$file/$logs/class.js +39 -39
  104. package/$server/$folder/$file/$logs/handlers/methods/txt-test/$handler/class.js +4 -4
  105. package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/class.js +60 -2
  106. package/$server/$folder/$file/$office/$outlook/$ics/class.js +227 -227
  107. package/$server/$folder/$file/$office/$word/$rtf/template.rtf +159 -159
  108. package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/class.js +1699 -2
  109. package/$server/$folder/$file/$task/class.js +2 -2
  110. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +827 -2
  111. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/readme.md +2 -2
  112. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/feed.js +17 -0
  113. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/panel.js +7 -1
  114. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/util.js +1 -0
  115. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/voice-policy.js +6 -2
  116. package/$server/$folder/$file/$task/handlers/preview/$handler/class.js +3 -3
  117. package/$server/$folder/$file/$task/readme.md +32 -32
  118. package/$server/$folder/$file/$txt/handlers/preview/$handler/class.js +3 -3
  119. package/$server/$folder/$file/$txt/handlers/preview/$handler/preview.js +41 -41
  120. package/$server/$folder/$file/$video/handlers/preview/$handler/class.js +4 -4
  121. package/$server/$folder/$file/$video/handlers/preview/$handler/preview.js +13 -13
  122. package/$server/$folder/$file/class.js +2 -2
  123. package/$server/$folder/$file/handlers/methods/download/$handler/class.js +2 -2
  124. package/$server/$folder/$file/handlers/methods/download/$handler/download.js +4 -4
  125. package/$server/$folder/$file/handlers/pages/form/$handler/class.js +2 -2
  126. package/$server/$folder/$file/handlers/pages/form/file/$handler/class.js +32 -2
  127. package/$server/$folder/$file/handlers/pages/form/folder/$handler/class.js +3 -0
  128. package/$server/$folder/$file/readme.md +31 -31
  129. package/$server/$folder/class.js +11 -11
  130. package/$server/$folder/handlers/methods/create/$handler/class.js +35 -38
  131. package/$server/$folder/handlers/pages/form/$handler/class.js +2469 -5
  132. package/$server/$folder/handlers/pages/form/folder/$handler/class.js +22 -0
  133. package/$server/$folder/handlers/readme.md +1 -1
  134. package/$server/$folder/lib/chat-item/chat-item.js +4 -4
  135. package/$server/$folder/lib/class-picker/class-picker.js +8 -5
  136. package/$server/$folder/lib/consultant/consultant.js +5 -5
  137. package/$server/$folder/lib/email/settings.js +82 -82
  138. package/$server/$folder/lib/file-viewer/file-viewer.js +8 -8
  139. package/$server/$folder/lib/icon/icon.js +1 -1
  140. package/$server/$folder/lib/icon/user/user.js +6 -6
  141. package/$server/$folder/lib/item-data-grid/item-data-grid.js +48 -48
  142. package/$server/$folder/lib/item-data-grid/readme.md +1 -1
  143. package/$server/$folder/lib/item-form/item-form.js +84 -84
  144. package/$server/$folder/lib/item-form/readme.md +1 -1
  145. package/$server/$folder/lib/local-models-transfer/local-models-transfer.js +11 -11
  146. package/$server/$folder/lib/menu/menu.js +3 -2
  147. package/$server/$folder/lib/menu/readme.md +29 -29
  148. package/$server/$folder/lib/messenger-settings/messenger-settings.js +2 -2
  149. package/$server/$folder/lib/node/node.js +62 -25
  150. package/$server/$folder/lib/node/readme.md +29 -29
  151. package/$server/$folder/lib/pack/pack.js +4 -4
  152. package/$server/$folder/lib/prompt-bar/prompt-bar.js +2 -2
  153. package/$server/$folder/lib/site-loc/readme.md +16 -16
  154. package/$server/$folder/lib/site-loc/site-loc.js +3 -3
  155. package/$server/$folder/lib/tree/tree.js +62 -29
  156. package/.github/workflows/ci.yml +39 -39
  157. package/AGENTS.md +6 -6
  158. package/MODULES/$domain/$folder/$class/$module/class.js +5 -6
  159. package/MODULES/$domain/class.js +8 -31
  160. package/MODULES/$domain/handlers/pages/form/system/mcp/$handler/class.js +389 -0
  161. package/MODULES/$domain/readme.md +2 -2
  162. package/MODULES/MCP/.gitkeep +0 -0
  163. package/MODULES/{DaData → /320/224/320/260/320/275/320/275/321/213/320/265/DaData}/$module/class.js +2 -2
  164. package/MODULES/{Geo → /320/224/320/260/320/275/320/275/321/213/320/265/Geo}/$module/readme.md +1 -1
  165. package/MODULES/{Geo → /320/224/320/260/320/275/320/275/321/213/320/265/Geo}//320/223/320/265/320/276/321/202/320/276/321/207/320/272/320/270/$catalog/class.js +1 -1
  166. package/MODULES/{Geo → /320/224/320/260/320/275/320/275/321/213/320/265/Geo}//320/232/320/260/321/200/321/202/320/260/$catalog/class.js +2 -2
  167. package/MODULES/{Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/map.js → /320/224/320/260/320/275/320/275/321/213/320/265/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/class.js} +295 -266
  168. package/MODULES/{KLADR/$module/handlers/pages/form/kladr/$handler/kladr.js → /320/224/320/260/320/275/320/275/321/213/320/265/KLADR/$module/handlers/pages/form/kladr/$handler/class.js} +32 -25
  169. package/MODULES/{KLADR → /320/224/320/260/320/275/320/275/321/213/320/265/KLADR}//320/235/320/260/321/201/320/265/320/273/321/221/320/275/320/275/321/213/320/265 /320/277/321/203/320/275/320/272/321/202/321/213/$catalog/class.js" +1 -1
  170. package/MODULES/{KLADR → /320/224/320/260/320/275/320/275/321/213/320/265/KLADR}//320/243/320/273/320/270/321/206/321/213/$catalog/class.js +1 -1
  171. package/MODULES/{1C → /320/232/320/276/320/275/320/275/320/265/320/272/321/202/320/276/321/200/321/213/1C}/$module/class.js +1 -1
  172. package/MODULES/{Bitrix24 → /320/232/320/276/320/275/320/275/320/265/320/272/321/202/320/276/321/200/321/213/Bitrix24}/$module/class.js +1 -1
  173. package/MODULES/{YandexDisk → /320/232/320/276/320/275/320/275/320/265/320/272/321/202/320/276/321/200/321/213/YandexDisk}/$module/class.js +1 -1
  174. package/MODULES/{Marketplaces/Ozon/$module → /320/234/320/260/321/200/320/272/320/265/321/202/320/277/320/273/320/265/320/271/321/201/321/213/Ozon/$mcp}/class.js +1 -1
  175. package/MODULES/{Marketplaces/Wildberries/$module → /320/234/320/260/321/200/320/272/320/265/321/202/320/277/320/273/320/265/320/271/321/201/321/213/Wildberries/$mcp}/class.js +1 -1
  176. package/MODULES/{Marketplaces/YandexMarket/$module → /320/234/320/260/321/200/320/272/320/265/321/202/320/277/320/273/320/265/320/271/321/201/321/213/YandexMarket/$mcp}/class.js +1 -1
  177. package/{models → MODULES//320/234/320/276/320/264/320/265/320/273/320/270}/GigaChat/$provider/readme.md +24 -24
  178. package/{models → MODULES//320/234/320/276/320/264/320/265/320/273/320/270}/Local/$provider/$folder/$class/$ai/class.js +1 -1
  179. package/{models → MODULES//320/234/320/276/320/264/320/265/320/273/320/270}/Local/$provider/class.js +1 -1
  180. package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/ai/$handler/class.js +3 -0
  181. package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/models/$handler/class.js +1242 -0
  182. package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/training/$handler/class.js +244 -0
  183. package/MODULES/{Process/$module/readme.md → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Process/$module/readme.md" } +1 -1
  184. package/MODULES/{Process → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Process}//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/class.js" +3 -3
  185. package/MODULES/{Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/gantt.js" → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/class.js" } +106 -93
  186. package/MODULES/{Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/scheduler.js" → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/class.js" } +79 -71
  187. package/MODULES/{Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/bpmn.js" → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/class.js" } +297 -185
  188. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/objects/$handler/class.js" +3 -0
  189. package/MODULES/{Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/virtual.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/class.js" } +413 -390
  190. package/MODULES/{Register/CATALOGS/$catalog/readme.md → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS/$catalog/readme.md" } +1 -1
  191. package/MODULES/{Register/CATALOGS//320/224/320/276/320/263/320/276/320/262/320/276/321/200/321/213/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/224/320/276/320/263/320/276/320/262/320/276/321/200/321/213/$catalog/class.js" } +1 -1
  192. package/MODULES/{Register/CATALOGS//320/232/320/273/320/270/320/265/320/275/321/202/321/213/$virtual/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/232/320/273/320/270/320/265/320/275/321/202/321/213/$virtual/class.js" } +2 -2
  193. package/MODULES/{Register/CATALOGS//320/235/320/276/320/274/320/265/320/275/320/272/320/273/320/260/321/202/321/203/321/200/320/260/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/235/320/276/320/274/320/265/320/275/320/272/320/273/320/260/321/202/321/203/321/200/320/260/$catalog/class.js" } +1 -1
  194. package/MODULES/{Register/CATALOGS//320/237/320/260/321/200/321/202/320/270/320/270/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/237/320/260/321/200/321/202/320/270/320/270/$catalog/class.js" } +2 -2
  195. package/MODULES/{Register/CATALOGS//320/237/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/320/270/$virtual/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/237/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/320/270/$virtual/class.js" } +1 -1
  196. package/MODULES/{Register/CATALOGS//320/241/320/272/320/273/320/260/320/264/321/213/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/241/320/272/320/273/320/260/320/264/321/213/$catalog/class.js" } +2 -2
  197. package/MODULES/{Register/CATALOGS//320/241/320/276/321/202/321/200/321/203/320/264/320/275/320/270/320/272/320/270/$virtual/$folder/$class/$data/$catalog/$virtual/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/241/320/276/321/202/321/200/321/203/320/264/320/275/320/270/320/272/320/270/$virtual/$folder/$class/$data/$catalog/$virtual/class.js" } +2 -2
  198. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/CATALOGS//320/241/320/276/321/202/321/200/321/203/320/264/320/275/320/270/320/272/320/270//320/222 /320/276/321/202/320/277/321/203/321/201/320/272/320/265/$virtual/class.js" +1 -1
  199. package/MODULES/{Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213/$catalog/$folder/$class/$data/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213/$catalog/$folder/$class/$data/$catalog/class.js" } +2 -2
  200. package/MODULES/{Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213//320/230/320/237/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213//320/230/320/237/$catalog/class.js" } +2 -2
  201. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213//320/244/320/270/320/267. /320/273/320/270/321/206/320/260/$catalog/class.js" +2 -2
  202. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213//320/256/321/200. /320/273/320/270/321/206/320/260/$catalog/class.js" +2 -2
  203. package/MODULES/{Register/CATALOGS//320/242/321/200/320/260/320/275/321/201/320/277/320/276/321/200/321/202/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS//320/242/321/200/320/260/320/275/321/201/320/277/320/276/321/200/321/202/$catalog/class.js" } +2 -2
  204. package/MODULES/{Register/OPERATIONS/$operation/readme.md → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS/$operation/readme.md" } +1 -1
  205. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/224/320/276/321/201/321/202/320/260/320/262/320/272/320/260/$operation/class.js" +22 -0
  206. package/MODULES/{Register/OPERATIONS//320/227/320/260/321/200/320/277/320/273/320/260/321/202/320/260/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/227/320/260/321/200/320/277/320/273/320/260/321/202/320/260/$operation/class.js" } +7 -7
  207. package/MODULES/{Register/OPERATIONS//320/230/320/275/320/262/320/265/320/275/321/202/320/260/321/200/320/270/320/267/320/260/321/206/320/270/321/217/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/230/320/275/320/262/320/265/320/275/321/202/320/260/321/200/320/270/320/267/320/260/321/206/320/270/321/217/$operation/class.js" } +9 -9
  208. package/MODULES/{Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213/$operation/$folder/$class/$data/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213/$operation/$folder/$class/$data/$operation/class.js" } +1 -1
  209. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/222/320/265/321/200/320/275/321/203/321/202/321/214 /320/270/320/267 /320/276/321/202/320/277/321/203/321/201/320/272/320/260/$operation/class.js" +14 -0
  210. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/236/321/202/320/277/321/200/320/260/320/262/320/270/321/202/321/214 /320/262 /320/276/321/202/320/277/321/203/321/201/320/272/$operation/class.js" +15 -0
  211. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/237/321/200/320/270/321/221/320/274 /320/275/320/260 /321/200/320/260/320/261/320/276/321/202/321/203/$operation/class.js" +3 -3
  212. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/243/320/262/320/276/320/273/321/214/320/275/320/265/320/275/320/270/320/265/$operation/class.js" +14 -0
  213. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/220/320/262/320/260/320/275/321/201/320/276/320/262/321/213/320/271 /320/276/321/202/321/207/321/221/321/202/$operation/class.js" +17 -0
  214. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/237/320/232/320/236/$operation/class.js" +18 -0
  215. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/240/320/232/320/236/$operation/class.js" +17 -0
  216. package/MODULES/{Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$operation/$folder/$class/$data/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$operation/$folder/$class/$data/$operation/class.js" } +1 -1
  217. package/MODULES/{Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270//320/227/320/262/320/276/320/275/320/276/320/272/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270//320/227/320/262/320/276/320/275/320/276/320/272/$operation/class.js" } +2 -2
  218. package/MODULES/{Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270//320/237/320/270/321/201/321/214/320/274/320/276/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270//320/237/320/270/321/201/321/214/320/274/320/276/$operation/class.js" } +2 -2
  219. package/MODULES/{Register/OPERATIONS//320/232/320/276/320/274/320/277/320/273/320/265/320/272/321/202/320/260/321/206/320/270/321/217/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/232/320/276/320/274/320/277/320/273/320/265/320/272/321/202/320/260/321/206/320/270/321/217/$operation/class.js" } +14 -14
  220. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/236/321/201/320/275/320/276/320/262/320/275/321/213/320/265 /321/201/321/200/320/265/320/264/321/201/321/202/320/262/320/260//320/235/320/260/321/207/320/270/321/201/320/273/320/265/320/275/320/270/320/265 /320/260/320/274/320/276/321/200/321/202/320/270/320/267/320/260/321/206/320/270/320/270/$operation/class.js" +3 -3
  221. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/236/321/201/320/275/320/276/320/262/320/275/321/213/320/265 /321/201/321/200/320/265/320/264/321/201/321/202/320/262/320/260//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/320/265 /320/236/320/241/$operation/class.js" +30 -0
  222. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/236/321/201/320/275/320/276/320/262/320/275/321/213/320/265 /321/201/321/200/320/265/320/264/321/201/321/202/320/262/320/260//320/237/321/200/320/270/320/275/321/217/321/202/320/270/320/265 /320/272 /321/203/321/207/321/221/321/202/321/203 /320/236/320/241/$operation/class.js" +3 -3
  223. package/MODULES/{Register/OPERATIONS//320/237/320/265/321/200/320/265/320/274/320/265/321/211/320/265/320/275/320/270/320/265/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/237/320/265/321/200/320/265/320/274/320/265/321/211/320/265/320/275/320/270/320/265/$operation/class.js" } +7 -7
  224. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260/$operation/$folder/$class/$data/$operation/class.js" +1 -1
  225. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/227/320/260/321/200/320/277/320/273/320/260/321/202/320/260/$operation/class.js" +8 -0
  226. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/235/320/224/320/241/$operation/class.js" +1 -1
  227. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/235/320/224/320/244/320/233/$operation/class.js" +1 -1
  228. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/237/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/321/203/$operation/class.js" +11 -0
  229. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/241/321/202/321/200/320/260/321/205/320/276/320/262/321/213/320/265 /320/262/320/267/320/275/320/276/321/201/321/213/$operation/class.js" +1 -1
  230. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/320/265 /321/202/320/276/320/262/320/260/321/200/320/260/$operation/class.js" +9 -9
  231. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202/$operation/$folder/$class/$data/$operation/class.js" +1 -1
  232. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202//320/222/320/276/320/267/320/262/321/200/320/260/321/202 /320/276/321/202 /320/277/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/320/260/$operation/class.js" +11 -0
  233. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202//320/236/321/202 /320/277/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/217/$operation/class.js" +11 -0
  234. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276//320/222/321/213/320/277/321/203/321/201/320/272 /320/263/320/276/321/202/320/276/320/262/320/276/320/271 /320/277/321/200/320/276/320/264/321/203/320/272/321/206/320/270/320/270/$operation/class.js" +4 -4
  235. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276//320/237/320/265/321/200/320/265/320/264/320/260/321/207/320/260 /320/274/320/260/321/202/320/265/321/200/320/270/320/260/320/273/320/276/320/262 /320/262 /320/277/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276/$operation/class.js" +4 -4
  236. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276//320/241/320/277/320/270/321/201/320/260/320/275/320/270/320/265 /320/276/320/261/321/211/320/265/321/205/320/276/320/267/321/217/320/271/321/201/321/202/320/262/320/265/320/275/320/275/321/213/321/205 /320/267/320/260/321/202/321/200/320/260/321/202/$operation/class.js" +6 -6
  237. package/MODULES/{Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217/$operation/$folder/$class/$data/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217/$operation/$folder/$class/$data/$operation/class.js" } +5 -5
  238. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/222/320/276/320/267/320/262/321/200/320/260/321/202 /320/276/321/202 /320/277/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/217/$operation/class.js" +32 -0
  239. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/class.js" +32 -0
  240. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/241/321/207/321/221/321/202 /320/275/320/260 /320/276/320/277/320/273/320/260/321/202/321/203.html" +40 -40
  241. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/242/320/276/320/262/320/260/321/200/320/275/320/260/321/217 /320/275/320/260/320/272/320/273/320/260/320/264/320/275/320/260/321/217.html" +56 -56
  242. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/241/320/277/320/270/321/201/320/260/320/275/320/270/320/265 /320/242/320/234/320/246/$operation/class.js" +6 -6
  243. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/243/321/201/321/202/320/260/320/275/320/276/320/262/320/272/320/260 /320/275/320/276/321/200/320/274/320/260/321/202/320/270/320/262/320/260/$operation/class.js" +4 -4
  244. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/244/320/270/320/275/320/260/320/275/321/201/320/276/320/262/321/213/320/271 /321/200/320/265/320/267/321/203/320/273/321/214/321/202/320/260/321/202//320/227/320/260/320/272/321/200/321/213/321/202/320/270/320/265 /320/274/320/265/321/201/321/217/321/206/320/260/$operation/class.js" +2 -2
  245. package/MODULES/{Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/analysis.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/class.js" } +9 -4
  246. package/MODULES/{Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/postings.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/class.js" } +845 -753
  247. package/MODULES/{Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/turnovers.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/class.js" } +9 -4
  248. package/MODULES/{Register/REGISTER/$register/$folder/$class/$data/$register/$account/readme.md → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/$folder/$class/$data/$register/$account/readme.md" } +1 -1
  249. package/MODULES/{Register/REGISTER/$register/ai/skills/register-accounts.md → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/ai/skills/register-accounts.md" } +1 -1
  250. package/MODULES/{Register/REGISTER/$register/handlers/pages/form/journal/$handler/journal.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/handlers/pages/form/journal/$handler/class.js" } +382 -329
  251. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/class.js" +807 -0
  252. package/MODULES/{Register/REGISTER/$register/readme.md → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/readme.md" } +1 -1
  253. package/MODULES/{Register/REGISTER/01/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/01/$account/class.js" } +1 -1
  254. package/MODULES/{Register/REGISTER/02/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/02/$account/class.js" } +1 -1
  255. package/MODULES/{Register/REGISTER/04/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/04/$account/class.js" } +1 -1
  256. package/MODULES/{Register/REGISTER/08/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/08/$account/class.js" } +1 -1
  257. package/MODULES/{Register/REGISTER/10/$account/$folder/$class/$data/$register/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/10/$account/$folder/$class/$data/$register/$account/class.js" } +2 -2
  258. package/MODULES/{Register/REGISTER/10/01/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/10/01/$account/class.js" } +1 -1
  259. package/MODULES/{Register/REGISTER/10/05/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/10/05/$account/class.js" } +1 -1
  260. package/MODULES/{Register/REGISTER/41/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/41/$account/class.js" } +3 -3
  261. package/MODULES/{Register/REGISTER/43/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/43/$account/class.js" } +2 -2
  262. package/MODULES/{Register/REGISTER/44/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/44/$account/class.js" } +1 -1
  263. package/MODULES/{Register/REGISTER/60/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/60/$account/class.js" } +2 -2
  264. package/MODULES/{Register/REGISTER/62/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/62/$account/class.js" } +2 -2
  265. package/MODULES/{Register/REGISTER/68/01/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/68/01/$account/class.js" } +1 -1
  266. package/MODULES/{Register/REGISTER/68/02/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/68/02/$account/class.js" } +1 -1
  267. package/MODULES/{Register/REGISTER/70/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/70/$account/class.js" } +1 -1
  268. package/MODULES/{Register/REGISTER/71/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/71/$account/class.js" } +1 -1
  269. package/MODULES/{Register/REGISTER/73/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/73/$account/class.js" } +1 -1
  270. package/MODULES/{Register/REGISTER/76/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/76/$account/class.js" } +1 -1
  271. package/MODULES/{Register/REGISTER/90/01/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/90/01/$account/class.js" } +1 -1
  272. package/MODULES/{Register/REGISTER/90/02/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/90/02/$account/class.js" } +1 -1
  273. package/MODULES/{Register/REGISTER/90/03/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/90/03/$account/class.js" } +1 -1
  274. package/MODULES/{Register/REGISTER/91/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/91/$account/class.js" } +1 -1
  275. package/MODULES/{Register/REGISTER/94/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/94/$account/class.js" } +2 -2
  276. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/REGISTER//320/232/320/260/320/264/321/200/320/276/320/262/321/213/320/271 /321/200/320/265/320/267/320/265/321/200/320/262/$account/class.js" +1 -1
  277. package/MODULES/{Register/REGISTER//320/232/320/260/320/264/321/200/321/213/$account/$folder/$class/$data/$register/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER//320/232/320/260/320/264/321/200/321/213/$account/$folder/$class/$data/$register/$account/class.js" } +1 -1
  278. package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/REGISTER//320/232/320/260/320/264/321/200/321/213//320/222 /320/276/321/202/320/277/321/203/321/201/320/272/320/265/$account/class.js" +1 -1
  279. package/MODULES/{Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/240/320/260/320/261/320/276/321/202/320/260/321/216/321/202/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/240/320/260/320/261/320/276/321/202/320/260/321/216/321/202/$account/class.js" } +1 -1
  280. package/MODULES/{Register/REGISTER//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$account/class.js" } +1 -1
  281. package/MODULES/{Register/REGISTER//320/235/320/276/321/200/320/274/320/260/321/202/320/270/320/262/321/213/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER//320/235/320/276/321/200/320/274/320/260/321/202/320/270/320/262/321/213/$account/class.js" } +2 -2
  282. package/MODULES/{Register/REGISTER//320/242/320/265/321/205/320/275/320/270/321/207/320/265/321/201/320/272/320/270/320/271/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER//320/242/320/265/321/205/320/275/320/270/321/207/320/265/321/201/320/272/320/270/320/271/$account/class.js" } +1 -1
  283. package/MODULES/{Register/STRUCTS/$struct/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/STRUCTS/$struct/class.js" } +4 -4
  284. package/MODULES/{Register/STRUCTS//320/237/320/260/321/201/320/277/320/276/321/200/321/202/$struct/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/STRUCTS//320/237/320/260/321/201/320/277/320/276/321/200/321/202/$struct/class.js" } +2 -2
  285. package/NODES/$node/$folder/$class/$node/class.js +35 -35
  286. package/NODES/$node/class.js +5 -5
  287. package/NODES/$node/handlers/pages/form/network/$handler/class.js +121 -4
  288. package/PROJECTS/$domain/$folder/$class/$structure/$project/class.js +1 -2
  289. package/PROJECTS/$domain/readme.md +1 -1
  290. package/oda/benchmarks/dbmon/lib/ENV.js +213 -213
  291. package/oda/benchmarks/dbmon/lib/ga.js +11 -11
  292. package/oda/benchmarks/dbmon/lib/memory-stats.js +105 -105
  293. package/oda/benchmarks/dbmon/lib/monitor.js +69 -69
  294. package/oda/benchmarks/sierpinski/sierpinski.js +149 -149
  295. package/oda/components/editors/code-editor/code-editor.js +387 -387
  296. package/oda/components/editors/code-editor/src/ace.js +16 -16
  297. package/oda/components/editors/code-editor/src/beautify-css.js +1625 -1625
  298. package/oda/components/editors/code-editor/src/beautify-html.js +3122 -3122
  299. package/oda/components/editors/code-editor/src/beautify.js +4005 -4005
  300. package/oda/components/editors/code-editor/src/ext-beautify.js +7 -7
  301. package/oda/components/editors/code-editor/src/ext-code_lens.js +7 -7
  302. package/oda/components/editors/code-editor/src/ext-elastic_tabstops_lite.js +7 -7
  303. package/oda/components/editors/code-editor/src/ext-emmet.js +7 -7
  304. package/oda/components/editors/code-editor/src/ext-error_marker.js +7 -7
  305. package/oda/components/editors/code-editor/src/ext-hardwrap.js +7 -7
  306. package/oda/components/editors/code-editor/src/ext-keybinding_menu.js +7 -7
  307. package/oda/components/editors/code-editor/src/ext-language_tools.js +7 -7
  308. package/oda/components/editors/code-editor/src/ext-linking.js +7 -7
  309. package/oda/components/editors/code-editor/src/ext-modelist.js +7 -7
  310. package/oda/components/editors/code-editor/src/ext-options.js +7 -7
  311. package/oda/components/editors/code-editor/src/ext-prompt.js +7 -7
  312. package/oda/components/editors/code-editor/src/ext-rtl.js +7 -7
  313. package/oda/components/editors/code-editor/src/ext-searchbox.js +7 -7
  314. package/oda/components/editors/code-editor/src/ext-settings_menu.js +7 -7
  315. package/oda/components/editors/code-editor/src/ext-spellcheck.js +7 -7
  316. package/oda/components/editors/code-editor/src/ext-split.js +7 -7
  317. package/oda/components/editors/code-editor/src/ext-static_highlight.js +7 -7
  318. package/oda/components/editors/code-editor/src/ext-statusbar.js +7 -7
  319. package/oda/components/editors/code-editor/src/ext-textarea.js +7 -7
  320. package/oda/components/editors/code-editor/src/ext-themelist.js +7 -7
  321. package/oda/components/editors/code-editor/src/ext-whitespace.js +7 -7
  322. package/oda/components/editors/code-editor/src/keybinding-emacs.js +7 -7
  323. package/oda/components/editors/code-editor/src/keybinding-sublime.js +7 -7
  324. package/oda/components/editors/code-editor/src/keybinding-vim.js +7 -7
  325. package/oda/components/editors/code-editor/src/keybinding-vscode.js +7 -7
  326. package/oda/components/editors/code-editor/src/mode-css.js +7 -7
  327. package/oda/components/editors/code-editor/src/mode-html.js +7 -7
  328. package/oda/components/editors/code-editor/src/mode-javascript.js +7 -7
  329. package/oda/components/editors/code-editor/src/mode-json.js +7 -7
  330. package/oda/components/editors/code-editor/src/mode-markdown.js +7 -7
  331. package/oda/components/editors/code-editor/src/mode-svg.js +7 -7
  332. package/oda/components/editors/code-editor/src/mode-text.js +7 -7
  333. package/oda/components/editors/code-editor/src/mode-xml.js +7 -7
  334. package/oda/components/editors/code-editor/src/mode-xquery.js +7 -7
  335. package/oda/components/editors/code-editor/src/snippets/css.js +7 -7
  336. package/oda/components/editors/code-editor/src/snippets/html.js +7 -7
  337. package/oda/components/editors/code-editor/src/snippets/javascript.js +7 -7
  338. package/oda/components/editors/code-editor/src/snippets/json.js +7 -7
  339. package/oda/components/editors/code-editor/src/snippets/markdown.js +7 -7
  340. package/oda/components/editors/code-editor/src/snippets/svg.js +7 -7
  341. package/oda/components/editors/code-editor/src/snippets/text.js +7 -7
  342. package/oda/components/editors/code-editor/src/snippets/xml.js +7 -7
  343. package/oda/components/editors/code-editor/src/snippets/xquery.js +7 -7
  344. package/oda/components/editors/code-editor/src/theme-solarized_dark.js +7 -7
  345. package/oda/components/editors/code-editor/src/theme-solarized_light.js +7 -7
  346. package/oda/components/editors/markdown/markdown-editor/lib/font-awesome.min.css +3 -3
  347. package/oda/components/editors/markdown/markdown-editor/lib/readme.md +332 -332
  348. package/oda/components/editors/markdown/markdown-editor/markdown-editor.js +78 -78
  349. package/oda/components/editors/markdown/markdown-viewer/test.md +239 -239
  350. package/oda/components/editors/markdown/markdown.js +76 -76
  351. package/oda/components/inputs/block/readme.md +39 -39
  352. package/oda/components/inputs/checkbox/checkbox.js +92 -92
  353. package/oda/components/inputs/color/color.js +83 -83
  354. package/oda/components/inputs/date/date.js +40 -40
  355. package/oda/components/inputs/input/input.js +219 -219
  356. package/oda/components/inputs/link/link.js +1 -1
  357. package/oda/components/inputs/link/readme.md +42 -42
  358. package/oda/components/inputs/markdown-input/markdown-input.js +77 -77
  359. package/oda/components/inputs/numeric/numeric.js +141 -141
  360. package/oda/components/inputs/table-input/readme.md +39 -39
  361. package/oda/components/inputs/text/text.js +88 -88
  362. package/oda/components/inputs/toggle/toggle.js +101 -101
  363. package/oda/components/layouts/hexagon-layout/hexagon-layout.js +218 -218
  364. package/oda/components/menus/menu/index_old.html +140 -140
  365. package/oda/components/structure/controls-map.js +56 -56
  366. package/oda/components/structure/controls.js +29 -29
  367. package/oda/components/structure/readme.md +31 -31
  368. package/oda/components/structure/structure.js +64 -64
  369. package/oda/components/table/index.html +210 -210
  370. package/oda/components/table/lib/coerce.js +68 -68
  371. package/oda/components/table/lib/column.js +568 -568
  372. package/oda/components/table/readme.md +120 -120
  373. package/oda/components/table/router.js +86 -86
  374. package/oda/components/table/settings.js +89 -89
  375. package/oda/index.html +159 -159
  376. package/oda/tools/icons/icons-set/icons-set.js +60 -60
  377. package/oda/tools/icons/lib/svg/_makeSVG.html +41 -41
  378. package/oda/tools/icons/lib/svg/aws.svg +2679 -2679
  379. package/oda/tools/icons/lib/svg/info.json +46 -46
  380. package/oda/tools/jupyter/demo.ipynb +160 -160
  381. package/oda/tools/jupyter/lib/print_elements.js +73 -73
  382. package/oda/tools/jupyter/test-2.ipynb +305 -305
  383. package/oda/tools/jupyter/test.ipynb +603 -603
  384. package/oda/tools/styles/adoptedStyleSheets.js +333 -333
  385. package/oda/tools/tester/device-preview/devices.json +9 -9
  386. package/package.json +1 -1
  387. package/rules/rules.md +445 -445
  388. package/scripts/SYNC-README.md +107 -107
  389. package/scripts/agent-eval.mjs +223 -223
  390. package/scripts/check-architecture.mjs +25 -16
  391. package/scripts/check-ignored-code.mjs +4 -4
  392. package/scripts/demo-seed.mjs +7 -7
  393. package/scripts/dump-svn-chat.mjs +9 -9
  394. package/scripts/extract-chat-day.mjs +21 -21
  395. package/scripts/import-bis.mjs +133 -133
  396. package/scripts/import-delovaya.mjs +94 -94
  397. package/scripts/migrate-tree.mjs +454 -0
  398. package/scripts/rag-bench.mjs +166 -166
  399. package/scripts/restore-chat.mjs +166 -166
  400. package/scripts/sync-svn-git.bat +129 -129
  401. package/scripts/test-merge.mjs +75 -75
  402. package/scripts/work-desktop-bridge.mjs +101 -101
  403. package/sources/client/class.js +3 -0
  404. package/sources/client/field.js +168 -168
  405. package/sources/client/handler.js +68 -32
  406. package/sources/client/index.js +32 -32
  407. package/sources/client/readme.md +16 -16
  408. package/sources/client.js +12 -0
  409. package/sources/core.js +91 -91
  410. package/sources/data/api.js +5 -5
  411. package/sources/data/choices.js +125 -125
  412. package/sources/data/classes.js +3 -3
  413. package/sources/data/db.js +5 -6
  414. package/sources/data/print.js +2 -2
  415. package/sources/data/schema.js +5 -5
  416. package/sources/data/sql-inspector.js +8 -8
  417. package/sources/host/auto-updater.js +6 -10
  418. package/sources/host/babel-merge.js +398 -353
  419. package/sources/host/config.js +48 -48
  420. package/sources/host/index-db.js +94 -94
  421. package/sources/host/net-guard.js +228 -228
  422. package/sources/host/package-install.js +63 -63
  423. package/sources/host/push.js +86 -86
  424. package/sources/host/readme.md +41 -41
  425. package/sources/host/secret-box.js +93 -93
  426. package/sources/host/server-id.js +26 -26
  427. package/sources/host/stun.js +33 -33
  428. package/sources/host/tls-ca.js +60 -60
  429. package/sources/host/vapid.js +14 -14
  430. package/sources/host/watch.js +1 -1
  431. package/sources/index.html +1 -1
  432. package/sources/modules/a2a/server.js +608 -608
  433. package/sources/modules/agent/connections.js +442 -442
  434. package/sources/modules/agent/diff.js +69 -69
  435. package/sources/modules/agent/eval.js +222 -222
  436. package/sources/modules/agent/extensions.js +57 -30
  437. package/sources/modules/agent/hooks.js +131 -131
  438. package/sources/modules/agent/index.js +14 -11
  439. package/sources/modules/agent/log.js +43 -43
  440. package/sources/modules/agent/loop.js +65 -0
  441. package/sources/modules/agent/mcp-pool.js +253 -253
  442. package/sources/modules/agent/node-rules.js +100 -51
  443. package/sources/modules/agent/permissions.js +1 -1
  444. package/sources/modules/agent/plugins.js +4 -3
  445. package/sources/modules/agent/recovery.js +89 -89
  446. package/sources/modules/agent/scope.js +387 -0
  447. package/sources/modules/agent/session.js +350 -15
  448. package/sources/modules/agent/taint.js +100 -100
  449. package/sources/modules/agent/tools/branch.js +311 -311
  450. package/sources/modules/agent/tools/browser.js +254 -254
  451. package/sources/modules/agent/tools/computer.js +120 -120
  452. package/sources/modules/agent/tools/connect.js +316 -316
  453. package/sources/modules/agent/tools/dev/lsp.js +334 -334
  454. package/sources/modules/agent/tools/dev/patch.js +564 -564
  455. package/sources/modules/agent/tools/memory.js +153 -153
  456. package/sources/modules/agent/tools/meta.js +61 -1
  457. package/sources/modules/agent/tools/os-files.js +358 -358
  458. package/sources/modules/agent/tools/plugins.js +80 -80
  459. package/sources/modules/agent/tools/sandbox.js +268 -268
  460. package/sources/modules/agent/tools/services.js +8 -2
  461. package/sources/modules/agent/tools/work/access.js +5 -5
  462. package/sources/modules/agent/tools/work/classes.js +24 -8
  463. package/sources/modules/agent/tools/work/common.js +6 -6
  464. package/sources/modules/agent/tools/work/data.js +2 -2
  465. package/sources/modules/agent/triggers.js +2 -2
  466. package/sources/modules/agent/twin-bus.js +5 -5
  467. package/sources/modules/agent/types.d.ts +183 -183
  468. package/sources/modules/agent/undo.js +254 -254
  469. package/sources/modules/agent/util.js +179 -179
  470. package/sources/modules/agent/voice.js +9 -9
  471. package/sources/modules/contacts/contacts.js +200 -200
  472. package/sources/modules/contacts/index.html +546 -546
  473. package/sources/modules/kladr/index.js +4 -5
  474. package/sources/modules/lan/discovery.js +192 -192
  475. package/sources/modules/lan/store.js +62 -62
  476. package/sources/modules/license/index.js +5 -5
  477. package/sources/modules/mcp/readme.md +70 -70
  478. package/sources/modules/mcp/server.js +525 -525
  479. package/sources/modules/mcp/tokens.js +140 -140
  480. package/sources/modules/nodes/identity.js +123 -123
  481. package/sources/modules/nodes/outbound.js +105 -105
  482. package/sources/modules/nodes/signing.js +71 -71
  483. package/sources/modules/notify/index.js +12 -12
  484. package/sources/modules/rag/embed-worker.js +36 -36
  485. package/sources/modules/rag/embedder.js +3 -3
  486. package/sources/modules/rag/indexer.js +1 -1
  487. package/sources/modules/rag/readme.md +70 -70
  488. package/sources/modules/rag/scope.js +3 -3
  489. package/sources/modules/rag/search.js +1 -1
  490. package/sources/modules/readme.md +21 -21
  491. package/sources/modules/sandbox/config.js +74 -74
  492. package/sources/modules/sandbox/driver.js +100 -100
  493. package/sources/modules/sandbox/images/work-computer/Dockerfile +34 -34
  494. package/sources/modules/sandbox/images/work-computer/entrypoint.sh +24 -24
  495. package/sources/modules/sandbox/manager.js +1089 -1089
  496. package/sources/modules/sandbox/readme.md +63 -63
  497. package/sources/modules/sandbox/vnc-proxy.js +296 -296
  498. package/sources/modules/trainer/dataset.js +8 -8
  499. package/sources/modules/trainer/halogen.js +37 -37
  500. package/sources/modules/trainer/huggingface.js +13 -13
  501. package/sources/modules/trainer/index.js +44 -39
  502. package/sources/modules/trainer/local-engine.js +9 -9
  503. package/sources/modules/trainer/paths.js +9 -2
  504. package/sources/modules/trainer/providers.js +126 -78
  505. package/sources/modules/trainer/runner.js +10 -10
  506. package/sources/modules/trainer/transfer.js +8 -8
  507. package/sources/server/access/audit.js +138 -138
  508. package/sources/server/access/gateway.js +1 -1
  509. package/sources/server/access/links.js +4 -4
  510. package/sources/server/access/refs.js +106 -106
  511. package/sources/server/access/workplaces.js +7 -7
  512. package/sources/server/assert-class-id.js +23 -23
  513. package/sources/server/chat-threads.js +22 -8
  514. package/sources/server/class/archive.js +7 -7
  515. package/sources/server/class/base-template.js +34 -29
  516. package/sources/server/class/distro.js +41 -33
  517. package/sources/server/class/module-status.js +380 -0
  518. package/sources/server/class/scaffold.js +2 -2
  519. package/sources/server/class/search.js +1 -1
  520. package/sources/server/class/security.js +24 -14
  521. package/sources/server/class.js +140 -124
  522. package/sources/server/external-source.js +90 -90
  523. package/sources/server/file.js +1 -1
  524. package/sources/server/folder.js +150 -44
  525. package/sources/server/handler.js +25 -12
  526. package/sources/server/index.js +12 -12
  527. package/sources/server/logs.js +5 -6
  528. package/sources/server/memory-mark.js +34 -34
  529. package/sources/server/node.js +1 -1
  530. package/sources/server/readme.md +110 -110
  531. package/sources/server/safe-node-name.js +67 -67
  532. package/sources/server/server.js +8 -6
  533. package/sources/server/upload-mark.js +24 -24
  534. package/sources/server/user.js +85 -18
  535. package/sources/server/zip-guard.js +81 -81
  536. package/whitepaper.md +568 -568
  537. package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/mcp/$handler/class.js +0 -9
  538. package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/mcp/$handler/mcp.js +0 -813
  539. package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -1
  540. package/$server/$folder/$class/$structure/$organization/$folder/$class/$data/$catalog/class.js +0 -4
  541. package/$server/$folder/$class/$structure/$organization/$folder/$class/$data/$operation/class.js +0 -4
  542. package/$server/$folder/$class/$structure/$organization/$folder/$class/$data/$register/class.js +0 -4
  543. package/$server/$folder/$class/$structure/$organization/$folder/$class/$data/$struct/class.js +0 -4
  544. package/$server/$folder/$class/$structure/$organization/$folder/$class/$domain/class.js +0 -4
  545. package/$server/$folder/$class/$structure/$organization/$folder/$class/$module/class.js +0 -4
  546. package/$server/$folder/$class/$structure/$organization/$folder/$class/$structure/$organization/class.js +0 -4
  547. package/$server/$folder/$class/$structure/$organization/class.js +0 -19
  548. package/$server/$folder/$class/$structure/$organization/icon.png +0 -0
  549. package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/$handler/tabs/license/$handler/class.js +0 -6
  550. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -3
  551. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -3
  552. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -3
  553. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/profile/$handler/class.js +0 -5
  554. package/$server/$folder/$class/$structure/handlers/pages/data/$handler/data.js +0 -313
  555. package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/explorer.js +0 -16
  556. package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/calendar.js +0 -1226
  557. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat.js +0 -2095
  558. package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/email.js +0 -1188
  559. package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/search.js +0 -289
  560. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -6
  561. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/database/$handler/class.js +0 -9
  562. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -6
  563. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -5
  564. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -281
  565. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/class.js +0 -5
  566. package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/staff.js +0 -2126
  567. package/$server/$folder/$class/$structure/handlers/pages/site/$handler/site.js +0 -240
  568. package/$server/$folder/$class/handlers/pages/form/object/$handler/class.js +0 -32
  569. package/$server/$folder/$class/handlers/pages/form/object/$handler/object.js +0 -1371
  570. package/$server/$folder/$class/handlers/pages/form/objects/$handler/class.js +0 -32
  571. package/$server/$folder/$class/handlers/pages/form/objects/$handler/objects.js +0 -2130
  572. package/$server/$folder/$class/handlers/pages/form/system/$handler/system.js +0 -309
  573. package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/files/$handler/files.js +0 -17
  574. package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/requisites/$handler/class.js +0 -16
  575. package/$server/$folder/$class/handlers/pages/storage/$handler/storage.js +0 -21
  576. package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/editor.js +0 -27
  577. package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/file.js +0 -31
  578. package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/file.js +0 -10
  579. package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/file.js +0 -72
  580. package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/file.js +0 -63
  581. package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/file.js +0 -1845
  582. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/file.js +0 -760
  583. package/$server/$folder/$file/handlers/pages/form/file/$handler/file.js +0 -29
  584. package/$server/$folder/handlers/pages/form/$handler/form.js +0 -2122
  585. package/MODULES/$domain/handlers/pages/form/system/$handler/tabs/mcp/$handler/class.js +0 -6
  586. package/MODULES/$domain/handlers/pages/form/system/$handler/tabs/mcp/$handler/mcp.js +0 -1
  587. package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/class.js +0 -24
  588. package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/class.js +0 -7
  589. package/MODULES/Marketplaces/$domain/class.js +0 -9
  590. package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/class.js" +0 -6
  591. package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/class.js" +0 -6
  592. package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/class.js" +0 -18
  593. package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/class.js +0 -5
  594. package/MODULES/Register/OPERATIONS//320/224/320/276/321/201/321/202/320/260/320/262/320/272/320/260/$operation/class.js +0 -22
  595. package/MODULES/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/222/320/265/321/200/320/275/321/203/321/202/321/214 /320/270/320/267 /320/276/321/202/320/277/321/203/321/201/320/272/320/260/$operation/class.js" +0 -14
  596. package/MODULES/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/236/321/202/320/277/321/200/320/260/320/262/320/270/321/202/321/214 /320/262 /320/276/321/202/320/277/321/203/321/201/320/272/$operation/class.js" +0 -15
  597. package/MODULES/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/243/320/262/320/276/320/273/321/214/320/275/320/265/320/275/320/270/320/265/$operation/class.js +0 -14
  598. package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/220/320/262/320/260/320/275/321/201/320/276/320/262/321/213/320/271 /320/276/321/202/321/207/321/221/321/202/$operation/class.js" +0 -17
  599. package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/237/320/232/320/236/$operation/class.js +0 -18
  600. package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/240/320/232/320/236/$operation/class.js +0 -17
  601. package/MODULES/Register/OPERATIONS//320/236/321/201/320/275/320/276/320/262/320/275/321/213/320/265 /321/201/321/200/320/265/320/264/321/201/321/202/320/262/320/260//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/320/265 /320/236/320/241/$operation/class.js" +0 -30
  602. package/MODULES/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/227/320/260/321/200/320/277/320/273/320/260/321/202/320/260/$operation/class.js" +0 -8
  603. package/MODULES/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/237/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/321/203/$operation/class.js" +0 -11
  604. package/MODULES/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202//320/222/320/276/320/267/320/262/321/200/320/260/321/202 /320/276/321/202 /320/277/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/320/260/$operation/class.js" +0 -11
  605. package/MODULES/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202//320/236/321/202 /320/277/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/217/$operation/class.js" +0 -11
  606. package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/222/320/276/320/267/320/262/321/200/320/260/321/202 /320/276/321/202 /320/277/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/217/$operation/class.js" +0 -32
  607. package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/class.js +0 -32
  608. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/class.js +0 -8
  609. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/class.js +0 -8
  610. package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/class.js +0 -8
  611. package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/class.js +0 -5
  612. package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/class.js +0 -5
  613. package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/sheet.js +0 -808
  614. package/NODES/$node/handlers/pages/form/network/$handler/network.js +0 -110
  615. package/ORGANIZATIONS/$domain/$folder/$class/$structure/$organization/class.js +0 -5
  616. package/ORGANIZATIONS/$domain/class.js +0 -5
  617. package/ORGANIZATIONS/$domain/readme.md +0 -10
  618. package/models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
  619. package/models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
  620. package/models/$ai/$folder/$class/$provider/readme.md +0 -16
  621. package/models/$ai/class.js +0 -169
  622. package/models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js +0 -167
  623. package/models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
  624. package/models/$ai/readme.md +0 -62
  625. package/models/Local/$provider/handlers/methods/transfer/$handler/class.js +0 -41
  626. package/models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js +0 -1453
  627. package/models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
  628. /package/{models/$ai → $server}/$folder/$class/$ai/methods/chat/$method/class.js +0 -0
  629. /package/$server/$folder/$class/$structure/{$organization/handlers/pages/form/system/$handler/tabs → $project/handlers/pages/form/system}/requisites/$handler/class.js +0 -0
  630. /package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/database → database}/$handler/class.js +0 -0
  631. /package/MODULES/{CBR/$module/class.js → /320/224/320/260/320/275/320/275/321/213/320/265/CBR/$module/class.js"} +0 -0
  632. /package/MODULES/{Geo/$module/class.js → /320/224/320/260/320/275/320/275/321/213/320/265/Geo/$module/class.js"} +0 -0
  633. /package/MODULES/{Geo → /320/224/320/260/320/275/320/275/321/213/320/265/Geo}//320/232/320/276/320/276/321/200/320/264/320/270/320/275/320/260/321/202/321/213/$struct/class.js" +0 -0
  634. /package/MODULES/{Geo → /320/224/320/260/320/275/320/275/321/213/320/265/Geo}//320/250/320/265/320/271/320/277/$struct/class.js" +0 -0
  635. /package/MODULES/{KLADR/$module/$folder/$class/$data/$catalog/class.js → /320/224/320/260/320/275/320/275/321/213/320/265/KLADR/$module/$folder/$class/$data/$catalog/class.js"} +0 -0
  636. /package/MODULES/{KLADR/$module/class.js → /320/224/320/260/320/275/320/275/321/213/320/265/KLADR/$module/class.js"} +0 -0
  637. /package/MODULES/{KLADR/$module/readme.md → /320/224/320/260/320/275/320/275/321/213/320/265/KLADR/$module/readme.md"} +0 -0
  638. /package/MODULES/{KLADR → /320/224/320/260/320/275/320/275/321/213/320/265/KLADR}//320/237/320/276/320/264/321/200/320/260/320/267/320/264/320/265/320/273/320/265/320/275/320/270/321/217 /320/234/320/222/320/224/$catalog/class.js" +0 -0
  639. /package/MODULES/{KLADR → /320/224/320/260/320/275/320/275/321/213/320/265/KLADR}//320/240/320/265/320/263/320/270/320/276/320/275/321/213/$catalog/class.js" +0 -0
  640. /package/MODULES/{RuCalendar/$module/class.js → /320/224/320/260/320/275/320/275/321/213/320/265/RuCalendar/$module/class.js"} +0 -0
  641. /package/MODULES/{Weather/$module/class.js → /320/224/320/260/320/275/320/275/321/213/320/265/Weather/$module/class.js"} +0 -0
  642. /package/MODULES/{2GIS/$module/class.js → /320/232/320/276/320/275/320/275/320/265/320/272/321/202/320/276/321/200/321/213/2GIS/$mcp/class.js"} +0 -0
  643. /package/MODULES/{2GIS/$module/readme.md → /320/232/320/276/320/275/320/275/320/265/320/272/321/202/320/276/321/200/321/213/2GIS/$mcp/readme.md"} +0 -0
  644. /package/MODULES/{Telegram/$module/class.js → /320/232/320/276/320/275/320/275/320/265/320/272/321/202/320/276/321/200/321/213/Telegram/$module/class.js"} +0 -0
  645. /package/{models/GigaChat/$provider/$folder/$class/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/GigaChat/$provider/$folder/$class/$ai/class.js"} +0 -0
  646. /package/{models/GigaChat/$provider/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/GigaChat/$provider/class.js"} +0 -0
  647. /package/{models/GigaChat/GigaChat 2 Lite/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/GigaChat/GigaChat 2 Lite/$ai/class.js"} +0 -0
  648. /package/{models/GigaChat/GigaChat 2 Max/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/GigaChat/GigaChat 2 Max/$ai/class.js"} +0 -0
  649. /package/{models/GigaChat/GigaChat 2 Pro/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/GigaChat/GigaChat 2 Pro/$ai/class.js"} +0 -0
  650. /package/{models/GigaChat/GigaChat Embeddings/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/GigaChat/GigaChat Embeddings/$ai/class.js"} +0 -0
  651. /package/{models/MTS-AI/$provider/$folder/$class/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/MTS-AI/$provider/$folder/$class/$ai/class.js"} +0 -0
  652. /package/{models/MTS-AI/$provider/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/MTS-AI/$provider/class.js"} +0 -0
  653. /package/{models/MTS-AI/Cotype Lite/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/MTS-AI/Cotype Lite/$ai/class.js"} +0 -0
  654. /package/{models/MTS-AI/Cotype Pro 2/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/MTS-AI/Cotype Pro 2/$ai/class.js"} +0 -0
  655. /package/{models/MTS-AI/Cotype Vision/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/MTS-AI/Cotype Vision/$ai/class.js"} +0 -0
  656. /package/{models/T-Bank/$provider/$folder/$class/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/T-Bank/$provider/$folder/$class/$ai/class.js"} +0 -0
  657. /package/{models/T-Bank/$provider/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/T-Bank/$provider/class.js"} +0 -0
  658. /package/{models/T-Bank/T-Lite 2.0/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/T-Bank/T-Lite 2.0/$ai/class.js"} +0 -0
  659. /package/{models/T-Bank/T-Pro 2.0/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/T-Bank/T-Pro 2.0/$ai/class.js"} +0 -0
  660. /package/{models/T-Bank/T-VoiceKit ASR/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/T-Bank/T-VoiceKit ASR/$ai/class.js"} +0 -0
  661. /package/{models/T-Bank/T-VoiceKit TTS/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/T-Bank/T-VoiceKit TTS/$ai/class.js"} +0 -0
  662. /package/{models/Yandex/$provider/$folder/$class/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/$provider/$folder/$class/$ai/class.js"} +0 -0
  663. /package/{models/Yandex/$provider/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/$provider/class.js"} +0 -0
  664. /package/{models/Yandex/Alice AI (YandexGPT 5 Pro)/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/Alice AI (YandexGPT 5 Pro)/$ai/class.js"} +0 -0
  665. /package/{models/Yandex/Yandex Embeddings/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/Yandex Embeddings/$ai/class.js"} +0 -0
  666. /package/{models/Yandex/Yandex SpeechKit ASR/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/Yandex SpeechKit ASR/$ai/class.js"} +0 -0
  667. /package/{models/Yandex/Yandex SpeechKit TTS/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/Yandex SpeechKit TTS/$ai/class.js"} +0 -0
  668. /package/{models/Yandex/YandexART/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/YandexART/$ai/class.js"} +0 -0
  669. /package/{models/Yandex/YandexGPT 5 Lite/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/YandexGPT 5 Lite/$ai/class.js"} +0 -0
  670. /package/{models/Yandex/YandexGPT Reasoning/$ai/class.js → MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Yandex/YandexGPT Reasoning/$ai/class.js"} +0 -0
  671. /package/MODULES/{DuckDuckGo/$module/class.js → /320/237/320/276/320/270/321/201/320/272/DuckDuckGo/$module/class.js"} +0 -0
  672. /package/MODULES/{SearXNG/$module/class.js → /320/237/320/276/320/270/321/201/320/272/SearXNG/$module/class.js"} +0 -0
  673. /package/MODULES/{Yandex/$module/class.js → /320/237/320/276/320/270/321/201/320/272/Yandex/$module/class.js"} +0 -0
  674. /package/MODULES/{Process/$module/$folder/$class/$data/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Process/$module/$folder/$class/$data/$catalog/class.js"} +0 -0
  675. /package/MODULES/{Process/$module/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Process/$module/class.js"} +0 -0
  676. /package/MODULES/{Process → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Process}//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/class.js" +0 -0
  677. /package/MODULES/{Register/$module/$folder/$class/$data/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/$module/$folder/$class/$data/$catalog/class.js"} +0 -0
  678. /package/MODULES/{Register/$module/$folder/$class/$data/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/$module/$folder/$class/$data/$operation/class.js"} +0 -0
  679. /package/MODULES/{Register/$module/$folder/$class/$data/$register/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/$module/$folder/$class/$data/$register/class.js"} +0 -0
  680. /package/MODULES/{Register/$module/$folder/$class/$data/$struct/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/$module/$folder/$class/$data/$struct/class.js"} +0 -0
  681. /package/MODULES/{Register/$module/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/$module/class.js"} +0 -0
  682. /package/MODULES/{Register/$module/readme.md → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/$module/readme.md"} +0 -0
  683. /package/MODULES/{Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/$folder/$class/$data/$catalog/$virtual/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/$folder/$class/$data/$catalog/$virtual/class.js"} +0 -0
  684. /package/MODULES/{Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/class.js"} +0 -0
  685. /package/MODULES/{Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/class.js"} +0 -0
  686. /package/MODULES/{Register/CATALOGS/$catalog/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/CATALOGS/$catalog/class.js"} +0 -0
  687. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/CATALOGS//320/222/320/270/320/264/321/213 /320/275/320/276/321/200/320/274/320/260/321/202/320/270/320/262/320/276/320/262/$catalog/class.js" +0 -0
  688. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/CATALOGS//320/224/320/276/320/273/320/266/320/275/320/276/321/201/321/202/320/270/$catalog/class.js" +0 -0
  689. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/CATALOGS//320/241/320/276/321/202/321/200/321/203/320/264/320/275/320/270/320/272/320/270/$virtual/class.js" +0 -0
  690. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213/$catalog/class.js" +0 -0
  691. /package/MODULES/{Register/OPERATIONS/$operation/$folder/$class/$data/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS/$operation/$folder/$class/$data/$operation/class.js"} +0 -0
  692. /package/MODULES/{Register/OPERATIONS/$operation/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/OPERATIONS/$operation/class.js"} +0 -0
  693. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/232/320/260/320/264/321/200/321/213/$operation/class.js" +0 -0
  694. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/232/320/260/321/201/321/201/320/260/$operation/$folder/$class/$data/$operation/class.js" +0 -0
  695. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/232/320/260/321/201/321/201/320/260/$operation/class.js" +0 -0
  696. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$operation/class.js" +0 -0
  697. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/236/321/201/320/275/320/276/320/262/320/275/321/213/320/265 /321/201/321/200/320/265/320/264/321/201/321/202/320/262/320/260/$operation/class.js" +0 -0
  698. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260/$operation/$folder/$class/$data/$operation/print//320/237/320/273/320/260/321/202/321/221/320/266/320/275/320/276/320/265 /320/277/320/276/321/200/321/203/321/207/320/265/320/275/320/270/320/265.html" +0 -0
  699. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260/$operation/class.js" +0 -0
  700. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202/$operation/class.js" +0 -0
  701. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/237/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276/$operation/class.js" +0 -0
  702. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217/$operation/class.js" +0 -0
  703. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/OPERATIONS//320/244/320/270/320/275/320/260/320/275/321/201/320/276/320/262/321/213/320/271 /321/200/320/265/320/267/321/203/320/273/321/214/321/202/320/260/321/202/$operation/class.js" +0 -0
  704. /package/MODULES/{Register/REGISTER/$register/$folder/$class/$data/$register/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/$folder/$class/$data/$register/$account/class.js"} +0 -0
  705. /package/MODULES/{Register/REGISTER/$register/$folder/$class/$data/$register/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/$folder/$class/$data/$register/class.js"} +0 -0
  706. /package/MODULES/{Register/REGISTER/$register/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/$register/class.js"} +0 -0
  707. /package/MODULES/{Register/REGISTER/10/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/10/$account/class.js"} +0 -0
  708. /package/MODULES/{Register/REGISTER/19/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/19/$account/class.js"} +0 -0
  709. /package/MODULES/{Register/REGISTER/20/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/20/$account/class.js"} +0 -0
  710. /package/MODULES/{Register/REGISTER/26/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/26/$account/class.js"} +0 -0
  711. /package/MODULES/{Register/REGISTER/50/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/50/$account/class.js"} +0 -0
  712. /package/MODULES/{Register/REGISTER/51/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/51/$account/class.js"} +0 -0
  713. /package/MODULES/{Register/REGISTER/55/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/55/$account/class.js"} +0 -0
  714. /package/MODULES/{Register/REGISTER/58/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/58/$account/class.js"} +0 -0
  715. /package/MODULES/{Register/REGISTER/66/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/66/$account/class.js"} +0 -0
  716. /package/MODULES/{Register/REGISTER/67/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/67/$account/class.js"} +0 -0
  717. /package/MODULES/{Register/REGISTER/68/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/68/$account/class.js"} +0 -0
  718. /package/MODULES/{Register/REGISTER/68/04/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/68/04/$account/class.js"} +0 -0
  719. /package/MODULES/{Register/REGISTER/69/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/69/$account/class.js"} +0 -0
  720. /package/MODULES/{Register/REGISTER/75/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/75/$account/class.js"} +0 -0
  721. /package/MODULES/{Register/REGISTER/80/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/80/$account/class.js"} +0 -0
  722. /package/MODULES/{Register/REGISTER/84/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/84/$account/class.js"} +0 -0
  723. /package/MODULES/{Register/REGISTER/90/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/90/$account/class.js"} +0 -0
  724. /package/MODULES/{Register/REGISTER/90/09/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/90/09/$account/class.js"} +0 -0
  725. /package/MODULES/{Register/REGISTER/99/$account/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/REGISTER/99/$account/class.js"} +0 -0
  726. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/REGISTER//320/232/320/260/320/264/321/200/321/213/$account/class.js" +0 -0
  727. /package/MODULES/{Register/STRUCTS/$struct/$folder/$class/$data/$struct/class.js → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/STRUCTS/$struct/$folder/$class/$data/$struct/class.js"} +0 -0
  728. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/STRUCTS//320/220/320/264/321/200/320/265/321/201/$struct/class.js" +0 -0
  729. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/STRUCTS//320/221/320/260/320/275/320/272/320/276/320/262/321/201/320/272/320/270/320/271 /321/201/321/207/321/221/321/202/$struct/class.js" +0 -0
  730. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/STRUCTS//320/225/320/264/320/270/320/275/320/270/321/206/320/260 /320/270/320/267/320/274/320/265/321/200/320/265/320/275/320/270/321/217/$struct/class.js" +0 -0
  731. /package/MODULES/{Register → /320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register}/STRUCTS//320/244/320/230/320/236/$struct/class.js" +0 -0
  732. /package/{users → USERS}/$users/class.js +0 -0
@@ -0,0 +1,2158 @@
1
+ /**
2
+ * form/objects — список объектов класса и редактор на учётном ядре (методы `db_*`, sources/data/api.js).
3
+ * Схема — `db_schema` (поля с учётом наследования), список — `db_query` (класс с потомками,
4
+ * названия ссылок приходят в `names`), редактор — модальное окно `item-object-editor`;
5
+ * закрытие с несохранёнными изменениями спрашивает «Сохранить перед закрытием?».
6
+ *
7
+ * Операции: полоса периодов сверху (дата операции), колонки «Дата» и «Статус», в окне — дата,
8
+ * проводки (действующие или предпросмотр черновика) и действия по статусу:
9
+ * черновик — сохранить, удалить, провести (несохранённое сначала сохраняется);
10
+ * проведённая — сохранить (= исправление: сторно и новые проводки), отменить; отменённая — только просмотр.
11
+ * Справочники — весь список без полосы периодов.
12
+ *
13
+ * Период хранится здесь, а не в пакете: пакет stateless, состояние — per-point ($save).
14
+ * `packetsKey` хранит КЛЮЧ выбора, а не границы: у пункта «Сейчас» ключ 'now'
15
+ * относителен, поэтому нетронутый дефолт остаётся «сегодня», а не вчерашним днём.
16
+ */
17
+
18
+ // Дата по местному времени: ядро понимает 'YYYY-MM-DD' как местный день.
19
+ function _day(d) {
20
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
21
+ }
22
+ const _today = () => _day(new Date());
23
+
24
+ /** Тип поля ядра → тип редактора (editor-form). */
25
+ const TYPES = {
26
+ string: 'String',
27
+ text: 'Text',
28
+ number: 'Number',
29
+ money: 'Number',
30
+ integer: 'Number',
31
+ boolean: 'Boolean',
32
+ date: 'Date',
33
+ datetime: 'DateTime',
34
+ link: 'Link',
35
+ struct: 'Struct',
36
+ table: 'Table',
37
+ enum: 'Select',
38
+ file: 'File'
39
+ };
40
+ const STATUS = {
41
+ draft: 'черновик',
42
+ registered: 'проведена',
43
+ cancelled: 'отменена',
44
+ deleted: 'удалена'
45
+ };
46
+ const DATE_FIELD = Object.freeze({
47
+ id: 'time',
48
+ label: 'Дата',
49
+ type: 'Date',
50
+ required: true
51
+ });
52
+ const NUM_FIELD_IDS = new Set(['num', 'doc_number', 'order_number', 'number', 'doc_num']);
53
+
54
+ /** Поле схемы ядра → поле редактора: тип, справочник ссылки, варианты, вложенные поля структуры и колонки табличной части. */
55
+ function formField(f) {
56
+ const rawType = String(f.type || '').toLowerCase();
57
+ const out = {
58
+ id: f.id,
59
+ label: f.label || f.id,
60
+ type: TYPES[rawType] || TYPES[f.type] || 'String'
61
+ };
62
+ if (rawType === 'money') out.formatMoney = true;
63
+ if (f.required) out.required = true;
64
+ if (rawType === 'link') out.catalog = f.targetPath || f.target;
65
+ if (rawType === 'enum') out.options = (f.values || f.options || []).map(v => v && typeof v === 'object' ? {
66
+ value: String(v.id ?? v.value),
67
+ label: String(v.label ?? v.id ?? v.value)
68
+ } : {
69
+ value: String(v),
70
+ label: String(v)
71
+ });
72
+ if (rawType === 'struct') out.children = (f.fields || []).map(formField);
73
+ if (rawType === 'table') out.columns = (f.fields || []).map(formField);
74
+ return out;
75
+ }
76
+
77
+ /** Ключ места записи для выбора и сохранения: «подразделение|место». */
78
+ function contextKeyOf(c) {
79
+ return c ? `${c.unit}|${c.place ?? ''}` : '';
80
+ }
81
+ const money = v => Number(v) ? Number(v).toLocaleString('ru-RU', {
82
+ minimumFractionDigits: 2,
83
+ maximumFractionDigits: 2
84
+ }) : '';
85
+ const saldo = (d, c) => {
86
+ const net = (Number(d) || 0) - (Number(c) || 0);
87
+ return net > 0 ? money(net) + ' Дт' : net < 0 ? money(-net) + ' Кт' : '0';
88
+ };
89
+
90
+ /** Строка табличной части не пуста: есть хотя бы одно заполненное поле. */
91
+ function isNonEmptyRow(row) {
92
+ if (!row || typeof row !== 'object') return false;
93
+ return Object.values(row).some(v => v !== undefined && v !== null && String(v).trim() !== '');
94
+ }
95
+ const OP_STATUSES = [{
96
+ id: '',
97
+ label: 'Все статусы'
98
+ }, {
99
+ id: 'draft',
100
+ label: 'Черновики'
101
+ }, {
102
+ id: 'registered',
103
+ label: 'Проведённые'
104
+ }, {
105
+ id: 'cancelled',
106
+ label: 'Отменённые'
107
+ }];
108
+ const CAT_STATUSES = [{
109
+ id: '',
110
+ label: 'Действующие'
111
+ }, {
112
+ id: 'deleted',
113
+ label: 'Удалённые'
114
+ }];
115
+ /**
116
+ * item-object-editor — содержимое модального окна: форма, проводки, состояние/траектория, ошибка и действия.
117
+ * Бизнес-методы остаются на handler'е; компонент только связывает их с разметкой.
118
+ */
119
+ ODA({
120
+ is: 'item-object-editor',
121
+ imports: '/oda/components/button/button.js, /oda/components/layouts/editor-form/editor-form.js',
122
+ template: /*html*/`
123
+ <style>
124
+ :host {
125
+ @apply --vertical;
126
+ width: min(680px, calc(100vw - 24px));
127
+ max-width: 100%;
128
+ min-height: 0;
129
+ box-sizing: border-box;
130
+ overflow: hidden;
131
+ }
132
+ oda-editor-form {
133
+ flex: 1 1 auto;
134
+ min-height: 0;
135
+ overflow-y: auto;
136
+ }
137
+ .error {
138
+ color: var(--error-color);
139
+ white-space: break-spaces;
140
+ padding: 0 var(--space-m);
141
+ }
142
+ .entries {
143
+ @apply --vertical;
144
+ gap: 2px;
145
+ padding: 0 var(--space-m);
146
+ font-size: smaller;
147
+ opacity: .8;
148
+ }
149
+ .trajectory {
150
+ @apply --vertical;
151
+ gap: 4px;
152
+ padding: var(--space-s) var(--space-m);
153
+ max-height: 180px;
154
+ overflow-y: auto;
155
+ font-size: smaller;
156
+ border-top: 1px solid var(--border-color, #ddd);
157
+ }
158
+ .trajectory-title {
159
+ font-weight: bold;
160
+ opacity: .85;
161
+ }
162
+ .traj-row {
163
+ @apply --horizontal;
164
+ flex-wrap: wrap;
165
+ gap: 4px 8px;
166
+ align-items: center;
167
+ }
168
+ .traj-link {
169
+ cursor: pointer;
170
+ text-decoration: underline;
171
+ }
172
+ .traj-num {
173
+ margin-left: auto;
174
+ text-align: right;
175
+ white-space: nowrap;
176
+ }
177
+ .bar {
178
+ @apply --horizontal;
179
+ flex-wrap: wrap;
180
+ justify-content: flex-end;
181
+ gap: var(--space-s);
182
+ padding: var(--space-m);
183
+ border-top: 1px solid var(--subtle-border, var(--border-color, #ddd));
184
+ flex-shrink: 0;
185
+ }
186
+ .context {
187
+ @apply --horizontal;
188
+ flex-wrap: wrap;
189
+ align-items: center;
190
+ gap: var(--space-s);
191
+ padding: var(--space-m) var(--space-m) 0;
192
+ }
193
+ </style>
194
+ <label class="context" ~if="owner.showContext && !owner.editing?.id">От места
195
+ <select @change="owner.contextKey = $this.value">
196
+ <option ~for="owner.contexts" :value="owner.contextKeyOf($for.item)"
197
+ :selected="owner.contextKeyOf($for.item) === owner.contextKeyOf(owner.context)">{{owner.contextTitle($for.item)}}</option>
198
+ </select>
199
+ </label>
200
+ <oda-editor-form :metadata="owner.activeSchema" :data="owner.editing" :field-errors="owner.fieldErrors" @input="onFormInput" @change="onFormInput" @cell-changed="onFormInput"></oda-editor-form>
201
+ <div class="entries" ~if="owner.entries?.length">
202
+ <div class="entry" ~for="owner.entries">{{owner.entryText($for.item)}}</div>
203
+ </div>
204
+ <div class="trajectory" ~if="owner.objectBalances?.length || owner.trajectory?.length">
205
+ <div class="trajectory-title" ~if="owner.objectBalances?.length">Остатки по счетам</div>
206
+ <div class="traj-row" ~for="owner.objectBalances">
207
+ <span class="traj-link" @tap="openBalance($for.item)">{{$for.item.label}}</span>
208
+ <span class="traj-num">{{$for.item.balance}}{{$for.item.qty ? ' (' + $for.item.qty + ')' : ''}}</span>
209
+ </div>
210
+ <div class="trajectory-title" ~if="owner.trajectory?.length">Движения ({{owner.trajectory.length}})</div>
211
+ <div class="traj-row" ~for="owner.trajectory">
212
+ <span>{{$for.item.date}}</span>
213
+ <span class="traj-link" @tap="openTrajOp($for.item)">{{$for.item.op}}</span>
214
+ <span>{{$for.item.account}}</span>
215
+ <span class="traj-num">{{$for.item.debit ? '+' + $for.item.debit : ($for.item.credit ? '−' + $for.item.credit : $for.item.qty)}} → {{$for.item.balance}}</span>
216
+ </div>
217
+ </div>
218
+ <div class="error" ~if="owner.error">{{owner.error}}</div>
219
+ <div class="bar" no-flex>
220
+ <oda-button ~if="owner.canSave" icon="editor:save" :disabled="owner.busy" @tap="save">Сохранить</oda-button>
221
+ <oda-button ~if="owner.canRemove" icon="icons:delete" :disabled="owner.busy"
222
+ @tap="removeObject">Удалить</oda-button>
223
+ <oda-button ~if="owner.canRestore" icon="icons:restore" :disabled="owner.busy"
224
+ @tap="restoreObject">Восстановить</oda-button>
225
+ <oda-button ~if="owner.canRegister" :disabled="owner.busy" @tap="post">Провести</oda-button>
226
+ <oda-button ~if="owner.canCancel" :disabled="owner.busy" @tap="cancelOperation">Отменить</oda-button>
227
+ <oda-button ~for="owner.printForms" icon="icons:print" :title="$for.item.label" @tap="printForm($for.item.name)">{{$for.item.label}}</oda-button>
228
+ <oda-button icon="icons:close" :disabled="owner.busy" @tap="close">Закрыть</oda-button>
229
+ </div>
230
+ `,
231
+ owner: null,
232
+ attached() {
233
+ // после первого рендера формы: контролы могли нормализовать значения
234
+ this.async(() => {
235
+ if (this.isConnected) this.owner?.snapshot?.();
236
+ });
237
+ },
238
+ onFormInput() {
239
+ if (this.owner && this.owner.fieldErrors && Object.keys(this.owner.fieldErrors).length) this.owner.fieldErrors = {};
240
+ this.owner?.schedulePreview?.();
241
+ },
242
+ async save() {
243
+ if (await this.owner.save()) this.close();
244
+ },
245
+ async removeObject() {
246
+ if (await this.owner.removeObject()) this.close();
247
+ },
248
+ async restoreObject() {
249
+ if (await this.owner.restoreObject()) this.close();
250
+ },
251
+ async post() {
252
+ await this.owner.post();
253
+ },
254
+ async cancelOperation() {
255
+ await this.owner.cancelOperation();
256
+ },
257
+ async printForm(name) {
258
+ await this.owner.printForm(name);
259
+ },
260
+ async openBalance(b) {
261
+ const owner = this.owner;
262
+ this.close();
263
+ await owner?.openBalanceAccount?.(b);
264
+ },
265
+ async openTrajOp(item) {
266
+ const owner = this.owner;
267
+ this.close();
268
+ await owner?.openTrajectoryOp?.(item);
269
+ },
270
+ close() {
271
+ this.parentElement?.close?.();
272
+ }
273
+ });
274
+ export default {
275
+ icon: 'odant:grid',
276
+ label: 'Объекты',
277
+ order: 1,
278
+ default: true,
279
+ allowSave: false,
280
+ /**
281
+ * Только классы с полями объектов (у групп и служебных/абстрактных классов формы нет).
282
+ * Поля лист справочника или операции может наследовать (собственных `FIELDS` нет) —
283
+ * их собирает ядро данных (`db_schema`), поэтому смотрим на схему, а без неё — на METADATA.
284
+ */
285
+ async allowUse($context, params) {
286
+ try {
287
+ const s = (await $context?.db_schema?.({
288
+ session: params?.session
289
+ }))?.schema;
290
+ if (s) {
291
+ if (s.abstract) return false;
292
+ return (s.family === 'operation' || s.family === 'catalog') && (s.fields.length > 0 || !s.leaf);
293
+ }
294
+ } catch {
295
+ return false;
296
+ }
297
+ if ($context?.DATA?.abstract) return false;
298
+ const md = await $context?.METADATA;
299
+ return Array.isArray(md?.FIELDS) && md.FIELDS.length > 0;
300
+ },
301
+ component: {
302
+ imports: 'oda//button, oda//packets, oda//table, ~/lib//editor-form, ~/lib//menu, ~/lib//popover, ~/lib//class-picker',
303
+ template: /*html*/`
304
+ <style>
305
+ :host {
306
+ @apply --vertical;
307
+ @apply --flex;
308
+ @apply --content;
309
+ gap: 0;
310
+ padding: 0;
311
+ overflow: hidden;
312
+ font-size: 13px;
313
+ }
314
+ .body {
315
+ @apply --horizontal;
316
+ flex: 1;
317
+ gap: 0;
318
+ overflow: hidden;
319
+ }
320
+ .list {
321
+ @apply --vertical;
322
+ flex: 1;
323
+ overflow: hidden;
324
+ }
325
+ oda-table {
326
+ flex: 1;
327
+ }
328
+ .bar {
329
+ @apply --horizontal;
330
+ @apply --header;
331
+ flex-shrink: 0;
332
+ gap: 8px;
333
+ align-items: center;
334
+ flex-wrap: wrap;
335
+ padding: 3px 8px;
336
+ min-height: 28px;
337
+ border-bottom: 1px solid var(--border-color);
338
+ font-size: 12px;
339
+ }
340
+ .bar input.search,
341
+ .bar select {
342
+ @apply --content;
343
+ min-width: 0;
344
+ padding: 2px 6px;
345
+ font-size: 12px;
346
+ border: 1px solid var(--border-color);
347
+ border-radius: 3px;
348
+ }
349
+ .bar input.search {
350
+ width: 170px;
351
+ }
352
+ .pager {
353
+ @apply --horizontal;
354
+ gap: 4px;
355
+ align-items: center;
356
+ margin-left: auto;
357
+ font-size: 12px;
358
+ }
359
+ .error {
360
+ padding: 6px 10px;
361
+ color: var(--error-color);
362
+ background: var(--error-soft);
363
+ border-bottom: 1px solid var(--error-color);
364
+ white-space: break-spaces;
365
+ }
366
+ .grid-footer {
367
+ @apply --horizontal;
368
+ @apply --light;
369
+ color: var(--content-color);
370
+ flex-shrink: 0;
371
+ align-items: center;
372
+ justify-content: space-between;
373
+ min-height: 24px;
374
+ padding: 2px 10px;
375
+ border-top: 1px solid var(--border-color);
376
+ font-size: 11.5px;
377
+ font-weight: 600;
378
+ user-select: none;
379
+ }
380
+ </style>
381
+ <oda-packets no-flex mode="day" ~if="packetsStart && isOperation"
382
+ :start="packetsStart" :end="packetsEnd" :days="packetsDays"
383
+ ::value="packetsKey" @selection-changed="onPackets($event)"></oda-packets>
384
+ <div class="body">
385
+ <div class="list">
386
+ <div class="bar" ~if="!inWorkForm">
387
+ <oda-button ~if="canCreate && !inWorkForm" icon="icons:plus" @tap="create">Создать</oda-button>
388
+ <oda-button icon="icons:refresh" @tap="reload">Обновить</oda-button>
389
+ <input class="search" type="search" :value="searchQuery" placeholder="Поиск…" @change="onSearch($this.value)">
390
+ <select title="Статус" @change="filterStatus($this.value)">
391
+ <option ~for="statusOptions" :value="$for.item.id" :selected="$for.item.id === statusFilter">{{$for.item.label}}</option>
392
+ </select>
393
+ <select ~for="filterableFields" :title="$for.item.label" @change="setFieldFilter($for.item.id, $this.value)">
394
+ <option value="" :selected="!fieldFilters[$for.item.id]">{{$for.item.label}}: все</option>
395
+ <option ~for="$for.item.filterOptions" :value="$for.$for.item.value" :selected="$for.$for.item.value === fieldFilters[$for.item.id]">{{$for.$for.item.label}}</option>
396
+ </select>
397
+ <select ~if="units.length > 1" title="Подразделение" @change="filterUnit($this.value)">
398
+ <option value="" :selected="!unitFilter">Все подразделения</option>
399
+ <option ~for="units" :value="$for.item.cid" :selected="$for.item.cid === unitFilter">{{$for.item.label}}</option>
400
+ </select>
401
+ </div>
402
+ <div class="error" ~if="error && !editorOpen">{{error}}</div>
403
+ <oda-table id="objectsTable" allow-focus allow-selection even-odd col-lines row-lines readonly ::focused-row="focusedRow" ::selected-rows="selectedRows"
404
+ :metadata="tableMetadata" :data-set="tableRows"
405
+ :$save-key="$item?.short || $item?.path" @click="onTableClick($event)" @dblclick="onTableDblClick($event)" @cell-link-click="onCellLinkClick($event)" @row-contextmenu="onRowContextMenu($event)"></oda-table>
406
+ <div class="grid-footer">
407
+ <span>{{total || rows.length}}</span>
408
+ <span ~if="selectedRows?.length > 1">Выбрано: {{selectedRows.length}}</span>
409
+ <div class="pager" ~if="total > pageSize || page > 1">
410
+ <span>{{pageText}}</span>
411
+ <oda-button ~if="page > 1" icon="icons:chevron-left" icon-size="16" title="Предыдущая страница" @tap="setPage(page - 1)"></oda-button>
412
+ <oda-button ~if="page * pageSize < total" icon="icons:chevron-right" icon-size="16" title="Следующая страница" @tap="setPage(page + 1)"></oda-button>
413
+ </div>
414
+ </div>
415
+ </div>
416
+ </div>
417
+ `,
418
+ rows: [],
419
+ columns: [],
420
+ schema: null,
421
+ /** листья поддерева для создания объектов в группе (db_schema.leaves): [{ cid, path, label, count }] */
422
+ leaves: [],
423
+ /** описание классов поддерева (db_schema.classes): cid → { cid, path, parent, label, icon, leaf, count, group } */
424
+ classes: {},
425
+ /** выбранный лист при создании/редактировании в группе и его схема */
426
+ leafCid: '',
427
+ leafSchema: null,
428
+ editing: null,
429
+ /** проводки редактируемой операции: действующие или предпросмотр черновика */
430
+ entries: [],
431
+ /** названия счетов и аналитик для предпросмотра проводок (db_preview.names) */
432
+ entryNames: {
433
+ objects: {},
434
+ classes: {}
435
+ },
436
+ /** текущие сальдо объекта справочника по счетам (db_trajectory.closing) */
437
+ objectBalances: [],
438
+ /** движения объекта справочника по журналу (db_trajectory.items) */
439
+ trajectory: [],
440
+ trajectoryNames: {
441
+ objects: {},
442
+ classes: {},
443
+ paths: {}
444
+ },
445
+ /** печатные формы открытой операции (db_print_list): [{ name, label }] */
446
+ printForms: [],
447
+ focusedRow: null,
448
+ selectedRows: [],
449
+ focusedItem: null,
450
+ /** окно редактора открыто: второй клик по таблице не открывает ещё одно */
451
+ editorOpen: false,
452
+ /** идёт сохранение/удаление/проведение: повторные действия и закрытие ждут */
453
+ busy: false,
454
+ /** снимок значений на момент открытия/успешного действия — база для isDirty */
455
+ _snapshot: '',
456
+ /** поиск, фильтр статуса, фильтры по полям и постраничность списка */
457
+ searchQuery: '',
458
+ statusFilter: '',
459
+ fieldFilters: {},
460
+ total: 0,
461
+ page: 1,
462
+ pageSize: 200,
463
+ _findFormHost() {
464
+ if (this.$form && ('focusedItem' in this.$form || typeof this.$form.syncFromView === 'function' || typeof this.$form.openInForm === 'function' || typeof this.$form.updateActiveTabLabel === 'function' || typeof this.$form.setFormPeriod === 'function')) return this.$form;
465
+ for (let p = this.parentElement || this.domHost; p; p = p.parentElement || p.domHost) {
466
+ if (p.localName === 'work-form' || typeof p.syncFromView === 'function' || typeof p.openInForm === 'function' || typeof p.setFormPeriod === 'function' || 'focusedItem' in p) return p;
467
+ }
468
+ return null;
469
+ },
470
+ get inWorkForm() {
471
+ return Boolean(this._findFormHost());
472
+ },
473
+ _notifyForm() {
474
+ const host = this._findFormHost();
475
+ if (!host) return;
476
+ if (host.view_control && host.view_control !== this) return;
477
+ if (typeof host.syncFromView === 'function') host.syncFromView(this);else host.focusedItem = this.focusedItem;
478
+ },
479
+ /** Вынести поле поиска в правую зону тулбара work-form (.toolbar-zone.right). */
480
+ mountToolbarSlots(formHost = this._findFormHost()) {
481
+ if (!formHost || typeof document === 'undefined') return;
482
+ const container = formHost.$?.('.toolbar-zone.right') || formHost;
483
+ let searchWrap = container.querySelector?.('[data-objects-search-wrap]');
484
+ let searchInput = container.querySelector?.('input[data-objects-search]');
485
+ if (!searchWrap) {
486
+ searchWrap = document.createElement('div');
487
+ searchWrap.setAttribute('slot', 'tool-right');
488
+ searchWrap.setAttribute('data-toolbar-widget', '1');
489
+ searchWrap.setAttribute('data-objects-search-wrap', '1');
490
+ searchWrap.style.cssText = 'display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--content-background); padding: 0 2px 0 6px; min-height: 24px; box-sizing: border-box;';
491
+ searchInput = document.createElement('input');
492
+ searchInput.setAttribute('data-objects-search', '1');
493
+ searchInput.type = 'search';
494
+ searchInput.placeholder = 'Поиск по объектам…';
495
+ searchInput.title = 'Серверный поиск по всему содержимому объектов (Enter или кнопка поиска)';
496
+ searchInput.style.cssText = 'width: 195px; min-height: 22px; padding: 1px 4px; font-size: 12.5px; border: none; background: transparent; color: var(--content-color); outline: none;';
497
+ const searchBtn = document.createElement('button');
498
+ searchBtn.type = 'button';
499
+ searchBtn.title = 'Найти на сервере во всём содержимом объектов';
500
+ searchBtn.textContent = '🔍';
501
+ searchBtn.style.cssText = 'border: none; background: transparent; color: var(--accent-color); cursor: pointer; font-size: 12px; padding: 1px 5px; border-radius: 2px; line-height: 1;';
502
+ let searchTimer = null;
503
+ const runNow = (force = false) => {
504
+ if (searchTimer) {
505
+ clearTimeout(searchTimer);
506
+ searchTimer = null;
507
+ }
508
+ const owner = searchWrap._ownerView || this;
509
+ const val = String(searchInput.value ?? '').trim();
510
+ if (force || val !== String(owner.searchQuery ?? '').trim()) owner.onSearch(val);
511
+ };
512
+ searchInput.addEventListener('input', () => {
513
+ if (searchTimer) clearTimeout(searchTimer);
514
+ searchTimer = setTimeout(() => runNow(false), 260);
515
+ });
516
+ searchInput.addEventListener('keydown', ev => {
517
+ if (ev.key === 'Enter') {
518
+ ev.preventDefault();
519
+ runNow(true);
520
+ } else if (ev.key === 'Escape' && searchInput.value) {
521
+ ev.preventDefault();
522
+ searchInput.value = '';
523
+ runNow(true);
524
+ }
525
+ });
526
+ searchInput.addEventListener('change', () => runNow(false));
527
+ searchInput.addEventListener('search', () => runNow(true));
528
+ searchBtn.addEventListener('click', () => runNow(true));
529
+ searchWrap.appendChild(searchInput);
530
+ searchWrap.appendChild(searchBtn);
531
+ container.appendChild(searchWrap);
532
+ }
533
+ searchWrap._ownerView = this;
534
+ if (searchInput) {
535
+ searchInput._ownerView = this;
536
+ searchInput.value = this.searchQuery || '';
537
+ }
538
+ formHost._checkToolbarSlots?.();
539
+ },
540
+ getItemButtons() {
541
+ return [{
542
+ id: 'create',
543
+ label: 'Новый',
544
+ icon: 'icons:add',
545
+ isButton: true,
546
+ order: 1,
547
+ disabled: !this.canCreate,
548
+ execute: () => this.create()
549
+ }];
550
+ },
551
+ get itemButtons() {
552
+ return this.getItemButtons();
553
+ },
554
+ getActiveSelection() {
555
+ const tblSel = this.$?.('#objectsTable')?.selectedRows;
556
+ const rawSel = Array.isArray(tblSel) && tblSel.length ? tblSel : this.selectedRows;
557
+ const sel = Array.isArray(rawSel) ? rawSel.filter(r => r?.id) : [];
558
+ if (sel.length > 0) return sel;
559
+ return this.focusedRow?.id ? [this.focusedRow] : [];
560
+ },
561
+ get activeSelection() {
562
+ return this.getActiveSelection();
563
+ },
564
+ canDeleteRow(row = this.focusedRow) {
565
+ if (!row?.id || !this.canCreate) return false;
566
+ if (this.isOperation) return row.status === 'draft';
567
+ return row.status !== 'deleted';
568
+ },
569
+ canDeleteSelection(rows = this.getActiveSelection()) {
570
+ const list = Array.isArray(rows) ? rows : rows?.id ? [rows] : [];
571
+ return list.length > 0 && list.every(r => this.canDeleteRow(r));
572
+ },
573
+ getFocusedButtons() {
574
+ const sel = this.getActiveSelection();
575
+ const isMulti = sel.length > 1;
576
+ const row = sel[0] || this.focusedRow;
577
+ return [{
578
+ id: 'copy',
579
+ label: 'Копия',
580
+ icon: 'icons:content-copy',
581
+ isButton: true,
582
+ order: 2,
583
+ disabled: isMulti || !row?.id || !this.canCreate,
584
+ execute: () => this.copyRow(row)
585
+ }, {
586
+ id: 'open',
587
+ label: 'Открыть',
588
+ icon: 'icons:launch',
589
+ isButton: true,
590
+ order: 3,
591
+ disabled: isMulti || !row?.id,
592
+ execute: () => this.openEditor(row)
593
+ }, {
594
+ id: 'delete',
595
+ label: 'Удалить',
596
+ icon: 'icons:delete',
597
+ isButton: true,
598
+ allowList: true,
599
+ order: 4,
600
+ disabled: !this.canDeleteSelection(sel),
601
+ execute: () => this.deleteRow(sel)
602
+ }];
603
+ },
604
+ get focusedButtons() {
605
+ return this.getFocusedButtons();
606
+ },
607
+ getFocusedServices() {
608
+ return [];
609
+ },
610
+ get focusedServices() {
611
+ return this.getFocusedServices();
612
+ },
613
+ async onCellLinkClick(e) {
614
+ const d = e?.detail?.value || e?.detail || {};
615
+ const row = d.row;
616
+ const col = d.column;
617
+ const field = col?.field || col;
618
+ if (!row || !field) return;
619
+ if (field.isGroupCol) {
620
+ const path = row._groupPath || row.cid && this.classes?.[row.cid]?.path || row.cid || '';
621
+ if (!path) return;
622
+ try {
623
+ const target = await WORK.get_item(path);
624
+ if (!target) return;
625
+ const formHost = this._findFormHost();
626
+ if (formHost && typeof formHost.openInForm === 'function') await formHost.openInForm(target, {
627
+ view: 'objects'
628
+ });else if (window.execute) window.execute(target, {
629
+ view: 'objects'
630
+ });
631
+ } catch (err) {
632
+ this.setError(err);
633
+ }
634
+ return;
635
+ }
636
+ const linkInfo = d.link || row._links?.[field.id];
637
+ const objId = linkInfo?.id;
638
+ let targetPath = linkInfo?.target || field.linkTarget || field.catalog || '';
639
+ if (!objId || !targetPath) return;
640
+ if (!targetPath.startsWith('/')) {
641
+ const curPath = this.$item?.short || this.$item?.path || '';
642
+ const m = curPath.match(/^(\/(?:ORGANIZATIONS|PROJECTS)\/[^/]+\/MODULES\/[^/]+)/);
643
+ if (m) targetPath = `${m[1]}/${targetPath.replace(/^\/+/, '')}`;
644
+ }
645
+ try {
646
+ const target = await WORK.get_item(targetPath);
647
+ if (!target) return;
648
+ const nav = {
649
+ view: 'objects/object',
650
+ id: String(objId),
651
+ label: String(row[field.id] || objId)
652
+ };
653
+ const formHost = this._findFormHost();
654
+ if (formHost && typeof formHost.openInForm === 'function') await formHost.openInForm(target, nav);else if (window.execute) window.execute(target, nav);
655
+ } catch (err) {
656
+ this.setError(err);
657
+ }
658
+ },
659
+ onTableClick() {
660
+ const tbl = this.$?.('#objectsTable');
661
+ if (tbl) {
662
+ if (tbl.focusedRow !== undefined) this.focusedRow = tbl.focusedRow;
663
+ if (Array.isArray(tbl.selectedRows)) this.selectedRows = tbl.selectedRows;
664
+ }
665
+ this._syncFocusedItem();
666
+ },
667
+ onTableDblClick() {
668
+ if (this.focusedRow?.id && !this.editorOpen) this.openEditor(this.focusedRow);
669
+ },
670
+ async onRowContextMenu(e) {
671
+ const d = e?.detail?.value || e?.detail || {};
672
+ const row = d.row || this.focusedRow;
673
+ const origEvent = d.originalEvent || e;
674
+ const tbl = this.$?.('#objectsTable');
675
+ if (tbl) {
676
+ if (tbl.focusedRow !== undefined) this.focusedRow = tbl.focusedRow;
677
+ if (Array.isArray(tbl.selectedRows)) this.selectedRows = tbl.selectedRows;
678
+ } else if (row) {
679
+ this.focusedRow = row;
680
+ }
681
+ this._syncFocusedItem();
682
+ if (!row?.id || typeof WORK?.showMenu !== 'function') return;
683
+ const sel = this.getActiveSelection();
684
+ const isMulti = sel.length > 1;
685
+ const objTitle = row.name || row.id;
686
+ const tools = [{
687
+ id: 'create',
688
+ label: 'Создать объект',
689
+ shortcut: 'CTRL+INSERT',
690
+ icon: 'icons:add',
691
+ disabled: !this.canCreate,
692
+ execute: () => this.create()
693
+ }, {
694
+ id: 'copy',
695
+ label: 'Создать объект (копия)',
696
+ shortcut: 'CTRL+SHIFT+C',
697
+ icon: 'icons:content-copy',
698
+ disabled: isMulti || !row?.id || !this.canCreate,
699
+ execute: () => this.copyRow(row)
700
+ }, {
701
+ id: 'open',
702
+ label: `Открыть объект '${objTitle}'`,
703
+ icon: 'icons:launch',
704
+ disabled: isMulti || !row?.id,
705
+ execute: () => this.openEditor(row)
706
+ }, {
707
+ id: 'delete',
708
+ label: isMulti ? `Удалить объекты (${sel.length})` : 'Удалить объект',
709
+ shortcut: 'DELETE',
710
+ icon: 'icons:delete',
711
+ disabled: !this.canDeleteSelection(sel),
712
+ execute: () => this.deleteRow(sel)
713
+ }];
714
+ try {
715
+ await WORK.showMenu({
716
+ TITLE: {
717
+ label: isMulti ? `объекты (${sel.length})` : `объект: ${objTitle}`
718
+ },
719
+ mode: 'tools',
720
+ customTools: tools
721
+ }, origEvent);
722
+ } catch (err) {
723
+ if (!(WORK.CancelError && err instanceof WORK.CancelError)) console.warn(err);
724
+ }
725
+ },
726
+ _syncFocusedItem() {
727
+ const sel = this.getActiveSelection();
728
+ if (sel.length > 1) this.focusedItem = sel;else if (sel.length === 1) this.focusedItem = sel[0];else this.focusedItem = null;
729
+ this._notifyForm();
730
+ },
731
+ $observers: {
732
+ /** внутри work-form одиночный клик фокусирует строку ($focusedItem), множественный — массив ($focusedItem), автономно — открывает редактор */
733
+ select(focusedRow) {
734
+ this._syncFocusedItem();
735
+ if (!this.inWorkForm && focusedRow?.id && !this.editorOpen) this.openEditor(focusedRow);
736
+ },
737
+ onSelectedRowsChanged(selectedRows) {
738
+ this._syncFocusedItem();
739
+ }
740
+ },
741
+ /** id объекта → название (ссылки в строках списка) */
742
+ names: {},
743
+ error: '',
744
+ /** Ошибки полей из ответа сервера (DataError.errors): { [field]: message } */
745
+ fieldErrors: {},
746
+ setError(e) {
747
+ this.error = String(e?.message || e || '');
748
+ const map = {};
749
+ if (Array.isArray(e?.errors)) {
750
+ for (const item of e.errors) {
751
+ if (item?.field && item?.message) map[item.field] = map[item.field] ? `${map[item.field]}; ${item.message}` : item.message;
752
+ }
753
+ } else if (this.error.includes('\n')) {
754
+ for (const line of this.error.split('\n')) {
755
+ const m = /^\s*[—-]\s*([a-zA-Z0-9_.\[\]]+)\s*:\s*(.+)$/.exec(line);
756
+ if (m) map[m[1]] = map[m[1]] ? `${map[m[1]]}; ${m[2].trim()}` : m[2].trim();
757
+ }
758
+ }
759
+ this.fieldErrors = map;
760
+ },
761
+ clearError() {
762
+ this.error = '';
763
+ this.fieldErrors = {};
764
+ },
765
+ /** Ключ выбранного пакета: 'now' | '*' | маска единицы | 'period:start:end'. */
766
+ packetsKey: {
767
+ $def: 'now',
768
+ $type: String,
769
+ $save: true
770
+ },
771
+ /** Режим гранулярности пакета: 'day' | 'week' | 'month' | 'quarter' | 'year'. */
772
+ packetsMode: {
773
+ $def: 'day',
774
+ $type: String,
775
+ $save: true
776
+ },
777
+ packetsStart: '',
778
+ packetsEnd: '',
779
+ packetsDays: [],
780
+ /** Период, который показал пакет, — единственный источник границ для выборки операций. */
781
+ period: null,
782
+ /** Подразделения, данные которых видны (db_scope): больше одного — фильтр списка. */
783
+ units: [],
784
+ /** Выбранное подразделение фильтра (cid), пусто — все. */
785
+ unitFilter: '',
786
+ /** Подразделения и места, от которых пользователь создаёт объекты (db_scope). */
787
+ contexts: [],
788
+ /** Последнее выбранное место записи: «подразделение|место». */
789
+ contextKey: {
790
+ $def: '',
791
+ $type: String,
792
+ $save: true
793
+ },
794
+ /** Место записи нового объекта: выбранное или первое из доступных. */
795
+ get context() {
796
+ const list = this.contexts || [];
797
+ return list.find(c => contextKeyOf(c) === this.contextKey) ?? list[0] ?? null;
798
+ },
799
+ /** Выбор места записи нужен, если их несколько (иначе сервер возьмёт единственное). */
800
+ get showContext() {
801
+ return (this.contexts || []).length > 1;
802
+ },
803
+ contextKeyOf,
804
+ /** Сменить фильтр подразделения списка и перечитать. */
805
+ filterUnit(cid) {
806
+ this.unitFilter = cid || '';
807
+ this.page = 1;
808
+ return this.reload();
809
+ },
810
+ onSearch(q) {
811
+ this.searchQuery = String(q ?? '').trim();
812
+ this.page = 1;
813
+ return this.reload();
814
+ },
815
+ filterStatus(status) {
816
+ this.statusFilter = status || '';
817
+ this.page = 1;
818
+ return this.reload();
819
+ },
820
+ setFieldFilter(fieldId, value) {
821
+ const next = {
822
+ ...(this.fieldFilters || {})
823
+ };
824
+ if (value === '' || value === undefined || value === null) delete next[fieldId];else next[fieldId] = String(value);
825
+ this.fieldFilters = next;
826
+ this.page = 1;
827
+ return this.reload();
828
+ },
829
+ setPage(p) {
830
+ const n = Math.max(1, Number(p) || 1);
831
+ if (n === this.page) return;
832
+ this.page = n;
833
+ return this.reload();
834
+ },
835
+ get statusOptions() {
836
+ return this.schema?.family === 'operation' ? OP_STATUSES : CAT_STATUSES;
837
+ },
838
+ /** Поля списка и флагов для быстрого отбора в шапке. */
839
+ get filterableFields() {
840
+ return (this.columns || []).filter(c => c.type === 'Select' || c.type === 'Boolean').map(c => ({
841
+ id: c.id,
842
+ label: c.label || c.id,
843
+ filterOptions: c.type === 'Boolean' ? [{
844
+ value: '1',
845
+ label: 'Да'
846
+ }, {
847
+ value: '0',
848
+ label: 'Нет'
849
+ }] : c.options || []
850
+ }));
851
+ },
852
+ get pageText() {
853
+ const from = (this.page - 1) * this.pageSize + 1;
854
+ const to = Math.min(this.page * this.pageSize, this.total || this.rows.length);
855
+ return `${from}–${to} из ${this.total}`;
856
+ },
857
+ contextTitle(c) {
858
+ return c?.place ? `${c.unit_label} / ${c.place_label}` : c?.unit_label || '';
859
+ },
860
+ /** Действующая схема редактора: у выбранного в группе листа — его схема, иначе схема класса. */
861
+ get activeSchema() {
862
+ return this.leafSchema || this.schema;
863
+ },
864
+ get isOperation() {
865
+ return this.schema?.family === 'operation';
866
+ },
867
+ get hasPostings() {
868
+ const s = this.activeSchema;
869
+ return this.isOperation && Array.isArray(s?.POSTINGS) && s.POSTINGS.length > 0;
870
+ },
871
+ /** Объекты создаются в листе справочника или операции (либо в группе, где есть листья). */
872
+ get canCreate() {
873
+ const s = this.schema;
874
+ return !!s && (!!s.leaf || this.leaves?.length > 0) && (s.family === 'catalog' || s.family === 'operation') && s.type !== '$virtual';
875
+ },
876
+ /** Выбор листа в окне нового объекта нужен в группе с несколькими листьями. */
877
+ get showLeafSelect() {
878
+ return !!this.schema && !this.schema.leaf && (this.leaves?.length || 0) > 1;
879
+ },
880
+ /** Колонка «Операция» / «Вид» показывается у группы классов с поддеревом. */
881
+ get showClassCol() {
882
+ return !!this.schema && !this.schema.leaf && Object.keys(this.classes || {}).length > 1;
883
+ },
884
+ get status() {
885
+ return this.editing?.status || '';
886
+ },
887
+ /** Сохранять можно справочник, новый объект, черновик и проведённую операцию (исправление). */
888
+ get canSave() {
889
+ return !!this.editing && this.status !== 'cancelled' && this.status !== 'deleted';
890
+ },
891
+ get canRemove() {
892
+ return !!this.editing?.id && (!this.isOperation || this.status === 'draft') && this.status !== 'deleted';
893
+ },
894
+ get canRestore() {
895
+ return !!this.editing?.id && !this.isOperation && this.status === 'deleted';
896
+ },
897
+ get canRegister() {
898
+ return this.isOperation && !!this.editing && (!this.editing.id || this.status === 'draft');
899
+ },
900
+ get canCancel() {
901
+ return this.isOperation && this.status === 'registered';
902
+ },
903
+ /** Заголовок окна: класс + имя объекта; у нового имени ещё нет. */
904
+ get editorTitle() {
905
+ const title = this.activeSchema?.title || this.schema?.title || '';
906
+ const field = this.fieldList().find(f => ['name', 'label', 'title'].includes(f.id));
907
+ const name = field ? String(this.editing?.[field.id] ?? '').trim() : '';
908
+ const object = name || (this.editing?.id ? '' : 'новый объект');
909
+ if (!title) return object || 'Объект';
910
+ if (!object || title === object) return title;
911
+ return title + ' · ' + object;
912
+ },
913
+ /** Относительный путь места хранения объекта внутри промежуточного класса (для колонки «Группа»). */
914
+ groupLabelOf(cid) {
915
+ if (!cid) return '';
916
+ const entry = this.classes?.[cid];
917
+ if (!entry) return String(cid);
918
+ if (typeof entry.group === 'string' && entry.group) return entry.group;
919
+ const rootCid = this.schema?.cid || '';
920
+ const rootPath = this.schema?.path || this.$item?.path || this.$item?.short || '';
921
+ if (entry.parent) {
922
+ const parts = [];
923
+ let cur = entry;
924
+ const seen = new Set();
925
+ while (cur && cur.cid !== rootCid && cur.path !== rootPath && !seen.has(cur.cid)) {
926
+ seen.add(cur.cid);
927
+ parts.unshift(cur.label || cur.cid.split('/').pop());
928
+ cur = cur.parent ? this.classes?.[cur.parent] : null;
929
+ }
930
+ if (parts.length) return parts.join('/');
931
+ }
932
+ let basePath = rootPath;
933
+ if (!basePath) {
934
+ const rootEntry = Object.values(this.classes || {}).find(c => !c.leaf);
935
+ basePath = rootEntry?.path || '';
936
+ }
937
+ if (basePath && entry.path && entry.path.startsWith(basePath + '/')) {
938
+ const rel = entry.path.slice(basePath.length + 1).split('/').filter(Boolean);
939
+ const byPath = new Map(Object.values(this.classes || {}).filter(c => c?.path).map(c => [c.path, c.label]));
940
+ let acc = basePath;
941
+ const labels = rel.map(seg => {
942
+ acc += '/' + seg;
943
+ return byPath.get(acc) || seg;
944
+ });
945
+ if (labels.length) return labels.join('/');
946
+ }
947
+ return entry.label || String(cid);
948
+ },
949
+ /** Колонки таблицы: первым всегда «Наименование» (прилипает слева), у операций — дата и статус, у промежуточного класса — колонка «Группа» справа (прилипает справа). */
950
+ get tableMetadata() {
951
+ const rawCols = (this.columns || []).map(c => {
952
+ if (c.type === 'Link') return {
953
+ ...c,
954
+ type: 'String',
955
+ isLinkCol: true,
956
+ linkTarget: c.catalog || ''
957
+ };
958
+ if (c.type === 'Table' || c.type === 'Struct') return {
959
+ ...c,
960
+ type: 'String'
961
+ };
962
+ return c;
963
+ });
964
+ const existingName = rawCols.find(c => c.id === 'name');
965
+ const nameCol = {
966
+ ...(existingName || {
967
+ id: 'name',
968
+ type: 'String'
969
+ }),
970
+ id: 'name',
971
+ label: !existingName?.label || existingName.label === 'name' ? 'Наименование' : existingName.label,
972
+ stickyLeft: true,
973
+ minWidth: 200
974
+ };
975
+ const restCols = rawCols.filter(c => c.id !== 'name');
976
+ const orderedCols = this.isOperation && restCols.length > 1 ? [...rawCols.filter(c => c.id !== 'name' && c.id !== 'comment'), ...rawCols.filter(c => c.id === 'comment')] : restCols;
977
+ const clsCol = this.showClassCol ? [{
978
+ id: 'cls',
979
+ label: 'Группа',
980
+ type: 'String',
981
+ isGroupCol: true,
982
+ stickyRight: true,
983
+ minWidth: 170
984
+ }] : [];
985
+ return this.isOperation ? [nameCol, {
986
+ id: 'time',
987
+ label: 'Дата',
988
+ type: 'String',
989
+ isDateCol: true,
990
+ system: false,
991
+ minWidth: 96
992
+ }, ...orderedCols, {
993
+ id: 'state',
994
+ label: 'Статус',
995
+ type: 'String',
996
+ minWidth: 96
997
+ }, ...clsCol] : [nameCol, ...orderedCols, ...clsCol];
998
+ },
999
+ /** Строки таблицы: названия вместо id ссылок, число строк табличной части, выжимка структуры, статус текстом; id сохраняется. */
1000
+ get tableRows() {
1001
+ const cols = this.columns || [];
1002
+ return (this.rows || []).map(r => {
1003
+ const out = {
1004
+ ...r
1005
+ };
1006
+ if (this.showClassCol) {
1007
+ const grp = this.groupLabelOf(r.cid);
1008
+ out.cls = grp;
1009
+ out.group = grp;
1010
+ const grpPath = r.cid && this.classes?.[r.cid]?.path || r.cid || '';
1011
+ if (grpPath) Object.defineProperty(out, '_groupPath', {
1012
+ value: grpPath,
1013
+ enumerable: false,
1014
+ configurable: true
1015
+ });
1016
+ }
1017
+ let links = null;
1018
+ for (const c of cols) {
1019
+ const v = r[c.id];
1020
+ if (c.type === 'Link' && v) {
1021
+ out[c.id] = this.names?.[v] || v;
1022
+ (links ??= {})[c.id] = {
1023
+ id: v,
1024
+ target: c.catalog || ''
1025
+ };
1026
+ } else if (Array.isArray(v)) out[c.id] = v.length ? `${v.length} стр.` : '';else if (c.type === 'Struct' && v && typeof v === 'object') out[c.id] = Object.values(v).filter(x => x !== undefined && x !== null && typeof x !== 'object' && String(x).trim() !== '').join(' ');
1027
+ }
1028
+ if (links) Object.defineProperty(out, '_links', {
1029
+ value: links,
1030
+ enumerable: false,
1031
+ configurable: true
1032
+ });
1033
+ if (this.isOperation) out.state = STATUS[r.status] || r.status || '';
1034
+ return out;
1035
+ });
1036
+ },
1037
+ /** Поля редактора: у операции первым — дата. */
1038
+ fieldList() {
1039
+ return (this.activeSchema?.FIELDS || this.schema?.FIELDS || []).filter(f => f?.id);
1040
+ },
1041
+ /** Значение для снимка: пустые null/undefined/'' эквивалентны. */
1042
+ _value(v) {
1043
+ if (v === undefined || v === null || v === '') return '';
1044
+ if (Array.isArray(v)) return v.map(x => this._value(x));
1045
+ if (typeof v === 'object') {
1046
+ const out = {};
1047
+ for (const k of Object.keys(v).sort()) out[k] = this._value(v[k]);
1048
+ return out;
1049
+ }
1050
+ return v;
1051
+ },
1052
+ /** Отпечаток только полей редактора: служебные id/status/version в dirty не входят. */
1053
+ fingerprint(data) {
1054
+ const out = {};
1055
+ for (const f of this.fieldList()) out[f.id] = this._value(data?.[f.id]);
1056
+ return JSON.stringify(out);
1057
+ },
1058
+ /** Запомнить текущее состояние как чистое (открытие, сохранение, проведение). */
1059
+ snapshot() {
1060
+ this._snapshot = this.fingerprint(this.editing);
1061
+ },
1062
+ /** Есть ли несохранённые изменения относительно снимка. */
1063
+ isDirty() {
1064
+ return !!this.editing && this.fingerprint(this.editing) !== this._snapshot;
1065
+ },
1066
+ /** Собрать описание схемы для формы и колонок из ответа db_schema.schema. */
1067
+ _buildSchema(s) {
1068
+ const fields = (Array.isArray(s?.fields) ? s.fields : []).filter(f => f?.id && f.id !== 'time').map(formField);
1069
+ let editorFields = fields;
1070
+ if (s?.family === 'operation') {
1071
+ const numId = s?.numerator?.field || fields.find(f => NUM_FIELD_IDS.has(f.id))?.id || '';
1072
+ const numField = numId ? fields.find(f => f.id === numId) : null;
1073
+ const scalars = fields.filter(f => f !== numField && f.id !== 'comment' && f.type !== 'Table');
1074
+ const comments = fields.filter(f => f !== numField && f.id === 'comment');
1075
+ const tables = fields.filter(f => f !== numField && f.type === 'Table');
1076
+ editorFields = [DATE_FIELD, ...(numField ? [numField] : []), ...scalars, ...comments, ...tables];
1077
+ }
1078
+ return {
1079
+ cid: s?.cid || '',
1080
+ path: s?.path || '',
1081
+ title: s?.label || '',
1082
+ family: s?.family || '',
1083
+ type: s?.type || '',
1084
+ leaf: !!s?.leaf,
1085
+ autoRegister: !!s?.autoRegister,
1086
+ numerator: s?.numerator || null,
1087
+ POSTINGS: Array.isArray(s?.postings) ? s.postings : [],
1088
+ LAYOUT: s?.layout || null,
1089
+ FIELDS: editorFields,
1090
+ columns: fields
1091
+ };
1092
+ },
1093
+ /** Схема класса с учётом наследования: поля для колонок и редактора, правила проводок, семейство, поддерево. */
1094
+ async loadSchema() {
1095
+ const res = await this.$item?.fetch('db_schema');
1096
+ const built = this._buildSchema(res?.schema);
1097
+ this.columns = built.columns;
1098
+ this.leaves = Array.isArray(res?.leaves) ? res.leaves : [];
1099
+ this.classes = res?.classes && typeof res.classes === 'object' ? res.classes : {};
1100
+ this._hasServerDays = Array.isArray(res?.days);
1101
+ this.packetsDays = this._hasServerDays ? res.days : [];
1102
+ this.schema = {
1103
+ cid: built.cid,
1104
+ path: built.path,
1105
+ title: built.title,
1106
+ family: built.family,
1107
+ type: built.type,
1108
+ leaf: built.leaf,
1109
+ autoRegister: built.autoRegister,
1110
+ numerator: built.numerator,
1111
+ POSTINGS: built.POSTINGS,
1112
+ LAYOUT: built.LAYOUT,
1113
+ FIELDS: built.FIELDS
1114
+ };
1115
+ },
1116
+ /** Элемент целевого класса-листа (при работе из группы); на самом листе или без WORK.get_item — $item. */
1117
+ async targetItem(cid = this.leafCid) {
1118
+ if (!cid || this.schema?.leaf || typeof WORK?.get_item !== 'function') return this.$item;
1119
+ const path = this.classes?.[cid]?.path || this.leaves?.find(l => l.cid === cid)?.path;
1120
+ if (!path) return this.$item;
1121
+ try {
1122
+ return (await WORK.get_item(path)) || this.$item;
1123
+ } catch {
1124
+ return this.$item;
1125
+ }
1126
+ },
1127
+ /** Загрузить схему выбранного листа в группе классов. */
1128
+ async loadLeafSchema(cid) {
1129
+ this.leafCid = cid || '';
1130
+ this.leafSchema = null;
1131
+ if (!cid || this.schema?.leaf) return;
1132
+ try {
1133
+ const target = await this.targetItem(cid);
1134
+ if (!target || target === this.$item) return;
1135
+ const res = await target.fetch('db_schema');
1136
+ if (res?.schema) {
1137
+ const b = this._buildSchema(res.schema);
1138
+ this.leafSchema = {
1139
+ title: b.title,
1140
+ family: b.family,
1141
+ type: b.type,
1142
+ leaf: b.leaf,
1143
+ autoRegister: b.autoRegister,
1144
+ numerator: b.numerator,
1145
+ POSTINGS: b.POSTINGS,
1146
+ FIELDS: b.FIELDS
1147
+ };
1148
+ }
1149
+ } catch {
1150
+ this.leafSchema = null;
1151
+ }
1152
+ },
1153
+ _autoGeneratedNum: '',
1154
+ _autoNumPeriodKey: '',
1155
+ _numeratorFieldId() {
1156
+ const s = this.activeSchema;
1157
+ if (s?.numerator?.enabled === false) return '';
1158
+ if (s?.numerator?.field) return s.numerator.field;
1159
+ const found = this.fieldList().find(f => NUM_FIELD_IDS.has(f.id));
1160
+ return found ? found.id : '';
1161
+ },
1162
+ _periodKeyForNumerator(timeStr) {
1163
+ const raw = String(timeStr || _today());
1164
+ const reset = this.activeSchema?.numerator?.reset || 'year';
1165
+ if (reset === 'never') return 'all';
1166
+ if (reset === 'day') return raw.slice(0, 10);
1167
+ if (reset === 'month') return raw.slice(0, 7);
1168
+ if (reset === 'quarter') {
1169
+ const y = raw.slice(0, 4);
1170
+ const m = parseInt(raw.slice(5, 7), 10) || 1;
1171
+ return `${y}-Q${Math.floor((m - 1) / 3) + 1}`;
1172
+ }
1173
+ return raw.slice(0, 4);
1174
+ },
1175
+ async _assignAutoNumber(force = false) {
1176
+ if (!this.isOperation || !this.editing || this.editing.id) return;
1177
+ const numField = this._numeratorFieldId();
1178
+ if (!numField) return;
1179
+ const curVal = String(this.editing[numField] ?? '').trim();
1180
+ if (!force && curVal && curVal !== this._autoGeneratedNum) return;
1181
+ try {
1182
+ const target = await this.targetItem();
1183
+ if (!target || typeof target.fetch !== 'function') return;
1184
+ const res = await target.fetch('db_next_number', {
1185
+ time: this.editing.time || _today()
1186
+ });
1187
+ if (res?.number && this.editing && !this.editing.id) {
1188
+ const latestVal = String(this.editing[numField] ?? '').trim();
1189
+ if (force || !latestVal || latestVal === this._autoGeneratedNum) {
1190
+ this.editing[numField] = String(res.number);
1191
+ this._autoGeneratedNum = String(res.number);
1192
+ this._autoNumPeriodKey = this._periodKeyForNumerator(this.editing.time);
1193
+ if (this.isObjectView) {
1194
+ this._dirtyTick = (this._dirtyTick || 0) + 1;
1195
+ this._findFormHost()?.updateActiveTabLabel?.(this.documentTitle);
1196
+ this._notifyForm();
1197
+ }
1198
+ }
1199
+ }
1200
+ } catch {/* ignore if server doesn't return db_next_number in mock */}
1201
+ },
1202
+ /** Сменить лист при создании объекта в группе классов. */
1203
+ async selectLeaf(cid) {
1204
+ await this.loadLeafSchema(cid);
1205
+ await this._assignAutoNumber(true);
1206
+ this.snapshot();
1207
+ if (this.isOperation) this.schedulePreview();
1208
+ },
1209
+ _applyNavFields(nav) {
1210
+ if (!nav || typeof nav !== 'object') return;
1211
+ if (nav.packetsKey) this.packetsKey = String(nav.packetsKey);
1212
+ },
1213
+ async syncFormPeriod(fp) {
1214
+ if (!this.isOperation || !fp || typeof fp !== 'object' || !fp.packetsKey) return;
1215
+ if (this.packetsKey === fp.packetsKey) return;
1216
+ this.packetsKey = String(fp.packetsKey);
1217
+ if (fp.packetsKey === '*') {
1218
+ this.period = this.packetsStart && this.packetsEnd ? {
1219
+ start: this.packetsStart,
1220
+ end: this.packetsEnd
1221
+ } : null;
1222
+ await this.reload();
1223
+ } else if (fp.from && fp.to) {
1224
+ this.period = {
1225
+ start: String(fp.from),
1226
+ end: String(fp.to)
1227
+ };
1228
+ await this.reload();
1229
+ }
1230
+ },
1231
+ async attached() {
1232
+ if (this._attachedDone && !this._initialNav && !this._pendingNavId) {
1233
+ this.mountToolbarSlots();
1234
+ return;
1235
+ }
1236
+ const initNav = this._initialNav;
1237
+ this._initialNav = null;
1238
+ if (initNav?.id) this._pendingNavId = String(initNav.id);
1239
+ const formPeriodKey = initNav?.packetsKey || this._findFormHost()?.formPeriod?.packetsKey || '';
1240
+ if (formPeriodKey) {
1241
+ this.packetsKey = String(formPeriodKey);
1242
+ } else {
1243
+ const savedLocalKey = typeof this.loadFromLocalStorage === 'function' ? this.loadFromLocalStorage('packetsKey') : undefined;
1244
+ if (typeof savedLocalKey === 'string' && savedLocalKey) this.packetsKey = savedLocalKey;
1245
+ }
1246
+ this.mountToolbarSlots();
1247
+ try {
1248
+ await Promise.all([this.loadSchema(), this.loadScope()]);
1249
+ } catch (e) {
1250
+ this.error = String(e?.message || e);
1251
+ return;
1252
+ }
1253
+ // у операций строки грузит пакет (событие выбора периода), справочник — весь список сразу
1254
+ if (this.isOperation) await this.loadRange();else await this.reload();
1255
+ if (this._pendingNavId) {
1256
+ const id = this._pendingNavId;
1257
+ this._pendingNavId = '';
1258
+ await this.openEditor({
1259
+ id
1260
+ });
1261
+ }
1262
+ this._attachedDone = true;
1263
+ },
1264
+ /** Переход из отчёта (журнал, карточка счёта, состав, траектория) сразу к объекту по id. */
1265
+ async applyNav(nav = {}) {
1266
+ if (!nav?.id) return;
1267
+ if (!this.schema) {
1268
+ this._pendingNavId = String(nav.id);
1269
+ return;
1270
+ }
1271
+ await this.openEditor({
1272
+ id: String(nav.id)
1273
+ });
1274
+ },
1275
+ /** Видимые подразделения и места записи; без ответа — форма работает без выбора (сервер решит сам). */
1276
+ async loadScope() {
1277
+ try {
1278
+ const s = await this.$item?.fetch('db_scope');
1279
+ this.units = Array.isArray(s?.units) && !s.all ? s.units : [];
1280
+ this.contexts = Array.isArray(s?.contexts) ? s.contexts : [];
1281
+ } catch {
1282
+ this.units = [];
1283
+ this.contexts = [];
1284
+ }
1285
+ },
1286
+ /** Границы полосы: по реально существующим дням операций (db_schema.days) либо от первой до последней операции. */
1287
+ async loadRange() {
1288
+ if (!this.$item) return;
1289
+ if (Array.isArray(this.packetsDays) && this.packetsDays.length > 0) {
1290
+ const firstDay = this.packetsDays[0];
1291
+ const lastDay = this.packetsDays[this.packetsDays.length - 1];
1292
+ const today = _today();
1293
+ if (this.packetsKey === 'now' && !this.packetsDays.includes(today)) this.packetsKey = '*';
1294
+ this.packetsStart = firstDay;
1295
+ this.packetsEnd = lastDay;
1296
+ return;
1297
+ }
1298
+ if (this._hasServerDays) {
1299
+ const today = _today();
1300
+ this.packetsStart = today;
1301
+ this.packetsEnd = today;
1302
+ return;
1303
+ }
1304
+ const edge = order => this.$item.fetch('db_query', {
1305
+ order,
1306
+ limit: 1
1307
+ }).then(r => r?.items?.[0]?.time).catch(() => undefined);
1308
+ const [first, last] = await Promise.all([edge('time'), edge('-time')]);
1309
+ const today = _today();
1310
+ const lastDay = last ? _day(new Date(last)) : today;
1311
+ this.packetsEnd = lastDay > today ? lastDay : today;
1312
+ this.packetsStart = first ? _day(new Date(first)) : this.packetsEnd;
1313
+ },
1314
+ /**
1315
+ * Смена периода в пакете — единственный повод грузить строки операций заново.
1316
+ * Пакет шлёт selection-changed дважды: авто-событие пропа `selection`
1317
+ * (detail — массив выбранных единиц) и явное при смене выбора (detail — объект).
1318
+ * Учитываем только явное, иначе первая выборка ушла бы без границ.
1319
+ */
1320
+ async onPackets(e) {
1321
+ const d = e?.detail?.value ?? e?.detail ?? {};
1322
+ if (Array.isArray(d)) return;
1323
+ this.period = d.period || null;
1324
+ const nextKey = d.value || (d.selected?.name === '*' ? '*' : d.selected?.mask || this.packetsKey);
1325
+ if (nextKey) this.packetsKey = nextKey;
1326
+ if (this.isOperation) {
1327
+ this._findFormHost()?.setFormPeriod?.({
1328
+ packetsKey: this.packetsKey || '*',
1329
+ from: this.period?.start || '',
1330
+ to: this.period?.end || ''
1331
+ });
1332
+ }
1333
+ await this.reload();
1334
+ },
1335
+ /** Объект ядра → строка формы: поля тела, id, статус, версия; у операции — день даты; у группы — cid. */
1336
+ rowOf(o) {
1337
+ const b = o?.body || {};
1338
+ const row = {
1339
+ ...b,
1340
+ id: o.id,
1341
+ status: o.status,
1342
+ version: o.version
1343
+ };
1344
+ if (o?.cid) row.cid = o.cid;
1345
+ if (this.isOperation) {
1346
+ row.time = o.time ? _day(new Date(o.time)) : '';
1347
+ if (row.sum === undefined) {
1348
+ const fallbackSum = b.total ?? b.credited ?? b.saldo_26;
1349
+ if (fallbackSum !== undefined) row.sum = fallbackSum;
1350
+ }
1351
+ if (!row.comment) row.comment = b.descript || b.base || b.reason || b.theme || b.subject || b.content || '';
1352
+ }
1353
+ if (!row.name) {
1354
+ const clsTitle = o?.cid && this.classes?.[o.cid]?.label || this.schema?.title || '';
1355
+ const numPart = b.num ? ` № ${b.num}` : '';
1356
+ const datePart = row.time ? ` от ${row.time}` : '';
1357
+ row.name = clsTitle || b.num ? `${clsTitle}${numPart}${datePart}`.trim() : o?.id || '';
1358
+ }
1359
+ return row;
1360
+ },
1361
+ _reloadSeq: 0,
1362
+ async reload() {
1363
+ const seq = ++this._reloadSeq;
1364
+ this.rows = [];
1365
+ this.names = {};
1366
+ this.error = '';
1367
+ if (!this.$item) return;
1368
+ try {
1369
+ const params = {
1370
+ limit: this.pageSize || 200,
1371
+ order: '-time'
1372
+ };
1373
+ if (this.page > 1) params.offset = (this.page - 1) * (this.pageSize || 200);
1374
+ if (this.isOperation && this.period) {
1375
+ params.from = this.period.start;
1376
+ params.to = this.period.end;
1377
+ }
1378
+ if (this.unitFilter) params.unit = this.unitFilter;
1379
+ if (this.searchQuery) params.search = this.searchQuery;
1380
+ if (this.statusFilter) params.status = this.statusFilter;
1381
+ const where = {};
1382
+ for (const [k, v] of Object.entries(this.fieldFilters || {})) {
1383
+ if (v !== '' && v !== undefined && v !== null) {
1384
+ const col = (this.columns || []).find(c => c.id === k);
1385
+ where[k] = col?.type === 'Boolean' ? v === '1' || v === 'true' ? 1 : 0 : v;
1386
+ }
1387
+ }
1388
+ if (Object.keys(where).length) params.where = JSON.stringify(where);
1389
+ const res = await this.$item.fetch('db_query', params);
1390
+ if (seq !== this._reloadSeq) return;
1391
+ this.names = res?.names || {};
1392
+ this.rows = (Array.isArray(res?.items) ? res.items : []).map(o => this.rowOf(o));
1393
+ this.total = Number(res?.total) || this.rows.length;
1394
+ // строки пересозданы: выделение возвращаем на открытый объект по id
1395
+ this.selectedRows = [];
1396
+ this.$?.('#objectsTable')?.clearSelection?.();
1397
+ this.focusedRow = this.tableRows.find(r => r.id === (this.editing?.id || this.focusedRow?.id)) ?? null;
1398
+ this.focusedItem = this.focusedRow?.id ? this.focusedRow : null;
1399
+ this._notifyForm();
1400
+ } catch (e) {
1401
+ if (seq !== this._reloadSeq) return;
1402
+ this.error = String(e?.message || e);
1403
+ this._notifyForm();
1404
+ }
1405
+ },
1406
+ async select(row) {
1407
+ if (!row?.id) return;
1408
+ this.error = '';
1409
+ try {
1410
+ const found = await this.$item.fetch('db_read', {
1411
+ id: row.id
1412
+ });
1413
+ if (found?.names && typeof found.names === 'object') this.names = {
1414
+ ...(this.names || {}),
1415
+ ...found.names
1416
+ };
1417
+ await this.loadLeafSchema(found?.cid || row.cid || '');
1418
+ this.editing = this.rowOf(found || {
1419
+ id: row.id
1420
+ });
1421
+ await this.loadEntries();
1422
+ await this.loadPrints();
1423
+ await this.loadTrajectory();
1424
+ } catch (e) {
1425
+ this.error = String(e?.message || e);
1426
+ }
1427
+ },
1428
+ /** Состояние (остатки по счетам) и траектория движений объекта справочника (db_trajectory). */
1429
+ async loadTrajectory() {
1430
+ this.objectBalances = [];
1431
+ this.trajectory = [];
1432
+ this.trajectoryNames = {
1433
+ objects: {},
1434
+ classes: {},
1435
+ paths: {}
1436
+ };
1437
+ if (this.isOperation || !this.editing?.id || !this.$item) return;
1438
+ try {
1439
+ const res = await this.$item.fetch('db_trajectory', {
1440
+ id: this.editing.id,
1441
+ limit: 50
1442
+ });
1443
+ if (!res) return;
1444
+ const names = {
1445
+ objects: {},
1446
+ classes: {},
1447
+ paths: {},
1448
+ ...(res.names || {})
1449
+ };
1450
+ this.trajectoryNames = names;
1451
+ const accText = cid => {
1452
+ const code = String(cid || '').split('/').pop().replace(/^acc\./, '');
1453
+ const label = names.classes?.[cid];
1454
+ return label && label !== code && !label.startsWith(code + ' ') ? `${code} ${label}` : label || code;
1455
+ };
1456
+ this.objectBalances = (Array.isArray(res.closing) ? res.closing : []).map(b => ({
1457
+ account: b.account,
1458
+ slot: b.slot || '',
1459
+ label: accText(b.account),
1460
+ balance: saldo(b.debit, b.credit),
1461
+ qty: b.qty ? String(b.qty) : ''
1462
+ }));
1463
+ this.trajectory = (Array.isArray(res.items) ? res.items : []).map(i => {
1464
+ const title = names.objects?.[i.op_id];
1465
+ const op = (title && title !== i.op_id ? title : '') || names.classes?.[i.op_cid] || i.op_id || '';
1466
+ return {
1467
+ date: i.time ? new Date(i.time).toLocaleDateString() : '',
1468
+ op,
1469
+ op_id: i.op_id || '',
1470
+ op_cid: i.op_cid || '',
1471
+ account: accText(i.account),
1472
+ account_cid: i.account || '',
1473
+ debit: money(i.debit),
1474
+ credit: money(i.credit),
1475
+ qty: i.qty ? String(i.qty) : '',
1476
+ balance: saldo(i.balance > 0 ? i.balance : 0, i.balance < 0 ? -i.balance : 0),
1477
+ storno: !!i.storno
1478
+ };
1479
+ });
1480
+ } catch {
1481
+ this.objectBalances = [];
1482
+ this.trajectory = [];
1483
+ }
1484
+ },
1485
+ /** Печатные формы сохранённой операции; без ответа — кнопок печати нет. */
1486
+ async loadPrints() {
1487
+ this.printForms = [];
1488
+ if (!this.isOperation || !this.editing?.id) return;
1489
+ try {
1490
+ const target = await this.targetItem();
1491
+ const list = await target.fetch('db_print_list', {
1492
+ id: this.editing.id
1493
+ });
1494
+ this.printForms = Array.isArray(list) ? list : [];
1495
+ } catch {
1496
+ this.printForms = [];
1497
+ }
1498
+ },
1499
+ /** Открыть печатную форму в новом окне: окно создаётся сразу по клику, иначе браузер заблокирует его. */
1500
+ async printForm(name) {
1501
+ const win = window.open('', '_blank');
1502
+ if (!win) return this.error = 'Браузер заблокировал окно печати';
1503
+ try {
1504
+ const target = await this.targetItem();
1505
+ const res = await target.fetch('db_print', {
1506
+ id: this.editing.id,
1507
+ name
1508
+ });
1509
+ win.document.open();
1510
+ win.document.write(res?.html || '');
1511
+ win.document.close();
1512
+ win.focus();
1513
+ } catch (e) {
1514
+ win.close();
1515
+ this.error = String(e?.message || e);
1516
+ }
1517
+ },
1518
+ /** Проводки операции: проведённой — действующие, черновика — предпросмотр (ошибки правил — текстом). */
1519
+ async loadEntries() {
1520
+ this.entries = [];
1521
+ this.entryNames = {
1522
+ objects: {},
1523
+ classes: {}
1524
+ };
1525
+ const op = this.editing;
1526
+ if (!this.hasPostings || !op?.id || op.status === 'cancelled') return;
1527
+ try {
1528
+ const target = await this.targetItem();
1529
+ if (op.status === 'registered') this.entries = (await target.fetch('db_entries', {
1530
+ id: op.id
1531
+ })) || [];else {
1532
+ const p = await target.fetch('db_preview', {
1533
+ id: op.id
1534
+ });
1535
+ this.entryNames = p?.names || {
1536
+ objects: {},
1537
+ classes: {}
1538
+ };
1539
+ this.entries = [...(p?.entries || []), ...(p?.errors || []).map(e => ({
1540
+ error: (e.field ? e.field + ': ' : '') + e.message
1541
+ }))];
1542
+ }
1543
+ } catch (e) {
1544
+ this.entries = [{
1545
+ error: String(e?.message || e)
1546
+ }];
1547
+ }
1548
+ },
1549
+ /** Предпросмотр проводок по несохранённому телу операции при вводе в форме. */
1550
+ async previewDraft() {
1551
+ const op = this.editing;
1552
+ if (!this.isOperation || !this.hasPostings || !op || op.status === 'registered') return;
1553
+ try {
1554
+ const target = await this.targetItem();
1555
+ const params = op.time ? {
1556
+ time: op.time
1557
+ } : {};
1558
+ const p = await target.fetch('db_preview', params, this.postData());
1559
+ this.entryNames = p?.names || {
1560
+ objects: {},
1561
+ classes: {}
1562
+ };
1563
+ this.entries = [...(p?.entries || []), ...(p?.errors || []).map(e => ({
1564
+ error: (e.field ? e.field + ': ' : '') + e.message
1565
+ }))];
1566
+ if (this.isObjectView) {
1567
+ this._dirtyTick = (this._dirtyTick || 0) + 1;
1568
+ this._findFormHost()?.updateActiveTabLabel?.(this.documentTitle);
1569
+ }
1570
+ } catch (e) {
1571
+ this.entries = [{
1572
+ error: String(e?.message || e)
1573
+ }];
1574
+ }
1575
+ },
1576
+ schedulePreview() {
1577
+ if (!this.isOperation || !this.hasPostings) return;
1578
+ clearTimeout(this._previewTimer);
1579
+ this._previewTimer = setTimeout(() => {
1580
+ if (this.editing && (!this.editing.id || this.status === 'draft' || this.status === 'cancelled')) this.previewDraft();
1581
+ }, 250);
1582
+ },
1583
+ /** Строка проводки в окне: «Дт 62 — Кт 90: 500», с названиями счетов и аналитик (если есть) и количеством. */
1584
+ entryText(e) {
1585
+ if (e?.error) return e.error;
1586
+ const side = (cid, an) => {
1587
+ const code = String(cid || '').split('/').pop().replace(/^acc\./, '');
1588
+ const label = this.entryNames?.classes?.[cid];
1589
+ const base = label && label !== code && !label.startsWith(code + ' ') ? `${code} ${label}` : label || code;
1590
+ const objs = Object.values(an || {}).map(id => this.entryNames?.objects?.[id] || this.names?.[id] || id).filter(Boolean).join(', ');
1591
+ return objs ? `${base} (${objs})` : base;
1592
+ };
1593
+ const qty = e.qty ? ` (${e.doc_qty ?? e.qty}${e.doc_unit ? ' ' + e.doc_unit : ''})` : '';
1594
+ return `Дт ${side(e.debit, e.debit_analytics)} — Кт ${side(e.credit, e.credit_analytics)}: ${Number(e.amount || 0).toLocaleString('ru-RU', {
1595
+ minimumFractionDigits: 2
1596
+ })}${qty}`;
1597
+ },
1598
+ /** Загрузить объект и открыть вьюху редактора (внутри work-form — на вкладке form/object, автономно — модально). */
1599
+ async openEditor(row) {
1600
+ if (!row?.id || this.editorOpen) return;
1601
+ const formHost = this._findFormHost();
1602
+ if (formHost && typeof formHost.openInForm === 'function') {
1603
+ const target = await this.targetItem(row.cid || '');
1604
+ await formHost.openInForm(target || this.$item, {
1605
+ view: 'objects/object',
1606
+ id: row.id,
1607
+ leafCid: row.cid || '',
1608
+ label: row.name || row.title || row.id
1609
+ });
1610
+ return;
1611
+ }
1612
+ this.editorOpen = true;
1613
+ this.editing = null;
1614
+ try {
1615
+ await this.select(row);
1616
+ if (this.editing) await this.showEditor();
1617
+ } finally {
1618
+ this.focusedRow = null;
1619
+ this.editorOpen = false;
1620
+ }
1621
+ },
1622
+ /**
1623
+ * Построить дерево подклассов промежуточного класса для диалога выбора конечной точки хранения.
1624
+ * В промежуточных классах объекты храниться не могут — они отображаются как серые узлы группировки,
1625
+ * а выбрать можно только конечный класс-лист (`leaf: true`).
1626
+ */
1627
+ buildClassTree() {
1628
+ const fn = globalThis.__workClassPicker?.buildClassTree || globalThis.WORK?.buildClassTree;
1629
+ if (typeof fn === 'function') {
1630
+ return fn({
1631
+ classes: this.classes,
1632
+ leaves: this.leaves,
1633
+ rows: this.rows,
1634
+ rootCid: this.schema?.cid || '',
1635
+ rootPath: this.schema?.path || this.$item?.path || this.$item?.short || '',
1636
+ defaultIcon: this.isOperation ? 'carbon:task-complete' : 'carbon:catalog',
1637
+ defaultType: this.schema?.type || '$catalog'
1638
+ });
1639
+ }
1640
+ return [];
1641
+ },
1642
+ /** Открыть модальное окно выбора конечного класса хранения перед созданием объекта из промежуточного класса. */
1643
+ async pickTargetLeafClass() {
1644
+ const tree = this.buildClassTree();
1645
+ if (!tree.length) return '';
1646
+ const classTitle = this.schema?.title || this.$item?.DATA?.label || this.$item?.label || this.$item?.id || '';
1647
+ const dialogTitle = `Выберите класс для создания объекта '${classTitle}'`;
1648
+ const pickFn = globalThis.__workClassPicker?.pickClassFromTree || globalThis.WORK?.pickClassFromTree;
1649
+ if (typeof pickFn === 'function') return pickFn(tree, {
1650
+ title: dialogTitle
1651
+ });
1652
+ const picker = ODA.createComponent('item-class-picker', {
1653
+ treeNodes: tree,
1654
+ selectedCid: ''
1655
+ });
1656
+ try {
1657
+ await WORK.showModal(picker, {
1658
+ TITLE: {
1659
+ label: dialogTitle
1660
+ },
1661
+ allowClose: true,
1662
+ width: Math.min(580, (window.innerWidth || 640) - 32)
1663
+ });
1664
+ return picker.confirmedCid || '';
1665
+ } catch {
1666
+ return '';
1667
+ }
1668
+ },
1669
+ /** Новый объект — если вызван на промежуточном классе, сначала предлагаем выбрать конечный класс-лист хранения. */
1670
+ async create() {
1671
+ if (this.editorOpen) return;
1672
+ if (!this.schema) await this.loadSchema().catch(() => {});
1673
+ let chosenCid = '';
1674
+ if (!this.schema?.leaf) {
1675
+ if (!this.leaves?.length) return;
1676
+ if (typeof WORK?.showModal === 'function' && typeof document !== 'undefined') {
1677
+ chosenCid = await this.pickTargetLeafClass();
1678
+ if (!chosenCid) return;
1679
+ } else {
1680
+ chosenCid = this.leafCid || this.leaves[0].cid;
1681
+ }
1682
+ }
1683
+ const formHost = this._findFormHost();
1684
+ if (formHost && typeof formHost.openInForm === 'function') {
1685
+ const target = chosenCid ? await this.targetItem(chosenCid) : this.$item;
1686
+ const leafLabel = chosenCid ? this.classes?.[chosenCid]?.label || this.leaves?.find(l => l.cid === chosenCid)?.label || '' : '';
1687
+ const title = leafLabel || this.schema?.title || 'Объект';
1688
+ const fmtNew = globalThis.__workClassPicker?.formatNewObjectLabel || globalThis.WORK?.formatNewObjectLabel;
1689
+ const tabLabel = typeof fmtNew === 'function' ? fmtNew(title) : `${title} · новый объект`;
1690
+ if (target && chosenCid && typeof formHost.ensureClassTab === 'function') {
1691
+ await formHost.ensureClassTab(target);
1692
+ }
1693
+ await formHost.openInForm(target || this.$item, {
1694
+ view: 'objects/object',
1695
+ create: true,
1696
+ leafCid: chosenCid || '',
1697
+ label: tabLabel
1698
+ });
1699
+ return;
1700
+ }
1701
+ if (chosenCid) {
1702
+ this.editorOpen = true;
1703
+ await this.loadLeafSchema(chosenCid);
1704
+ } else {
1705
+ this.editorOpen = true;
1706
+ this.leafCid = '';
1707
+ this.leafSchema = null;
1708
+ }
1709
+ this.editing = this.isOperation ? {
1710
+ time: _today()
1711
+ } : {};
1712
+ await this._assignAutoNumber(true);
1713
+ this.entries = [];
1714
+ this.entryNames = {
1715
+ objects: {},
1716
+ classes: {}
1717
+ };
1718
+ this.objectBalances = [];
1719
+ this.trajectory = [];
1720
+ this.printForms = [];
1721
+ this.clearError();
1722
+ try {
1723
+ await this.showEditor();
1724
+ } finally {
1725
+ this.focusedRow = null;
1726
+ this.editorOpen = false;
1727
+ }
1728
+ },
1729
+ /** Клонирование выбранного объекта: открывает окно создания нового объекта с заполненными полями оригинала. */
1730
+ async copyRow(row = this.focusedRow) {
1731
+ if (!row?.id || this.editorOpen || !this.canCreate) return;
1732
+ const formHost = this._findFormHost();
1733
+ if (formHost && typeof formHost.openInForm === 'function') {
1734
+ const target = await this.targetItem(row.cid || '');
1735
+ await formHost.openInForm(target || this.$item, {
1736
+ view: 'objects/object',
1737
+ copyFrom: row.id,
1738
+ leafCid: row.cid || '',
1739
+ label: `${row.name || 'Объект'} (копия)`
1740
+ });
1741
+ return;
1742
+ }
1743
+ this.editorOpen = true;
1744
+ this.clearError();
1745
+ try {
1746
+ const found = await this.$item.fetch('db_read', {
1747
+ id: row.id
1748
+ });
1749
+ if (found?.names && typeof found.names === 'object') this.names = {
1750
+ ...(this.names || {}),
1751
+ ...found.names
1752
+ };
1753
+ await this.loadLeafSchema(found?.cid || row.cid || '');
1754
+ const baseBody = {
1755
+ ...(found?.body || {})
1756
+ };
1757
+ delete baseBody.id;
1758
+ delete baseBody.version;
1759
+ delete baseBody.status;
1760
+ const nf = this._numeratorFieldId();
1761
+ if (nf) delete baseBody[nf];
1762
+ this.editing = this.isOperation ? {
1763
+ ...baseBody,
1764
+ time: _today()
1765
+ } : baseBody;
1766
+ await this._assignAutoNumber(true);
1767
+ this.entries = [];
1768
+ this.entryNames = {
1769
+ objects: {},
1770
+ classes: {}
1771
+ };
1772
+ this.objectBalances = [];
1773
+ this.trajectory = [];
1774
+ this.printForms = [];
1775
+ await this.showEditor();
1776
+ } catch (e) {
1777
+ this.setError(e);
1778
+ } finally {
1779
+ this.editorOpen = false;
1780
+ }
1781
+ },
1782
+ /** Удаление выбранного объекта или списка объектов (при множественном выборе с allowList) из тулбара. */
1783
+ async deleteRow(target = this.activeSelection) {
1784
+ const list = (Array.isArray(target) ? target : target?.id ? [target] : this.activeSelection).filter(r => this.canDeleteRow(r));
1785
+ if (!list.length || this.busy) return;
1786
+ this.busy = true;
1787
+ this.clearError();
1788
+ try {
1789
+ for (const row of list) {
1790
+ const item = await this.targetItem(row.cid || '');
1791
+ await item.fetch('db_delete', {
1792
+ id: row.id
1793
+ });
1794
+ }
1795
+ this.selectedRows = [];
1796
+ this.focusedRow = null;
1797
+ this.focusedItem = null;
1798
+ this.$?.('#objectsTable')?.clearSelection?.();
1799
+ await this.reload();
1800
+ } catch (e) {
1801
+ this.setError(e);
1802
+ } finally {
1803
+ this.busy = false;
1804
+ }
1805
+ },
1806
+ /** Только поля схемы (без даты операции — она уходит параметром); пустые строки таблиц отбрасываются. */
1807
+ postData() {
1808
+ // editing — та же data, в которую пишет форма: снимок form.result может отставать
1809
+ const fields = this.fieldList().filter(f => f.id !== DATE_FIELD.id || !this.isOperation);
1810
+ const byId = new Map(fields.map(f => [f.id, f]));
1811
+ const out = {};
1812
+ for (const [k, v] of Object.entries(this.editing || {})) {
1813
+ const f = byId.get(k);
1814
+ if (!f) continue;
1815
+ if (f.type === 'Table' && Array.isArray(v)) out[k] = v.filter(isNonEmptyRow);else if (f.type === 'File' && v && typeof v === 'object') out[k] = v.path || v.name || String(v);else out[k] = v;
1816
+ }
1817
+ return out;
1818
+ },
1819
+ /** Загрузить выбранные в контролах File файлы на сервер перед сохранением объекта. */
1820
+ async uploadFiles(target) {
1821
+ if (!this.editing || typeof this.editing !== 'object') return;
1822
+ for (const f of this.fieldList()) {
1823
+ if (f.type !== 'File') continue;
1824
+ const val = this.editing[f.id];
1825
+ if (!val || typeof val === 'string') continue;
1826
+ const fileObj = Array.isArray(val) ? val[0] : val;
1827
+ if (!fileObj) continue;
1828
+ if (typeof target?.save_file === 'function' && typeof File !== 'undefined' && fileObj instanceof File) {
1829
+ const saved = await target.save_file(fileObj);
1830
+ this.editing[f.id] = saved?.path || saved?.id || fileObj.name;
1831
+ } else {
1832
+ this.editing[f.id] = fileObj.path || fileObj.name || String(fileObj);
1833
+ }
1834
+ }
1835
+ },
1836
+ /** Параметры записи: id и версия (защита от чужой правки), дата операции; у нового — место записи. */
1837
+ writeParams(extra = {}) {
1838
+ const p = {
1839
+ ...extra
1840
+ };
1841
+ if (this.editing?.id) {
1842
+ p.id = this.editing.id;
1843
+ if (this.editing.version) p.version = this.editing.version;
1844
+ } else if (this.showContext && this.context) {
1845
+ p.unit = this.context.unit;
1846
+ if (this.context.place) p.place = this.context.place;
1847
+ }
1848
+ if (this.isOperation && this.editing?.time) p.time = this.editing.time;
1849
+ return p;
1850
+ },
1851
+ /** Ответ записи: id, статус и версия — для следующего действия в том же окне. */
1852
+ accept(res) {
1853
+ if (res?.id && this.editing) Object.assign(this.editing, {
1854
+ id: res.id,
1855
+ status: res.status,
1856
+ version: res.version
1857
+ });
1858
+ },
1859
+ hasPendingUploads() {
1860
+ if (!this.editing || typeof this.editing !== 'object' || typeof File === 'undefined') return false;
1861
+ for (const f of this.fieldList()) {
1862
+ if (f.type !== 'File') continue;
1863
+ const val = this.editing[f.id];
1864
+ const fileObj = Array.isArray(val) ? val[0] : val;
1865
+ if (fileObj instanceof File) return true;
1866
+ }
1867
+ return false;
1868
+ },
1869
+ async save() {
1870
+ if (this.busy || !this.canSave) return false;
1871
+ this.busy = true;
1872
+ this.clearError();
1873
+ try {
1874
+ if (this.hasPendingUploads()) {
1875
+ const t = await this.targetItem();
1876
+ await this.uploadFiles(t);
1877
+ }
1878
+ const data = this.postData();
1879
+ // снимок отправленного, а не текущего: ввод во время запроса остаётся dirty
1880
+ const saved = this.fingerprint({
1881
+ ...data,
1882
+ time: this.editing.time
1883
+ });
1884
+ const target = await this.targetItem();
1885
+ let res;
1886
+ if (!this.editing.id) res = await target.fetch('db_create', this.writeParams(), data);else if (this.status === 'registered') res = await target.fetch('db_correct', this.writeParams({
1887
+ replace: true
1888
+ }), data);else res = await target.fetch('db_update', this.writeParams({
1889
+ replace: true
1890
+ }), data);
1891
+ this.accept(res);
1892
+ this._snapshot = saved;
1893
+ // внутри окна список обновит его закрытие; внешняя кнопка — сразу
1894
+ if (!this.editorOpen && !this.isObjectView) await this.reload();
1895
+ return true;
1896
+ } catch (e) {
1897
+ this.setError(e);
1898
+ return false;
1899
+ } finally {
1900
+ this.busy = false;
1901
+ }
1902
+ },
1903
+ /** Подтверждение действия; отмена диалога — false. */
1904
+ async confirm(text, title, ok) {
1905
+ try {
1906
+ await WORK.showConfirm(text, {
1907
+ TITLE: {
1908
+ label: title
1909
+ },
1910
+ OK: ok,
1911
+ CANCEL: {
1912
+ label: 'Отмена',
1913
+ icon: 'icons:close',
1914
+ colorMode: 'info'
1915
+ }
1916
+ });
1917
+ return true;
1918
+ } catch {
1919
+ return false;
1920
+ }
1921
+ },
1922
+ /** Удалить редактируемый объект (имя не remove — не затенять Element.remove). */
1923
+ async removeObject() {
1924
+ if (this.busy || !this.canRemove) return false;
1925
+ // подтверждение — часть операции: пока оно открыто, окно не закрыть
1926
+ this.busy = true;
1927
+ try {
1928
+ if (!(await this.confirm('Удалить объект?', 'Удаление', {
1929
+ label: 'Удалить',
1930
+ icon: 'icons:delete',
1931
+ colorMode: 'error'
1932
+ }))) return false;
1933
+ this.error = '';
1934
+ const target = await this.targetItem();
1935
+ await target.fetch('db_delete', this.writeParams());
1936
+ this.snapshot();
1937
+ if (!this.editorOpen && !this.isObjectView) await this.reload();
1938
+ return true;
1939
+ } catch (e) {
1940
+ this.error = String(e?.message || e);
1941
+ return false;
1942
+ } finally {
1943
+ this.busy = false;
1944
+ }
1945
+ },
1946
+ /** Восстановить удалённый объект справочника (db_restore). */
1947
+ async restoreObject() {
1948
+ if (this.busy || !this.canRestore) return false;
1949
+ this.busy = true;
1950
+ this.error = '';
1951
+ try {
1952
+ const target = await this.targetItem();
1953
+ const res = await target.fetch('db_restore', {
1954
+ id: this.editing.id
1955
+ });
1956
+ this.accept(res || {
1957
+ id: this.editing.id,
1958
+ status: 'active',
1959
+ version: this.editing.version
1960
+ });
1961
+ this.snapshot();
1962
+ if (!this.editorOpen && !this.isObjectView) await this.reload();else if (this.isObjectView) await this._findFormHost()?.reloadSiblingLists?.();
1963
+ return true;
1964
+ } catch (e) {
1965
+ this.error = String(e?.message || e);
1966
+ return false;
1967
+ } finally {
1968
+ this.busy = false;
1969
+ }
1970
+ },
1971
+ /** Провести: несохранённое (и новый объект) сначала сохраняется. */
1972
+ async post() {
1973
+ if (this.busy || !this.canRegister) return false;
1974
+ if ((!this.editing.id || this.isDirty()) && !(await this.save())) return false;
1975
+ this.busy = true;
1976
+ this.clearError();
1977
+ try {
1978
+ const target = await this.targetItem();
1979
+ const res = await target.fetch('db_register', this.writeParams());
1980
+ this.accept(res);
1981
+ await this.select({
1982
+ id: this.editing.id
1983
+ });
1984
+ this.focusedItem = this.editing || this.focusedItem;
1985
+ this.snapshot();
1986
+ if (!this.isObjectView) await this.reload();else await this._findFormHost()?.reloadSiblingLists?.();
1987
+ return true;
1988
+ } catch (e) {
1989
+ this.setError(e);
1990
+ return false;
1991
+ } finally {
1992
+ this.busy = false;
1993
+ }
1994
+ },
1995
+ /** Отменить проведённую операцию: сторно всех проводок. */
1996
+ async cancelOperation() {
1997
+ if (this.busy || !this.canCancel) return false;
1998
+ this.busy = true;
1999
+ this.error = '';
2000
+ try {
2001
+ if (!(await this.confirm('Отменить операцию? Её проводки будут сторнированы.', 'Отмена операции', {
2002
+ label: 'Отменить операцию',
2003
+ icon: 'icons:block',
2004
+ colorMode: 'error'
2005
+ }))) return false;
2006
+ const target = await this.targetItem();
2007
+ const res = await target.fetch('db_cancel', this.writeParams());
2008
+ this.accept(res);
2009
+ await this.select({
2010
+ id: this.editing.id
2011
+ });
2012
+ this.focusedItem = this.editing || this.focusedItem;
2013
+ this.snapshot();
2014
+ if (!this.isObjectView) await this.reload();else await this._findFormHost()?.reloadSiblingLists?.();
2015
+ return true;
2016
+ } catch (e) {
2017
+ this.error = String(e?.message || e);
2018
+ return false;
2019
+ } finally {
2020
+ this.busy = false;
2021
+ }
2022
+ },
2023
+ /** Открыть карточку счёта по строке остатка объекта справочника. */
2024
+ async openBalanceAccount(b) {
2025
+ const path = this.trajectoryNames?.paths?.[b?.account] || b?.account;
2026
+ if (!path) return;
2027
+ const nav = {
2028
+ view: 'postings'
2029
+ };
2030
+ if (b.slot && this.editing?.id) nav.filters = {
2031
+ [b.slot]: this.editing.id
2032
+ };
2033
+ try {
2034
+ const t = await WORK.get_item(path);
2035
+ if (t && window.execute) window.execute(t, nav);
2036
+ } catch (e) {
2037
+ this.error = String(e?.message || e);
2038
+ }
2039
+ },
2040
+ /** Открыть операцию из траектории объекта справочника. */
2041
+ async openTrajectoryOp(item) {
2042
+ const path = this.trajectoryNames?.paths?.[item?.op_cid] || item?.op_cid;
2043
+ if (!path) return;
2044
+ try {
2045
+ const t = await WORK.get_item(path);
2046
+ if (t && window.execute) window.execute(t, item?.op_id ? {
2047
+ view: 'objects',
2048
+ id: item.op_id
2049
+ } : undefined);
2050
+ } catch (e) {
2051
+ this.error = String(e?.message || e);
2052
+ }
2053
+ },
2054
+ /** Окно редактора и единый guard закрытия: dirty/busy не пропускают close дальше. */
2055
+ async showEditor() {
2056
+ // «Создать» доступна до ответа схемы: иначе окно откроется с пустой формой и без имени класса
2057
+ if (!this.schema) await this.loadSchema().catch(() => {});
2058
+ this.snapshot();
2059
+ let unguard = () => {};
2060
+ try {
2061
+ const el = ODA.createComponent('item-object-editor', {
2062
+ owner: this
2063
+ });
2064
+ unguard = this.guardClose(el);
2065
+ await WORK.showModal(el, {
2066
+ TITLE: {
2067
+ label: this.editorTitle
2068
+ },
2069
+ allowClose: true,
2070
+ width: Math.min(720, window.innerWidth || 720)
2071
+ });
2072
+ } catch (e) {
2073
+ if (!(WORK.CancelError && e instanceof WORK.CancelError)) this.error = String(e?.message || e);
2074
+ } finally {
2075
+ clearTimeout(this._previewTimer);
2076
+ unguard();
2077
+ this.editing = null;
2078
+ this.entries = [];
2079
+ this.objectBalances = [];
2080
+ this.trajectory = [];
2081
+ this.leafCid = '';
2082
+ this.leafSchema = null;
2083
+ await this.reload();
2084
+ }
2085
+ },
2086
+ /**
2087
+ * Capture-слушатель close: событие всплывает и composed, поэтому документ видит его
2088
+ * раньше платформенного слушателя на popover. Dirty/busy останавливаем и решаем судьбу окна.
2089
+ */
2090
+ guardClose(el) {
2091
+ let pop = null;
2092
+ let bypass = false;
2093
+ let checking = false;
2094
+ const onClose = e => {
2095
+ const target = e.target;
2096
+ if (!target?.contains?.(el)) return;
2097
+ pop = target;
2098
+ if (bypass) return;
2099
+ if (this.busy) {
2100
+ e.stopImmediatePropagation();
2101
+ return;
2102
+ }
2103
+ if (!this.isDirty()) return;
2104
+ e.stopImmediatePropagation();
2105
+ if (checking) return;
2106
+ checking = true;
2107
+ // крестик закрывает по pointerdown: промпт открываем после текущего события
2108
+ setTimeout(async () => {
2109
+ try {
2110
+ if (!(await this.confirmClose())) return;
2111
+ if (!pop?.isConnected) return;
2112
+ bypass = true;
2113
+ pop.close('');
2114
+ } catch {/* не закрываем: окно остаётся открытым */} finally {
2115
+ checking = false;
2116
+ }
2117
+ }, 0);
2118
+ };
2119
+ document.addEventListener('close', onClose, true);
2120
+ return () => document.removeEventListener('close', onClose, true);
2121
+ },
2122
+ /** Да — сохранить и закрыть; Нет — не сохранять и закрыть; Отмена/X/Esc/Enter — остаться. */
2123
+ async confirmClose() {
2124
+ const text = ODA.createElement('p', {
2125
+ textContent: 'Сохранить перед закрытием?',
2126
+ style: 'margin: var(--space-l);'
2127
+ });
2128
+ let result;
2129
+ try {
2130
+ result = await WORK.showDialog(text, {
2131
+ TITLE: {
2132
+ label: 'Закрытие'
2133
+ },
2134
+ allowClose: true,
2135
+ OK: null,
2136
+ BUTTONS: [{
2137
+ label: 'Да',
2138
+ icon: 'icons:check',
2139
+ colorMode: 'success'
2140
+ }, {
2141
+ label: 'Нет',
2142
+ icon: 'icons:close',
2143
+ colorMode: 'error'
2144
+ }],
2145
+ CANCEL: {
2146
+ label: 'Отмена',
2147
+ icon: 'icons:close',
2148
+ colorMode: 'info'
2149
+ }
2150
+ });
2151
+ } catch {
2152
+ return false;
2153
+ }
2154
+ if (result === 1) return await this.save();
2155
+ return result === 2;
2156
+ }
2157
+ }
2158
+ };