@overvis/hmi-workspace-ui 0.0.0-stage → 0.1.0

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 (1023) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +84 -2
  3. package/THIRD_PARTY_NOTICES +151 -0
  4. package/dist/OFL-1.1.txt +93 -0
  5. package/dist/alarm-list-BL3xQ5Lf.js +423 -0
  6. package/dist/alarm-rule-dialog-S1ZUg-74.js +423 -0
  7. package/dist/alarm-rule-lists-C5v1Kf7A.js +344 -0
  8. package/dist/alarm-rules-page-CqFzofPd.js +121 -0
  9. package/dist/alert-B8MAoIO8.js +45 -0
  10. package/dist/alert-dialog-CYkuMg5D.js +129 -0
  11. package/dist/api-error-9rQmUN5L.js +93 -0
  12. package/dist/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  13. package/dist/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  14. package/dist/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  15. package/dist/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  16. package/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  17. package/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  18. package/dist/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  19. package/dist/base-revision-YCO27zR4.js +106 -0
  20. package/dist/breadcrumb-DzVL1yHa.js +74 -0
  21. package/dist/breadcrumbs-0cjsV2cq.js +21 -0
  22. package/dist/button-6SxPBYMz.js +44 -0
  23. package/dist/catalog-list-DjZojYLJ.js +77 -0
  24. package/dist/code-editor-BVimvjDV.js +143 -0
  25. package/dist/context-u9KJQmdB.js +102 -0
  26. package/dist/copyable-id-DYGiAcnq.js +40 -0
  27. package/dist/dashboard-bindings.js +26 -0
  28. package/dist/dashboard-context-CBfG6DoT.js +191 -0
  29. package/dist/dashboards-page-BlrJguNz.js +1064 -0
  30. package/dist/date-time-picker-C3FhMXk6.js +266 -0
  31. package/dist/de-14WdmJxZ.js +4578 -0
  32. package/dist/diagnostic-text-BAkzW0SE.js +111 -0
  33. package/dist/diagnostic-text-DiKd2i1w.js +76 -0
  34. package/dist/dialog-BIhQXcZC.js +237 -0
  35. package/dist/dialog-BqyIxMD-.js +54 -0
  36. package/dist/dialogs-B6BRnf3Q.js +730 -0
  37. package/dist/dialogs-D_v1LeH4.js +7820 -0
  38. package/dist/display-DmOo23mi.js +79 -0
  39. package/dist/dropdown-menu-DSzbBq3v.js +136 -0
  40. package/dist/editor-language-To9MxloY.js +437 -0
  41. package/dist/editor-page-BiSZJz5b.js +1353 -0
  42. package/dist/empty-B-QJ-06w.js +59 -0
  43. package/dist/en-BgercpT0.js +4578 -0
  44. package/dist/entity-controls-D1K4Ot3O.js +76 -0
  45. package/dist/errors-CcsvDHu8.js +26 -0
  46. package/dist/footer-DC-Q0052.js +10675 -0
  47. package/dist/history-page-sAAhG54V.js +1400 -0
  48. package/dist/host.js +1523 -0
  49. package/dist/i18n-BgzakKoC.js +401 -0
  50. package/dist/i18n.js +2 -0
  51. package/dist/icon-D-pR9htW.js +57 -0
  52. package/dist/index-page-DMH82fZe.js +214 -0
  53. package/dist/index.js +19118 -0
  54. package/dist/item-B5SaTFQU.js +120 -0
  55. package/dist/lat-lng-B12P7QyY.js +11 -0
  56. package/dist/list-page-CvsdZb86.js +363 -0
  57. package/dist/location-map-renderer-DO5yfdSU.js +145 -0
  58. package/dist/location-picker-renderer-CjCxg6ai.js +105 -0
  59. package/dist/model-B8gGi4OK.js +9 -0
  60. package/dist/mutation-form-validators-BNz5bsv1.js +2408 -0
  61. package/dist/mutations-THtGG6Ai.js +240 -0
  62. package/dist/notice-card-DyGywFsW.js +246 -0
  63. package/dist/page-2KPemaAj.js +328 -0
  64. package/dist/page-6rIoTg2L.js +459 -0
  65. package/dist/page-C6giEoEd.js +1935 -0
  66. package/dist/page-DCbTxKsi.js +313 -0
  67. package/dist/page-DWO427hT.js +208 -0
  68. package/dist/page-LXu_2zm3.js +137 -0
  69. package/dist/page-aaUiVOnk.js +513 -0
  70. package/dist/page-header-RB2YFWlE.js +55 -0
  71. package/dist/page-title-CdCbiLt8.js +14 -0
  72. package/dist/page-v6LCwswN.js +304 -0
  73. package/dist/panel-DDy8tUNR.js +338 -0
  74. package/dist/parameter-values.js +215 -0
  75. package/dist/pl-lQ9HXV9k.js +4578 -0
  76. package/dist/presence-code-BfSXr50g.js +83 -0
  77. package/dist/progress-C7cxNJA1.js +83 -0
  78. package/dist/provider-BOeYHi0n.js +134 -0
  79. package/dist/provider-DoEpKcQ-.js +29015 -0
  80. package/dist/query-gate-DVhNIkge.js +33 -0
  81. package/dist/quick-report-CUVJnbKP.js +416 -0
  82. package/dist/radio-group-CZGqVbkJ.js +26 -0
  83. package/dist/retention-BYXNpYmR.js +62 -0
  84. package/dist/retention-note-CHhA6gjY.js +42 -0
  85. package/dist/rolldown-runtime-Dy4uBu1J.js +11 -0
  86. package/dist/ru-qTKINoUj.js +4578 -0
  87. package/dist/run-text-DvaO8LDF.js +113 -0
  88. package/dist/search-D4rDnE9T.js +265 -0
  89. package/dist/sections-kCOyc4NR.js +77 -0
  90. package/dist/select-BKiOWdSr.js +539 -0
  91. package/dist/select-eNgZdZ30.js +521 -0
  92. package/dist/skeleton-6yk8Tdh5.js +19 -0
  93. package/dist/slider-DorDsoF8.js +37 -0
  94. package/dist/spinner-C-HPNxOc.js +530 -0
  95. package/dist/src/audit/checkpoint-presentation.d.ts +2 -0
  96. package/dist/src/audit/checkpoints.d.ts +23 -0
  97. package/dist/src/audit/history-model.d.ts +3 -0
  98. package/dist/src/audit/history-page.d.ts +13 -0
  99. package/dist/src/audit/history-presentation.d.ts +21 -0
  100. package/dist/src/audit/history-search.d.ts +6 -0
  101. package/dist/src/audit/revert-checkpoint-dialog.d.ts +29 -0
  102. package/dist/src/audit/revert-device-confirmation.d.ts +20 -0
  103. package/dist/src/audit/setup-change-list.d.ts +5 -0
  104. package/dist/src/brand/brand-link.d.ts +7 -0
  105. package/dist/src/brand/local-brand-link.d.ts +11 -0
  106. package/dist/src/brand/overvis-logo.d.ts +10 -0
  107. package/dist/src/brand/workspace-brand-link.d.ts +10 -0
  108. package/dist/src/brand/workspace-favicon.d.ts +4 -0
  109. package/dist/src/chrome/language-switcher.d.ts +3 -0
  110. package/dist/src/chrome/mode-toggle.d.ts +1 -0
  111. package/dist/src/chrome/text-link.d.ts +8 -0
  112. package/dist/src/code-editor/code-editor.d.ts +55 -0
  113. package/dist/src/code-editor/formula-input.d.ts +20 -0
  114. package/dist/src/code-editor/json-positions.d.ts +26 -0
  115. package/dist/src/code-editor/language-features.d.ts +122 -0
  116. package/dist/src/code-editor/taskfile-language.d.ts +10 -0
  117. package/dist/src/dev-fatal/error-boundary.d.ts +10 -0
  118. package/dist/src/dev-fatal/format-console-error.d.ts +5 -0
  119. package/dist/src/dev-fatal/install.d.ts +6 -0
  120. package/dist/src/dev-fatal/is-enabled.d.ts +7 -0
  121. package/dist/src/dev-fatal/overlay.d.ts +8 -0
  122. package/dist/src/dev-fatal/report-render-error.d.ts +6 -0
  123. package/dist/src/dev-fatal/should-ignore.d.ts +5 -0
  124. package/dist/src/entry/host/index.d.ts +43 -0
  125. package/dist/src/entry/ui/index.d.ts +80 -0
  126. package/dist/src/form/api-error.d.ts +11 -0
  127. package/dist/src/form/fields/checkbox-field.d.ts +9 -0
  128. package/dist/src/form/fields/dashboard-picker-field.d.ts +13 -0
  129. package/dist/src/form/fields/formula-field.d.ts +11 -0
  130. package/dist/src/form/fields/otp-field.d.ts +14 -0
  131. package/dist/src/form/fields/parameter-picker-field.d.ts +3 -0
  132. package/dist/src/form/fields/text-field.d.ts +9 -0
  133. package/dist/src/form/fields/textarea-field.d.ts +6 -0
  134. package/dist/src/form/focus-first-invalid-field.d.ts +4 -0
  135. package/dist/src/form/form-contexts.d.ts +1 -0
  136. package/dist/src/form/form-error-banner.d.ts +4 -0
  137. package/dist/src/form/form-root.d.ts +18 -0
  138. package/dist/src/form/format-field-errors.d.ts +10 -0
  139. package/dist/src/form/index.d.ts +36 -0
  140. package/dist/src/form/map-trpc-to-form-errors.d.ts +34 -0
  141. package/dist/src/form/message.d.ts +5 -0
  142. package/dist/src/form/mutation-form-validators.d.ts +41 -0
  143. package/dist/src/form/submit-button.d.ts +13 -0
  144. package/dist/src/form/trpc-error-data.d.ts +19 -0
  145. package/dist/src/form/use-app-form.d.ts +89 -0
  146. package/dist/src/hooks/use-closed-minute.d.ts +6 -0
  147. package/dist/src/hooks/use-media-query.d.ts +2 -0
  148. package/dist/src/hooks/use-mobile.d.ts +1 -0
  149. package/dist/src/hooks/use-now.d.ts +5 -0
  150. package/dist/src/i18n/catalogs/de/action.d.ts +14 -0
  151. package/dist/src/i18n/catalogs/de/alarm.d.ts +79 -0
  152. package/dist/src/i18n/catalogs/de/api-error.d.ts +261 -0
  153. package/dist/src/i18n/catalogs/de/audit.d.ts +133 -0
  154. package/dist/src/i18n/catalogs/de/automation-editor.d.ts +220 -0
  155. package/dist/src/i18n/catalogs/de/automation-language.d.ts +249 -0
  156. package/dist/src/i18n/catalogs/de/automation.d.ts +59 -0
  157. package/dist/src/i18n/catalogs/de/brand.d.ts +4 -0
  158. package/dist/src/i18n/catalogs/de/cold-room.d.ts +26 -0
  159. package/dist/src/i18n/catalogs/de/copyable.d.ts +6 -0
  160. package/dist/src/i18n/catalogs/de/dashboard.d.ts +92 -0
  161. package/dist/src/i18n/catalogs/de/device-preset.d.ts +71 -0
  162. package/dist/src/i18n/catalogs/de/document.d.ts +52 -0
  163. package/dist/src/i18n/catalogs/de/edge-program-language.d.ts +165 -0
  164. package/dist/src/i18n/catalogs/de/edge-program.d.ts +238 -0
  165. package/dist/src/i18n/catalogs/de/endpoint.d.ts +112 -0
  166. package/dist/src/i18n/catalogs/de/error.d.ts +34 -0
  167. package/dist/src/i18n/catalogs/de/fleet.d.ts +247 -0
  168. package/dist/src/i18n/catalogs/de/formula.d.ts +35 -0
  169. package/dist/src/i18n/catalogs/de/graphics.d.ts +417 -0
  170. package/dist/src/i18n/catalogs/de/language.d.ts +10 -0
  171. package/dist/src/i18n/catalogs/de/messages.d.ts +19 -0
  172. package/dist/src/i18n/catalogs/de/parameter.d.ts +373 -0
  173. package/dist/src/i18n/catalogs/de/pull.d.ts +11 -0
  174. package/dist/src/i18n/catalogs/de/report.d.ts +377 -0
  175. package/dist/src/i18n/catalogs/de/setup.d.ts +65 -0
  176. package/dist/src/i18n/catalogs/de/starter.d.ts +38 -0
  177. package/dist/src/i18n/catalogs/de/storage.d.ts +124 -0
  178. package/dist/src/i18n/catalogs/de/symbols-hvac.d.ts +142 -0
  179. package/dist/src/i18n/catalogs/de/symbols-power.d.ts +122 -0
  180. package/dist/src/i18n/catalogs/de/symbols-quarry.d.ts +81 -0
  181. package/dist/src/i18n/catalogs/de/symbols.d.ts +676 -0
  182. package/dist/src/i18n/catalogs/de/theme.d.ts +4 -0
  183. package/dist/src/i18n/catalogs/de/ui.d.ts +37 -0
  184. package/dist/src/i18n/catalogs/de/workspace.d.ts +19 -0
  185. package/dist/src/i18n/catalogs/de.d.ts +4510 -0
  186. package/dist/src/i18n/catalogs/en/action.d.ts +14 -0
  187. package/dist/src/i18n/catalogs/en/alarm.d.ts +79 -0
  188. package/dist/src/i18n/catalogs/en/api-error.d.ts +261 -0
  189. package/dist/src/i18n/catalogs/en/audit.d.ts +133 -0
  190. package/dist/src/i18n/catalogs/en/automation-editor.d.ts +220 -0
  191. package/dist/src/i18n/catalogs/en/automation-language.d.ts +249 -0
  192. package/dist/src/i18n/catalogs/en/automation.d.ts +59 -0
  193. package/dist/src/i18n/catalogs/en/brand.d.ts +4 -0
  194. package/dist/src/i18n/catalogs/en/cold-room.d.ts +26 -0
  195. package/dist/src/i18n/catalogs/en/copyable.d.ts +6 -0
  196. package/dist/src/i18n/catalogs/en/dashboard.d.ts +92 -0
  197. package/dist/src/i18n/catalogs/en/device-preset.d.ts +71 -0
  198. package/dist/src/i18n/catalogs/en/document.d.ts +52 -0
  199. package/dist/src/i18n/catalogs/en/edge-program-language.d.ts +165 -0
  200. package/dist/src/i18n/catalogs/en/edge-program.d.ts +238 -0
  201. package/dist/src/i18n/catalogs/en/endpoint.d.ts +112 -0
  202. package/dist/src/i18n/catalogs/en/error.d.ts +34 -0
  203. package/dist/src/i18n/catalogs/en/fleet.d.ts +247 -0
  204. package/dist/src/i18n/catalogs/en/formula.d.ts +35 -0
  205. package/dist/src/i18n/catalogs/en/graphics.d.ts +417 -0
  206. package/dist/src/i18n/catalogs/en/language.d.ts +10 -0
  207. package/dist/src/i18n/catalogs/en/messages.d.ts +19 -0
  208. package/dist/src/i18n/catalogs/en/parameter.d.ts +373 -0
  209. package/dist/src/i18n/catalogs/en/pull.d.ts +11 -0
  210. package/dist/src/i18n/catalogs/en/report.d.ts +377 -0
  211. package/dist/src/i18n/catalogs/en/setup.d.ts +65 -0
  212. package/dist/src/i18n/catalogs/en/starter.d.ts +38 -0
  213. package/dist/src/i18n/catalogs/en/storage.d.ts +124 -0
  214. package/dist/src/i18n/catalogs/en/symbols-hvac.d.ts +142 -0
  215. package/dist/src/i18n/catalogs/en/symbols-power.d.ts +122 -0
  216. package/dist/src/i18n/catalogs/en/symbols-quarry.d.ts +81 -0
  217. package/dist/src/i18n/catalogs/en/symbols.d.ts +676 -0
  218. package/dist/src/i18n/catalogs/en/theme.d.ts +4 -0
  219. package/dist/src/i18n/catalogs/en/ui.d.ts +37 -0
  220. package/dist/src/i18n/catalogs/en/workspace.d.ts +19 -0
  221. package/dist/src/i18n/catalogs/en.d.ts +4510 -0
  222. package/dist/src/i18n/catalogs/pl/action.d.ts +14 -0
  223. package/dist/src/i18n/catalogs/pl/alarm.d.ts +79 -0
  224. package/dist/src/i18n/catalogs/pl/api-error.d.ts +261 -0
  225. package/dist/src/i18n/catalogs/pl/audit.d.ts +133 -0
  226. package/dist/src/i18n/catalogs/pl/automation-editor.d.ts +220 -0
  227. package/dist/src/i18n/catalogs/pl/automation-language.d.ts +249 -0
  228. package/dist/src/i18n/catalogs/pl/automation.d.ts +59 -0
  229. package/dist/src/i18n/catalogs/pl/brand.d.ts +4 -0
  230. package/dist/src/i18n/catalogs/pl/cold-room.d.ts +26 -0
  231. package/dist/src/i18n/catalogs/pl/copyable.d.ts +6 -0
  232. package/dist/src/i18n/catalogs/pl/dashboard.d.ts +92 -0
  233. package/dist/src/i18n/catalogs/pl/device-preset.d.ts +71 -0
  234. package/dist/src/i18n/catalogs/pl/document.d.ts +52 -0
  235. package/dist/src/i18n/catalogs/pl/edge-program-language.d.ts +165 -0
  236. package/dist/src/i18n/catalogs/pl/edge-program.d.ts +238 -0
  237. package/dist/src/i18n/catalogs/pl/endpoint.d.ts +112 -0
  238. package/dist/src/i18n/catalogs/pl/error.d.ts +34 -0
  239. package/dist/src/i18n/catalogs/pl/fleet.d.ts +247 -0
  240. package/dist/src/i18n/catalogs/pl/formula.d.ts +35 -0
  241. package/dist/src/i18n/catalogs/pl/graphics.d.ts +417 -0
  242. package/dist/src/i18n/catalogs/pl/language.d.ts +10 -0
  243. package/dist/src/i18n/catalogs/pl/messages.d.ts +19 -0
  244. package/dist/src/i18n/catalogs/pl/parameter.d.ts +373 -0
  245. package/dist/src/i18n/catalogs/pl/pull.d.ts +11 -0
  246. package/dist/src/i18n/catalogs/pl/report.d.ts +377 -0
  247. package/dist/src/i18n/catalogs/pl/setup.d.ts +65 -0
  248. package/dist/src/i18n/catalogs/pl/starter.d.ts +38 -0
  249. package/dist/src/i18n/catalogs/pl/storage.d.ts +124 -0
  250. package/dist/src/i18n/catalogs/pl/symbols-hvac.d.ts +142 -0
  251. package/dist/src/i18n/catalogs/pl/symbols-power.d.ts +122 -0
  252. package/dist/src/i18n/catalogs/pl/symbols-quarry.d.ts +81 -0
  253. package/dist/src/i18n/catalogs/pl/symbols.d.ts +676 -0
  254. package/dist/src/i18n/catalogs/pl/theme.d.ts +4 -0
  255. package/dist/src/i18n/catalogs/pl/ui.d.ts +37 -0
  256. package/dist/src/i18n/catalogs/pl/workspace.d.ts +19 -0
  257. package/dist/src/i18n/catalogs/pl.d.ts +4510 -0
  258. package/dist/src/i18n/catalogs/ru/action.d.ts +14 -0
  259. package/dist/src/i18n/catalogs/ru/alarm.d.ts +79 -0
  260. package/dist/src/i18n/catalogs/ru/api-error.d.ts +261 -0
  261. package/dist/src/i18n/catalogs/ru/audit.d.ts +133 -0
  262. package/dist/src/i18n/catalogs/ru/automation-editor.d.ts +220 -0
  263. package/dist/src/i18n/catalogs/ru/automation-language.d.ts +249 -0
  264. package/dist/src/i18n/catalogs/ru/automation.d.ts +59 -0
  265. package/dist/src/i18n/catalogs/ru/brand.d.ts +4 -0
  266. package/dist/src/i18n/catalogs/ru/cold-room.d.ts +26 -0
  267. package/dist/src/i18n/catalogs/ru/copyable.d.ts +6 -0
  268. package/dist/src/i18n/catalogs/ru/dashboard.d.ts +92 -0
  269. package/dist/src/i18n/catalogs/ru/device-preset.d.ts +71 -0
  270. package/dist/src/i18n/catalogs/ru/document.d.ts +52 -0
  271. package/dist/src/i18n/catalogs/ru/edge-program-language.d.ts +165 -0
  272. package/dist/src/i18n/catalogs/ru/edge-program.d.ts +238 -0
  273. package/dist/src/i18n/catalogs/ru/endpoint.d.ts +112 -0
  274. package/dist/src/i18n/catalogs/ru/error.d.ts +34 -0
  275. package/dist/src/i18n/catalogs/ru/fleet.d.ts +247 -0
  276. package/dist/src/i18n/catalogs/ru/formula.d.ts +35 -0
  277. package/dist/src/i18n/catalogs/ru/graphics.d.ts +417 -0
  278. package/dist/src/i18n/catalogs/ru/language.d.ts +10 -0
  279. package/dist/src/i18n/catalogs/ru/messages.d.ts +19 -0
  280. package/dist/src/i18n/catalogs/ru/parameter.d.ts +373 -0
  281. package/dist/src/i18n/catalogs/ru/pull.d.ts +11 -0
  282. package/dist/src/i18n/catalogs/ru/report.d.ts +377 -0
  283. package/dist/src/i18n/catalogs/ru/setup.d.ts +65 -0
  284. package/dist/src/i18n/catalogs/ru/starter.d.ts +38 -0
  285. package/dist/src/i18n/catalogs/ru/storage.d.ts +124 -0
  286. package/dist/src/i18n/catalogs/ru/symbols-hvac.d.ts +142 -0
  287. package/dist/src/i18n/catalogs/ru/symbols-power.d.ts +122 -0
  288. package/dist/src/i18n/catalogs/ru/symbols-quarry.d.ts +81 -0
  289. package/dist/src/i18n/catalogs/ru/symbols.d.ts +676 -0
  290. package/dist/src/i18n/catalogs/ru/theme.d.ts +4 -0
  291. package/dist/src/i18n/catalogs/ru/ui.d.ts +37 -0
  292. package/dist/src/i18n/catalogs/ru/workspace.d.ts +19 -0
  293. package/dist/src/i18n/catalogs/ru.d.ts +4510 -0
  294. package/dist/src/i18n/catalogs/uk/action.d.ts +14 -0
  295. package/dist/src/i18n/catalogs/uk/alarm.d.ts +79 -0
  296. package/dist/src/i18n/catalogs/uk/api-error.d.ts +261 -0
  297. package/dist/src/i18n/catalogs/uk/audit.d.ts +133 -0
  298. package/dist/src/i18n/catalogs/uk/automation-editor.d.ts +220 -0
  299. package/dist/src/i18n/catalogs/uk/automation-language.d.ts +249 -0
  300. package/dist/src/i18n/catalogs/uk/automation.d.ts +59 -0
  301. package/dist/src/i18n/catalogs/uk/brand.d.ts +4 -0
  302. package/dist/src/i18n/catalogs/uk/cold-room.d.ts +26 -0
  303. package/dist/src/i18n/catalogs/uk/copyable.d.ts +6 -0
  304. package/dist/src/i18n/catalogs/uk/dashboard.d.ts +92 -0
  305. package/dist/src/i18n/catalogs/uk/device-preset.d.ts +71 -0
  306. package/dist/src/i18n/catalogs/uk/document.d.ts +52 -0
  307. package/dist/src/i18n/catalogs/uk/edge-program-language.d.ts +165 -0
  308. package/dist/src/i18n/catalogs/uk/edge-program.d.ts +238 -0
  309. package/dist/src/i18n/catalogs/uk/endpoint.d.ts +112 -0
  310. package/dist/src/i18n/catalogs/uk/error.d.ts +34 -0
  311. package/dist/src/i18n/catalogs/uk/fleet.d.ts +247 -0
  312. package/dist/src/i18n/catalogs/uk/formula.d.ts +35 -0
  313. package/dist/src/i18n/catalogs/uk/graphics.d.ts +417 -0
  314. package/dist/src/i18n/catalogs/uk/language.d.ts +10 -0
  315. package/dist/src/i18n/catalogs/uk/messages.d.ts +19 -0
  316. package/dist/src/i18n/catalogs/uk/parameter.d.ts +373 -0
  317. package/dist/src/i18n/catalogs/uk/pull.d.ts +11 -0
  318. package/dist/src/i18n/catalogs/uk/report.d.ts +377 -0
  319. package/dist/src/i18n/catalogs/uk/setup.d.ts +65 -0
  320. package/dist/src/i18n/catalogs/uk/starter.d.ts +38 -0
  321. package/dist/src/i18n/catalogs/uk/storage.d.ts +124 -0
  322. package/dist/src/i18n/catalogs/uk/symbols-hvac.d.ts +142 -0
  323. package/dist/src/i18n/catalogs/uk/symbols-power.d.ts +122 -0
  324. package/dist/src/i18n/catalogs/uk/symbols-quarry.d.ts +81 -0
  325. package/dist/src/i18n/catalogs/uk/symbols.d.ts +676 -0
  326. package/dist/src/i18n/catalogs/uk/theme.d.ts +4 -0
  327. package/dist/src/i18n/catalogs/uk/ui.d.ts +37 -0
  328. package/dist/src/i18n/catalogs/uk/workspace.d.ts +19 -0
  329. package/dist/src/i18n/catalogs/uk.d.ts +4510 -0
  330. package/dist/src/i18n/index.d.ts +4 -0
  331. package/dist/src/i18n/locale.d.ts +11 -0
  332. package/dist/src/i18n/messages.d.ts +12 -0
  333. package/dist/src/i18n/use-language-change.d.ts +5 -0
  334. package/dist/src/i18n/use-locale.d.ts +1 -0
  335. package/dist/src/index.d.ts +151 -0
  336. package/dist/src/lib/utils.d.ts +2 -0
  337. package/dist/src/theme-provider.d.ts +16 -0
  338. package/dist/src/trpc.d.ts +37 -0
  339. package/dist/src/ui/accordion.d.ts +6 -0
  340. package/dist/src/ui/alert-dialog.d.ts +20 -0
  341. package/dist/src/ui/alert.d.ts +10 -0
  342. package/dist/src/ui/aspect-ratio.d.ts +6 -0
  343. package/dist/src/ui/attachment.d.ts +23 -0
  344. package/dist/src/ui/avatar.d.ts +11 -0
  345. package/dist/src/ui/badge.d.ts +6 -0
  346. package/dist/src/ui/breadcrumb.d.ts +10 -0
  347. package/dist/src/ui/bubble.d.ts +16 -0
  348. package/dist/src/ui/button-group.d.ts +10 -0
  349. package/dist/src/ui/button.d.ts +8 -0
  350. package/dist/src/ui/calendar.d.ts +10 -0
  351. package/dist/src/ui/card.d.ts +11 -0
  352. package/dist/src/ui/carousel.d.ts +28 -0
  353. package/dist/src/ui/chart.d.ts +60 -0
  354. package/dist/src/ui/checkbox.d.ts +3 -0
  355. package/dist/src/ui/collapsible.d.ts +5 -0
  356. package/dist/src/ui/combobox.d.ts +24 -0
  357. package/dist/src/ui/command.d.ts +19 -0
  358. package/dist/src/ui/content-overlay/dismiss.d.ts +10 -0
  359. package/dist/src/ui/content-overlay/region.d.ts +37 -0
  360. package/dist/src/ui/content-overlay/root.d.ts +3 -0
  361. package/dist/src/ui/content-overlay/tab-wrap.d.ts +6 -0
  362. package/dist/src/ui/context-menu.d.ts +28 -0
  363. package/dist/src/ui/data-table.d.ts +38 -0
  364. package/dist/src/ui/date-time-picker.d.ts +30 -0
  365. package/dist/src/ui/dialog.d.ts +19 -0
  366. package/dist/src/ui/direction.d.ts +3 -0
  367. package/dist/src/ui/drawer.d.ts +18 -0
  368. package/dist/src/ui/dropdown-menu.d.ts +29 -0
  369. package/dist/src/ui/empty.d.ts +11 -0
  370. package/dist/src/ui/field.d.ts +24 -0
  371. package/dist/src/ui/gauge-bar.d.ts +43 -0
  372. package/dist/src/ui/gauge.d.ts +24 -0
  373. package/dist/src/ui/hover-card.d.ts +5 -0
  374. package/dist/src/ui/input-group.d.ts +18 -0
  375. package/dist/src/ui/input-otp.d.ts +11 -0
  376. package/dist/src/ui/input.d.ts +3 -0
  377. package/dist/src/ui/item.d.ts +22 -0
  378. package/dist/src/ui/kbd.d.ts +3 -0
  379. package/dist/src/ui/label.d.ts +3 -0
  380. package/dist/src/ui/marker.d.ts +10 -0
  381. package/dist/src/ui/menubar.d.ts +28 -0
  382. package/dist/src/ui/message-history/context.d.ts +51 -0
  383. package/dist/src/ui/message-history/emit.d.ts +27 -0
  384. package/dist/src/ui/message-history/legacy-content.d.ts +6 -0
  385. package/dist/src/ui/message-history/legacy.d.ts +7 -0
  386. package/dist/src/ui/message-history/model.d.ts +22 -0
  387. package/dist/src/ui/message-history/panel.d.ts +6 -0
  388. package/dist/src/ui/message-history/store.d.ts +26 -0
  389. package/dist/src/ui/message-history/toast.d.ts +7 -0
  390. package/dist/src/ui/message-scroller.d.ts +20 -0
  391. package/dist/src/ui/message.d.ts +10 -0
  392. package/dist/src/ui/native-select.d.ts +8 -0
  393. package/dist/src/ui/navigation-menu.d.ts +11 -0
  394. package/dist/src/ui/notice-card.d.ts +61 -0
  395. package/dist/src/ui/page-header.d.ts +21 -0
  396. package/dist/src/ui/page-title.d.ts +5 -0
  397. package/dist/src/ui/pagination.d.ts +17 -0
  398. package/dist/src/ui/popover.d.ts +9 -0
  399. package/dist/src/ui/progress.d.ts +7 -0
  400. package/dist/src/ui/questionnaire.d.ts +19 -0
  401. package/dist/src/ui/radio-group.d.ts +5 -0
  402. package/dist/src/ui/resizable.d.ts +7 -0
  403. package/dist/src/ui/scroll-area.d.ts +5 -0
  404. package/dist/src/ui/select.d.ts +11 -0
  405. package/dist/src/ui/separator.d.ts +3 -0
  406. package/dist/src/ui/sheet.d.ts +14 -0
  407. package/dist/src/ui/sidebar.d.ts +63 -0
  408. package/dist/src/ui/skeleton.d.ts +7 -0
  409. package/dist/src/ui/slider.d.ts +3 -0
  410. package/dist/src/ui/sonner.d.ts +9 -0
  411. package/dist/src/ui/sparkline.d.ts +31 -0
  412. package/dist/src/ui/spinner.d.ts +2 -0
  413. package/dist/src/ui/svg-diagram/dom.d.ts +6 -0
  414. package/dist/src/ui/svg-diagram/types.d.ts +13 -0
  415. package/dist/src/ui/svg-diagram.d.ts +8 -0
  416. package/dist/src/ui/switch.d.ts +5 -0
  417. package/dist/src/ui/table.d.ts +10 -0
  418. package/dist/src/ui/tabs.d.ts +11 -0
  419. package/dist/src/ui/textarea.d.ts +3 -0
  420. package/dist/src/ui/theme-scope.d.ts +11 -0
  421. package/dist/src/ui/toggle-group.d.ts +11 -0
  422. package/dist/src/ui/toggle.d.ts +8 -0
  423. package/dist/src/ui/tooltip.d.ts +6 -0
  424. package/dist/src/version.d.ts +2 -0
  425. package/dist/src/workspace/access-label.d.ts +2 -0
  426. package/dist/src/workspace/alarms/actions.d.ts +19 -0
  427. package/dist/src/workspace/alarms/alarm-list.d.ts +65 -0
  428. package/dist/src/workspace/alarms/history.d.ts +17 -0
  429. package/dist/src/workspace/alarms/model.d.ts +29 -0
  430. package/dist/src/workspace/alarms/nav.d.ts +15 -0
  431. package/dist/src/workspace/alarms/page.d.ts +10 -0
  432. package/dist/src/workspace/alarms/provider.d.ts +30 -0
  433. package/dist/src/workspace/alarms/search.d.ts +8 -0
  434. package/dist/src/workspace/alarms/sound.d.ts +9 -0
  435. package/dist/src/workspace/automations/diagnostic-text.d.ts +6 -0
  436. package/dist/src/workspace/automations/editor-language.d.ts +13 -0
  437. package/dist/src/workspace/automations/item-descriptions.d.ts +3 -0
  438. package/dist/src/workspace/automations/parameter-names.d.ts +2 -0
  439. package/dist/src/workspace/automations/run-text.d.ts +18 -0
  440. package/dist/src/workspace/automations/trace-view.d.ts +24 -0
  441. package/dist/src/workspace/automations/use-catalog.d.ts +10 -0
  442. package/dist/src/workspace/caches.d.ts +41 -0
  443. package/dist/src/workspace/context.d.ts +71 -0
  444. package/dist/src/workspace/copyable-id.d.ts +4 -0
  445. package/dist/src/workspace/dashboards/actions-menu.d.ts +4 -0
  446. package/dist/src/workspace/dashboards/anchor-scroll.d.ts +11 -0
  447. package/dist/src/workspace/dashboards/bindings.d.ts +26 -0
  448. package/dist/src/workspace/dashboards/configuration-rename-dialog.d.ts +10 -0
  449. package/dist/src/workspace/dashboards/configuration-required.d.ts +10 -0
  450. package/dist/src/workspace/dashboards/configuration-update-queue.d.ts +2 -0
  451. package/dist/src/workspace/dashboards/copy-dialog.d.ts +7 -0
  452. package/dist/src/workspace/dashboards/document/blocks.d.ts +42 -0
  453. package/dist/src/workspace/dashboards/document/chart-data.d.ts +13 -0
  454. package/dist/src/workspace/dashboards/document/chart.d.ts +10 -0
  455. package/dist/src/workspace/dashboards/document/layout.d.ts +29 -0
  456. package/dist/src/workspace/dashboards/document/markdown.d.ts +7 -0
  457. package/dist/src/workspace/dashboards/document/sources.d.ts +32 -0
  458. package/dist/src/workspace/dashboards/document/tiles/chart.d.ts +23 -0
  459. package/dist/src/workspace/dashboards/document/tiles/context.d.ts +23 -0
  460. package/dist/src/workspace/dashboards/document/tiles/controls.d.ts +23 -0
  461. package/dist/src/workspace/dashboards/document/tiles/frame.d.ts +28 -0
  462. package/dist/src/workspace/dashboards/document/tiles/gauge-model.d.ts +4 -0
  463. package/dist/src/workspace/dashboards/document/tiles/gauge.d.ts +11 -0
  464. package/dist/src/workspace/dashboards/document/tiles/presentation.d.ts +29 -0
  465. package/dist/src/workspace/dashboards/document/tiles/reading.d.ts +14 -0
  466. package/dist/src/workspace/dashboards/document/tiles/sparkline.d.ts +7 -0
  467. package/dist/src/workspace/dashboards/document/tiles/tile.d.ts +8 -0
  468. package/dist/src/workspace/dashboards/document/tiles/tones.d.ts +44 -0
  469. package/dist/src/workspace/dashboards/document/tiles/use-tile-tone.d.ts +19 -0
  470. package/dist/src/workspace/dashboards/document/tiles/value.d.ts +8 -0
  471. package/dist/src/workspace/dashboards/document/view.d.ts +16 -0
  472. package/dist/src/workspace/dashboards/enabled-switch.d.ts +10 -0
  473. package/dist/src/workspace/dashboards/entrypoint.d.ts +15 -0
  474. package/dist/src/workspace/dashboards/icon.d.ts +6 -0
  475. package/dist/src/workspace/dashboards/load-module.d.ts +40 -0
  476. package/dist/src/workspace/dashboards/locale.d.ts +8 -0
  477. package/dist/src/workspace/dashboards/module-cache.d.ts +9 -0
  478. package/dist/src/workspace/dashboards/mount-diagnostics.d.ts +23 -0
  479. package/dist/src/workspace/dashboards/mount.d.ts +39 -0
  480. package/dist/src/workspace/dashboards/name.d.ts +11 -0
  481. package/dist/src/workspace/dashboards/navigation.d.ts +51 -0
  482. package/dist/src/workspace/dashboards/page-paths.d.ts +7 -0
  483. package/dist/src/workspace/dashboards/page-tabs.d.ts +23 -0
  484. package/dist/src/workspace/dashboards/page.d.ts +4 -0
  485. package/dist/src/workspace/dashboards/rotation.d.ts +26 -0
  486. package/dist/src/workspace/dashboards/search-params.d.ts +7 -0
  487. package/dist/src/workspace/dashboards/sortable-grid.d.ts +79 -0
  488. package/dist/src/workspace/dashboards/stylesheet.d.ts +9 -0
  489. package/dist/src/workspace/dashboards/use-configuration-mutation.d.ts +40 -0
  490. package/dist/src/workspace/device-api/errors.d.ts +6 -0
  491. package/dist/src/workspace/device-api/use-device-api.d.ts +75 -0
  492. package/dist/src/workspace/device-presets/cold-room-card.d.ts +17 -0
  493. package/dist/src/workspace/device-presets/cold-room-commands.d.ts +19 -0
  494. package/dist/src/workspace/device-presets/cold-room-labels.d.ts +5 -0
  495. package/dist/src/workspace/device-presets/cold-room-model.d.ts +141 -0
  496. package/dist/src/workspace/device-presets/command-button.d.ts +34 -0
  497. package/dist/src/workspace/device-presets/endpoint-unavailable.d.ts +15 -0
  498. package/dist/src/workspace/device-presets/gauge-scale.d.ts +23 -0
  499. package/dist/src/workspace/device-presets/gauges.d.ts +52 -0
  500. package/dist/src/workspace/device-presets/header.d.ts +14 -0
  501. package/dist/src/workspace/device-presets/layout.d.ts +52 -0
  502. package/dist/src/workspace/device-presets/overview.d.ts +103 -0
  503. package/dist/src/workspace/device-presets/quantity.d.ts +5 -0
  504. package/dist/src/workspace/device-presets/relay-test-panel.d.ts +37 -0
  505. package/dist/src/workspace/device-presets/relay-test.d.ts +164 -0
  506. package/dist/src/workspace/device-presets/series-colors.d.ts +58 -0
  507. package/dist/src/workspace/device-presets/settings-choice.d.ts +20 -0
  508. package/dist/src/workspace/device-presets/settings-fields.d.ts +39 -0
  509. package/dist/src/workspace/device-presets/settings-form.d.ts +35 -0
  510. package/dist/src/workspace/device-presets/settings-page.d.ts +29 -0
  511. package/dist/src/workspace/device-presets/settings-rows.d.ts +25 -0
  512. package/dist/src/workspace/device-presets/settings-section.d.ts +78 -0
  513. package/dist/src/workspace/device-presets/settings-text.d.ts +5 -0
  514. package/dist/src/workspace/device-presets/settings-types.d.ts +122 -0
  515. package/dist/src/workspace/device-presets/settings-write-dialog.d.ts +27 -0
  516. package/dist/src/workspace/device-presets/settings-write.d.ts +73 -0
  517. package/dist/src/workspace/device-presets/state-text.d.ts +17 -0
  518. package/dist/src/workspace/device-presets/trend-chart.d.ts +51 -0
  519. package/dist/src/workspace/device-presets/trend-model.d.ts +45 -0
  520. package/dist/src/workspace/device-presets/unsupported.d.ts +14 -0
  521. package/dist/src/workspace/device-presets/values.d.ts +56 -0
  522. package/dist/src/workspace/edge-programs/deploy-status.d.ts +12 -0
  523. package/dist/src/workspace/edge-programs/diagnostic-text.d.ts +9 -0
  524. package/dist/src/workspace/edge-programs/editor-language.d.ts +15 -0
  525. package/dist/src/workspace/edge-programs/item-descriptions.d.ts +3 -0
  526. package/dist/src/workspace/edge-programs/live-state.d.ts +12 -0
  527. package/dist/src/workspace/endpoint-status/provider.d.ts +16 -0
  528. package/dist/src/workspace/endpoint-status/store.d.ts +18 -0
  529. package/dist/src/workspace/errors.d.ts +1 -0
  530. package/dist/src/workspace/fleet/alarms.d.ts +27 -0
  531. package/dist/src/workspace/fleet/binding-editor.d.ts +65 -0
  532. package/dist/src/workspace/fleet/board-editor.d.ts +118 -0
  533. package/dist/src/workspace/fleet/command-buttons.d.ts +19 -0
  534. package/dist/src/workspace/fleet/command-entry.d.ts +25 -0
  535. package/dist/src/workspace/fleet/command-steps.d.ts +65 -0
  536. package/dist/src/workspace/fleet/control-mode.d.ts +30 -0
  537. package/dist/src/workspace/fleet/counter-bars.d.ts +109 -0
  538. package/dist/src/workspace/fleet/counter-notices.d.ts +23 -0
  539. package/dist/src/workspace/fleet/counter-period.d.ts +35 -0
  540. package/dist/src/workspace/fleet/counter-shares.d.ts +34 -0
  541. package/dist/src/workspace/fleet/counter-total.d.ts +43 -0
  542. package/dist/src/workspace/fleet/counter-totals.d.ts +77 -0
  543. package/dist/src/workspace/fleet/due-dates.d.ts +18 -0
  544. package/dist/src/workspace/fleet/duplicate-dialog.d.ts +63 -0
  545. package/dist/src/workspace/fleet/editor-dialog.d.ts +26 -0
  546. package/dist/src/workspace/fleet/equipment-setup.d.ts +44 -0
  547. package/dist/src/workspace/fleet/equipment-view.d.ts +31 -0
  548. package/dist/src/workspace/fleet/figure.d.ts +18 -0
  549. package/dist/src/workspace/fleet/form-types.d.ts +15 -0
  550. package/dist/src/workspace/fleet/group-command-dialogs.d.ts +43 -0
  551. package/dist/src/workspace/fleet/group-command.d.ts +83 -0
  552. package/dist/src/workspace/fleet/indicator-lights.d.ts +23 -0
  553. package/dist/src/workspace/fleet/map.d.ts +41 -0
  554. package/dist/src/workspace/fleet/mode-badge.d.ts +7 -0
  555. package/dist/src/workspace/fleet/operations.d.ts +23 -0
  556. package/dist/src/workspace/fleet/order-editor.d.ts +13 -0
  557. package/dist/src/workspace/fleet/overview-model.d.ts +43 -0
  558. package/dist/src/workspace/fleet/overview.d.ts +93 -0
  559. package/dist/src/workspace/fleet/page-header.d.ts +27 -0
  560. package/dist/src/workspace/fleet/parameters.d.ts +65 -0
  561. package/dist/src/workspace/fleet/period-settings.d.ts +66 -0
  562. package/dist/src/workspace/fleet/placement-fields.d.ts +104 -0
  563. package/dist/src/workspace/fleet/position.d.ts +13 -0
  564. package/dist/src/workspace/fleet/readings.d.ts +64 -0
  565. package/dist/src/workspace/fleet/section.d.ts +7 -0
  566. package/dist/src/workspace/fleet/site-page.d.ts +150 -0
  567. package/dist/src/workspace/fleet/slot-fields.d.ts +53 -0
  568. package/dist/src/workspace/fleet/starter-fields.d.ts +63 -0
  569. package/dist/src/workspace/fleet/status-badge.d.ts +23 -0
  570. package/dist/src/workspace/fleet/status.d.ts +85 -0
  571. package/dist/src/workspace/formulas/diagnostic-text.d.ts +7 -0
  572. package/dist/src/workspace/graphics/actions/details.d.ts +49 -0
  573. package/dist/src/workspace/graphics/actions/dialog.d.ts +12 -0
  574. package/dist/src/workspace/graphics/actions/selection.d.ts +1352 -0
  575. package/dist/src/workspace/graphics/binding-value.d.ts +19 -0
  576. package/dist/src/workspace/graphics/bindings.d.ts +847 -0
  577. package/dist/src/workspace/graphics/canvas.d.ts +47 -0
  578. package/dist/src/workspace/graphics/commands/fields.d.ts +7 -0
  579. package/dist/src/workspace/graphics/commands/model.d.ts +10 -0
  580. package/dist/src/workspace/graphics/commands/provider.d.ts +285 -0
  581. package/dist/src/workspace/graphics/dashboard-graphics.d.ts +12 -0
  582. package/dist/src/workspace/graphics/editor-session.d.ts +47 -0
  583. package/dist/src/workspace/graphics/framing.d.ts +28 -0
  584. package/dist/src/workspace/graphics/generated-drawing.d.ts +47 -0
  585. package/dist/src/workspace/graphics/geometry.d.ts +41 -0
  586. package/dist/src/workspace/graphics/image-cache.d.ts +18 -0
  587. package/dist/src/workspace/graphics/image-dialog.d.ts +5 -0
  588. package/dist/src/workspace/graphics/image-picker.d.ts +5 -0
  589. package/dist/src/workspace/graphics/inspector/bindings.d.ts +17 -0
  590. package/dist/src/workspace/graphics/inspector/element.d.ts +10 -0
  591. package/dist/src/workspace/graphics/inspector/fields.d.ts +69 -0
  592. package/dist/src/workspace/graphics/inspector/item.d.ts +862 -0
  593. package/dist/src/workspace/graphics/inspector/multi.d.ts +10 -0
  594. package/dist/src/workspace/graphics/inspector/panel.d.ts +27 -0
  595. package/dist/src/workspace/graphics/inspector/ports.d.ts +2 -0
  596. package/dist/src/workspace/graphics/inspector/section.d.ts +14 -0
  597. package/dist/src/workspace/graphics/inspector/slots.d.ts +7 -0
  598. package/dist/src/workspace/graphics/inspector/symbol.d.ts +11 -0
  599. package/dist/src/workspace/graphics/line-geometry.d.ts +26 -0
  600. package/dist/src/workspace/graphics/lines.d.ts +14 -0
  601. package/dist/src/workspace/graphics/node-memo.d.ts +3 -0
  602. package/dist/src/workspace/graphics/node.d.ts +3 -0
  603. package/dist/src/workspace/graphics/placement.d.ts +23 -0
  604. package/dist/src/workspace/graphics/quality-indicator.d.ts +6 -0
  605. package/dist/src/workspace/graphics/resize-handles.d.ts +8 -0
  606. package/dist/src/workspace/graphics/source-picker.d.ts +35 -0
  607. package/dist/src/workspace/graphics/symbol-issues.d.ts +26 -0
  608. package/dist/src/workspace/graphics/symbols/agriculture/fertigation.d.ts +1 -0
  609. package/dist/src/workspace/graphics/symbols/agriculture/index.d.ts +2 -0
  610. package/dist/src/workspace/graphics/symbols/agriculture/soil-sensor.d.ts +1 -0
  611. package/dist/src/workspace/graphics/symbols/agriculture/soil.d.ts +9 -0
  612. package/dist/src/workspace/graphics/symbols/agriculture/sprinkler.d.ts +1 -0
  613. package/dist/src/workspace/graphics/symbols/agriculture/zone.d.ts +1 -0
  614. package/dist/src/workspace/graphics/symbols/bindings.d.ts +34 -0
  615. package/dist/src/workspace/graphics/symbols/browser.d.ts +28 -0
  616. package/dist/src/workspace/graphics/symbols/builtins.d.ts +2 -0
  617. package/dist/src/workspace/graphics/symbols/button.d.ts +2 -0
  618. package/dist/src/workspace/graphics/symbols/catalog.d.ts +41 -0
  619. package/dist/src/workspace/graphics/symbols/compressed-air/compressor.d.ts +1 -0
  620. package/dist/src/workspace/graphics/symbols/compressed-air/drain.d.ts +15 -0
  621. package/dist/src/workspace/graphics/symbols/compressed-air/index.d.ts +1 -0
  622. package/dist/src/workspace/graphics/symbols/compressed-air/receiver.d.ts +1 -0
  623. package/dist/src/workspace/graphics/symbols/compressed-air/treatment.d.ts +2 -0
  624. package/dist/src/workspace/graphics/symbols/definition.d.ts +115 -0
  625. package/dist/src/workspace/graphics/symbols/electrical/breaker.d.ts +2 -0
  626. package/dist/src/workspace/graphics/symbols/electrical/compensation.d.ts +1 -0
  627. package/dist/src/workspace/graphics/symbols/electrical/index.d.ts +5 -0
  628. package/dist/src/workspace/graphics/symbols/electrical/loads.d.ts +3 -0
  629. package/dist/src/workspace/graphics/symbols/electrical/machines.d.ts +3 -0
  630. package/dist/src/workspace/graphics/symbols/electrical/metering.d.ts +8 -0
  631. package/dist/src/workspace/graphics/symbols/electrical/presentation.d.ts +132 -0
  632. package/dist/src/workspace/graphics/symbols/electrical/renewables.d.ts +2 -0
  633. package/dist/src/workspace/graphics/symbols/electrical/storage.d.ts +2 -0
  634. package/dist/src/workspace/graphics/symbols/electrical/supply.d.ts +2 -0
  635. package/dist/src/workspace/graphics/symbols/electrical/switchgear.d.ts +61 -0
  636. package/dist/src/workspace/graphics/symbols/food/filling.d.ts +1 -0
  637. package/dist/src/workspace/graphics/symbols/food/index.d.ts +1 -0
  638. package/dist/src/workspace/graphics/symbols/food/vessel.d.ts +1 -0
  639. package/dist/src/workspace/graphics/symbols/fuel-gas/gas-detector.d.ts +1 -0
  640. package/dist/src/workspace/graphics/symbols/fuel-gas/index.d.ts +1 -0
  641. package/dist/src/workspace/graphics/symbols/handles.d.ts +6 -0
  642. package/dist/src/workspace/graphics/symbols/hvac/air-handling.d.ts +4 -0
  643. package/dist/src/workspace/graphics/symbols/hvac/air-section.d.ts +60 -0
  644. package/dist/src/workspace/graphics/symbols/hvac/air-terminals.d.ts +2 -0
  645. package/dist/src/workspace/graphics/symbols/hvac/air-treatment.d.ts +2 -0
  646. package/dist/src/workspace/graphics/symbols/hvac/circuit.d.ts +45 -0
  647. package/dist/src/workspace/graphics/symbols/hvac/cooling-plant.d.ts +2 -0
  648. package/dist/src/workspace/graphics/symbols/hvac/firing.d.ts +2 -0
  649. package/dist/src/workspace/graphics/symbols/hvac/hydronic.d.ts +5 -0
  650. package/dist/src/workspace/graphics/symbols/hvac/index.d.ts +2 -0
  651. package/dist/src/workspace/graphics/symbols/hvac/instruments.d.ts +5 -0
  652. package/dist/src/workspace/graphics/symbols/hvac/presentation.d.ts +162 -0
  653. package/dist/src/workspace/graphics/symbols/manufacturing/actuators.d.ts +20 -0
  654. package/dist/src/workspace/graphics/symbols/manufacturing/conveyor.d.ts +26 -0
  655. package/dist/src/workspace/graphics/symbols/manufacturing/index.d.ts +3 -0
  656. package/dist/src/workspace/graphics/symbols/manufacturing/indicators.d.ts +2 -0
  657. package/dist/src/workspace/graphics/symbols/manufacturing/stations.d.ts +3 -0
  658. package/dist/src/workspace/graphics/symbols/ports.d.ts +12 -0
  659. package/dist/src/workspace/graphics/symbols/preferences.d.ts +27 -0
  660. package/dist/src/workspace/graphics/symbols/preview.d.ts +8 -0
  661. package/dist/src/workspace/graphics/symbols/properties.d.ts +46 -0
  662. package/dist/src/workspace/graphics/symbols/provider.d.ts +12 -0
  663. package/dist/src/workspace/graphics/symbols/pump-status-icon.d.ts +5 -0
  664. package/dist/src/workspace/graphics/symbols/pump.d.ts +2 -0
  665. package/dist/src/workspace/graphics/symbols/quality.d.ts +63 -0
  666. package/dist/src/workspace/graphics/symbols/quarry/belt-scale.d.ts +1 -0
  667. package/dist/src/workspace/graphics/symbols/quarry/chute.d.ts +1 -0
  668. package/dist/src/workspace/graphics/symbols/quarry/crusher.d.ts +2 -0
  669. package/dist/src/workspace/graphics/symbols/quarry/diverter-gate.d.ts +2 -0
  670. package/dist/src/workspace/graphics/symbols/quarry/dust-collector.d.ts +1 -0
  671. package/dist/src/workspace/graphics/symbols/quarry/feeder.d.ts +1 -0
  672. package/dist/src/workspace/graphics/symbols/quarry/hopper.d.ts +1 -0
  673. package/dist/src/workspace/graphics/symbols/quarry/index.d.ts +1 -0
  674. package/dist/src/workspace/graphics/symbols/quarry/parts.d.ts +18 -0
  675. package/dist/src/workspace/graphics/symbols/quarry/screen.d.ts +2 -0
  676. package/dist/src/workspace/graphics/symbols/quarry/spray-suppression.d.ts +1 -0
  677. package/dist/src/workspace/graphics/symbols/quarry/stockpile.d.ts +1 -0
  678. package/dist/src/workspace/graphics/symbols/quarry/trommel.d.ts +1 -0
  679. package/dist/src/workspace/graphics/symbols/reading.d.ts +3 -0
  680. package/dist/src/workspace/graphics/symbols/render.d.ts +12 -0
  681. package/dist/src/workspace/graphics/symbols/reservoir.d.ts +2 -0
  682. package/dist/src/workspace/graphics/symbols/serialize.d.ts +7 -0
  683. package/dist/src/workspace/graphics/symbols/status.d.ts +47 -0
  684. package/dist/src/workspace/graphics/symbols/thermal/furnace.d.ts +28 -0
  685. package/dist/src/workspace/graphics/symbols/thermal/heater.d.ts +6 -0
  686. package/dist/src/workspace/graphics/symbols/thermal/index.d.ts +1 -0
  687. package/dist/src/workspace/graphics/symbols/thermal/kiln.d.ts +1 -0
  688. package/dist/src/workspace/graphics/symbols/upright.d.ts +68 -0
  689. package/dist/src/workspace/graphics/symbols/variant-field.d.ts +17 -0
  690. package/dist/src/workspace/graphics/symbols/variants.d.ts +30 -0
  691. package/dist/src/workspace/graphics/symbols/viewport.d.ts +43 -0
  692. package/dist/src/workspace/graphics/symbols/warehouse/agv.d.ts +4 -0
  693. package/dist/src/workspace/graphics/symbols/warehouse/cold-room.d.ts +2 -0
  694. package/dist/src/workspace/graphics/symbols/warehouse/cooling-unit.d.ts +19 -0
  695. package/dist/src/workspace/graphics/symbols/warehouse/door.d.ts +61 -0
  696. package/dist/src/workspace/graphics/symbols/warehouse/index.d.ts +1 -0
  697. package/dist/src/workspace/graphics/symbols/warehouse/loading-dock.d.ts +2 -0
  698. package/dist/src/workspace/graphics/symbols/warehouse/pallet.d.ts +2 -0
  699. package/dist/src/workspace/graphics/symbols/warehouse/rack.d.ts +25 -0
  700. package/dist/src/workspace/graphics/symbols/warehouse/stacker-crane.d.ts +12 -0
  701. package/dist/src/workspace/graphics/symbols/warehouse/storage-zone.d.ts +34 -0
  702. package/dist/src/workspace/graphics/symbols/waste/baler.d.ts +5 -0
  703. package/dist/src/workspace/graphics/symbols/waste/compactor.d.ts +1 -0
  704. package/dist/src/workspace/graphics/symbols/waste/container.d.ts +7 -0
  705. package/dist/src/workspace/graphics/symbols/waste/index.d.ts +2 -0
  706. package/dist/src/workspace/graphics/symbols/waste/parts.d.ts +32 -0
  707. package/dist/src/workspace/graphics/symbols/waste/separator.d.ts +1 -0
  708. package/dist/src/workspace/graphics/symbols/waste/shredder.d.ts +1 -0
  709. package/dist/src/workspace/graphics/symbols/waste/vehicle.d.ts +1 -0
  710. package/dist/src/workspace/graphics/symbols/waste/weighbridge.d.ts +1 -0
  711. package/dist/src/workspace/graphics/symbols/water/aeration.d.ts +8 -0
  712. package/dist/src/workspace/graphics/symbols/water/artwork.d.ts +42 -0
  713. package/dist/src/workspace/graphics/symbols/water/clarifier.d.ts +1 -0
  714. package/dist/src/workspace/graphics/symbols/water/disinfection.d.ts +1 -0
  715. package/dist/src/workspace/graphics/symbols/water/dosing.d.ts +30 -0
  716. package/dist/src/workspace/graphics/symbols/water/filter.d.ts +1 -0
  717. package/dist/src/workspace/graphics/symbols/water/index.d.ts +8 -0
  718. package/dist/src/workspace/graphics/symbols/water/instruments.d.ts +3 -0
  719. package/dist/src/workspace/graphics/symbols/water/pumps.d.ts +7 -0
  720. package/dist/src/workspace/graphics/symbols/water/tank.d.ts +1 -0
  721. package/dist/src/workspace/graphics/symbols/water/treatment-state.d.ts +15 -0
  722. package/dist/src/workspace/graphics/symbols/water/valves.d.ts +8 -0
  723. package/dist/src/workspace/graphics/symbols/well.d.ts +2 -0
  724. package/dist/src/workspace/graphics/toolbar.d.ts +58 -0
  725. package/dist/src/workspace/graphics/use-images.d.ts +13 -0
  726. package/dist/src/workspace/graphics/view-frame.d.ts +31 -0
  727. package/dist/src/workspace/graphics/viewport-passthrough.d.ts +8 -0
  728. package/dist/src/workspace/index-page.d.ts +3 -0
  729. package/dist/src/workspace/layout.d.ts +3 -0
  730. package/dist/src/workspace/live-changes.d.ts +16 -0
  731. package/dist/src/workspace/local-message-identity.d.ts +2 -0
  732. package/dist/src/workspace/local-setup-link.d.ts +16 -0
  733. package/dist/src/workspace/local-workspace-app.d.ts +21 -0
  734. package/dist/src/workspace/maps/auth-failure.d.ts +5 -0
  735. package/dist/src/workspace/maps/error-boundary.d.ts +21 -0
  736. package/dist/src/workspace/maps/lat-lng.d.ts +8 -0
  737. package/dist/src/workspace/maps/location-map-renderer.d.ts +10 -0
  738. package/dist/src/workspace/maps/location-map.d.ts +40 -0
  739. package/dist/src/workspace/maps/location-picker-renderer.d.ts +20 -0
  740. package/dist/src/workspace/maps/location-picker.d.ts +31 -0
  741. package/dist/src/workspace/maps/use-browser-config.d.ts +11 -0
  742. package/dist/src/workspace/maps/use-reverse-geocode.d.ts +15 -0
  743. package/dist/src/workspace/mobile-nav.d.ts +13 -0
  744. package/dist/src/workspace/mutations.d.ts +10634 -0
  745. package/dist/src/workspace/no-access.d.ts +1 -0
  746. package/dist/src/workspace/page-navigation.d.ts +67 -0
  747. package/dist/src/workspace/page-state/branch-path.d.ts +7 -0
  748. package/dist/src/workspace/page-state/context.d.ts +14 -0
  749. package/dist/src/workspace/page-state/dashboard-context.d.ts +37 -0
  750. package/dist/src/workspace/page-state/dashboard.d.ts +65 -0
  751. package/dist/src/workspace/page-state/model.d.ts +48 -0
  752. package/dist/src/workspace/page-state/parameters.d.ts +11 -0
  753. package/dist/src/workspace/page-state/report.d.ts +16 -0
  754. package/dist/src/workspace/page-state/store.d.ts +10 -0
  755. package/dist/src/workspace/parameters/defaults.d.ts +7 -0
  756. package/dist/src/workspace/parameters/display.d.ts +28 -0
  757. package/dist/src/workspace/parameters/distinct-names.d.ts +12 -0
  758. package/dist/src/workspace/parameters/errors.d.ts +15 -0
  759. package/dist/src/workspace/parameters/form/shared-fields.d.ts +49 -0
  760. package/dist/src/workspace/parameters/form/values.d.ts +33 -0
  761. package/dist/src/workspace/parameters/geo-value.d.ts +9 -0
  762. package/dist/src/workspace/parameters/icon.d.ts +8 -0
  763. package/dist/src/workspace/parameters/inventory-options.d.ts +9 -0
  764. package/dist/src/workspace/parameters/live/condition.d.ts +4 -0
  765. package/dist/src/workspace/parameters/live/control-button.d.ts +13 -0
  766. package/dist/src/workspace/parameters/live/controls.d.ts +14 -0
  767. package/dist/src/workspace/parameters/live/coordinator.d.ts +87 -0
  768. package/dist/src/workspace/parameters/live/deadline.d.ts +13 -0
  769. package/dist/src/workspace/parameters/live/diagnostic-copy.d.ts +26 -0
  770. package/dist/src/workspace/parameters/live/diagnostic-links.d.ts +5 -0
  771. package/dist/src/workspace/parameters/live/diagnostics.d.ts +9 -0
  772. package/dist/src/workspace/parameters/live/history-windows.d.ts +53 -0
  773. package/dist/src/workspace/parameters/live/metric.d.ts +29 -0
  774. package/dist/src/workspace/parameters/live/model.d.ts +133 -0
  775. package/dist/src/workspace/parameters/live/provider.d.ts +49 -0
  776. package/dist/src/workspace/parameters/live/read-once.d.ts +13 -0
  777. package/dist/src/workspace/parameters/live/stale-note.d.ts +8 -0
  778. package/dist/src/workspace/parameters/live/use-history.d.ts +30 -0
  779. package/dist/src/workspace/parameters/live/use-stored-history.d.ts +85 -0
  780. package/dist/src/workspace/parameters/live/value-display.d.ts +25 -0
  781. package/dist/src/workspace/parameters/live/value-editor.d.ts +24 -0
  782. package/dist/src/workspace/parameters/live/write-review-dialog.d.ts +41 -0
  783. package/dist/src/workspace/parameters/live/write-review-form.d.ts +18 -0
  784. package/dist/src/workspace/parameters/live/write-sequence-dialog.d.ts +80 -0
  785. package/dist/src/workspace/parameters/metadata.d.ts +37 -0
  786. package/dist/src/workspace/parameters/option-labels.d.ts +14 -0
  787. package/dist/src/workspace/parameters/picker/browser.d.ts +41 -0
  788. package/dist/src/workspace/parameters/picker/model.d.ts +91 -0
  789. package/dist/src/workspace/parameters/picker/picker.d.ts +380 -0
  790. package/dist/src/workspace/parameters/runtime-errors.d.ts +23 -0
  791. package/dist/src/workspace/parameters/source-fields.d.ts +22 -0
  792. package/dist/src/workspace/parameters/value/cells.d.ts +21 -0
  793. package/dist/src/workspace/parameters/value/edit-draft.d.ts +24 -0
  794. package/dist/src/workspace/parameters/value/reads.d.ts +54 -0
  795. package/dist/src/workspace/parameters/value/state.d.ts +96 -0
  796. package/dist/src/workspace/parameters/value/type/datetime-parts.d.ts +12 -0
  797. package/dist/src/workspace/parameters/value/type/fields.d.ts +5 -0
  798. package/dist/src/workspace/parameters/value/type/geo.d.ts +10 -0
  799. package/dist/src/workspace/parameters/value/type/int-repr.d.ts +9 -0
  800. package/dist/src/workspace/parameters/writability.d.ts +26 -0
  801. package/dist/src/workspace/pull-instructions.d.ts +4 -0
  802. package/dist/src/workspace/query-gate.d.ts +40 -0
  803. package/dist/src/workspace/reports/aggregate-fetch.d.ts +25 -0
  804. package/dist/src/workspace/reports/bar-legend.d.ts +12 -0
  805. package/dist/src/workspace/reports/bar-path.d.ts +25 -0
  806. package/dist/src/workspace/reports/cadence-fetch.d.ts +25 -0
  807. package/dist/src/workspace/reports/calendar/demand.d.ts +46 -0
  808. package/dist/src/workspace/reports/calendar/layout.d.ts +98 -0
  809. package/dist/src/workspace/reports/calendar/representation.d.ts +7 -0
  810. package/dist/src/workspace/reports/cell-title.d.ts +11 -0
  811. package/dist/src/workspace/reports/chart/axes.d.ts +17 -0
  812. package/dist/src/workspace/reports/chart/build.d.ts +208 -0
  813. package/dist/src/workspace/reports/chart/caches.d.ts +57 -0
  814. package/dist/src/workspace/reports/chart/colors.d.ts +17 -0
  815. package/dist/src/workspace/reports/chart/comment-gutter.d.ts +44 -0
  816. package/dist/src/workspace/reports/chart/demand.d.ts +50 -0
  817. package/dist/src/workspace/reports/chart/paint.d.ts +17 -0
  818. package/dist/src/workspace/reports/chart/pan-zoom.d.ts +19 -0
  819. package/dist/src/workspace/reports/chart/payload.d.ts +57 -0
  820. package/dist/src/workspace/reports/chart/plot-interactions.d.ts +13 -0
  821. package/dist/src/workspace/reports/chart/plot-tooltip.d.ts +10 -0
  822. package/dist/src/workspace/reports/chart/plot.d.ts +29 -0
  823. package/dist/src/workspace/reports/chart/realtime.d.ts +96 -0
  824. package/dist/src/workspace/reports/chart/representation.d.ts +40 -0
  825. package/dist/src/workspace/reports/chart/tooltip.d.ts +36 -0
  826. package/dist/src/workspace/reports/chart/use-realtime.d.ts +44 -0
  827. package/dist/src/workspace/reports/color/cascade.d.ts +3 -0
  828. package/dist/src/workspace/reports/color/css.d.ts +5 -0
  829. package/dist/src/workspace/reports/color/select.d.ts +11 -0
  830. package/dist/src/workspace/reports/comments/author.d.ts +2 -0
  831. package/dist/src/workspace/reports/comments/errors.d.ts +11 -0
  832. package/dist/src/workspace/reports/comments/footer.d.ts +1 -0
  833. package/dist/src/workspace/reports/comments/use-comments.d.ts +9 -0
  834. package/dist/src/workspace/reports/csv/build.d.ts +29 -0
  835. package/dist/src/workspace/reports/csv/columns.d.ts +18 -0
  836. package/dist/src/workspace/reports/csv/fetch.d.ts +29 -0
  837. package/dist/src/workspace/reports/csv/use-export.d.ts +7 -0
  838. package/dist/src/workspace/reports/data/context.d.ts +79 -0
  839. package/dist/src/workspace/reports/data/extent.d.ts +40 -0
  840. package/dist/src/workspace/reports/data/provider.d.ts +20 -0
  841. package/dist/src/workspace/reports/data/report-caches.d.ts +56 -0
  842. package/dist/src/workspace/reports/data/specs.d.ts +38 -0
  843. package/dist/src/workspace/reports/demand-cache.d.ts +76 -0
  844. package/dist/src/workspace/reports/element-size.d.ts +7 -0
  845. package/dist/src/workspace/reports/generated.d.ts +46 -0
  846. package/dist/src/workspace/reports/histogram/build.d.ts +1 -0
  847. package/dist/src/workspace/reports/histogram/demand.d.ts +26 -0
  848. package/dist/src/workspace/reports/histogram/plot.d.ts +42 -0
  849. package/dist/src/workspace/reports/histogram/representation.d.ts +8 -0
  850. package/dist/src/workspace/reports/histogram/slots.d.ts +19 -0
  851. package/dist/src/workspace/reports/hourly-matrix/demand.d.ts +28 -0
  852. package/dist/src/workspace/reports/hourly-matrix/layout.d.ts +36 -0
  853. package/dist/src/workspace/reports/hourly-matrix/model.d.ts +66 -0
  854. package/dist/src/workspace/reports/hourly-matrix/representation.d.ts +7 -0
  855. package/dist/src/workspace/reports/html/build.d.ts +57 -0
  856. package/dist/src/workspace/reports/html/cache-clone.d.ts +36 -0
  857. package/dist/src/workspace/reports/html/calendar.d.ts +15 -0
  858. package/dist/src/workspace/reports/html/comments.d.ts +13 -0
  859. package/dist/src/workspace/reports/html/css.d.ts +2 -0
  860. package/dist/src/workspace/reports/html/document.d.ts +5 -0
  861. package/dist/src/workspace/reports/html/escape.d.ts +6 -0
  862. package/dist/src/workspace/reports/html/matrix.d.ts +13 -0
  863. package/dist/src/workspace/reports/html/mounted.d.ts +19 -0
  864. package/dist/src/workspace/reports/html/png.d.ts +39 -0
  865. package/dist/src/workspace/reports/html/ready.d.ts +56 -0
  866. package/dist/src/workspace/reports/html/table.d.ts +3 -0
  867. package/dist/src/workspace/reports/html/use-render.d.ts +8 -0
  868. package/dist/src/workspace/reports/html/widgets.d.ts +31 -0
  869. package/dist/src/workspace/reports/page.d.ts +4 -0
  870. package/dist/src/workspace/reports/preset/errors.d.ts +5 -0
  871. package/dist/src/workspace/reports/preset/form-helpers.d.ts +65 -0
  872. package/dist/src/workspace/reports/preset/submit.d.ts +43 -0
  873. package/dist/src/workspace/reports/quick-report.d.ts +17 -0
  874. package/dist/src/workspace/reports/readings-client.d.ts +23 -0
  875. package/dist/src/workspace/reports/runtime-chrome.d.ts +15 -0
  876. package/dist/src/workspace/reports/sankey/demand.d.ts +47 -0
  877. package/dist/src/workspace/reports/sankey/graph.d.ts +28 -0
  878. package/dist/src/workspace/reports/sankey/layout.d.ts +80 -0
  879. package/dist/src/workspace/reports/sankey/representation.d.ts +7 -0
  880. package/dist/src/workspace/reports/sankey/use-caches.d.ts +16 -0
  881. package/dist/src/workspace/reports/session/init.d.ts +9 -0
  882. package/dist/src/workspace/reports/session/storage.d.ts +24 -0
  883. package/dist/src/workspace/reports/state-duration/demand.d.ts +39 -0
  884. package/dist/src/workspace/reports/state-duration/reduce.d.ts +27 -0
  885. package/dist/src/workspace/reports/state-duration/representation.d.ts +7 -0
  886. package/dist/src/workspace/reports/state-duration/use-caches.d.ts +15 -0
  887. package/dist/src/workspace/reports/table/cache-fetch.d.ts +8 -0
  888. package/dist/src/workspace/reports/table/chunk.d.ts +31 -0
  889. package/dist/src/workspace/reports/table/demand.d.ts +83 -0
  890. package/dist/src/workspace/reports/table/fetch.d.ts +42 -0
  891. package/dist/src/workspace/reports/table/format.d.ts +7 -0
  892. package/dist/src/workspace/reports/table/representation.d.ts +10 -0
  893. package/dist/src/workspace/reports/table/rows.d.ts +31 -0
  894. package/dist/src/workspace/reports/table/snapshot.d.ts +40 -0
  895. package/dist/src/workspace/reports/table/totals.d.ts +4 -0
  896. package/dist/src/workspace/reports/time-buckets/build.d.ts +40 -0
  897. package/dist/src/workspace/reports/time-buckets/demand.d.ts +52 -0
  898. package/dist/src/workspace/reports/time-buckets/navigate.d.ts +26 -0
  899. package/dist/src/workspace/reports/time-buckets/plot.d.ts +58 -0
  900. package/dist/src/workspace/reports/time-buckets/representation.d.ts +8 -0
  901. package/dist/src/workspace/reports/time-buckets/slots.d.ts +23 -0
  902. package/dist/src/workspace/reports/time-nav.d.ts +1 -0
  903. package/dist/src/workspace/reports/use-demand-cache.d.ts +29 -0
  904. package/dist/src/workspace/reports/use-quick-report.d.ts +45 -0
  905. package/dist/src/workspace/reports/view.d.ts +6 -0
  906. package/dist/src/workspace/routes.d.ts +23 -0
  907. package/dist/src/workspace/setup/automations/alarm-rule-dialog.d.ts +7 -0
  908. package/dist/src/workspace/setup/automations/alarm-rule-lists.d.ts +61 -0
  909. package/dist/src/workspace/setup/automations/alarm-rules-page.d.ts +4 -0
  910. package/dist/src/workspace/setup/automations/document.d.ts +39 -0
  911. package/dist/src/workspace/setup/automations/dry-run.d.ts +12 -0
  912. package/dist/src/workspace/setup/automations/editor-form.d.ts +22 -0
  913. package/dist/src/workspace/setup/automations/editor-page.d.ts +14 -0
  914. package/dist/src/workspace/setup/automations/editor-tab.d.ts +6 -0
  915. package/dist/src/workspace/setup/automations/entity-controls.d.ts +22 -0
  916. package/dist/src/workspace/setup/automations/history.d.ts +15 -0
  917. package/dist/src/workspace/setup/automations/list-page.d.ts +28 -0
  918. package/dist/src/workspace/setup/automations/starter-dialog.d.ts +10 -0
  919. package/dist/src/workspace/setup/automations/starter-handoff.d.ts +17 -0
  920. package/dist/src/workspace/setup/base-revision.d.ts +64 -0
  921. package/dist/src/workspace/setup/breadcrumbs.d.ts +10 -0
  922. package/dist/src/workspace/setup/catalog-list.d.ts +21 -0
  923. package/dist/src/workspace/setup/dashboards-order.d.ts +10 -0
  924. package/dist/src/workspace/setup/dashboards-page.d.ts +24 -0
  925. package/dist/src/workspace/setup/dashboards-reorder-queue.d.ts +13 -0
  926. package/dist/src/workspace/setup/dashboards-sortable-list.d.ts +6 -0
  927. package/dist/src/workspace/setup/endpoints/connection-error.d.ts +3 -0
  928. package/dist/src/workspace/setup/endpoints/connection-indicator.d.ts +4 -0
  929. package/dist/src/workspace/setup/endpoints/device-log-clock.d.ts +7 -0
  930. package/dist/src/workspace/setup/endpoints/display.d.ts +12 -0
  931. package/dist/src/workspace/setup/endpoints/edit-dialog.d.ts +5 -0
  932. package/dist/src/workspace/setup/endpoints/enabled-switch.d.ts +10 -0
  933. package/dist/src/workspace/setup/endpoints/form-problem.d.ts +5 -0
  934. package/dist/src/workspace/setup/endpoints/page.d.ts +11 -0
  935. package/dist/src/workspace/setup/endpoints/presence-challenge.d.ts +34 -0
  936. package/dist/src/workspace/setup/endpoints/presence-code.d.ts +6 -0
  937. package/dist/src/workspace/setup/endpoints/programs/deploy-status-bar.d.ts +13 -0
  938. package/dist/src/workspace/setup/endpoints/programs/device-log.d.ts +15 -0
  939. package/dist/src/workspace/setup/endpoints/programs/dialogs.d.ts +16 -0
  940. package/dist/src/workspace/setup/endpoints/programs/live-state-pane.d.ts +7 -0
  941. package/dist/src/workspace/setup/endpoints/programs/program-editor.d.ts +79 -0
  942. package/dist/src/workspace/setup/endpoints/programs/programs-tab.d.ts +14 -0
  943. package/dist/src/workspace/setup/endpoints/programs/settings-dialog.d.ts +9 -0
  944. package/dist/src/workspace/setup/endpoints/programs/starter-dialog.d.ts +17 -0
  945. package/dist/src/workspace/setup/endpoints/programs/tasks-table.d.ts +5 -0
  946. package/dist/src/workspace/setup/endpoints/sharing.d.ts +9 -0
  947. package/dist/src/workspace/setup/endpoints/status-connection.d.ts +8 -0
  948. package/dist/src/workspace/setup/endpoints/status-device-ui-progress.d.ts +9 -0
  949. package/dist/src/workspace/setup/endpoints/status-device-ui.d.ts +8 -0
  950. package/dist/src/workspace/setup/endpoints/status-page.d.ts +14 -0
  951. package/dist/src/workspace/setup/endpoints/status-recorded.d.ts +13 -0
  952. package/dist/src/workspace/setup/endpoints/status-tab.d.ts +12 -0
  953. package/dist/src/workspace/setup/endpoints/wireguard-docs.d.ts +11 -0
  954. package/dist/src/workspace/setup/files/errors.d.ts +1 -0
  955. package/dist/src/workspace/setup/files/http.d.ts +21 -0
  956. package/dist/src/workspace/setup/files/page.d.ts +3 -0
  957. package/dist/src/workspace/setup/menu.d.ts +14 -0
  958. package/dist/src/workspace/setup/nav.d.ts +11 -0
  959. package/dist/src/workspace/setup/parameters/dialogs.d.ts +32 -0
  960. package/dist/src/workspace/setup/parameters/edit/create-branch-form.d.ts +10 -0
  961. package/dist/src/workspace/setup/parameters/edit/dialog-body.d.ts +13 -0
  962. package/dist/src/workspace/setup/parameters/edit/form.d.ts +22 -0
  963. package/dist/src/workspace/setup/parameters/page.d.ts +3 -0
  964. package/dist/src/workspace/setup/parameters/recorded.d.ts +14 -0
  965. package/dist/src/workspace/setup/parameters/selection.d.ts +45 -0
  966. package/dist/src/workspace/setup/parameters/stamp-from-template-form.d.ts +10 -0
  967. package/dist/src/workspace/setup/parameters/toolbar.d.ts +32 -0
  968. package/dist/src/workspace/setup/parameters/tree/expand.d.ts +10 -0
  969. package/dist/src/workspace/setup/parameters/tree/model.d.ts +61 -0
  970. package/dist/src/workspace/setup/parameters/tree/rows.d.ts +38 -0
  971. package/dist/src/workspace/setup/parameters/tree/storage.d.ts +13 -0
  972. package/dist/src/workspace/setup/parameters/use-tree-selection.d.ts +21 -0
  973. package/dist/src/workspace/setup/parameters/use-tree-view.d.ts +22 -0
  974. package/dist/src/workspace/setup/report/add-parameters-dialog.d.ts +8 -0
  975. package/dist/src/workspace/setup/report/calendar-editor.d.ts +9 -0
  976. package/dist/src/workspace/setup/report/chart-editor.d.ts +14 -0
  977. package/dist/src/workspace/setup/report/edit/confirm-removal-dialog.d.ts +9 -0
  978. package/dist/src/workspace/setup/report/edit/dialog-body.d.ts +10 -0
  979. package/dist/src/workspace/setup/report/edit/form.d.ts +14 -0
  980. package/dist/src/workspace/setup/report/edit/representations-section.d.ts +11 -0
  981. package/dist/src/workspace/setup/report/edit/sections.d.ts +23 -0
  982. package/dist/src/workspace/setup/report/edit/state.d.ts +29 -0
  983. package/dist/src/workspace/setup/report/foldable-item-card.d.ts +47 -0
  984. package/dist/src/workspace/setup/report/histogram-editor.d.ts +9 -0
  985. package/dist/src/workspace/setup/report/hourly-matrix-editor.d.ts +9 -0
  986. package/dist/src/workspace/setup/report/includes-literal.d.ts +1 -0
  987. package/dist/src/workspace/setup/report/layout-editor.d.ts +6 -0
  988. package/dist/src/workspace/setup/report/number-draft-input.d.ts +23 -0
  989. package/dist/src/workspace/setup/report/page.d.ts +3 -0
  990. package/dist/src/workspace/setup/report/sankey-editor.d.ts +9 -0
  991. package/dist/src/workspace/setup/report/state-duration-editor.d.ts +9 -0
  992. package/dist/src/workspace/setup/report/table-editor.d.ts +9 -0
  993. package/dist/src/workspace/setup/report/time-buckets-editor.d.ts +9 -0
  994. package/dist/src/workspace/setup/route/dialog.d.ts +33 -0
  995. package/dist/src/workspace/setup/route/dialogs.d.ts +41 -0
  996. package/dist/src/workspace/setup/sections.d.ts +17 -0
  997. package/dist/src/workspace/setup/starters/starter-fields.d.ts +45 -0
  998. package/dist/src/workspace/setup/starters/starter-form.d.ts +50 -0
  999. package/dist/src/workspace/setup/storage/dialogs.d.ts +77 -0
  1000. package/dist/src/workspace/setup/storage/format.d.ts +6 -0
  1001. package/dist/src/workspace/setup/storage/page.d.ts +3 -0
  1002. package/dist/src/workspace/setup/storage/retention-note.d.ts +11 -0
  1003. package/dist/src/workspace/setup/storage/retention.d.ts +21 -0
  1004. package/dist/src/workspace/shell.d.ts +21 -0
  1005. package/dist/src/workspace/sidebar-nav-link.d.ts +13 -0
  1006. package/dist/src/workspace/suspended.d.ts +8 -0
  1007. package/dist/starter-fields-BRLX0z-v.js +586 -0
  1008. package/dist/starter-handoff-BA3ucMKL.js +19 -0
  1009. package/dist/status-page-DAHiKM9P.js +3286 -0
  1010. package/dist/styles-reference.css +54 -0
  1011. package/dist/styles.css +2 -0
  1012. package/dist/switch-BqD0RH_G.js +18 -0
  1013. package/dist/table-Q2-voLuw.js +65 -0
  1014. package/dist/tabs-CSIucYFP.js +57 -0
  1015. package/dist/theme-provider-BkRohQFU.js +61 -0
  1016. package/dist/toggle-group-9Bs0Mm3r.js +82 -0
  1017. package/dist/trpc-CvJUuUXp.js +153 -0
  1018. package/dist/ui.js +2174 -0
  1019. package/dist/uk-CwpJAxmx.js +4578 -0
  1020. package/dist/utils-CX-Pz5p6.js +8 -0
  1021. package/dist/wireguard-docs-AfU6NzTL.js +81 -0
  1022. package/dist/writability-BuH-spxv.js +57 -0
  1023. package/package.json +149 -3
@@ -0,0 +1,3286 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { r as t } from "./trpc-CvJUuUXp.js";
3
+ import { f as n, h as r, m as i, n as a } from "./i18n-BgzakKoC.js";
4
+ import { a as o, d as s, et as c, j as l, t as u } from "./mutation-form-validators-BNz5bsv1.js";
5
+ import { t as d } from "./utils-CX-Pz5p6.js";
6
+ import { A as f, M as p, V as m, a as h, l as g, n as _, r as v, t as y } from "./spinner-C-HPNxOc.js";
7
+ import { n as b, t as x } from "./button-6SxPBYMz.js";
8
+ import { a as S, i as C, l as w, o as T, r as E, t as D } from "./dialog-BIhQXcZC.js";
9
+ import { n as O } from "./skeleton-6yk8Tdh5.js";
10
+ import { i as k, o as A } from "./context-u9KJQmdB.js";
11
+ import { n as j, t as M } from "./api-error-9rQmUN5L.js";
12
+ import { c as N, i as P, n as F, o as I, s as L, t as R } from "./table-Q2-voLuw.js";
13
+ import { a as ee, i as te, n as ne, o as z, r as re, t as ie } from "./empty-B-QJ-06w.js";
14
+ import { i as B, n as V, r as H, t as U } from "./alert-B8MAoIO8.js";
15
+ import { t as ae } from "./switch-BqD0RH_G.js";
16
+ import { n as oe, t as se } from "./toggle-group-9Bs0Mm3r.js";
17
+ import { a as ce, l as le, o as ue, r as de, s as fe, t as pe } from "./progress-C7cxNJA1.js";
18
+ import { a as W, c as me } from "./mutations-THtGG6Ai.js";
19
+ import { a as he, d as ge, i as _e, n as ve, o as ye, r as be, s as xe, t as Se } from "./alert-dialog-CYkuMg5D.js";
20
+ import { t as Ce } from "./page-header-RB2YFWlE.js";
21
+ import { i as we, r as Te, t as Ee } from "./tabs-CSIucYFP.js";
22
+ import { n as De, r as Oe, t as ke } from "./query-gate-DVhNIkge.js";
23
+ import { a as Ae, i as je, n as Me, t as Ne } from "./display-DmOo23mi.js";
24
+ import { t as Pe } from "./breadcrumbs-0cjsV2cq.js";
25
+ import { n as Fe, r as Ie, t as Le } from "./presence-code-BfSXr50g.js";
26
+ import { n as Re, t as ze } from "./base-revision-YCO27zR4.js";
27
+ import { t as Be } from "./code-editor-BVimvjDV.js";
28
+ import { i as Ve, n as He, r as Ue, t as We } from "./starter-fields-BRLX0z-v.js";
29
+ import { skipToken as Ge } from "@tanstack/react-query";
30
+ import { useCallback as Ke, useDeferredValue as qe, useEffect as G, useMemo as Je, useRef as K, useState as q } from "react";
31
+ import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
32
+ import Z from "typebox";
33
+ import { AlertCircleIcon as Ye, ArrowDownIcon as Xe, CableIcon as Ze, ChevronRightIcon as Qe, CircleAlertIcon as $e, CircleCheckIcon as et, ClockAlertIcon as tt, CpuIcon as nt, ExternalLinkIcon as rt, HistoryIcon as it, InfoIcon as at, LayoutTemplateIcon as ot, PencilIcon as st, PlusIcon as ct, RefreshCwIcon as lt, SearchIcon as ut, SettingsIcon as dt, Trash2Icon as ft, TriangleAlertIcon as pt, WifiOffIcon as mt } from "lucide-react";
34
+ import { formatAppDateTime as Q, resolveLocalized as ht, schema as gt } from "@overvis/hmi-shared";
35
+ import { Prec as _t } from "@codemirror/state";
36
+ import { keymap as vt } from "@codemirror/view";
37
+ import { canWriteSetup as yt } from "@overvis/hmi-shared/workspace";
38
+ import { useBlocker as bt } from "@tanstack/react-router";
39
+ import { flushSync as xt } from "react-dom";
40
+ import { deployedEdgePrograms as St, deviceUiSessionQuery as Ct, edgeDeployStatusOutputSchema as wt, edgeLiveStateSchema as Tt, edgeProgramHmiParameters as Et, edgeProgramParameterProblem as Dt, freeEdgeProgramFileName as Ot, isDeviceUiProgressMessage as kt, isDeviceUiUnreachableMessage as At, isEdgeProgramFileName as jt, isMc252Endpoint as Mt, normalizeEdgeProgramFileName as Nt } from "@overvis/hmi-shared/endpoint";
41
+ import { taskfileItemWord as Pt, taskfileLanguageDocsUrl as Ft, taskfileLanguageService as It, taskfileVocabulary as $ } from "@overvis/hmi-shared/taskfile";
42
+ import { StreamLanguage as Lt } from "@codemirror/language";
43
+ //#region src/workspace/edge-programs/deploy-status.ts
44
+ function Rt(e) {
45
+ let [n, r] = q(null), i = t.edgeProgram.watchDeployStatus.useSubscription(e == null ? Ge : { endpointId: e }, { onData: (e) => {
46
+ let t = wt["~standard"].validate(e);
47
+ t.issues ?? r(t.value);
48
+ } });
49
+ return {
50
+ status: n?.endpointId === e ? n : null,
51
+ live: i.status === "pending"
52
+ };
53
+ }
54
+ //#endregion
55
+ //#region src/workspace/setup/endpoints/device-log-clock.tsx
56
+ var zt = 6e4;
57
+ function Bt({ endpointId: e }) {
58
+ let n = i(), r = t.deviceLog.status.useQuery({ endpointId: e }, { refetchInterval: zt }).data?.clock;
59
+ if (r == null) return null;
60
+ let a = Math.round(Math.abs(r.offsetMs) / 6e4);
61
+ return /* @__PURE__ */ X(U, {
62
+ variant: "warning",
63
+ children: [
64
+ /* @__PURE__ */ Y(tt, {}),
65
+ /* @__PURE__ */ Y(B, { children: n("endpoint_device_log_clock_title") }),
66
+ /* @__PURE__ */ X(H, { children: [/* @__PURE__ */ Y("p", { children: r.offsetMs > 0 ? n("endpoint_device_log_clock_ahead", {
67
+ minutes: a,
68
+ since: Q(r.since)
69
+ }) : n("endpoint_device_log_clock_behind", {
70
+ minutes: a,
71
+ since: Q(r.since)
72
+ }) }), /* @__PURE__ */ Y("p", { children: n("endpoint_device_log_clock_fix") })] })
73
+ ]
74
+ });
75
+ }
76
+ //#endregion
77
+ //#region src/workspace/setup/endpoints/connection-error.ts
78
+ function Vt(e) {
79
+ switch (e.reason) {
80
+ case "endpoint_vpn_pending": return n("parameter_runtime_error_vpn_pending_help");
81
+ case "protocol_error": return n("parameter_runtime_error_protocol_help");
82
+ default: return n("parameter_runtime_error_connection_help");
83
+ }
84
+ }
85
+ //#endregion
86
+ //#region src/workspace/setup/endpoints/status-connection.tsx
87
+ var Ht = 2e3;
88
+ function Ut(e) {
89
+ if (e == null) return n("endpoint_status_state_unknown");
90
+ switch (e) {
91
+ case "connecting": return n("endpoint_status_state_connecting");
92
+ case "connected": return n("endpoint_status_state_connected");
93
+ case "disconnected": return n("endpoint_status_state_disconnected");
94
+ case "error": return n("endpoint_status_state_error");
95
+ }
96
+ }
97
+ function Wt(e) {
98
+ if (e == null) return "bg-muted text-muted-foreground";
99
+ switch (e) {
100
+ case "connected": return "bg-emerald-500/15 text-emerald-700 dark:text-emerald-400";
101
+ case "connecting": return "bg-amber-500/15 text-amber-800 dark:text-amber-400";
102
+ case "disconnected": return "bg-muted text-muted-foreground";
103
+ case "error": return "bg-destructive/15 text-destructive";
104
+ }
105
+ }
106
+ function Gt(e) {
107
+ let t = [];
108
+ for (let n = 0; n < e.length; n += 2) t.push(e.slice(n, n + 2).toUpperCase());
109
+ return t.join(" ");
110
+ }
111
+ function Kt(e) {
112
+ switch (e.channel) {
113
+ case "sent":
114
+ case "rx": return {
115
+ at: e.at,
116
+ channel: e.channel,
117
+ dataHex: Gt(e.data)
118
+ };
119
+ case "events": return {
120
+ at: e.at,
121
+ channel: "event",
122
+ kind: e.event.kind,
123
+ ...e.event.kind === "error" ? { message: e.event.message } : {}
124
+ };
125
+ case "tx": return null;
126
+ }
127
+ }
128
+ function qt(e) {
129
+ let t = Q(e.at);
130
+ return e.channel === "sent" ? `${t} TX ${e.dataHex ?? ""}` : e.channel === "rx" ? `${t} RX ${e.dataHex ?? ""}` : `${t} EVT ${e.kind ?? "event"}${e.message != null && e.message.length > 0 ? ` ${e.message}` : ""}`;
131
+ }
132
+ function Jt(e) {
133
+ switch (e) {
134
+ case "sent": return "text-sky-700 dark:text-sky-400";
135
+ case "rx": return "text-violet-700 dark:text-violet-400";
136
+ case "event": return "text-amber-800 dark:text-amber-400";
137
+ }
138
+ }
139
+ function Yt(e) {
140
+ switch (e) {
141
+ case "pending": return n("endpoint_status_stream_live");
142
+ case "connecting": return n("endpoint_status_stream_reconnecting");
143
+ case "error": return n("endpoint_status_stream_error");
144
+ case "idle": return n("endpoint_status_stream_reconnecting");
145
+ }
146
+ }
147
+ function Xt(e, t) {
148
+ return e === "error" || t === "error" ? "error" : e === "connecting" || t === "connecting" ? "connecting" : e === "idle" || t === "idle" ? "idle" : "pending";
149
+ }
150
+ function Zt({ endpointId: e, endpoint: n, statusDetails: r }) {
151
+ let a = i(), o = je(e), s = Ae(), [c, l] = q([]), [u, f] = q(!0), p = K(null), m = K(!0), h = Xt(s, t.endpoint.traffic.useSubscription({
152
+ endpointId: e,
153
+ channels: [
154
+ "sent",
155
+ "rx",
156
+ "events"
157
+ ]
158
+ }, { onData(e) {
159
+ let t = Kt(e);
160
+ t != null && l((e) => {
161
+ let n = [...e, t];
162
+ return n.length <= Ht ? n : n.slice(n.length - Ht);
163
+ });
164
+ } }).status);
165
+ G(() => {
166
+ m.current = u;
167
+ }, [u]), G(() => {
168
+ let e = p.current;
169
+ e == null || !m.current || (e.scrollTop = e.scrollHeight);
170
+ }, [c]);
171
+ let g = o?.state ?? null, _ = o?.remote ?? null, v = a("endpoint_status_value_none"), y = n.kind === "pin" ? Ne(n) : n.kind === "wireguard" ? Me(n.port) : `${n.hostname ?? "—"}:${String(n.port)}`, b = _ == null ? v : `${_.hostname}:${String(_.port)}`, S = o?.state === "connected" ? `${a("endpoint_status_connected_since")}: ${Q(o.connectedAt)}` : `${a("endpoint_status_last_error")}: ${o?.lastError == null ? v : Vt(o.lastError)}`;
172
+ return /* @__PURE__ */ X("div", {
173
+ className: "flex min-h-0 flex-1 flex-col gap-4",
174
+ children: [/* @__PURE__ */ X("div", {
175
+ className: "\n flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-md border px-3 py-2 text-sm\n ",
176
+ children: [
177
+ /* @__PURE__ */ Y("span", {
178
+ className: d("inline-flex items-center rounded-md px-2 py-0.5 text-sm font-medium", Wt(g)),
179
+ children: Ut(g)
180
+ }),
181
+ /* @__PURE__ */ Y("span", {
182
+ className: "text-muted-foreground",
183
+ children: Yt(h)
184
+ }),
185
+ /* @__PURE__ */ Y("span", {
186
+ className: "text-border",
187
+ children: "|"
188
+ }),
189
+ /* @__PURE__ */ Y(Qt, {
190
+ label: a("endpoint_status_setup_address"),
191
+ value: y
192
+ }),
193
+ /* @__PURE__ */ Y(Qt, {
194
+ label: a("endpoint_status_active_address"),
195
+ value: b
196
+ }),
197
+ /* @__PURE__ */ Y("span", {
198
+ className: "text-border",
199
+ children: "|"
200
+ }),
201
+ /* @__PURE__ */ Y("span", {
202
+ className: d("text-sm", o?.state === "connected" || o?.lastError == null ? "text-muted-foreground" : "text-destructive"),
203
+ children: S
204
+ }),
205
+ r
206
+ ]
207
+ }), /* @__PURE__ */ X("div", {
208
+ className: "relative min-h-0 flex-1",
209
+ children: [/* @__PURE__ */ Y("div", {
210
+ ref: p,
211
+ className: "\n size-full min-h-48 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs\n ",
212
+ onScroll: () => {
213
+ let e = p.current;
214
+ if (e == null) return;
215
+ let t = e.scrollHeight - e.scrollTop - e.clientHeight < 24;
216
+ m.current = t, f(t);
217
+ },
218
+ children: c.length === 0 ? /* @__PURE__ */ Y("p", {
219
+ className: "text-muted-foreground",
220
+ children: a("endpoint_status_log_empty")
221
+ }) : /* @__PURE__ */ Y("div", {
222
+ className: "space-y-0.5",
223
+ children: c.map((e, t) => /* @__PURE__ */ Y("div", {
224
+ className: d("break-all whitespace-pre-wrap", Jt(e.channel)),
225
+ children: qt(e)
226
+ }, `${e.at}-${String(t)}`))
227
+ })
228
+ }), u ? null : /* @__PURE__ */ X(x, {
229
+ type: "button",
230
+ size: "sm",
231
+ variant: "secondary",
232
+ className: "absolute right-4 bottom-4 shadow-md",
233
+ onClick: () => {
234
+ let e = p.current;
235
+ e != null && (e.scrollTop = e.scrollHeight), f(!0);
236
+ },
237
+ children: [/* @__PURE__ */ Y(Xe, { "data-icon": "inline-start" }), a("endpoint_status_jump_to_latest")]
238
+ })]
239
+ })]
240
+ });
241
+ }
242
+ function Qt({ label: e, value: t }) {
243
+ return /* @__PURE__ */ X("span", {
244
+ className: "text-muted-foreground",
245
+ children: [/* @__PURE__ */ X("span", {
246
+ className: "text-foreground/70",
247
+ children: [e, ": "]
248
+ }), t]
249
+ });
250
+ }
251
+ //#endregion
252
+ //#region src/workspace/setup/endpoints/status-device-ui-progress.tsx
253
+ function $t(e) {
254
+ return e == null || e.bytesExpected === 0 ? null : Math.min(100, e.bytesReceived / e.bytesExpected * 100);
255
+ }
256
+ function en(e) {
257
+ return e != null && e.filesDone < e.files;
258
+ }
259
+ function tn(e, t) {
260
+ return new Intl.NumberFormat(e, {
261
+ style: "unit",
262
+ unit: "kilobyte",
263
+ maximumFractionDigits: 0
264
+ }).format(t / 1e3);
265
+ }
266
+ function nn({ progress: e }) {
267
+ let t = i(), n = r(), a = e != null && e.files > 0;
268
+ return /* @__PURE__ */ Y("div", {
269
+ className: "\n absolute inset-0 z-10 flex items-center justify-center rounded-md border bg-background p-4\n ",
270
+ children: /* @__PURE__ */ X("div", {
271
+ role: "status",
272
+ className: "flex w-full max-w-sm flex-col gap-2",
273
+ children: [
274
+ /* @__PURE__ */ X(pe, {
275
+ value: $t(e),
276
+ children: [/* @__PURE__ */ Y(de, { children: t("endpoint_status_device_ui_loading") }), /* @__PURE__ */ Y(ce, {})]
277
+ }),
278
+ a ? /* @__PURE__ */ Y("p", {
279
+ className: "text-sm text-muted-foreground tabular-nums",
280
+ children: t("endpoint_status_device_ui_progress", {
281
+ done: String(e.filesDone),
282
+ files: String(e.files),
283
+ received: tn(n, e.bytesReceived),
284
+ expected: tn(n, e.bytesExpected)
285
+ })
286
+ }) : null,
287
+ /* @__PURE__ */ Y("p", {
288
+ className: "text-xs text-muted-foreground",
289
+ children: t("endpoint_status_device_ui_progress_hint")
290
+ })
291
+ ]
292
+ })
293
+ });
294
+ }
295
+ //#endregion
296
+ //#region src/workspace/setup/endpoints/status-device-ui.tsx
297
+ var rn = 1e3;
298
+ function an({ mintTicket: e, endpointId: t, kind: n, onTicketUrl: r, resolveDeviceUiOrigin: a }) {
299
+ let o = i(), [s, c] = q(null), [l, u] = q(null), [d, f] = q(null), [p, m] = q(null), [h, g] = q(!1), [_, v] = q(!1), b = d == null ? null : d.kind === "request" ? j(d.error) : o("endpoint_status_device_ui_unreachable");
300
+ G(() => {
301
+ let n = !1;
302
+ return e({ id: t }).then((e) => {
303
+ if (n) return;
304
+ let i = a?.(e.origin) ?? e.origin, o = `${i}/?ticket=${encodeURIComponent(e.ticket)}`;
305
+ u(i), c(o), r(`${i}/?${Ct}=${encodeURIComponent(t)}`);
306
+ }, (e) => {
307
+ n || f({
308
+ kind: "request",
309
+ error: e
310
+ });
311
+ }), () => {
312
+ n = !0, r(null);
313
+ };
314
+ }, [t]), G(() => {
315
+ if (l == null) return;
316
+ let e = (e) => {
317
+ e.origin === l && (At(e.data) ? f({ kind: "unreachable" }) : kt(e.data) && m(e.data));
318
+ };
319
+ return window.addEventListener("message", e), () => {
320
+ window.removeEventListener("message", e);
321
+ };
322
+ }, [l]);
323
+ let x = b == null && s == null, S = b == null && s != null && (!h || en(p));
324
+ return G(() => {
325
+ if (!S) return;
326
+ let e = setTimeout(() => {
327
+ v(!0);
328
+ }, rn);
329
+ return () => {
330
+ clearTimeout(e);
331
+ };
332
+ }, [S]), /* @__PURE__ */ X("div", {
333
+ className: "flex min-h-0 flex-1 flex-col gap-2",
334
+ children: [b == null ? null : /* @__PURE__ */ X(U, {
335
+ variant: "destructive",
336
+ children: [
337
+ /* @__PURE__ */ Y(Ye, {}),
338
+ /* @__PURE__ */ Y(B, { children: o("error_request_failed_title") }),
339
+ /* @__PURE__ */ Y(H, { children: b })
340
+ ]
341
+ }), /* @__PURE__ */ X("div", {
342
+ className: "relative min-h-0 flex-1",
343
+ children: [
344
+ x ? /* @__PURE__ */ X("div", {
345
+ className: "\n absolute inset-0 z-10 flex items-center justify-center gap-2 text-sm\n text-muted-foreground\n ",
346
+ children: [/* @__PURE__ */ Y(y, {}), o("endpoint_status_device_ui_loading")]
347
+ }) : null,
348
+ S && _ ? /* @__PURE__ */ Y(nn, { progress: p }) : null,
349
+ s != null && b == null ? /* @__PURE__ */ Y("iframe", {
350
+ title: o("endpoint_status_tab_device_ui"),
351
+ src: s,
352
+ className: "size-full min-h-80 rounded-md border bg-background",
353
+ onLoad: () => {
354
+ g(!0);
355
+ },
356
+ onError: () => {
357
+ n === "wireguard" && f({ kind: "unreachable" });
358
+ }
359
+ }) : null
360
+ ]
361
+ })]
362
+ });
363
+ }
364
+ //#endregion
365
+ //#region src/workspace/edge-programs/diagnostic-text.ts
366
+ function on(e, t) {
367
+ switch (e) {
368
+ case "io": return n("taskfile_error_io");
369
+ case "mem": return n("taskfile_error_mem");
370
+ case "nopath": return n("taskfile_error_nopath");
371
+ case "nofile": return n("taskfile_error_nofile");
372
+ case "line_unrecognized": return n("taskfile_error_line_unrecognized");
373
+ case "item_name_too_big": return n("taskfile_error_item_name_too_big");
374
+ case "unexpected_value": return n("taskfile_error_unexpected_value");
375
+ case "too_many_items": return n("taskfile_error_too_many_items");
376
+ case "unknown_type": return n("taskfile_error_unknown_type");
377
+ case "expected_asterisk": return n("taskfile_error_expected_asterisk");
378
+ case "item_ref": return n("taskfile_error_item_ref");
379
+ case "arg_illegal": return n("taskfile_error_arg_illegal");
380
+ case "unexpected_item": return n("taskfile_error_unexpected_item");
381
+ case "value_bitsize_unsupported": return n("taskfile_error_value_bitsize_unsupported");
382
+ case "item_name": return n("taskfile_error_item_name");
383
+ case "expected_double_quotes": return n("taskfile_error_expected_double_quotes");
384
+ case "expected_eol": return n("taskfile_error_expected_eol");
385
+ case "expected_separator": return n("taskfile_error_expected_separator");
386
+ case "version_unsupported": return n("taskfile_error_version_unsupported");
387
+ case "crc": return n("taskfile_error_crc");
388
+ case "uid_broadcast": return n("taskfile_error_uid_broadcast");
389
+ case "file_format_unsupported": return n("taskfile_error_file_format_unsupported");
390
+ case "name_reserved": return n("taskfile_error_name_reserved");
391
+ case "name_doubled": return n("taskfile_error_name_doubled");
392
+ case "unsatisfied_forward_declaration": return n("taskfile_error_unsatisfied_forward_declaration", { name: String(t.name ?? t.token ?? "") });
393
+ case "item_ref_too_short": return n("taskfile_error_item_ref_too_short");
394
+ case "expected_value": return n("taskfile_error_expected_value");
395
+ case "array_idx": return n("taskfile_error_array_idx");
396
+ case "array_indirect_idx": return n("taskfile_error_array_indirect_idx");
397
+ case "array_undeclared": return n("taskfile_error_array_undeclared");
398
+ case "item_undeclared": return n("taskfile_error_item_undeclared");
399
+ case "out_of_param_mem": return n("taskfile_error_out_of_param_mem");
400
+ case "array_size": return n("taskfile_error_array_size");
401
+ case "item_ref_var": return n("taskfile_error_item_ref_var");
402
+ case "item_ref_cond": return n("taskfile_error_item_ref_cond");
403
+ case "index_bitsize_unsupported": return n("taskfile_error_index_bitsize_unsupported");
404
+ case "expected_closing_bracket": return n("taskfile_error_expected_closing_bracket");
405
+ case "unknown_string_function": return n("taskfile_error_unknown_string_function");
406
+ case "unmapped_param": return n("taskfile_error_unmapped_param");
407
+ case "param_map_partial_intersect": return n("taskfile_error_param_map_partial_intersect");
408
+ case "param_map_multiple_writers": return n("taskfile_error_param_map_multiple_writers");
409
+ case "obsolete_file_layout": return n("taskfile_error_obsolete_file_layout");
410
+ default: return n("taskfile_error_unknown", { code: e });
411
+ }
412
+ }
413
+ function sn(e) {
414
+ let t = String(e.args.filename ?? "");
415
+ switch (e.code) {
416
+ case "depends_on_invalid_definition": return n("taskfile_warning_depends_on_invalid_definition");
417
+ case "filename_ignored": return n("taskfile_warning_filename_ignored", { filename: t });
418
+ case "filename_invalid": return n("taskfile_warning_filename_invalid", { filename: t });
419
+ case "implicit_indirect_index": return n("taskfile_warning_implicit_indirect_index");
420
+ case "memory_log_target": return n("taskfile_warning_memory_log_target");
421
+ case "nonstandard_holding_name": return n("taskfile_warning_nonstandard_holding_name");
422
+ case "hmi_type_mismatch": return n("taskfile_warning_hmi_type_mismatch", {
423
+ parameter: String(e.args.parameter ?? ""),
424
+ type: String(e.args.type ?? ""),
425
+ actual: String(e.args.actual ?? "")
426
+ });
427
+ case "string_output_limit": return n("taskfile_warning_string_output_limit", { limit: String(e.args.limit ?? "") });
428
+ default: return n("taskfile_warning_unknown", { code: e.code });
429
+ }
430
+ }
431
+ function cn(e) {
432
+ return e.severity === "error" ? on(e.code, e.args) : sn(e);
433
+ }
434
+ var ln = {
435
+ ERROR_OUT_OF_MEMORY: "mem",
436
+ ERROR_NO_PATH: "nopath",
437
+ ERROR_NO_FILE: "nofile",
438
+ ERROR_ILLEGAL_ARGUMENT: "arg_illegal",
439
+ ERROR_EXPECTED_DOUBLE_QOUTES: "expected_double_quotes",
440
+ ERROR_NAME_ALREADY_DEFINED: "name_doubled",
441
+ ERROR_STRING_FUNCTION_ARGUMENT_TOO_SHORT: "item_ref_too_short",
442
+ ERROR_VALUE_FORMAT: "expected_value",
443
+ ERROR_ILLEGAL_ARRAY_INDEX: "array_idx",
444
+ ERROR_ARRAY_INDIRECT_INDEX_NOT_ALLOWED_HERE: "array_indirect_idx",
445
+ ERROR_OUT_OF_PARAMETER_STORAGE_MEMORY: "out_of_param_mem",
446
+ ERROR_ILLEGAL_ARRAY_SIZE: "array_size",
447
+ ERROR_UNEXPECTED_VARIABLE_REF: "item_ref_var",
448
+ ERROR_UNEXPECTED_CONDITION_REF: "item_ref_cond",
449
+ ERROR_LOGGING_UNMAPPED_PARAMETER: "unmapped_param",
450
+ ERROR_MAPPED_PARAMETER_INTERSECT_PARTIALLY: "param_map_partial_intersect",
451
+ ERROR_MULTIPLE_WRITERS_FOR_MAPPED_PARAMETER: "param_map_multiple_writers"
452
+ };
453
+ function un(e) {
454
+ return on(ln[e] ?? (e.startsWith("ERROR_") ? e.slice(6).toLowerCase() : e), {});
455
+ }
456
+ function dn(e) {
457
+ switch (e) {
458
+ case "EXC_MB_ILLEGAL_FUNCTION": return n("edge_task_error_mb_illegal_function");
459
+ case "EXC_MB_ILLEGAL_DATA_ADDRESS": return n("edge_task_error_mb_illegal_data_address");
460
+ case "EXC_MB_ILLEGAL_DATA_VALUE": return n("edge_task_error_mb_illegal_data_value");
461
+ case "EXC_MB_SLAVE_DEVICE_FAILURE": return n("edge_task_error_mb_slave_device_failure");
462
+ case "EXC_MB_ACKNOWLEDGE": return n("edge_task_error_mb_acknowledge");
463
+ case "EXC_MB_SLAVE_BUSY": return n("edge_task_error_mb_slave_busy");
464
+ case "EXC_MB_MEMORY_PARITY_ERROR": return n("edge_task_error_mb_memory_parity_error");
465
+ case "EXC_PARAM_PATH_UNAVAILABLE": return n("edge_task_error_param_path_unavailable");
466
+ case "EXC_PARAM_TARGET_FAILED": return n("edge_task_error_param_target_failed");
467
+ case "EXC_TYPE_UNKNOWN": return n("edge_task_error_type_unknown");
468
+ case "EXC_ACTION_UNKNOWN": return n("edge_task_error_action_unknown");
469
+ case "EXC_IO": return n("edge_task_error_io");
470
+ case "EXC_OUT_OF_MEMORY": return n("edge_task_error_out_of_memory");
471
+ case "EXC_STACK_OVERFLOW": return n("edge_task_error_stack_overflow");
472
+ case "EXC_STACK_UNDERFLOW": return n("edge_task_error_stack_underflow");
473
+ case "EXC_RESULT_INFINITY": return n("edge_task_error_result_infinity");
474
+ case "EXC_RESULT_COMPLEX": return n("edge_task_error_result_complex");
475
+ case "EXC_OUT_OF_BOUNDS": return n("edge_task_error_out_of_bounds");
476
+ case "EXC_UNKNOWN": return n("edge_task_error_unknown");
477
+ default: return e;
478
+ }
479
+ }
480
+ function fn(e) {
481
+ switch (e) {
482
+ case "card_unavailable": return n("edge_deploy_error_card_unavailable");
483
+ case "settings_rejected": return n("edge_deploy_error_settings_rejected");
484
+ case "edge_deploy_interrupted": return n("edge_deploy_error_interrupted");
485
+ default: return n("edge_deploy_error_failed");
486
+ }
487
+ }
488
+ //#endregion
489
+ //#region src/workspace/setup/endpoints/programs/deploy-status-bar.tsx
490
+ var pn = {
491
+ never: "outline",
492
+ pending: "outline",
493
+ deploying: "secondary",
494
+ synced: "success",
495
+ failed: "destructive",
496
+ blocked: "destructive",
497
+ offline: "warning",
498
+ conflict: "destructive",
499
+ drift: "warning"
500
+ };
501
+ function mn() {
502
+ let e = i();
503
+ return (t) => {
504
+ switch (t) {
505
+ case "never": return e("edge_deploy_state_never");
506
+ case "pending": return e("edge_deploy_state_pending");
507
+ case "deploying": return e("edge_deploy_state_deploying");
508
+ case "synced": return e("edge_deploy_state_synced");
509
+ case "failed": return e("edge_deploy_state_failed");
510
+ case "blocked": return e("edge_deploy_state_blocked");
511
+ case "offline": return e("edge_deploy_state_offline");
512
+ case "conflict": return e("edge_deploy_state_conflict");
513
+ case "drift": return e("edge_deploy_state_drift");
514
+ }
515
+ };
516
+ }
517
+ function hn() {
518
+ let e = i();
519
+ return (t) => {
520
+ switch (t.state) {
521
+ case "never": return e("edge_deploy_state_never_description");
522
+ case "pending": return t.autoSync ? e("edge_deploy_state_pending_auto") : e("edge_deploy_state_pending_manual");
523
+ case "deploying": return e("edge_deploy_state_deploying_description");
524
+ case "synced": return e("edge_deploy_state_synced_description");
525
+ case "failed": return e("edge_deploy_state_failed_description");
526
+ case "blocked": return e("edge_deploy_state_blocked_description");
527
+ case "offline": return e("edge_deploy_state_offline_description");
528
+ case "conflict": return e("edge_deploy_state_conflict_description");
529
+ case "drift": return e("edge_deploy_state_drift_description");
530
+ }
531
+ };
532
+ }
533
+ function gn() {
534
+ let e = i();
535
+ return (t) => [
536
+ ...t.deployedAt == null ? [] : [e("edge_deploy_meta_deployed", { time: Q(t.deployedAt) })],
537
+ ...t.checkedAt == null ? [] : [e("edge_deploy_meta_checked", { time: Q(t.checkedAt) })],
538
+ ...t.attemptedAt == null ? [] : [e("edge_deploy_meta_attempt", {
539
+ time: Q(t.attemptedAt),
540
+ attempts: String(t.attempts)
541
+ })]
542
+ ];
543
+ }
544
+ function _n({ workspaceId: e, deploy: t, canEdit: n, onOpenSettings: r, onShowLine: o }) {
545
+ let s = i(), c = a(), l = mn(), u = hn(), d = gn(), { syncNow: f } = W(e), { status: p } = t;
546
+ if (p == null) return /* @__PURE__ */ Y(O, { className: "h-16 w-full shrink-0 rounded-lg" });
547
+ let m = p.deviceError, h = d(p);
548
+ return /* @__PURE__ */ X("div", {
549
+ className: "flex shrink-0 flex-col gap-3",
550
+ children: [
551
+ /* @__PURE__ */ X("section", {
552
+ "aria-label": s("edge_deploy_title"),
553
+ className: "\n flex flex-col gap-3 rounded-lg border bg-card px-4 py-3\n sm:flex-row sm:items-center\n ",
554
+ children: [/* @__PURE__ */ X("div", {
555
+ className: "flex min-w-0 flex-1 flex-col gap-1",
556
+ children: [
557
+ /* @__PURE__ */ X("p", {
558
+ "aria-live": "polite",
559
+ className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",
560
+ children: [/* @__PURE__ */ X(g, {
561
+ variant: pn[p.state],
562
+ children: [
563
+ p.state === "deploying" ? /* @__PURE__ */ Y(y, { "data-icon": "inline-start" }) : null,
564
+ p.state === "offline" ? /* @__PURE__ */ Y(mt, { "data-icon": "inline-start" }) : null,
565
+ l(p.state)
566
+ ]
567
+ }), /* @__PURE__ */ Y("span", { children: u(p) })]
568
+ }),
569
+ h.length > 0 || !t.live ? /* @__PURE__ */ X("p", {
570
+ className: "flex flex-wrap gap-x-3 gap-y-0.5 text-xs text-muted-foreground",
571
+ children: [h.map((e) => /* @__PURE__ */ Y("span", { children: e }, e)), t.live ? null : /* @__PURE__ */ Y("span", { children: s("edge_deploy_live_unavailable") })]
572
+ }) : null,
573
+ p.settingsPending ? /* @__PURE__ */ X("p", {
574
+ className: "flex items-center gap-1.5 text-xs text-muted-foreground",
575
+ children: [/* @__PURE__ */ Y(at, { className: "size-3.5 shrink-0" }), s("edge_deploy_settings_pending")]
576
+ }) : null
577
+ ]
578
+ }), n ? /* @__PURE__ */ X("div", {
579
+ className: "flex shrink-0 gap-2",
580
+ children: [/* @__PURE__ */ X(x, {
581
+ type: "button",
582
+ variant: "ghost",
583
+ size: "sm",
584
+ onClick: r,
585
+ children: [/* @__PURE__ */ Y(dt, { "data-icon": "inline-start" }), s("edge_settings_open")]
586
+ }), /* @__PURE__ */ X(x, {
587
+ type: "button",
588
+ variant: p.state === "synced" ? "ghost" : "outline",
589
+ size: "sm",
590
+ disabled: f.isPending || p.state === "deploying",
591
+ onClick: () => {
592
+ f.mutate({ endpointId: p.endpointId }, {
593
+ onSuccess: (e) => {
594
+ e.jobId == null ? c.info(s("edge_deploy_sync_now_disabled")) : c.success(s("edge_deploy_sync_now_toast"));
595
+ },
596
+ onError: (e) => {
597
+ c.error(j(e));
598
+ }
599
+ });
600
+ },
601
+ children: [/* @__PURE__ */ Y(lt, { "data-icon": "inline-start" }), s("edge_deploy_sync_now")]
602
+ })]
603
+ }) : null]
604
+ }),
605
+ m == null ? null : /* @__PURE__ */ X(U, {
606
+ variant: "destructive",
607
+ children: [
608
+ /* @__PURE__ */ Y($e, {}),
609
+ /* @__PURE__ */ Y(B, { children: s("edge_deploy_device_error_title", { file: m.fileName }) }),
610
+ /* @__PURE__ */ Y(H, { children: m.line == null ? un(m.code) : s("edge_deploy_device_error_line", {
611
+ line: String(m.line),
612
+ message: un(m.code)
613
+ }) }),
614
+ m.programId != null && m.line != null ? /* @__PURE__ */ Y(V, { children: /* @__PURE__ */ Y(x, {
615
+ type: "button",
616
+ variant: "outline",
617
+ size: "sm",
618
+ onClick: () => {
619
+ m.programId != null && m.line != null && o(m.programId, m.line);
620
+ },
621
+ children: s("edge_deploy_device_error_show")
622
+ }) }) : null
623
+ ]
624
+ }),
625
+ p.error == null ? null : /* @__PURE__ */ X(U, {
626
+ variant: p.error.code === "settings_rejected" ? "warning" : "destructive",
627
+ children: [
628
+ /* @__PURE__ */ Y(pt, {}),
629
+ /* @__PURE__ */ Y(B, { children: s("edge_deploy_error_title") }),
630
+ /* @__PURE__ */ X(H, { children: [/* @__PURE__ */ Y("p", { children: fn(p.error.code) }), /* @__PURE__ */ Y("p", {
631
+ className: "font-mono text-xs break-all",
632
+ children: s("edge_deploy_error_detail", { message: p.error.message })
633
+ })] })
634
+ ]
635
+ })
636
+ ]
637
+ });
638
+ }
639
+ //#endregion
640
+ //#region src/workspace/setup/endpoints/programs/device-log.tsx
641
+ var vn = [
642
+ "error",
643
+ "message",
644
+ "system"
645
+ ];
646
+ function yn(e) {
647
+ let n = t.useUtils(), [r, i] = q(null), [a, o] = q("latest"), [s, c] = q(null), l = K(null), u = Ke((t, r, a) => {
648
+ let s = (t) => n.client.edgeProgram.readDeviceLog.query({
649
+ endpointId: e,
650
+ ...t
651
+ }, { signal: a.signal });
652
+ return (async () => {
653
+ if (t === "earlier" && r != null && r.start > 0) {
654
+ let e = await s({ before: r.start });
655
+ return e.size == null || e.size < r.cursor.offset ? {
656
+ result: await s({}),
657
+ merge: "replace"
658
+ } : {
659
+ result: e,
660
+ merge: "prepend"
661
+ };
662
+ }
663
+ if (t === "newer" && r != null) {
664
+ let e = await s({ after: r.cursor });
665
+ return {
666
+ result: e,
667
+ merge: e.reset ? "replace" : "append"
668
+ };
669
+ }
670
+ return {
671
+ result: await s({}),
672
+ merge: "latest"
673
+ };
674
+ })().then(({ result: e, merge: t }) => {
675
+ i((n) => {
676
+ if (t === "prepend" && n != null) return {
677
+ ...n,
678
+ entries: [...e.entries, ...n.entries],
679
+ start: e.start
680
+ };
681
+ let r = t === "append" && n != null;
682
+ return {
683
+ entries: r ? [...n.entries, ...e.entries] : e.entries,
684
+ start: r ? n.start : e.start,
685
+ cursor: e.cursor,
686
+ size: e.size,
687
+ readAt: /* @__PURE__ */ new Date(),
688
+ replaced: t === "replace"
689
+ };
690
+ });
691
+ }, (e) => {
692
+ a.signal.aborted || c(e);
693
+ }).finally(() => {
694
+ l.current === a && (l.current = null, o(null));
695
+ });
696
+ }, [e, n]);
697
+ return G(() => {
698
+ let e = new AbortController();
699
+ return l.current = e, u("latest", null, e), () => {
700
+ l.current?.abort();
701
+ };
702
+ }, [u]), {
703
+ log: r,
704
+ reading: a,
705
+ error: s,
706
+ read: (e, t) => {
707
+ l.current?.abort();
708
+ let n = new AbortController();
709
+ l.current = n, o(e), c(null), u(e, t, n);
710
+ }
711
+ };
712
+ }
713
+ function bn() {
714
+ let e = i();
715
+ return (t) => {
716
+ switch (t) {
717
+ case "error": return e("edge_log_kind_error");
718
+ case "message": return e("edge_log_kind_message");
719
+ case "system": return e("edge_log_kind_system");
720
+ case "restart": return e("edge_log_restart");
721
+ }
722
+ };
723
+ }
724
+ function xn() {
725
+ let e = i();
726
+ return (t) => {
727
+ switch (t) {
728
+ case "error": return e("edge_log_filter_errors");
729
+ case "message": return e("edge_log_filter_messages");
730
+ case "system": return e("edge_log_filter_system");
731
+ }
732
+ };
733
+ }
734
+ function Sn({ at: e }) {
735
+ let t = i();
736
+ return /* @__PURE__ */ Y("time", {
737
+ className: "font-mono text-xs text-muted-foreground tabular-nums",
738
+ ...e == null ? {} : { dateTime: e },
739
+ children: e == null ? t("edge_log_no_time") : Q(e)
740
+ });
741
+ }
742
+ function Cn({ entry: e, onShowLine: t }) {
743
+ let n = i(), { error: r } = e, a = String(r.line);
744
+ return /* @__PURE__ */ X("div", {
745
+ className: "flex flex-col gap-0.5",
746
+ children: [/* @__PURE__ */ Y("span", {
747
+ className: "text-destructive",
748
+ title: e.text,
749
+ children: n("edge_log_error", { message: dn(r.code) })
750
+ }), /* @__PURE__ */ Y("span", {
751
+ className: "flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs",
752
+ children: r.programs.length === 0 ? /* @__PURE__ */ Y("span", {
753
+ className: "text-muted-foreground",
754
+ children: n("edge_log_error_program_unknown", { line: a })
755
+ }) : /* @__PURE__ */ X(J, { children: [r.programs.length > 1 ? /* @__PURE__ */ Y("span", {
756
+ className: "text-muted-foreground",
757
+ children: n("edge_log_error_one_of")
758
+ }) : null, r.programs.map((e) => e.programId == null ? /* @__PURE__ */ Y("span", {
759
+ className: "font-mono text-muted-foreground",
760
+ children: n("edge_log_error_line", {
761
+ line: a,
762
+ file: e.fileName
763
+ })
764
+ }, e.fileName) : /* @__PURE__ */ Y(x, {
765
+ type: "button",
766
+ variant: "link",
767
+ size: "sm",
768
+ className: "h-auto p-0 font-mono text-xs",
769
+ onClick: () => {
770
+ e.programId != null && t(e.programId, r.line);
771
+ },
772
+ children: n("edge_log_error_line", {
773
+ line: a,
774
+ file: e.fileName
775
+ })
776
+ }, e.fileName))] })
777
+ })]
778
+ });
779
+ }
780
+ function wn({ entry: e, onShowLine: t }) {
781
+ let n = bn();
782
+ return e.kind === "restart" ? /* @__PURE__ */ X("li", {
783
+ className: "\n flex items-center gap-2 px-3 py-1 text-xs text-muted-foreground\n before:h-px before:flex-1 before:bg-border\n after:h-px after:flex-1 after:bg-border\n ",
784
+ title: e.text,
785
+ children: [/* @__PURE__ */ Y("span", { children: n("restart") }), /* @__PURE__ */ Y(Sn, { at: e.at })]
786
+ }) : /* @__PURE__ */ X("li", {
787
+ className: "\n grid grid-cols-[auto_minmax(0,1fr)] items-baseline gap-x-2 gap-y-0.5 px-3 py-1.5\n sm:grid-cols-[9.5rem_5.5rem_minmax(0,1fr)]\n ",
788
+ children: [
789
+ /* @__PURE__ */ Y(Sn, { at: e.at }),
790
+ /* @__PURE__ */ Y("span", {
791
+ className: "\n justify-self-end\n sm:justify-self-start\n ",
792
+ children: /* @__PURE__ */ Y(g, {
793
+ variant: e.kind === "error" ? "destructive" : e.kind === "system" ? "outline" : "secondary",
794
+ children: n(e.kind)
795
+ })
796
+ }),
797
+ /* @__PURE__ */ Y("div", {
798
+ className: "\n col-span-2 min-w-0 text-sm wrap-break-word\n sm:col-span-1\n ",
799
+ children: e.error == null ? /* @__PURE__ */ Y("span", {
800
+ className: d("font-mono", e.kind === "system" && "text-muted-foreground"),
801
+ children: e.text
802
+ }) : /* @__PURE__ */ Y(Cn, {
803
+ entry: {
804
+ ...e,
805
+ error: e.error
806
+ },
807
+ onShowLine: t
808
+ })
809
+ })
810
+ ]
811
+ });
812
+ }
813
+ function Tn(e, t, n) {
814
+ if (e.kind !== "restart" && !t.includes(e.kind)) return !1;
815
+ if (n.length === 0) return !0;
816
+ let r = n.toLocaleLowerCase();
817
+ return [e.text, ...e.error?.programs.map((e) => e.fileName) ?? []].some((e) => e.toLocaleLowerCase().includes(r));
818
+ }
819
+ function En({ endpointId: e, deviceLogging: t, settingsPending: n, canEdit: r, onOpenSettings: a, onShowLine: o }) {
820
+ let s = i(), c = xn(), { log: l, reading: u, error: d, read: f } = yn(e), [p, m] = q(["error", "message"]), [g, b] = q(""), S = (l?.entries ?? []).filter((e) => Tn(e, p, g.trim()));
821
+ S.reverse();
822
+ let C = `edge-device-log-${e}`, w;
823
+ return w = l == null ? d == null ? /* @__PURE__ */ X("div", {
824
+ className: "flex flex-col gap-2 p-3",
825
+ children: [
826
+ /* @__PURE__ */ Y(O, { className: "h-5" }),
827
+ /* @__PURE__ */ Y(O, { className: "h-5" }),
828
+ /* @__PURE__ */ Y(O, { className: "h-5" })
829
+ ]
830
+ }) : null : l.size == null ? /* @__PURE__ */ Y("p", {
831
+ className: "px-3 py-2 text-sm text-muted-foreground",
832
+ children: s("edge_log_no_file")
833
+ }) : S.length === 0 ? /* @__PURE__ */ Y("p", {
834
+ className: "px-3 py-2 text-sm text-muted-foreground",
835
+ children: l.entries.length === 0 ? s("edge_log_empty") : s("edge_log_no_match")
836
+ }) : /* @__PURE__ */ Y("ol", {
837
+ className: "divide-y py-1",
838
+ children: S.map((e) => /* @__PURE__ */ Y(wn, {
839
+ entry: e,
840
+ onShowLine: o
841
+ }, e.offset))
842
+ }), /* @__PURE__ */ X("section", {
843
+ "aria-labelledby": C,
844
+ className: "flex shrink-0 flex-col overflow-hidden rounded-lg border bg-card",
845
+ children: [
846
+ /* @__PURE__ */ X("div", {
847
+ className: "flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1 border-b px-3 py-1.5",
848
+ children: [
849
+ /* @__PURE__ */ Y("h2", {
850
+ id: C,
851
+ className: "text-sm font-medium",
852
+ children: s("edge_log_title")
853
+ }),
854
+ /* @__PURE__ */ Y("span", {
855
+ className: "flex-1 text-xs text-muted-foreground",
856
+ children: l == null ? null : s("edge_log_read_at", { time: Q(l.readAt) })
857
+ }),
858
+ /* @__PURE__ */ X(x, {
859
+ type: "button",
860
+ variant: "outline",
861
+ size: "sm",
862
+ disabled: u != null,
863
+ onClick: () => {
864
+ f(l == null ? "latest" : "newer", l);
865
+ },
866
+ children: [Y(u === "latest" || u === "newer" ? y : lt, { "data-icon": "inline-start" }), s("edge_log_refresh")]
867
+ })
868
+ ]
869
+ }),
870
+ /* @__PURE__ */ X("div", {
871
+ className: "\n flex flex-col gap-2 px-3 pt-3\n empty:hidden\n ",
872
+ children: [
873
+ t ? n ? /* @__PURE__ */ X(U, {
874
+ variant: "warning",
875
+ children: [/* @__PURE__ */ Y(pt, {}), /* @__PURE__ */ Y(H, { children: s("edge_log_logging_pending") })]
876
+ }) : null : /* @__PURE__ */ X(U, { children: [
877
+ /* @__PURE__ */ Y(at, {}),
878
+ /* @__PURE__ */ Y(H, { children: s("edge_log_logging_off") }),
879
+ r ? /* @__PURE__ */ Y(V, { children: /* @__PURE__ */ X(x, {
880
+ type: "button",
881
+ variant: "outline",
882
+ size: "sm",
883
+ onClick: a,
884
+ children: [/* @__PURE__ */ Y(dt, { "data-icon": "inline-start" }), s("edge_settings_open")]
885
+ }) }) : null
886
+ ] }),
887
+ l?.replaced === !0 ? /* @__PURE__ */ X(U, { children: [/* @__PURE__ */ Y(at, {}), /* @__PURE__ */ Y(H, { children: s("edge_log_replaced") })] }) : null,
888
+ d == null ? null : /* @__PURE__ */ Y(ke, {
889
+ message: j(d),
890
+ onRetry: () => {
891
+ f(l == null ? "latest" : "newer", l);
892
+ },
893
+ retrying: u != null
894
+ })
895
+ ]
896
+ }),
897
+ /* @__PURE__ */ X("div", {
898
+ className: "flex flex-wrap items-center gap-2 border-b px-3 py-2",
899
+ children: [/* @__PURE__ */ Y(se, {
900
+ "aria-label": s("edge_log_filter_label"),
901
+ multiple: !0,
902
+ variant: "outline",
903
+ size: "sm",
904
+ spacing: 0,
905
+ value: [...p],
906
+ onValueChange: (e) => {
907
+ m(vn.filter((t) => e.includes(t)));
908
+ },
909
+ children: vn.map((e) => /* @__PURE__ */ Y(oe, {
910
+ value: e,
911
+ children: c(e)
912
+ }, e))
913
+ }), /* @__PURE__ */ X(_, {
914
+ className: "\n h-8 min-w-40 flex-1\n sm:max-w-64\n ",
915
+ children: [/* @__PURE__ */ Y(v, { children: /* @__PURE__ */ Y(ut, {}) }), /* @__PURE__ */ Y(h, {
916
+ type: "search",
917
+ "aria-label": s("edge_log_search"),
918
+ placeholder: s("edge_log_search"),
919
+ value: g,
920
+ onChange: (e) => {
921
+ b(e.target.value);
922
+ }
923
+ })]
924
+ })]
925
+ }),
926
+ /* @__PURE__ */ X("div", {
927
+ className: "max-h-96 min-h-24 overflow-y-auto",
928
+ "aria-busy": u != null,
929
+ children: [w, l != null && l.start > 0 ? /* @__PURE__ */ Y("div", {
930
+ className: "border-t px-3 py-2",
931
+ children: /* @__PURE__ */ X(x, {
932
+ type: "button",
933
+ variant: "ghost",
934
+ size: "sm",
935
+ disabled: u != null,
936
+ onClick: () => {
937
+ f("earlier", l);
938
+ },
939
+ children: [u === "earlier" ? /* @__PURE__ */ Y(y, { "data-icon": "inline-start" }) : null, s("edge_log_load_earlier")]
940
+ })
941
+ }) : null]
942
+ })
943
+ ]
944
+ });
945
+ }
946
+ //#endregion
947
+ //#region src/workspace/setup/endpoints/programs/dialogs.tsx
948
+ var Dn = gt(Z.Object({ fileName: Z.String({ maxLength: 64 }) }, { additionalProperties: !1 }));
949
+ function On({ workspaceId: e, endpointId: t, program: n, onClose: r, onSaved: c }) {
950
+ let l = i(), d = a(), f = W(e), p = o({
951
+ defaultValues: { fileName: n?.fileName ?? "" },
952
+ validators: u({
953
+ schema: Dn,
954
+ submit: async (r) => {
955
+ let i = Nt(r.fileName);
956
+ if (!jt(i)) return { fields: { fileName: () => l("edge_program_file_name_invalid") } };
957
+ if (n == null) {
958
+ let n = await f.create.mutateAsync({
959
+ workspaceId: e,
960
+ endpointId: t,
961
+ fileName: i,
962
+ source: ""
963
+ });
964
+ d.success(l("edge_program_create_toast")), c(n.id);
965
+ } else await f.update.mutateAsync({
966
+ id: n.id,
967
+ fileName: i,
968
+ baseRevision: n.revision
969
+ }), d.success(l("edge_program_rename_toast")), c(n.id);
970
+ return null;
971
+ }
972
+ }),
973
+ onSubmitInvalid: s
974
+ });
975
+ return /* @__PURE__ */ Y(D, {
976
+ open: !0,
977
+ onOpenChange: (e) => {
978
+ e || r();
979
+ },
980
+ children: /* @__PURE__ */ Y(E, { children: /* @__PURE__ */ Y(p.AppForm, { children: /* @__PURE__ */ X(p.FormRoot, {
981
+ layout: "dialog",
982
+ children: [
983
+ /* @__PURE__ */ X(T, { children: [/* @__PURE__ */ Y(w, { children: l(n == null ? "edge_program_create_title" : "edge_program_rename_title") }), /* @__PURE__ */ Y(C, { children: l("edge_program_create_description") })] }),
984
+ /* @__PURE__ */ Y(m, { children: /* @__PURE__ */ Y(p.AppField, {
985
+ name: "fileName",
986
+ children: (e) => /* @__PURE__ */ Y(e.TextField, {
987
+ label: l("edge_program_file_name"),
988
+ maxLength: 64,
989
+ autoFocus: !0,
990
+ autoComplete: "off",
991
+ spellCheck: !1,
992
+ className: "font-mono uppercase",
993
+ description: e.state.value.trim() === "" ? void 0 : l("edge_program_file_name_description", { fileName: Nt(e.state.value) })
994
+ })
995
+ }) }),
996
+ /* @__PURE__ */ X(S, { children: [/* @__PURE__ */ Y(x, {
997
+ type: "button",
998
+ variant: "outline",
999
+ onClick: r,
1000
+ children: l("action_cancel")
1001
+ }), n == null ? /* @__PURE__ */ Y(p.SubmitButton, {
1002
+ label: l("edge_program_create"),
1003
+ pendingLabel: l("action_creating")
1004
+ }) : /* @__PURE__ */ Y(p.SubmitButton, {
1005
+ label: l("action_save"),
1006
+ pendingLabel: l("action_saving")
1007
+ })] })
1008
+ ]
1009
+ }) }) })
1010
+ });
1011
+ }
1012
+ function kn({ workspaceId: e, program: t, onClose: n, onDeleted: r }) {
1013
+ let c = i(), l = a(), { remove: d } = W(e), f = o({
1014
+ defaultValues: {},
1015
+ validators: u({ submit: async () => (await d.mutateAsync({
1016
+ id: t.id,
1017
+ baseRevision: t.revision
1018
+ }), null) }),
1019
+ onSubmitInvalid: s,
1020
+ onSubmit: () => {
1021
+ l.success(c("edge_program_delete_toast")), r();
1022
+ }
1023
+ });
1024
+ return /* @__PURE__ */ Y(D, {
1025
+ open: !0,
1026
+ onOpenChange: (e) => {
1027
+ e || n();
1028
+ },
1029
+ children: /* @__PURE__ */ Y(E, { children: /* @__PURE__ */ Y(f.AppForm, { children: /* @__PURE__ */ X(f.FormRoot, {
1030
+ layout: "dialog",
1031
+ children: [/* @__PURE__ */ X(T, { children: [/* @__PURE__ */ Y(w, { children: c("edge_program_delete_title", { file: t.fileName }) }), /* @__PURE__ */ Y(C, { children: c("edge_program_delete_description") })] }), /* @__PURE__ */ X(S, { children: [/* @__PURE__ */ Y(x, {
1032
+ type: "button",
1033
+ variant: "outline",
1034
+ onClick: n,
1035
+ children: c("action_cancel")
1036
+ }), /* @__PURE__ */ Y(f.SubmitButton, {
1037
+ label: c("edge_program_delete_submit"),
1038
+ pendingLabel: c("action_deleting"),
1039
+ variant: "destructive"
1040
+ })] })]
1041
+ }) }) })
1042
+ });
1043
+ }
1044
+ //#endregion
1045
+ //#region src/code-editor/taskfile-language.ts
1046
+ var An = /* @__PURE__ */ new Set([...$.statements, ...$.commands]), jn = new Set($.functions), Mn = /* @__PURE__ */ new Set([
1047
+ ...$.parameterTypes,
1048
+ ...$.devices,
1049
+ ...$.itemTypes
1050
+ ]), Nn = /* @__PURE__ */ new Set([...$.constants, ...$.runtimeErrors]), Pn = /^[^\s;#"[\]+:]+/u;
1051
+ function Fn(e, t) {
1052
+ if (e.sol() && (t.lineStart = !0, t.defining = !1), e.eatSpace()) return null;
1053
+ let n = e.peek();
1054
+ if (n === ";" || n === "#") return e.skipToEnd(), "comment";
1055
+ if (n === "\"") {
1056
+ for (e.next(); !e.eol() && e.next() !== "\"";);
1057
+ return t.lineStart = !1, "string";
1058
+ }
1059
+ if (t.lineStart && n === "@") return e.next(), e.match(/^[A-Za-z]+/u), t.lineStart = !1, "meta";
1060
+ if (e.match(/^-?\d+/u) !== null) return t.lineStart = !1, "number";
1061
+ let r = e.match(Pn);
1062
+ if (r === null || typeof r == "boolean") return e.next(), "punctuation";
1063
+ let i = r[0].toUpperCase();
1064
+ return t.lineStart && e.peek() === ":" ? (e.next(), "labelName") : (t.lineStart = !1, t.defining ? (t.defining = !1, "variableName.definition") : (i === "DEF" && (t.defining = !0), An.has(i) ? "keyword" : jn.has(i) ? "operator" : Mn.has(i) ? "typeName" : Nn.has(i) ? "atom" : "variableName"));
1065
+ }
1066
+ var In = Lt.define({
1067
+ name: "taskfile",
1068
+ startState: () => ({
1069
+ lineStart: !0,
1070
+ defining: !1
1071
+ }),
1072
+ token: Fn,
1073
+ languageData: { commentTokens: { line: ";" } }
1074
+ });
1075
+ function Ln() {
1076
+ return In;
1077
+ }
1078
+ //#endregion
1079
+ //#region src/workspace/edge-programs/item-descriptions.ts
1080
+ var Rn = {
1081
+ "option.PROTOCOLVERSION": "edge_program_item_option_protocolversion",
1082
+ "option.UPDATE": "edge_program_item_option_update",
1083
+ "option.UPDATEDIVISOR": "edge_program_item_option_updatedivisor",
1084
+ "option.PARAMLOADRATIO": "edge_program_item_option_paramloadratio",
1085
+ "option.PARAMTIMEOUT": "edge_program_item_option_paramtimeout",
1086
+ "option.VARBITS": "edge_program_item_option_varbits",
1087
+ "option.INDEXBITS": "edge_program_item_option_indexbits",
1088
+ "option.RESETDATA": "edge_program_item_option_resetdata",
1089
+ "option.SYNTAX": "edge_program_item_option_syntax",
1090
+ "statement.DEF": "edge_program_item_statement_def",
1091
+ "statement.PUT": "edge_program_item_statement_put",
1092
+ "statement.IF": "edge_program_item_statement_if",
1093
+ "statement.DO": "edge_program_item_statement_do",
1094
+ "holding.VAR": "edge_program_item_holding_var",
1095
+ "holding.VARS": "edge_program_item_holding_vars",
1096
+ "holding.COND": "edge_program_item_holding_cond",
1097
+ "holding.CONDS": "edge_program_item_holding_conds",
1098
+ "definition.string": "edge_program_item_definition_string",
1099
+ "device.MBWRDENIED": "edge_program_item_device_mbwrdenied",
1100
+ "device.MBWRSINGLE": "edge_program_item_device_mbwrsingle",
1101
+ "device.MBWRMULTI": "edge_program_item_device_mbwrmulti",
1102
+ "device.MBWRANY": "edge_program_item_device_mbwrany",
1103
+ "device.MBSELF": "edge_program_item_device_mbself",
1104
+ "device.LSADV": "edge_program_item_device_lsadv",
1105
+ "type.UINT16": "edge_program_item_type_uint16",
1106
+ "type.INT16": "edge_program_item_type_int16",
1107
+ "type.INT16BLE": "edge_program_item_type_int16ble",
1108
+ "type.INT32": "edge_program_item_type_int32",
1109
+ "type.INT32BLE": "edge_program_item_type_int32ble",
1110
+ "type.INT32WLE": "edge_program_item_type_int32wle",
1111
+ "type.BIT": "edge_program_item_type_bit",
1112
+ "type.INT32BE": "edge_program_item_type_int32be",
1113
+ "type.UINT16BLE": "edge_program_item_type_uint16ble",
1114
+ "type.UINT8": "edge_program_item_type_uint8",
1115
+ "type.INT8": "edge_program_item_type_int8",
1116
+ "type.UINT32": "edge_program_item_type_uint32",
1117
+ "type.UINT32BLE": "edge_program_item_type_uint32ble",
1118
+ "type.UINT32WLE": "edge_program_item_type_uint32wle",
1119
+ "type.INT64": "edge_program_item_type_int64",
1120
+ "type.INT64BLE": "edge_program_item_type_int64ble",
1121
+ "type.INT64WLE": "edge_program_item_type_int64wle",
1122
+ "memory.MEMTEMP": "edge_program_item_memory_memtemp",
1123
+ "memory.MEMBAT": "edge_program_item_memory_membat",
1124
+ "memory.MEMFILE": "edge_program_item_memory_memfile",
1125
+ "memory.MEMFLASH": "edge_program_item_memory_memflash",
1126
+ "table.C": "edge_program_item_table_c",
1127
+ "table.D": "edge_program_item_table_d",
1128
+ "table.H": "edge_program_item_table_h",
1129
+ "table.I": "edge_program_item_table_i",
1130
+ "command.EXIT": "edge_program_item_command_exit",
1131
+ "command.CALL": "edge_program_item_command_call",
1132
+ "command.RETURN": "edge_program_item_command_return",
1133
+ "command.WRITE": "edge_program_item_command_write",
1134
+ "command.GO": "edge_program_item_command_go",
1135
+ "command.SYSLOG": "edge_program_item_command_syslog",
1136
+ "command.SENDSMS": "edge_program_item_command_sendsms",
1137
+ "command.TRYCALL": "edge_program_item_command_trycall",
1138
+ "command.PARAMLOGNOCOMMENT": "edge_program_item_command_paramlognocomment",
1139
+ "command.PARAMLOG": "edge_program_item_command_paramlog",
1140
+ "command.RAISE": "edge_program_item_command_raise",
1141
+ "function.ADD": "edge_program_item_function_add",
1142
+ "function.SUB": "edge_program_item_function_sub",
1143
+ "function.MUL": "edge_program_item_function_mul",
1144
+ "function.DIV": "edge_program_item_function_div",
1145
+ "function.MOD": "edge_program_item_function_mod",
1146
+ "function.AND": "edge_program_item_function_and",
1147
+ "function.NAND": "edge_program_item_function_nand",
1148
+ "function.BITSAND": "edge_program_item_function_bitsand",
1149
+ "function.OR": "edge_program_item_function_or",
1150
+ "function.NOR": "edge_program_item_function_nor",
1151
+ "function.BITSOR": "edge_program_item_function_bitsor",
1152
+ "function.EQ": "edge_program_item_function_eq",
1153
+ "function.NE": "edge_program_item_function_ne",
1154
+ "function.NOT": "edge_program_item_function_not",
1155
+ "function.BITSNOT": "edge_program_item_function_bitsnot",
1156
+ "function.SHR": "edge_program_item_function_shr",
1157
+ "function.GE": "edge_program_item_function_ge",
1158
+ "function.LS": "edge_program_item_function_ls",
1159
+ "function.GR": "edge_program_item_function_gr",
1160
+ "function.LE": "edge_program_item_function_le",
1161
+ "function.SHL": "edge_program_item_function_shl",
1162
+ "function.READ": "edge_program_item_function_read",
1163
+ "function.ERR": "edge_program_item_function_err",
1164
+ "function.ERREQ": "edge_program_item_function_erreq",
1165
+ "function.ERRNE": "edge_program_item_function_errne",
1166
+ "function.SQRT": "edge_program_item_function_sqrt",
1167
+ "function.BITSBIT": "edge_program_item_function_bitsbit",
1168
+ "function.MAX": "edge_program_item_function_max",
1169
+ "function.MAXIDX": "edge_program_item_function_maxidx",
1170
+ "function.MIN": "edge_program_item_function_min",
1171
+ "function.MINIDX": "edge_program_item_function_minidx",
1172
+ "function.SUM": "edge_program_item_function_sum",
1173
+ "function.SELECTBY": "edge_program_item_function_selectby",
1174
+ "function.ISKNOWN": "edge_program_item_function_isknown",
1175
+ "function.ISNOTKNOWN": "edge_program_item_function_isnotknown",
1176
+ "function.SMSRCVD": "edge_program_item_function_smsrcvd",
1177
+ "function.NOSMSRCVD": "edge_program_item_function_nosmsrcvd",
1178
+ "function.VAL": "edge_program_item_function_val",
1179
+ "function.GETUPDPERIODSEC": "edge_program_item_function_getupdperiodsec",
1180
+ "function.GETUPDPERIODMSEC": "edge_program_item_function_getupdperiodmsec",
1181
+ "function.GETRTC": "edge_program_item_function_getrtc",
1182
+ "function.GETYEAR": "edge_program_item_function_getyear",
1183
+ "function.GETMONTH": "edge_program_item_function_getmonth",
1184
+ "function.GETDAY": "edge_program_item_function_getday",
1185
+ "function.GETHOURS": "edge_program_item_function_gethours",
1186
+ "function.GETMINUTES": "edge_program_item_function_getminutes",
1187
+ "function.GETSECONDS": "edge_program_item_function_getseconds",
1188
+ "function.GETDOW": "edge_program_item_function_getdow",
1189
+ "function.GETDAYTIME": "edge_program_item_function_getdaytime",
1190
+ "function.GETSUNRISE": "edge_program_item_function_getsunrise",
1191
+ "function.GETSUNSET": "edge_program_item_function_getsunset",
1192
+ "function.GETVOLTAGE": "edge_program_item_function_getvoltage",
1193
+ "function.GETTEMPERATURE": "edge_program_item_function_gettemperature",
1194
+ "function.GETUPDNAMEIDX": "edge_program_item_function_getupdnameidx",
1195
+ "error.OK": "edge_program_item_error_ok",
1196
+ "constant.LASTERROR": "edge_program_item_constant_lasterror",
1197
+ "constant.EMPTYSTRING": "edge_program_item_constant_emptystring",
1198
+ "constant.TRUE": "edge_program_item_constant_true",
1199
+ "constant.FALSE": "edge_program_item_constant_false",
1200
+ "label.RUN": "edge_program_item_label_run",
1201
+ "label.ONERROR": "edge_program_item_label_onerror",
1202
+ "reference.VAR": "edge_program_item_reference_var",
1203
+ "reference.ERR": "edge_program_item_reference_err",
1204
+ "reference.PHONE": "edge_program_item_reference_phone",
1205
+ "error.EXC_MB_ILLEGAL_FUNCTION": "edge_task_error_mb_illegal_function",
1206
+ "error.EXC_MB_ILLEGAL_DATA_ADDRESS": "edge_task_error_mb_illegal_data_address",
1207
+ "error.EXC_MB_ILLEGAL_DATA_VALUE": "edge_task_error_mb_illegal_data_value",
1208
+ "error.EXC_MB_SLAVE_DEVICE_FAILURE": "edge_task_error_mb_slave_device_failure",
1209
+ "error.EXC_MB_ACKNOWLEDGE": "edge_task_error_mb_acknowledge",
1210
+ "error.EXC_MB_SLAVE_BUSY": "edge_task_error_mb_slave_busy",
1211
+ "error.EXC_MB_MEMORY_PARITY_ERROR": "edge_task_error_mb_memory_parity_error",
1212
+ "error.EXC_PARAM_PATH_UNAVAILABLE": "edge_task_error_param_path_unavailable",
1213
+ "error.EXC_PARAM_TARGET_FAILED": "edge_task_error_param_target_failed",
1214
+ "error.EXC_TYPE_UNKNOWN": "edge_task_error_type_unknown",
1215
+ "error.EXC_ACTION_UNKNOWN": "edge_task_error_action_unknown",
1216
+ "error.EXC_IO": "edge_task_error_io",
1217
+ "error.EXC_OUT_OF_MEMORY": "edge_task_error_out_of_memory",
1218
+ "error.EXC_STACK_OVERFLOW": "edge_task_error_stack_overflow",
1219
+ "error.EXC_STACK_UNDERFLOW": "edge_task_error_stack_underflow",
1220
+ "error.EXC_RESULT_INFINITY": "edge_task_error_result_infinity",
1221
+ "error.EXC_RESULT_COMPLEX": "edge_task_error_result_complex",
1222
+ "error.EXC_OUT_OF_BOUNDS": "edge_task_error_out_of_bounds",
1223
+ "error.EXC_UNKNOWN": "edge_task_error_unknown"
1224
+ };
1225
+ function zn(e) {
1226
+ return Object.hasOwn(Rn, e);
1227
+ }
1228
+ function Bn(e) {
1229
+ return n(e === "BLE" ? "edge_program_language_order_bytes" : e === "WLE" ? "edge_program_language_order_words" : "edge_program_language_order_big");
1230
+ }
1231
+ function Vn(e) {
1232
+ if (zn(e)) return n(Rn[e]);
1233
+ let t = /^type\.F(32|64)(BLE|WLE)?EP(\d)R$/u.exec(e);
1234
+ if (t === null) return "";
1235
+ let r = t[1] ?? "", i = Bn(t[2]), a = Number(t[3] ?? "0");
1236
+ return a === 0 ? n("edge_program_language_float", {
1237
+ bits: r,
1238
+ order: i
1239
+ }) : n("edge_program_language_float_scaled", {
1240
+ bits: r,
1241
+ order: i,
1242
+ scale: String(10 ** a)
1243
+ });
1244
+ }
1245
+ //#endregion
1246
+ //#region src/workspace/edge-programs/editor-language.ts
1247
+ function Hn(e, t = !1) {
1248
+ if (e === void 0) return {};
1249
+ let r = Vn(e);
1250
+ return {
1251
+ description: t ? `${n("edge_program_language_unsupported")} ${r}` : r,
1252
+ docsUrl: Ft(e)
1253
+ };
1254
+ }
1255
+ function Un(e) {
1256
+ return [...e.path, e.name].join(" / ");
1257
+ }
1258
+ function Wn(e) {
1259
+ let { kind: t, count: r } = e.definition;
1260
+ switch (t) {
1261
+ case "label": return n("edge_program_language_symbol_label");
1262
+ case "device": return n("edge_program_language_symbol_device");
1263
+ case "parameter": return n("edge_program_language_symbol_parameter");
1264
+ case "string": return n("edge_program_language_symbol_string");
1265
+ case "variable": return r > 1 ? n("edge_program_language_symbol_variables", { count: String(r) }) : n("edge_program_language_symbol_variable");
1266
+ case "condition": return r > 1 ? n("edge_program_language_symbol_conditions", { count: String(r) }) : n("edge_program_language_symbol_condition");
1267
+ }
1268
+ }
1269
+ function Gn(e) {
1270
+ let { symbol: t, parameter: r, shared: i } = e, a = [Wn(t)];
1271
+ if (t.definition.implicit && a.push(n("edge_program_language_implicit")), r === null ? a.push(n("edge_program_language_hmi_none")) : r !== void 0 && (a.push(n("edge_program_language_hmi", { parameter: Un(r) })), e.mismatch === !0 && a.push(n("edge_program_language_hmi_mismatch", {
1272
+ type: r.type ?? "",
1273
+ actual: t.definition.dataType ?? ""
1274
+ }))), i !== void 0 && i.length > 0) {
1275
+ let e = i.map((e) => e.writes ? n("edge_program_language_shared_writer", { file: e.symbol.filename }) : e.symbol.filename);
1276
+ a.push(n("edge_program_language_shared", { programs: e.join(", ") }));
1277
+ }
1278
+ return {
1279
+ code: [t.declaration],
1280
+ description: a.join(" ")
1281
+ };
1282
+ }
1283
+ function Kn(e) {
1284
+ let t = {
1285
+ from: e.from,
1286
+ to: e.to
1287
+ };
1288
+ switch (e.kind) {
1289
+ case "item": {
1290
+ let r = [
1291
+ ...e.unsupported ? [n("edge_program_language_unsupported")] : [],
1292
+ Vn(e.item),
1293
+ ...e.memory === void 0 ? [] : [n("edge_program_language_memory", {
1294
+ used: String(e.memory.used),
1295
+ limit: String(e.memory.limit)
1296
+ })]
1297
+ ];
1298
+ return {
1299
+ ...t,
1300
+ code: e.signatures.length > 0 ? e.signatures : [Pt(e.item)],
1301
+ description: r.join(" "),
1302
+ docsUrl: Ft(e.item)
1303
+ };
1304
+ }
1305
+ case "symbol": return {
1306
+ ...t,
1307
+ ...Gn(e)
1308
+ };
1309
+ case "address": {
1310
+ let r = `${e.table} ${String(e.address)}`;
1311
+ return {
1312
+ ...t,
1313
+ code: [e.unitId === null ? r : `${r} · unit ${String(e.unitId)}`],
1314
+ description: e.parameter === null ? n("edge_program_language_hmi_none") : n("edge_program_language_hmi", { parameter: Un(e.parameter) })
1315
+ };
1316
+ }
1317
+ case "undefined": return {
1318
+ ...t,
1319
+ code: [e.name],
1320
+ description: n("edge_program_language_undefined")
1321
+ };
1322
+ }
1323
+ }
1324
+ function qn(e) {
1325
+ return e === null ? null : {
1326
+ from: e.from,
1327
+ to: e.to,
1328
+ filtered: e.filtered,
1329
+ items: e.items.map((e) => {
1330
+ let t = e.detail;
1331
+ return e.free === !0 && (t = n("edge_program_language_free_register")), e.parameters !== void 0 && (t = n("edge_program_language_unit_parameters", { count: String(e.parameters) })), {
1332
+ label: e.label,
1333
+ kind: e.kind,
1334
+ insert: e.insert,
1335
+ ...e.snippet === !0 ? { snippet: !0 } : {},
1336
+ ...t === void 0 || t === "" ? {} : { detail: t },
1337
+ ...e.boost === void 0 ? {} : { boost: e.boost },
1338
+ ...e.additionalEdits === void 0 ? {} : { additionalEdits: e.additionalEdits },
1339
+ ...e.parameter === void 0 ? Hn(e.item, e.unsupported === !0) : { description: Un(e.parameter) }
1340
+ };
1341
+ })
1342
+ };
1343
+ }
1344
+ function Jn(e) {
1345
+ switch (e) {
1346
+ case "name_empty": return n("edge_program_rename_name_empty");
1347
+ case "name_too_long": return n("edge_program_rename_name_too_long");
1348
+ case "name_invalid": return n("edge_program_rename_name_invalid");
1349
+ case "name_reserved": return n("edge_program_rename_name_reserved");
1350
+ case "name_taken": return n("edge_program_rename_name_taken");
1351
+ }
1352
+ }
1353
+ function Yn(e, t, r, i) {
1354
+ let a = (e) => e.filename === t ? {
1355
+ from: e.from,
1356
+ to: e.to
1357
+ } : r === null ? null : { open: () => {
1358
+ r(e);
1359
+ } };
1360
+ return {
1361
+ docsLabel: i.docs,
1362
+ referencesLabel: i.references,
1363
+ renameLabel: i.rename,
1364
+ completions: (t, n) => qn(e.completions(t, n)),
1365
+ info: (t, r) => {
1366
+ let i = e.hover(t, r);
1367
+ if (i === null) return null;
1368
+ let o = Kn(i), s = e.definition(t, r), c = s === null ? null : a(s);
1369
+ return c === null ? o : {
1370
+ ...o,
1371
+ actions: [{
1372
+ label: n("edge_program_language_go_to_definition"),
1373
+ run: (e) => {
1374
+ if ("open" in c) {
1375
+ c.open();
1376
+ return;
1377
+ }
1378
+ e.dispatch({
1379
+ selection: {
1380
+ anchor: c.from,
1381
+ head: c.to
1382
+ },
1383
+ scrollIntoView: !0
1384
+ }), e.focus();
1385
+ }
1386
+ }]
1387
+ };
1388
+ },
1389
+ signatureHelp: (t, n) => {
1390
+ let r = e.signatureHelp(t, n);
1391
+ return r === null ? null : {
1392
+ signatures: r.signatures,
1393
+ active: r.activeSignature,
1394
+ parameter: r.activeParameter,
1395
+ ...Hn(r.item)
1396
+ };
1397
+ },
1398
+ nameHints: (t) => e.nameHints(t).map((e) => ({
1399
+ offset: e.offset,
1400
+ text: e.parameter.name
1401
+ })),
1402
+ definition: (t, n) => {
1403
+ let r = e.definition(t, n);
1404
+ return r === null ? null : a(r);
1405
+ },
1406
+ references: (t, n) => {
1407
+ let r = e.references(t, n);
1408
+ return r === null ? null : r.flatMap((e) => {
1409
+ let t = a(e);
1410
+ return t === null ? [] : [{
1411
+ location: `${e.filename}:${String(e.line)}`,
1412
+ text: e.text,
1413
+ definition: e.definition,
1414
+ target: t
1415
+ }];
1416
+ });
1417
+ },
1418
+ rename: {
1419
+ prepare: (t, n) => e.prepareRename(t, n),
1420
+ apply: (t, r, i) => {
1421
+ let a = e.rename(t, r, i);
1422
+ return a === null ? { problem: n("edge_program_language_undefined") } : "problem" in a ? { problem: Jn(a.problem) } : { edits: a.edits };
1423
+ }
1424
+ }
1425
+ };
1426
+ }
1427
+ function Xn(e) {
1428
+ return {
1429
+ label: e.parameter === void 0 ? n("edge_program_fix_replace", { value: e.value }) : n("edge_program_fix_type", {
1430
+ value: e.value,
1431
+ parameter: e.parameter.name
1432
+ }),
1433
+ edit: {
1434
+ ...e.edit,
1435
+ cursor: e.cursor
1436
+ }
1437
+ };
1438
+ }
1439
+ function Zn(e, t, n) {
1440
+ return e.fixes(t, n).map(Xn);
1441
+ }
1442
+ //#endregion
1443
+ //#region src/workspace/setup/endpoints/programs/program-editor.tsx
1444
+ var Qn = _t.highest(vt.of([{
1445
+ key: "Mod-s",
1446
+ preventDefault: !0,
1447
+ run: (e) => {
1448
+ let t = e.dom.closest("form"), n = t?.querySelector("button[type=submit]");
1449
+ return t != null && n != null && !n.disabled && (t.requestSubmit(n), e.focus()), !0;
1450
+ }
1451
+ }])), $n = 20, er = [], tr = "@PROTOCOLVERSION 12\n@UPDATE 60\n\nDEF counter VAR\n\nrun:\nIF ISNOTKNOWN counter\nPUT counter 0\nPUT counter ADD counter 1\nEXIT OK\n";
1452
+ function nr(e, t, n, r, i) {
1453
+ return It({
1454
+ filename: e,
1455
+ programs: St([...n ?? [], {
1456
+ fileName: e,
1457
+ enabled: t && n != null,
1458
+ source: "\n"
1459
+ }]),
1460
+ programsKnown: n != null,
1461
+ parameters: r,
1462
+ ownUnitId: i
1463
+ });
1464
+ }
1465
+ var rr = 10 * 6e4;
1466
+ function ir(e, n) {
1467
+ return t.edgeProgram.readOwnUnitId.useQuery({ endpointId: e }, {
1468
+ enabled: n,
1469
+ staleTime: rr,
1470
+ retry: !1
1471
+ }).data?.ownUnitId ?? null;
1472
+ }
1473
+ function ar(e, n) {
1474
+ let i = r(), a = t.parameter.listTree.useQuery({ workspaceId: e });
1475
+ return Je(() => a.data == null ? null : Et({
1476
+ endpointId: n,
1477
+ locale: i,
1478
+ branches: a.data.branches,
1479
+ parameters: a.data.parameters
1480
+ }), [
1481
+ a.data,
1482
+ n,
1483
+ i
1484
+ ]);
1485
+ }
1486
+ function or(e) {
1487
+ return e.replace(/\r\n?/gu, "\n");
1488
+ }
1489
+ function sr(e, t) {
1490
+ let n = 0;
1491
+ for (let r = 1; r < t; r += 1) {
1492
+ let t = e.indexOf("\n", n);
1493
+ if (t < 0) return {
1494
+ from: e.length,
1495
+ to: e.length
1496
+ };
1497
+ n = t + 1;
1498
+ }
1499
+ let r = e.indexOf("\n", n), i = r < 0 ? e.length : r;
1500
+ return {
1501
+ from: n,
1502
+ to: e[i - 1] === "\r" ? i - 1 : i
1503
+ };
1504
+ }
1505
+ function cr({ severity: e }) {
1506
+ return e === "error" ? /* @__PURE__ */ Y($e, { className: "size-4 shrink-0 text-destructive" }) : /* @__PURE__ */ Y(pt, { className: "\n size-4 shrink-0 text-amber-600\n dark:text-amber-400\n " });
1507
+ }
1508
+ function lr({ fileName: e, onKeep: t, onDiscard: n }) {
1509
+ let r = i();
1510
+ return /* @__PURE__ */ Y(Se, {
1511
+ open: !0,
1512
+ onOpenChange: (e) => {
1513
+ e || t();
1514
+ },
1515
+ children: /* @__PURE__ */ X(_e, { children: [/* @__PURE__ */ X(xe, { children: [/* @__PURE__ */ Y(ge, { children: r("edge_program_discard_title") }), /* @__PURE__ */ Y(he, { children: r("edge_program_discard_description", { file: e }) })] }), /* @__PURE__ */ X(ye, {
1516
+ className: "sm:flex-wrap",
1517
+ children: [/* @__PURE__ */ Y(be, {
1518
+ onClick: t,
1519
+ children: r("edge_program_keep_editing")
1520
+ }), /* @__PURE__ */ Y(ve, {
1521
+ variant: "destructive",
1522
+ onClick: n,
1523
+ children: r("edge_program_discard_confirm")
1524
+ })]
1525
+ })] })
1526
+ });
1527
+ }
1528
+ function ur({ children: e }) {
1529
+ return /* @__PURE__ */ X("div", {
1530
+ className: "\n flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b bg-muted/40 px-3 py-1.5\n text-xs text-muted-foreground\n ",
1531
+ children: [/* @__PURE__ */ Y(at, { className: "size-3.5 shrink-0" }), e]
1532
+ });
1533
+ }
1534
+ function dr({ workspaceId: e, detail: t, others: n, autoSync: r, canEdit: c, editorRef: l, title: d, actions: f, tasks: p, taskCount: m, variables: h, onReload: g, fetchLatest: _, onDirtyChange: v, onOpenLocation: y }) {
1535
+ let b = i(), x = a(), { update: S } = W(e), C = Re(t.revision), [w, T] = q(() => or(t.source)), [E, D] = q(t.sourceSha256), O = o({
1536
+ defaultValues: { text: w },
1537
+ validators: u({
1538
+ submit: async (e) => {
1539
+ let n = await S.mutateAsync({
1540
+ id: t.id,
1541
+ source: e.text,
1542
+ baseSourceSha256: E
1543
+ });
1544
+ return D(n.sourceSha256), T(e.text), x.success(n.errorCount > 0 && n.enabled ? b("edge_program_save_has_errors") : b("edge_program_save_toast")), null;
1545
+ },
1546
+ mapError: C.mapError(),
1547
+ onError: C.onError
1548
+ }),
1549
+ onSubmitInvalid: s
1550
+ }), [k, A] = q(t.sourceSha256), [j, M] = q(null);
1551
+ if (t.sourceSha256 !== k && (A(t.sourceSha256), t.sourceSha256 !== E && O.state.values.text === w)) {
1552
+ let e = or(t.source);
1553
+ T(e), D(t.sourceSha256), C.rebase(t.revision), M({ text: e });
1554
+ }
1555
+ return G(() => {
1556
+ j !== null && O.reset({ text: j.text });
1557
+ }, [j, O]), /* @__PURE__ */ Y(O.AppForm, { children: /* @__PURE__ */ Y(O.FormRoot, {
1558
+ banner: !1,
1559
+ className: "flex min-h-0 min-w-0 flex-1 flex-col",
1560
+ children: /* @__PURE__ */ Y(O.Subscribe, {
1561
+ selector: (e) => e.values.text,
1562
+ children: (i) => /* @__PURE__ */ Y(pr, {
1563
+ workspaceId: e,
1564
+ endpointId: t.endpointId,
1565
+ fileName: t.fileName,
1566
+ enabled: t.enabled,
1567
+ editorId: `edge-program-${t.id}`,
1568
+ text: i,
1569
+ dirty: i !== w,
1570
+ others: n,
1571
+ autoSync: r,
1572
+ canEdit: c,
1573
+ editorRef: l,
1574
+ title: d,
1575
+ actions: f,
1576
+ tasks: p,
1577
+ taskCount: m,
1578
+ variables: h,
1579
+ save: c ? /* @__PURE__ */ Y(O.SubmitButton, {
1580
+ size: "sm",
1581
+ label: b("action_save"),
1582
+ pendingLabel: b("action_saving"),
1583
+ disabled: i === w
1584
+ }) : null,
1585
+ notices: c ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(ze, {
1586
+ base: C,
1587
+ onReload: g,
1588
+ onKeepMine: async () => {
1589
+ let e = await _();
1590
+ D(e.sourceSha256), C.rebase(e.revision);
1591
+ }
1592
+ }), /* @__PURE__ */ Y(O.FormErrorBanner, {})] }) : null,
1593
+ onDirtyChange: v,
1594
+ onText: (e) => {
1595
+ O.setFieldValue("text", e);
1596
+ },
1597
+ ...y === void 0 ? {} : { onOpenLocation: y }
1598
+ })
1599
+ })
1600
+ }) });
1601
+ }
1602
+ function fr({ workspaceId: e, endpointId: t, draft: n, others: c, autoSync: l, editorRef: d, tasks: f, taskCount: p, onDiscard: m, onCreated: h, onDirtyChange: g }) {
1603
+ let _ = i(), v = r(), y = a(), { create: b } = W(e), S = me(e), [C, w] = q(!1), T = o({
1604
+ defaultValues: { text: or(n.source) },
1605
+ validators: u({ submit: async (r) => {
1606
+ let i = await b.mutateAsync({
1607
+ workspaceId: e,
1608
+ endpointId: t,
1609
+ fileName: n.fileName,
1610
+ description: n.description,
1611
+ source: r.text
1612
+ });
1613
+ for (let e of n.parameters) try {
1614
+ await S.create.mutateAsync(e);
1615
+ } catch {
1616
+ y.error(_("edge_program_draft_parameter_failed", { name: ht(e.name, v) }));
1617
+ }
1618
+ return y.success(_("edge_program_draft_saved_toast")), xt(() => {
1619
+ w(!0);
1620
+ }), h(i.id), null;
1621
+ } }),
1622
+ onSubmitInvalid: s
1623
+ }), E = n.parameters.map((e) => ht(e.name, v)).join(", ");
1624
+ return /* @__PURE__ */ Y(T.AppForm, { children: /* @__PURE__ */ Y(T.FormRoot, {
1625
+ banner: !1,
1626
+ className: "flex min-h-0 min-w-0 flex-1 flex-col",
1627
+ children: /* @__PURE__ */ Y(T.Subscribe, {
1628
+ selector: (e) => e.isSubmitting,
1629
+ children: (r) => /* @__PURE__ */ Y(T.Subscribe, {
1630
+ selector: (e) => e.values.text,
1631
+ children: (i) => /* @__PURE__ */ Y(pr, {
1632
+ workspaceId: e,
1633
+ endpointId: t,
1634
+ fileName: n.fileName,
1635
+ enabled: !0,
1636
+ editorId: `edge-program-draft-${n.fileName}`,
1637
+ text: i,
1638
+ dirty: !C,
1639
+ others: c,
1640
+ autoSync: l,
1641
+ canEdit: !0,
1642
+ locked: r,
1643
+ editorRef: d,
1644
+ title: /* @__PURE__ */ Y("h2", {
1645
+ className: "min-w-0 truncate font-mono text-sm font-medium",
1646
+ children: n.fileName
1647
+ }),
1648
+ actions: /* @__PURE__ */ Y(x, {
1649
+ type: "button",
1650
+ variant: "ghost",
1651
+ size: "sm",
1652
+ disabled: r,
1653
+ onClick: m,
1654
+ children: _("edge_program_draft_discard")
1655
+ }),
1656
+ tasks: f,
1657
+ taskCount: p,
1658
+ variables: null,
1659
+ save: /* @__PURE__ */ Y(T.SubmitButton, {
1660
+ size: "sm",
1661
+ label: _("action_save"),
1662
+ pendingLabel: _("action_saving")
1663
+ }),
1664
+ notices: /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(ur, { children: [/* @__PURE__ */ Y("span", { children: _("edge_program_draft_notice", { starter: ht(n.starterName, v) }) }), E === "" ? null : /* @__PURE__ */ Y("span", { children: _("edge_program_draft_parameters", { names: E }) })] }), /* @__PURE__ */ Y(T.FormErrorBanner, {})] }),
1665
+ onDirtyChange: g,
1666
+ onText: (e) => {
1667
+ T.setFieldValue("text", e);
1668
+ }
1669
+ })
1670
+ })
1671
+ })
1672
+ }) });
1673
+ }
1674
+ function pr({ workspaceId: e, endpointId: t, fileName: n, enabled: r, editorId: a, text: o, dirty: s, others: l, autoSync: u, canEdit: f, locked: p = !1, editorRef: m, title: h, actions: g, tasks: _, taskCount: v, variables: y, save: b, notices: S, onDirtyChange: C, onText: w, onOpenLocation: T }) {
1675
+ let E = i(), [D, O] = q("problems"), k = ar(e, t), j = ir(t, f), M = r && o.length > 0, N = Je(() => nr(n, M, l, k, j), [
1676
+ n,
1677
+ M,
1678
+ l,
1679
+ k,
1680
+ j
1681
+ ]), P = T ?? null, F = E("edge_program_language_docs"), I = E("edge_program_language_references"), L = E("edge_program_language_rename"), R = Je(() => [
1682
+ Ln(),
1683
+ Qn,
1684
+ c(Yn(N, n, P, {
1685
+ docs: F,
1686
+ references: I,
1687
+ rename: L
1688
+ }))
1689
+ ], [
1690
+ N,
1691
+ n,
1692
+ P,
1693
+ F,
1694
+ I,
1695
+ L
1696
+ ]), { openAssistant: ee } = A();
1697
+ G(() => {
1698
+ C(s);
1699
+ }, [s, C]), G(() => () => {
1700
+ C(!1);
1701
+ }, [C]);
1702
+ let te = bt({
1703
+ shouldBlockFn: () => s,
1704
+ enableBeforeUnload: s,
1705
+ withResolver: !0
1706
+ }), ne = qe(o), z = Je(() => N.diagnostics(ne), [N, ne]), re = z.map((e, r) => {
1707
+ let i = cn(e), a = ee === void 0 ? [] : [{
1708
+ label: E("edge_program_ask_assistant"),
1709
+ run: () => {
1710
+ let r = sr(ne, e.range.line);
1711
+ ee(E("edge_program_ask_assistant_message", {
1712
+ file: n,
1713
+ device: t,
1714
+ problem: i,
1715
+ line: String(e.range.line),
1716
+ column: String(e.range.column),
1717
+ excerpt: ne.slice(r.from, r.to).trim()
1718
+ }));
1719
+ }
1720
+ }], o = f && !p && r < $n ? Zn(N, ne, e) : [];
1721
+ return {
1722
+ from: e.range.offset,
1723
+ to: e.range.endOffset,
1724
+ severity: e.severity,
1725
+ message: i,
1726
+ actions: [...o, ...a]
1727
+ };
1728
+ }), ie = z.filter((e) => e.severity === "error").length, B = z.length - ie, V = `${a}-status`;
1729
+ return /* @__PURE__ */ X(J, { children: [
1730
+ /* @__PURE__ */ X("div", {
1731
+ className: "\n flex min-h-12 shrink-0 flex-wrap items-center gap-x-2 gap-y-1 border-b px-3 py-1.5\n ",
1732
+ children: [/* @__PURE__ */ X("div", {
1733
+ className: "flex min-w-0 flex-1 items-center gap-2",
1734
+ children: [h, s ? /* @__PURE__ */ Y("span", {
1735
+ className: "size-2 shrink-0 rounded-full bg-amber-500",
1736
+ title: E("edge_program_unsaved"),
1737
+ children: /* @__PURE__ */ Y("span", {
1738
+ className: "sr-only",
1739
+ children: E("edge_program_unsaved")
1740
+ })
1741
+ }) : null]
1742
+ }), /* @__PURE__ */ X("div", {
1743
+ className: "flex shrink-0 items-center gap-1",
1744
+ children: [g, b]
1745
+ })]
1746
+ }),
1747
+ S,
1748
+ r ? null : /* @__PURE__ */ Y(ur, { children: E("edge_program_disabled_hint") }),
1749
+ f ? null : /* @__PURE__ */ Y(ur, { children: E("edge_program_read_only") }),
1750
+ o.length === 0 ? /* @__PURE__ */ X(ur, { children: [/* @__PURE__ */ Y("span", { children: E("edge_program_empty_hint") }), f ? /* @__PURE__ */ Y(x, {
1751
+ type: "button",
1752
+ variant: "link",
1753
+ size: "sm",
1754
+ className: "h-auto p-0 text-xs",
1755
+ onClick: () => {
1756
+ w(tr);
1757
+ },
1758
+ children: E("edge_program_insert_example")
1759
+ }) : null] }) : null,
1760
+ /* @__PURE__ */ Y(Be, {
1761
+ ref: m,
1762
+ id: a,
1763
+ ariaLabel: E("edge_program_editor_label", { file: n }),
1764
+ ariaDescribedBy: V,
1765
+ value: o,
1766
+ onChange: w,
1767
+ readOnly: !f || p,
1768
+ extensions: R,
1769
+ diagnostics: ne === o ? re : er,
1770
+ className: "\n min-h-64 flex-1 rounded-none border-0 shadow-none\n focus-within:ring-0\n dark:bg-transparent\n "
1771
+ }),
1772
+ /* @__PURE__ */ X("div", {
1773
+ id: V,
1774
+ className: "\n flex min-h-8 shrink-0 flex-wrap items-center gap-x-4 gap-y-1 border-t bg-muted/30 px-3\n py-1 text-xs text-muted-foreground\n ",
1775
+ children: [
1776
+ /* @__PURE__ */ X("button", {
1777
+ type: "button",
1778
+ className: d("\n flex items-center gap-1.5 rounded-sm\n hover:text-foreground\n focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none\n ", ie > 0 && "text-destructive"),
1779
+ onClick: () => {
1780
+ O("problems");
1781
+ },
1782
+ children: [z.length === 0 ? /* @__PURE__ */ Y(et, { className: "\n size-3.5 text-emerald-600\n dark:text-emerald-400\n " }) : /* @__PURE__ */ Y(cr, { severity: ie > 0 ? "error" : "warning" }), z.length === 0 ? E("edge_program_no_problems") : E("edge_program_problem_counts", {
1783
+ errors: String(ie),
1784
+ warnings: String(B)
1785
+ })]
1786
+ }),
1787
+ s ? /* @__PURE__ */ Y("span", { children: E("edge_program_unsaved") }) : null,
1788
+ /* @__PURE__ */ Y("span", { className: "flex-1" }),
1789
+ f && s && u && r ? /* @__PURE__ */ X("span", {
1790
+ className: "\n flex items-center gap-1.5 text-amber-700\n dark:text-amber-400\n ",
1791
+ children: [/* @__PURE__ */ Y(pt, { className: "size-3.5 shrink-0" }), E("edge_deploy_restart_warning")]
1792
+ }) : null,
1793
+ f ? /* @__PURE__ */ Y("span", { children: E("edge_program_keys_hint") }) : null
1794
+ ]
1795
+ }),
1796
+ /* @__PURE__ */ X(Ee, {
1797
+ className: d("flex shrink-0 flex-col gap-0 border-t", D === "variables" && y != null ? "\n h-80\n md:h-96\n " : "h-44"),
1798
+ value: D,
1799
+ onValueChange: (e) => {
1800
+ (e === "problems" || e === "tasks" || e === "variables") && O(e);
1801
+ },
1802
+ children: [/* @__PURE__ */ X(Te, {
1803
+ variant: "line",
1804
+ className: "h-9 shrink-0 px-3",
1805
+ children: [
1806
+ /* @__PURE__ */ X(we, {
1807
+ value: "problems",
1808
+ children: [E("edge_program_problems"), z.length > 0 ? /* @__PURE__ */ Y("span", {
1809
+ className: "text-xs text-muted-foreground tabular-nums",
1810
+ children: z.length
1811
+ }) : null]
1812
+ }),
1813
+ /* @__PURE__ */ X(we, {
1814
+ value: "tasks",
1815
+ children: [E("edge_tasks_title"), v > 0 ? /* @__PURE__ */ Y("span", {
1816
+ className: "text-xs text-muted-foreground tabular-nums",
1817
+ children: v
1818
+ }) : null]
1819
+ }),
1820
+ y == null ? null : /* @__PURE__ */ Y(we, {
1821
+ value: "variables",
1822
+ children: E("edge_live_title")
1823
+ })
1824
+ ]
1825
+ }), /* @__PURE__ */ Y("div", {
1826
+ className: "min-h-0 flex-1 overflow-y-auto border-t",
1827
+ children: D === "variables" && y != null ? y : D === "tasks" ? _ : z.length === 0 ? /* @__PURE__ */ Y("p", {
1828
+ className: "px-3 py-2 text-sm text-muted-foreground",
1829
+ children: E("edge_program_no_problems")
1830
+ }) : /* @__PURE__ */ Y("ul", {
1831
+ className: "py-1",
1832
+ children: z.map((e, t) => /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ X("button", {
1833
+ type: "button",
1834
+ className: "\n grid w-full grid-cols-[1rem_4.5rem_minmax(0,1fr)] items-start gap-2 px-3 py-1\n text-left text-sm\n hover:bg-muted\n focus-visible:bg-muted focus-visible:outline-none\n ",
1835
+ onClick: () => {
1836
+ m.current?.reveal(e.range.offset, e.range.endOffset);
1837
+ },
1838
+ children: [
1839
+ /* @__PURE__ */ Y("span", {
1840
+ className: "pt-0.5",
1841
+ children: /* @__PURE__ */ Y(cr, { severity: e.severity })
1842
+ }),
1843
+ /* @__PURE__ */ Y("span", {
1844
+ className: "pt-px font-mono text-xs text-muted-foreground tabular-nums",
1845
+ children: E("edge_program_problem_line", { line: String(e.range.line) })
1846
+ }),
1847
+ /* @__PURE__ */ Y("span", {
1848
+ className: "wrap-break-word",
1849
+ children: cn(e)
1850
+ })
1851
+ ]
1852
+ }) }, t))
1853
+ })
1854
+ })]
1855
+ }),
1856
+ te.status === "blocked" ? /* @__PURE__ */ Y(lr, {
1857
+ fileName: n,
1858
+ onKeep: te.reset,
1859
+ onDiscard: te.proceed
1860
+ }) : null
1861
+ ] });
1862
+ }
1863
+ //#endregion
1864
+ //#region src/workspace/setup/endpoints/programs/settings-dialog.tsx
1865
+ var mr = gt(Z.Object({
1866
+ autoSync: Z.Boolean(),
1867
+ deviceLogging: Z.Boolean(),
1868
+ readingsPullMinutes: Z.String()
1869
+ }, { additionalProperties: !1 }));
1870
+ function hr(e) {
1871
+ let t = e.trim();
1872
+ if (!/^\d+$/u.test(t)) return null;
1873
+ let n = Number(t);
1874
+ return n >= 1 && n <= 1440 ? n : null;
1875
+ }
1876
+ function gr({ workspaceId: e, settings: t, onReload: n, onClose: r }) {
1877
+ let c = i(), l = a(), { updateSettings: d } = W(e), f = Re(t.revision), p = o({
1878
+ defaultValues: {
1879
+ autoSync: t.settings.autoSync,
1880
+ deviceLogging: t.settings.deviceLogging,
1881
+ readingsPullMinutes: String(t.settings.readingsPullMinutes)
1882
+ },
1883
+ validators: u({
1884
+ schema: mr,
1885
+ submit: async (e) => {
1886
+ let n = hr(e.readingsPullMinutes);
1887
+ return n == null ? { fields: { readingsPullMinutes: () => c("edge_settings_pull_minutes_invalid") } } : (await d.mutateAsync({
1888
+ endpointId: t.endpointId,
1889
+ autoSync: e.autoSync,
1890
+ deviceLogging: e.deviceLogging,
1891
+ readingsPullMinutes: n,
1892
+ ...f.baseRevision === void 0 ? {} : { baseRevision: f.baseRevision }
1893
+ }), null);
1894
+ },
1895
+ mapError: f.mapError(),
1896
+ onError: f.onError
1897
+ }),
1898
+ onSubmitInvalid: s,
1899
+ onSubmit: () => {
1900
+ l.success(c("edge_settings_save_toast")), r();
1901
+ }
1902
+ });
1903
+ return /* @__PURE__ */ Y(D, {
1904
+ open: !0,
1905
+ onOpenChange: (e) => {
1906
+ e || r();
1907
+ },
1908
+ children: /* @__PURE__ */ Y(E, { children: /* @__PURE__ */ Y(p.AppForm, { children: /* @__PURE__ */ X(p.FormRoot, {
1909
+ layout: "dialog",
1910
+ children: [
1911
+ /* @__PURE__ */ X(T, { children: [/* @__PURE__ */ Y(w, { children: c("edge_settings_title") }), /* @__PURE__ */ Y(C, { children: c("edge_settings_description") })] }),
1912
+ /* @__PURE__ */ X(m, { children: [
1913
+ /* @__PURE__ */ Y(p.AppField, {
1914
+ name: "autoSync",
1915
+ children: (e) => /* @__PURE__ */ Y(e.CheckboxField, {
1916
+ label: c("edge_settings_auto_sync"),
1917
+ description: c("edge_settings_auto_sync_description")
1918
+ })
1919
+ }),
1920
+ /* @__PURE__ */ Y(p.AppField, {
1921
+ name: "deviceLogging",
1922
+ children: (e) => /* @__PURE__ */ Y(e.CheckboxField, {
1923
+ label: c("edge_settings_device_logging"),
1924
+ description: c("edge_settings_device_logging_description")
1925
+ })
1926
+ }),
1927
+ /* @__PURE__ */ Y(p.AppField, {
1928
+ name: "readingsPullMinutes",
1929
+ children: (e) => /* @__PURE__ */ Y(e.TextField, {
1930
+ label: c("edge_settings_pull_minutes"),
1931
+ description: c("edge_settings_pull_minutes_description"),
1932
+ inputMode: "numeric",
1933
+ className: "w-32"
1934
+ })
1935
+ })
1936
+ ] }),
1937
+ /* @__PURE__ */ Y(ze, {
1938
+ base: f,
1939
+ onReload: n
1940
+ }),
1941
+ /* @__PURE__ */ X(S, { children: [/* @__PURE__ */ Y(x, {
1942
+ type: "button",
1943
+ variant: "outline",
1944
+ onClick: r,
1945
+ children: c("action_cancel")
1946
+ }), /* @__PURE__ */ Y(p.SubmitButton, {
1947
+ label: c("action_save"),
1948
+ pendingLabel: c("action_saving")
1949
+ })] })
1950
+ ]
1951
+ }) }) })
1952
+ });
1953
+ }
1954
+ //#endregion
1955
+ //#region src/workspace/edge-programs/live-state.ts
1956
+ function _r() {
1957
+ return typeof document > "u" || document.visibilityState === "visible";
1958
+ }
1959
+ function vr(e) {
1960
+ let [n, r] = q(_r), [i, a] = q(null);
1961
+ G(() => {
1962
+ let e = () => {
1963
+ r(_r());
1964
+ };
1965
+ return document.addEventListener("visibilitychange", e), () => {
1966
+ document.removeEventListener("visibilitychange", e);
1967
+ };
1968
+ }, []);
1969
+ let o = t.edgeProgram.watchLiveState.useSubscription(n ? { programId: e } : Ge, {
1970
+ onStarted: () => {
1971
+ a(null);
1972
+ },
1973
+ onData: (t) => {
1974
+ let n = Tt["~standard"].validate(t);
1975
+ n.issues ?? a({
1976
+ programId: e,
1977
+ state: n.value
1978
+ });
1979
+ }
1980
+ });
1981
+ return {
1982
+ state: o.status === "pending" && i?.programId === e ? i.state : null,
1983
+ failed: o.status === "error"
1984
+ };
1985
+ }
1986
+ //#endregion
1987
+ //#region src/workspace/setup/endpoints/programs/live-state-pane.tsx
1988
+ function yr({ programId: e }) {
1989
+ let t = i(), { state: n, failed: r } = vr(e);
1990
+ return r ? /* @__PURE__ */ Y(br, { children: t("edge_live_failed") }) : n == null ? /* @__PURE__ */ X(br, { children: [/* @__PURE__ */ Y(y, { className: "size-3.5" }), t("edge_live_reading")] }) : n.status === "not_running" ? /* @__PURE__ */ Y(br, { children: t("edge_live_not_running") }) : n.status === "unavailable" ? /* @__PURE__ */ Y(br, { children: n.reason === "own_unit_off" ? t("edge_live_own_unit_off") : n.reason === "device_refused" ? t("edge_live_device_refused") : t("edge_live_offline") }) : /* @__PURE__ */ Y(xr, { state: n });
1991
+ }
1992
+ function br({ children: e }) {
1993
+ return /* @__PURE__ */ Y("p", {
1994
+ className: "flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground",
1995
+ children: e
1996
+ });
1997
+ }
1998
+ function xr({ state: e }) {
1999
+ let t = i();
2000
+ return /* @__PURE__ */ X("div", {
2001
+ className: "flex flex-col",
2002
+ children: [
2003
+ /* @__PURE__ */ Y(Sr, {
2004
+ stats: e.stats,
2005
+ at: e.at
2006
+ }),
2007
+ e.namesCurrent ? null : /* @__PURE__ */ Y("p", {
2008
+ className: "\n px-3 pb-1 text-xs text-amber-700\n dark:text-amber-400\n ",
2009
+ children: t("edge_live_names_pending")
2010
+ }),
2011
+ e.unreadable.variables > 0 || e.unreadable.conditions > 0 ? /* @__PURE__ */ Y("p", {
2012
+ className: "px-3 pb-1 text-xs text-muted-foreground",
2013
+ children: t("edge_live_unreadable", {
2014
+ variables: String(e.unreadable.variables),
2015
+ conditions: String(e.unreadable.conditions)
2016
+ })
2017
+ }) : null,
2018
+ /* @__PURE__ */ X("div", {
2019
+ className: "\n grid grid-cols-1 border-t\n md:grid-cols-[minmax(0,3fr)_minmax(0,2fr)] md:divide-x\n ",
2020
+ children: [/* @__PURE__ */ Y(Tr, { variables: e.variables }), /* @__PURE__ */ Y(Dr, { conditions: e.conditions })]
2021
+ })
2022
+ ]
2023
+ });
2024
+ }
2025
+ function Sr({ stats: e, at: t }) {
2026
+ let n = i(), r = (e) => n("edge_live_stats_range", {
2027
+ min: String(e.min),
2028
+ avg: String(e.avg),
2029
+ max: String(e.max)
2030
+ });
2031
+ return /* @__PURE__ */ X("dl", {
2032
+ className: "\n flex flex-wrap items-center gap-x-4 gap-y-1 px-3 py-2 text-xs text-muted-foreground\n ",
2033
+ children: [
2034
+ /* @__PURE__ */ X("div", {
2035
+ className: "flex items-center gap-1.5",
2036
+ children: [
2037
+ /* @__PURE__ */ Y("span", {
2038
+ className: "\n size-2 rounded-full bg-emerald-500\n motion-safe:animate-pulse\n ",
2039
+ "aria-hidden": !0
2040
+ }),
2041
+ /* @__PURE__ */ Y("dt", {
2042
+ className: "sr-only",
2043
+ children: n("edge_live_updated")
2044
+ }),
2045
+ /* @__PURE__ */ Y("dd", {
2046
+ className: "tabular-nums",
2047
+ children: n("edge_live_updated_at", { time: new Date(t).toLocaleTimeString() })
2048
+ })
2049
+ ]
2050
+ }),
2051
+ /* @__PURE__ */ X("div", {
2052
+ className: "flex gap-1",
2053
+ children: [/* @__PURE__ */ Y("dt", { children: n("edge_live_period") }), /* @__PURE__ */ Y("dd", {
2054
+ className: "text-foreground tabular-nums",
2055
+ children: r(e.period)
2056
+ })]
2057
+ }),
2058
+ /* @__PURE__ */ X("div", {
2059
+ className: "flex gap-1",
2060
+ children: [/* @__PURE__ */ Y("dt", { children: n("edge_live_duration") }), /* @__PURE__ */ Y("dd", {
2061
+ className: "text-foreground tabular-nums",
2062
+ children: r(e.duration)
2063
+ })]
2064
+ })
2065
+ ]
2066
+ });
2067
+ }
2068
+ function Cr() {
2069
+ return /* @__PURE__ */ Y("span", {
2070
+ className: "text-muted-foreground italic",
2071
+ children: i()("edge_live_unknown")
2072
+ });
2073
+ }
2074
+ function wr(e, t, n) {
2075
+ return e ?? n(String(t));
2076
+ }
2077
+ function Tr({ variables: e }) {
2078
+ let t = i(), [n, r] = q(/* @__PURE__ */ new Set()), a = (e) => {
2079
+ r((t) => {
2080
+ let n = new Set(t);
2081
+ return n.delete(e) || n.add(e), n;
2082
+ });
2083
+ };
2084
+ return /* @__PURE__ */ X(R, { children: [/* @__PURE__ */ Y(L, { children: /* @__PURE__ */ X(N, { children: [/* @__PURE__ */ Y(I, {
2085
+ className: "pl-3",
2086
+ children: t("edge_live_variable")
2087
+ }), /* @__PURE__ */ Y(I, {
2088
+ className: "pr-3 text-right",
2089
+ children: t("edge_live_value")
2090
+ })] }) }), /* @__PURE__ */ X(F, { children: [e.length === 0 ? /* @__PURE__ */ Y(N, { children: /* @__PURE__ */ Y(P, {
2091
+ colSpan: 2,
2092
+ className: "pl-3 text-muted-foreground",
2093
+ children: t("edge_live_no_variables")
2094
+ }) }) : null, e.map((e) => {
2095
+ let r = wr(e.name, e.index, (e) => t("edge_live_unnamed_variable", { index: e }));
2096
+ if (e.values.length === 1) return /* @__PURE__ */ X(N, { children: [/* @__PURE__ */ Y(P, {
2097
+ className: "pl-3 font-mono",
2098
+ children: r
2099
+ }), /* @__PURE__ */ Y(P, {
2100
+ className: "pr-3 text-right font-mono tabular-nums",
2101
+ children: e.values[0] ?? /* @__PURE__ */ Y(Cr, {})
2102
+ })] }, e.index);
2103
+ let i = n.has(e.index);
2104
+ return [/* @__PURE__ */ X(N, { children: [/* @__PURE__ */ Y(P, {
2105
+ className: "pl-3 font-mono",
2106
+ children: /* @__PURE__ */ X("button", {
2107
+ type: "button",
2108
+ className: "\n flex items-center gap-1 rounded-sm\n hover:text-foreground\n focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none\n ",
2109
+ "aria-expanded": i,
2110
+ onClick: () => {
2111
+ a(e.index);
2112
+ },
2113
+ children: [
2114
+ /* @__PURE__ */ Y(Qe, {
2115
+ className: d("size-3.5 shrink-0 transition-transform", i && "rotate-90"),
2116
+ "aria-hidden": !0
2117
+ }),
2118
+ r,
2119
+ /* @__PURE__ */ X("span", {
2120
+ className: "text-muted-foreground",
2121
+ children: [
2122
+ "[",
2123
+ e.values.length,
2124
+ "]"
2125
+ ]
2126
+ })
2127
+ ]
2128
+ })
2129
+ }), /* @__PURE__ */ Y(P, {
2130
+ className: "\n max-w-0 truncate pr-3 text-right font-mono text-muted-foreground tabular-nums\n ",
2131
+ children: i ? null : e.values.map((e) => e ?? "?").join(", ")
2132
+ })] }, e.index), ...i ? e.values.map((t, n) => /* @__PURE__ */ X(N, { children: [/* @__PURE__ */ X(P, {
2133
+ className: "pl-8 font-mono text-muted-foreground",
2134
+ children: [
2135
+ r,
2136
+ "[",
2137
+ n,
2138
+ "]"
2139
+ ]
2140
+ }), /* @__PURE__ */ Y(P, {
2141
+ className: "pr-3 text-right font-mono tabular-nums",
2142
+ children: t ?? /* @__PURE__ */ Y(Cr, {})
2143
+ })] }, `${String(e.index)}:${String(n)}`)) : []];
2144
+ })] })] });
2145
+ }
2146
+ function Er({ value: e }) {
2147
+ let t = i();
2148
+ return e == null ? /* @__PURE__ */ Y(g, {
2149
+ variant: "outline",
2150
+ children: t("edge_live_unknown")
2151
+ }) : /* @__PURE__ */ Y(g, {
2152
+ variant: e ? "default" : "secondary",
2153
+ children: t(e ? "edge_live_true" : "edge_live_false")
2154
+ });
2155
+ }
2156
+ function Dr({ conditions: e }) {
2157
+ let t = i(), n = e.flatMap((e) => {
2158
+ let n = wr(e.name, e.index, (e) => t("edge_live_unnamed_condition", { index: e }));
2159
+ return e.values.length === 1 ? [{
2160
+ key: String(e.index),
2161
+ name: n,
2162
+ value: e.values[0] ?? null
2163
+ }] : e.values.map((t, r) => ({
2164
+ key: `${String(e.index)}:${String(r)}`,
2165
+ name: `${n}[${String(r)}]`,
2166
+ value: t
2167
+ }));
2168
+ });
2169
+ return /* @__PURE__ */ X(R, { children: [/* @__PURE__ */ Y(L, { children: /* @__PURE__ */ X(N, { children: [/* @__PURE__ */ Y(I, {
2170
+ className: "pl-3",
2171
+ children: t("edge_live_condition")
2172
+ }), /* @__PURE__ */ Y(I, {
2173
+ className: "pr-3 text-right",
2174
+ children: t("edge_live_value")
2175
+ })] }) }), /* @__PURE__ */ X(F, { children: [n.length === 0 ? /* @__PURE__ */ Y(N, { children: /* @__PURE__ */ Y(P, {
2176
+ colSpan: 2,
2177
+ className: "pl-3 text-muted-foreground",
2178
+ children: t("edge_live_no_conditions")
2179
+ }) }) : null, n.map((e) => /* @__PURE__ */ X(N, { children: [/* @__PURE__ */ Y(P, {
2180
+ className: "pl-3 font-mono",
2181
+ children: e.name
2182
+ }), /* @__PURE__ */ Y(P, {
2183
+ className: "pr-3 text-right",
2184
+ children: /* @__PURE__ */ Y(Er, { value: e.value })
2185
+ })] }, e.key))] })] });
2186
+ }
2187
+ //#endregion
2188
+ //#region src/workspace/setup/endpoints/programs/starter-dialog.tsx
2189
+ function Or({ workspaceId: e, endpointId: n, fileNames: r, onClose: a, onBuilt: o }) {
2190
+ let s = i(), [c, l] = q(null), [u, d] = q(!1), f = t.templates.edgeProgram.list.useQuery({ workspaceId: e }, { enabled: c == null });
2191
+ return /* @__PURE__ */ Y(D, {
2192
+ open: !0,
2193
+ onOpenChange: (e) => {
2194
+ !e && !u && a();
2195
+ },
2196
+ children: /* @__PURE__ */ Y(E, {
2197
+ className: "sm:max-w-xl",
2198
+ showCloseButton: !u,
2199
+ children: c == null ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(T, { children: [/* @__PURE__ */ Y(w, { children: s("edge_program_starter_title") }), /* @__PURE__ */ Y(C, { children: s("edge_program_starter_pick_description") })] }), /* @__PURE__ */ Y(Oe, {
2200
+ query: f,
2201
+ loading: /* @__PURE__ */ X("div", {
2202
+ className: "flex flex-col gap-2",
2203
+ children: [/* @__PURE__ */ Y(O, { className: "h-14 w-full" }), /* @__PURE__ */ Y(O, { className: "h-14 w-full" })]
2204
+ }),
2205
+ error: (e) => /* @__PURE__ */ Y(ke, { message: j(e) }),
2206
+ isEmpty: (e) => e.starters.length === 0,
2207
+ empty: /* @__PURE__ */ Y("p", {
2208
+ className: "text-muted-foreground",
2209
+ children: s("edge_program_starter_empty")
2210
+ }),
2211
+ children: ({ starters: e }) => /* @__PURE__ */ Y(We, {
2212
+ starters: e,
2213
+ onPick: l
2214
+ })
2215
+ })] }) : /* @__PURE__ */ Y(Ar, {
2216
+ workspaceId: e,
2217
+ endpointId: n,
2218
+ starterId: c,
2219
+ fileNames: r,
2220
+ onBack: () => {
2221
+ l(null);
2222
+ },
2223
+ onBuilt: o,
2224
+ onBuilding: d
2225
+ })
2226
+ })
2227
+ });
2228
+ }
2229
+ function kr(e, t) {
2230
+ let n = new Map(e.map((e) => [e.id, e])), r = (e, i) => {
2231
+ let a = e == null ? void 0 : n.get(e);
2232
+ return a == null || i.has(a.id) ? [] : (i.add(a.id), [...r(a.parentId, i), ht(a.name, t)]);
2233
+ };
2234
+ return e.map((e) => ({
2235
+ id: e.id,
2236
+ name: r(e.id, /* @__PURE__ */ new Set()).join(" / ")
2237
+ })).sort((e, n) => e.name.localeCompare(n.name, t));
2238
+ }
2239
+ function Ar({ workspaceId: e, endpointId: n, starterId: a, fileNames: o, onBack: s, onBuilt: c, onBuilding: l }) {
2240
+ let u = i(), d = r(), f = t.templates.edgeProgram.get.useQuery({
2241
+ workspaceId: e,
2242
+ starterId: a
2243
+ }), p = t.parameter.listTree.useQuery({ workspaceId: e }), m = p.data, h = Je(() => {
2244
+ if (m == null) return;
2245
+ let e = new Map(m.parameters.map((e) => [e.id, e])), t = (t, r) => {
2246
+ let i = e.get(r);
2247
+ return i === void 0 ? null : Dt(t, r, i, n, "");
2248
+ };
2249
+ return {
2250
+ parameterFits: (n, r) => e.has(r) && t(n, r) == null,
2251
+ parameterProblem: t,
2252
+ endpoints: [],
2253
+ alarmRules: [],
2254
+ branches: kr(m.branches, d),
2255
+ members: []
2256
+ };
2257
+ }, [
2258
+ m,
2259
+ n,
2260
+ d
2261
+ ]), g = Je(() => {
2262
+ if (m == null) return;
2263
+ let e = new Map(m.branches.map((e) => [e.id, e.parentId])), t = (t) => {
2264
+ let n = [];
2265
+ for (let r = t; r != null && !n.includes(r); r = e.get(r)) n.unshift(r);
2266
+ return n;
2267
+ }, r;
2268
+ for (let e of m.parameters) {
2269
+ let { source: i } = e;
2270
+ if (i.kind !== "modbus-tcp" || i.endpointId !== n) continue;
2271
+ let a = t(e.branchId);
2272
+ if (r === void 0) {
2273
+ r = a;
2274
+ continue;
2275
+ }
2276
+ let o = r.findIndex((e, t) => a[t] !== e);
2277
+ o >= 0 && (r = r.slice(0, o));
2278
+ }
2279
+ return r?.at(-1);
2280
+ }, [m, n]), _ = f.data;
2281
+ return /* @__PURE__ */ Y(Oe, {
2282
+ query: {
2283
+ isLoading: f.isLoading || p.isLoading,
2284
+ isError: (_ == null || h == null) && (f.isError || p.isError),
2285
+ error: f.error ?? p.error,
2286
+ data: _ != null && h != null ? {
2287
+ starter: _,
2288
+ data: h
2289
+ } : void 0
2290
+ },
2291
+ loading: /* @__PURE__ */ X("div", {
2292
+ className: "flex flex-col gap-4",
2293
+ children: [/* @__PURE__ */ Y(O, { className: "h-6 w-48" }), /* @__PURE__ */ Y(O, { className: "h-40 w-full" })]
2294
+ }),
2295
+ error: (e) => /* @__PURE__ */ Y(ke, { message: e == null ? u("error_request_failed") : j(e) }),
2296
+ children: (t) => /* @__PURE__ */ Y(Mr, {
2297
+ workspaceId: e,
2298
+ endpointId: n,
2299
+ starter: t.starter,
2300
+ data: t.data,
2301
+ fileNames: o,
2302
+ deviceBranch: g,
2303
+ onBack: s,
2304
+ onBuilt: c,
2305
+ onBuilding: l
2306
+ })
2307
+ });
2308
+ }
2309
+ function jr(e, t, n) {
2310
+ let r = Ue(e.placeholders);
2311
+ for (let i of e.placeholders) i.kind === "fileName" ? r[i.name] = Ot(i.default, t) : i.kind === "branch" && n !== void 0 && (r[i.name] = n);
2312
+ return r;
2313
+ }
2314
+ function Mr({ workspaceId: e, endpointId: n, starter: a, data: c, fileNames: l, deviceBranch: d, onBack: f, onBuilt: p, onBuilding: m }) {
2315
+ let h = i(), g = r(), _ = t.useUtils(), [v, y] = q([]), b = K(1e3), E = () => `row-${String(b.current++)}`, D = o({
2316
+ defaultValues: { values: jr(a, l, d) },
2317
+ validators: u({ submit: async (t) => {
2318
+ let r = Ve(a.placeholders, t.values), i;
2319
+ m(!0);
2320
+ try {
2321
+ i = r.ok ? await _.client.templates.edgeProgram.instantiate.query({
2322
+ workspaceId: e,
2323
+ endpointId: n,
2324
+ starterId: a.id,
2325
+ values: r.values
2326
+ }) : r;
2327
+ } finally {
2328
+ m(!1);
2329
+ }
2330
+ return i.ok ? (y([]), p({
2331
+ starterName: a.name,
2332
+ fileName: i.fileName,
2333
+ description: i.description,
2334
+ source: i.source,
2335
+ parameters: i.parameters
2336
+ }), null) : (y(i.problems), {
2337
+ form: () => h("starter_fix_problems"),
2338
+ fields: {}
2339
+ });
2340
+ } }),
2341
+ onSubmitInvalid: s
2342
+ }), O = (e) => {
2343
+ y((t) => t.filter((t) => t.path !== e && !t.path.startsWith(`${e}/`)));
2344
+ };
2345
+ return /* @__PURE__ */ Y(D.AppForm, { children: /* @__PURE__ */ X(D.FormRoot, {
2346
+ layout: "dialog",
2347
+ children: [
2348
+ /* @__PURE__ */ X(T, { children: [/* @__PURE__ */ Y(w, { children: ht(a.name, g) }), /* @__PURE__ */ Y(C, { children: ht(a.description, g) })] }),
2349
+ /* @__PURE__ */ Y(D.AppField, {
2350
+ name: "values",
2351
+ children: (t) => /* @__PURE__ */ Y(He, {
2352
+ workspaceId: e,
2353
+ placeholders: a.placeholders,
2354
+ values: t.state.value,
2355
+ onChange: (e, n) => {
2356
+ O(n), t.handleChange(e);
2357
+ },
2358
+ problems: v,
2359
+ data: c,
2360
+ newKey: E
2361
+ })
2362
+ }),
2363
+ /* @__PURE__ */ X(S, { children: [/* @__PURE__ */ Y(D.Subscribe, {
2364
+ selector: (e) => e.isSubmitting,
2365
+ children: (e) => /* @__PURE__ */ Y(x, {
2366
+ type: "button",
2367
+ variant: "outline",
2368
+ disabled: e,
2369
+ onClick: f,
2370
+ children: h("starter_back")
2371
+ })
2372
+ }), /* @__PURE__ */ Y(D.SubmitButton, {
2373
+ label: h("starter_continue"),
2374
+ pendingLabel: h("starter_continue_pending")
2375
+ })] })
2376
+ ]
2377
+ }) });
2378
+ }
2379
+ //#endregion
2380
+ //#region src/workspace/setup/endpoints/programs/tasks-table.tsx
2381
+ function Nr(e) {
2382
+ return e.slice(e.lastIndexOf("/") + 1);
2383
+ }
2384
+ function Pr(e, t) {
2385
+ return new Intl.NumberFormat(t, { maximumFractionDigits: 3 }).format(e / 1e3);
2386
+ }
2387
+ function Fr({ tasks: e }) {
2388
+ let t = i(), n = r();
2389
+ return e.length === 0 ? /* @__PURE__ */ Y("p", {
2390
+ className: "px-3 py-2 text-sm text-muted-foreground",
2391
+ children: t("edge_tasks_empty")
2392
+ }) : /* @__PURE__ */ X(R, { children: [/* @__PURE__ */ Y(L, { children: /* @__PURE__ */ X(N, { children: [
2393
+ /* @__PURE__ */ Y(I, {
2394
+ className: "pl-3",
2395
+ children: t("edge_tasks_program")
2396
+ }),
2397
+ /* @__PURE__ */ Y(I, { children: t("edge_tasks_state") }),
2398
+ /* @__PURE__ */ Y(I, {
2399
+ className: "\n hidden\n sm:table-cell\n ",
2400
+ children: t("edge_tasks_period")
2401
+ }),
2402
+ /* @__PURE__ */ Y(I, {
2403
+ className: "\n hidden\n md:table-cell\n ",
2404
+ children: t("edge_tasks_last_run")
2405
+ }),
2406
+ /* @__PURE__ */ Y(I, {
2407
+ className: "pr-3",
2408
+ children: t("edge_tasks_last_error")
2409
+ })
2410
+ ] }) }), /* @__PURE__ */ Y(F, { children: e.map((e) => /* @__PURE__ */ X(N, { children: [
2411
+ /* @__PURE__ */ Y(P, {
2412
+ className: "pl-3 font-mono",
2413
+ children: Nr(e.sourceFile)
2414
+ }),
2415
+ /* @__PURE__ */ Y(P, { children: /* @__PURE__ */ Y(g, {
2416
+ variant: e.state === "running" ? "secondary" : "outline",
2417
+ children: e.state === "running" ? t("edge_task_state_running") : e.state === "idle" ? t("edge_task_state_idle") : e.state
2418
+ }) }),
2419
+ /* @__PURE__ */ Y(P, {
2420
+ className: "\n hidden tabular-nums\n sm:table-cell\n ",
2421
+ children: t("edge_task_period_seconds", { seconds: Pr(e.periodMs, n) })
2422
+ }),
2423
+ /* @__PURE__ */ Y(P, {
2424
+ className: "\n hidden\n md:table-cell\n ",
2425
+ children: e.lastRunOn == null ? "—" : Q(e.lastRunOn)
2426
+ }),
2427
+ /* @__PURE__ */ Y(P, {
2428
+ className: "pr-3 whitespace-normal",
2429
+ children: e.lastErrorCode == null || e.lastErrorCode === "OK" ? /* @__PURE__ */ Y("span", {
2430
+ className: "text-muted-foreground",
2431
+ children: t("edge_task_no_error")
2432
+ }) : /* @__PURE__ */ Y("span", {
2433
+ className: "text-destructive",
2434
+ title: e.lastErrorCode,
2435
+ children: dn(e.lastErrorCode)
2436
+ })
2437
+ })
2438
+ ] }, e.sourceFile)) })] });
2439
+ }
2440
+ //#endregion
2441
+ //#region src/workspace/setup/endpoints/programs/programs-tab.tsx
2442
+ function Ir(e) {
2443
+ let t = e == null ? null : e.map((e) => `${e.fileName}\u0000${String(e.enabled)}\u0000${e.source}`).join(""), [n, r] = q({
2444
+ key: t,
2445
+ sources: e
2446
+ });
2447
+ return n.key !== t && r({
2448
+ key: t,
2449
+ sources: e
2450
+ }), n.key === t ? n.sources : e;
2451
+ }
2452
+ function Lr({ program: e }) {
2453
+ let t = i();
2454
+ return e.errorCount === 0 && e.warningCount === 0 ? null : /* @__PURE__ */ X("span", {
2455
+ className: "flex items-center gap-1.5 text-xs tabular-nums",
2456
+ "aria-label": t("edge_program_problem_counts", {
2457
+ errors: String(e.errorCount),
2458
+ warnings: String(e.warningCount)
2459
+ }),
2460
+ children: [e.errorCount > 0 ? /* @__PURE__ */ X("span", {
2461
+ className: "flex items-center gap-0.5 text-destructive",
2462
+ children: [/* @__PURE__ */ Y($e, { className: "size-3.5" }), e.errorCount]
2463
+ }) : null, e.warningCount > 0 ? /* @__PURE__ */ X("span", {
2464
+ className: "\n flex items-center gap-0.5 text-amber-600\n dark:text-amber-400\n ",
2465
+ children: [/* @__PURE__ */ Y(pt, { className: "size-3.5" }), e.warningCount]
2466
+ }) : null]
2467
+ });
2468
+ }
2469
+ function Rr({ workspaceId: e, program: t }) {
2470
+ let n = i(), r = a(), { update: o } = W(e);
2471
+ return /* @__PURE__ */ X("label", {
2472
+ className: "flex items-center gap-2 text-sm text-muted-foreground",
2473
+ children: [/* @__PURE__ */ Y(ae, {
2474
+ size: "sm",
2475
+ checked: t.enabled,
2476
+ disabled: o.isPending,
2477
+ "aria-label": n("edge_program_enabled_label"),
2478
+ onCheckedChange: (e) => {
2479
+ o.mutate({
2480
+ id: t.id,
2481
+ enabled: e,
2482
+ baseRevision: t.revision
2483
+ }, {
2484
+ onSuccess: () => {
2485
+ r.success(n(e ? "edge_program_enable_toast" : "edge_program_disable_toast"));
2486
+ },
2487
+ onError: (e) => {
2488
+ r.error(j(e));
2489
+ }
2490
+ });
2491
+ }
2492
+ }), /* @__PURE__ */ Y("span", {
2493
+ className: "\n hidden\n sm:inline\n ",
2494
+ children: t.enabled ? n("edge_program_enabled") : n("edge_program_disabled")
2495
+ })]
2496
+ });
2497
+ }
2498
+ function zr({ workspaceId: e, endpointId: n, deploy: r, canEdit: a, programId: o, onProgramChange: s }) {
2499
+ let c = i(), l = t.useUtils(), u = K(null), [m, h] = q(null), [g, _] = q(0), [v, y] = q(0), [b, S] = q(null), [C, w] = q(null), T = K(0), E = K(null);
2500
+ G(() => (E.current = C?.build ?? null, () => {
2501
+ E.current = null;
2502
+ }), [C]), C != null && C.over !== o && w(null);
2503
+ let D = t.edgeProgram.list.useQuery({
2504
+ workspaceId: e,
2505
+ endpointId: n
2506
+ }), k = t.edgeProgram.getSettings.useQuery({ endpointId: n }), A = Je(() => D.data?.items ?? [], [D.data]), [M, N] = q(void 0);
2507
+ o == null && A.length > 0 && (M == null || !A.some((e) => e.id === M)) && N(A[0]?.id);
2508
+ let P = A.find((e) => e.id === (o ?? M)), F = t.edgeProgram.get.useQuery({ id: P?.id ?? "" }, { enabled: P != null }), I = A.filter((e) => e.id !== P?.id && e.enabled && e.sourceBytes > 0), L = t.useQueries((e) => I.map((t) => e.edgeProgram.get({ id: t.id }))), R = Ir(L.every((e) => e.isSuccess) ? L.map((e, t) => ({
2509
+ fileName: I[t]?.fileName ?? e.data.fileName,
2510
+ enabled: I[t]?.enabled ?? e.data.enabled,
2511
+ source: e.data.source
2512
+ })) : null), B = F.data?.id === P?.id ? F.data : void 0, V = new Set((r.status?.programs ?? []).flatMap((e) => e.programId == null ? [] : [e.programId]));
2513
+ G(() => {
2514
+ if (C != null || b == null || B == null || B.id !== b.programId) return;
2515
+ let e = u.current;
2516
+ if (e == null) return;
2517
+ let t = sr(e.text(), b.line), { column: n, length: r } = b;
2518
+ n === void 0 || r === void 0 ? e.reveal(t.from, t.to) : e.reveal(t.from + n - 1, t.from + n - 1 + r), S(null);
2519
+ }, [
2520
+ b,
2521
+ B,
2522
+ C
2523
+ ]);
2524
+ let H = r.status?.tasks ?? [], U = (e, t) => {
2525
+ S({
2526
+ programId: e,
2527
+ line: t
2528
+ }), e !== P?.id && s(e);
2529
+ }, ae = (e) => {
2530
+ let t = A.find((t) => t.fileName === e.filename);
2531
+ t !== void 0 && (S({
2532
+ programId: t.id,
2533
+ line: e.line,
2534
+ column: e.column,
2535
+ length: e.to - e.from
2536
+ }), t.id !== P?.id && s(t.id));
2537
+ }, oe = (e, t) => {
2538
+ if (C == null) {
2539
+ U(e, t);
2540
+ return;
2541
+ }
2542
+ h({
2543
+ kind: "discard-for-line",
2544
+ fileName: C.draft.fileName,
2545
+ programId: e,
2546
+ line: t
2547
+ });
2548
+ }, se = () => {
2549
+ h({ kind: "create" });
2550
+ }, ce = K(!1), le = Ke((e) => {
2551
+ ce.current = e;
2552
+ }, []), ue = () => {
2553
+ let e = C?.draft.fileName ?? P?.fileName;
2554
+ h(ce.current && e !== void 0 ? {
2555
+ kind: "discard-for-starter",
2556
+ fileName: e
2557
+ } : { kind: "starter" });
2558
+ }, de = R == null || P != null && P.enabled && P.sourceBytes > 0 && B == null ? null : [...R, ...P != null && P.enabled && B != null ? [{
2559
+ fileName: P.fileName,
2560
+ enabled: !0,
2561
+ source: B.source
2562
+ }] : []];
2563
+ if (D.isError && D.data == null) return /* @__PURE__ */ Y(De, {
2564
+ message: j(D.error),
2565
+ onRetry: () => D.refetch()
2566
+ });
2567
+ let fe = a ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(x, {
2568
+ type: "button",
2569
+ variant: "ghost",
2570
+ size: "icon-sm",
2571
+ "aria-label": c("edge_program_starter_title"),
2572
+ title: c("edge_program_starter_title"),
2573
+ onClick: ue,
2574
+ children: /* @__PURE__ */ Y(ot, {})
2575
+ }), /* @__PURE__ */ Y(x, {
2576
+ type: "button",
2577
+ variant: "ghost",
2578
+ size: "icon-sm",
2579
+ "aria-label": c("edge_program_create"),
2580
+ title: c("edge_program_create"),
2581
+ onClick: se,
2582
+ children: /* @__PURE__ */ Y(ct, {})
2583
+ })] }) : null, pe;
2584
+ if (C != null && k.data != null) {
2585
+ let { build: t } = C;
2586
+ pe = /* @__PURE__ */ Y(fr, {
2587
+ workspaceId: e,
2588
+ endpointId: n,
2589
+ draft: C.draft,
2590
+ others: de,
2591
+ autoSync: k.data.settings.autoSync,
2592
+ editorRef: u,
2593
+ tasks: /* @__PURE__ */ Y(Fr, { tasks: H }),
2594
+ taskCount: H.length,
2595
+ onDiscard: () => {
2596
+ w(null);
2597
+ },
2598
+ onCreated: (e) => {
2599
+ E.current === t && (w(null), s(e));
2600
+ },
2601
+ onDirtyChange: le
2602
+ }, C.build);
2603
+ } else pe = A.length === 0 ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(ie, {
2604
+ className: "flex-1",
2605
+ children: [/* @__PURE__ */ X(te, { children: [
2606
+ /* @__PURE__ */ Y(ee, {
2607
+ variant: "icon",
2608
+ children: /* @__PURE__ */ Y(nt, {})
2609
+ }),
2610
+ /* @__PURE__ */ Y(z, { children: c("edge_programs_empty_title") }),
2611
+ /* @__PURE__ */ Y(re, { children: c("edge_programs_empty_description") })
2612
+ ] }), a ? /* @__PURE__ */ Y(ne, { children: /* @__PURE__ */ X("div", {
2613
+ className: "flex flex-wrap justify-center gap-2",
2614
+ children: [/* @__PURE__ */ X(x, {
2615
+ type: "button",
2616
+ variant: "outline",
2617
+ onClick: ue,
2618
+ children: [/* @__PURE__ */ Y(ot, { "data-icon": "inline-start" }), c("edge_program_starter_action")]
2619
+ }), /* @__PURE__ */ X(x, {
2620
+ type: "button",
2621
+ onClick: se,
2622
+ children: [/* @__PURE__ */ Y(ct, { "data-icon": "inline-start" }), c("edge_program_create")]
2623
+ })]
2624
+ }) }) : null]
2625
+ }), H.length > 0 ? /* @__PURE__ */ X("section", {
2626
+ "aria-label": c("edge_tasks_title"),
2627
+ className: "flex h-44 shrink-0 flex-col border-t",
2628
+ children: [/* @__PURE__ */ Y("h2", {
2629
+ className: "flex h-9 shrink-0 items-center border-b px-3 text-sm font-medium",
2630
+ children: c("edge_tasks_title")
2631
+ }), /* @__PURE__ */ Y("div", {
2632
+ className: "min-h-0 flex-1 overflow-y-auto",
2633
+ children: /* @__PURE__ */ Y(Fr, { tasks: H })
2634
+ })]
2635
+ }) : null] }) : P == null ? /* @__PURE__ */ Y(De, {
2636
+ className: "flex-1 justify-center",
2637
+ message: j("edge_program_not_found"),
2638
+ onRetry: () => {
2639
+ s(void 0);
2640
+ }
2641
+ }) : F.isError && B == null ? /* @__PURE__ */ Y(De, {
2642
+ className: "flex-1 justify-center",
2643
+ message: j(F.error),
2644
+ onRetry: () => F.refetch()
2645
+ }) : k.isError && k.data == null ? /* @__PURE__ */ Y(De, {
2646
+ className: "flex-1 justify-center",
2647
+ message: j(k.error),
2648
+ onRetry: () => k.refetch()
2649
+ }) : B == null || k.data == null ? /* @__PURE__ */ Y(O, { className: "m-3 flex-1" }) : /* @__PURE__ */ X(J, { children: [F.isError ? /* @__PURE__ */ Y(ke, {
2650
+ className: "m-3",
2651
+ message: j(F.error),
2652
+ onRetry: () => F.refetch()
2653
+ }) : null, /* @__PURE__ */ Y(dr, {
2654
+ workspaceId: e,
2655
+ detail: B,
2656
+ others: R,
2657
+ autoSync: k.data.settings.autoSync,
2658
+ canEdit: a,
2659
+ editorRef: u,
2660
+ onOpenLocation: ae,
2661
+ title: /* @__PURE__ */ X(J, { children: [
2662
+ /* @__PURE__ */ Y("h2", {
2663
+ className: "\n hidden min-w-0 truncate font-mono text-sm font-medium\n lg:block\n ",
2664
+ children: P.fileName
2665
+ }),
2666
+ /* @__PURE__ */ Y(f, {
2667
+ size: "sm",
2668
+ className: "\n min-w-0 font-mono\n lg:hidden\n ",
2669
+ "aria-label": c("edge_program_select"),
2670
+ value: P.id,
2671
+ onChange: (e) => {
2672
+ s(e.target.value);
2673
+ },
2674
+ children: A.map((e) => /* @__PURE__ */ Y(p, {
2675
+ value: e.id,
2676
+ children: e.fileName
2677
+ }, e.id))
2678
+ }),
2679
+ /* @__PURE__ */ Y("span", {
2680
+ className: "\n flex\n lg:hidden\n ",
2681
+ children: fe
2682
+ })
2683
+ ] }),
2684
+ actions: a ? /* @__PURE__ */ X(J, { children: [
2685
+ /* @__PURE__ */ Y(Rr, {
2686
+ workspaceId: e,
2687
+ program: P
2688
+ }),
2689
+ /* @__PURE__ */ Y(x, {
2690
+ type: "button",
2691
+ variant: "ghost",
2692
+ size: "icon-sm",
2693
+ "aria-label": c("edge_program_rename"),
2694
+ title: c("edge_program_rename"),
2695
+ onClick: () => {
2696
+ h({
2697
+ kind: "rename",
2698
+ program: P
2699
+ });
2700
+ },
2701
+ children: /* @__PURE__ */ Y(st, {})
2702
+ }),
2703
+ /* @__PURE__ */ Y(x, {
2704
+ type: "button",
2705
+ variant: "ghost",
2706
+ size: "icon-sm",
2707
+ "aria-label": c("edge_program_delete"),
2708
+ title: c("edge_program_delete"),
2709
+ onClick: () => {
2710
+ h({
2711
+ kind: "delete",
2712
+ program: P
2713
+ });
2714
+ },
2715
+ children: /* @__PURE__ */ Y(ft, {})
2716
+ })
2717
+ ] }) : null,
2718
+ tasks: /* @__PURE__ */ Y(Fr, { tasks: H }),
2719
+ taskCount: H.length,
2720
+ variables: a ? /* @__PURE__ */ Y(yr, { programId: B.id }) : null,
2721
+ fetchLatest: () => l.client.edgeProgram.get.query({ id: B.id }),
2722
+ onDirtyChange: le,
2723
+ onReload: async () => {
2724
+ let e = await l.client.edgeProgram.get.query({ id: B.id });
2725
+ l.edgeProgram.get.setData({ id: B.id }, e), _((e) => e + 1);
2726
+ }
2727
+ }, `${B.id}-${String(g)}`)] });
2728
+ return /* @__PURE__ */ X("div", {
2729
+ className: "flex min-h-0 flex-1 flex-col gap-3",
2730
+ children: [
2731
+ /* @__PURE__ */ Y(_n, {
2732
+ workspaceId: e,
2733
+ deploy: r,
2734
+ canEdit: a,
2735
+ onOpenSettings: () => {
2736
+ h({ kind: "settings" });
2737
+ },
2738
+ onShowLine: oe
2739
+ }),
2740
+ D.data == null ? /* @__PURE__ */ Y(O, { className: "min-h-144 flex-1 rounded-lg" }) : /* @__PURE__ */ X("div", {
2741
+ className: "flex min-h-144 flex-1 overflow-hidden rounded-lg border bg-card",
2742
+ children: [A.length > 0 ? /* @__PURE__ */ X("aside", {
2743
+ className: "\n hidden w-56 shrink-0 flex-col border-r\n lg:flex\n ",
2744
+ children: [
2745
+ /* @__PURE__ */ X("div", {
2746
+ className: "flex h-12 shrink-0 items-center gap-2 border-b pr-1.5 pl-3",
2747
+ children: [/* @__PURE__ */ Y("h2", {
2748
+ className: "flex-1 text-sm font-medium",
2749
+ children: c("edge_programs_title")
2750
+ }), fe]
2751
+ }),
2752
+ /* @__PURE__ */ Y("nav", {
2753
+ "aria-label": c("edge_programs_list_label"),
2754
+ className: "flex min-h-0 flex-1 flex-col gap-px overflow-y-auto p-1.5",
2755
+ children: A.map((e) => /* @__PURE__ */ X("button", {
2756
+ type: "button",
2757
+ "aria-current": e.id === P?.id ? "page" : void 0,
2758
+ className: d("\n flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm\n hover:bg-muted\n focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none\n ", e.id === P?.id && "bg-muted font-medium"),
2759
+ onClick: () => {
2760
+ s(e.id);
2761
+ },
2762
+ children: [
2763
+ /* @__PURE__ */ Y("span", {
2764
+ className: d("size-1.5 shrink-0 rounded-full", V.has(e.id) ? "bg-emerald-500" : "bg-transparent"),
2765
+ title: V.has(e.id) ? c("edge_program_runs") : void 0
2766
+ }),
2767
+ /* @__PURE__ */ Y("span", {
2768
+ className: d("min-w-0 flex-1 truncate font-mono", !e.enabled && "text-muted-foreground line-through"),
2769
+ children: e.fileName
2770
+ }),
2771
+ V.has(e.id) ? /* @__PURE__ */ Y("span", {
2772
+ className: "sr-only",
2773
+ children: c("edge_program_runs")
2774
+ }) : null,
2775
+ e.enabled ? null : /* @__PURE__ */ Y("span", {
2776
+ className: "text-xs text-muted-foreground",
2777
+ children: c("edge_program_disabled_badge")
2778
+ }),
2779
+ /* @__PURE__ */ Y(Lr, { program: e })
2780
+ ]
2781
+ }, e.id))
2782
+ }),
2783
+ /* @__PURE__ */ Y("p", {
2784
+ className: "shrink-0 border-t px-3 py-2 text-xs text-muted-foreground",
2785
+ children: c("edge_programs_description")
2786
+ })
2787
+ ]
2788
+ }) : null, /* @__PURE__ */ Y("div", {
2789
+ className: "flex min-w-0 flex-1 flex-col",
2790
+ children: pe
2791
+ })]
2792
+ }),
2793
+ /* @__PURE__ */ Y(En, {
2794
+ endpointId: n,
2795
+ deviceLogging: k.data?.settings.deviceLogging ?? !0,
2796
+ settingsPending: r.status?.settingsPending ?? !1,
2797
+ canEdit: a,
2798
+ onOpenSettings: () => {
2799
+ h({ kind: "settings" });
2800
+ },
2801
+ onShowLine: oe
2802
+ }, n),
2803
+ m?.kind === "create" || m?.kind === "rename" ? /* @__PURE__ */ Y(On, {
2804
+ workspaceId: e,
2805
+ endpointId: n,
2806
+ ...m.kind === "rename" ? { program: m.program } : {},
2807
+ onClose: () => {
2808
+ h(null);
2809
+ },
2810
+ onSaved: (e) => {
2811
+ h(null), s(e);
2812
+ }
2813
+ }) : null,
2814
+ m?.kind === "discard-for-line" ? /* @__PURE__ */ Y(lr, {
2815
+ fileName: m.fileName,
2816
+ onKeep: () => {
2817
+ h((e) => e?.kind === "discard-for-line" ? null : e);
2818
+ },
2819
+ onDiscard: () => {
2820
+ h(null), xt(() => {
2821
+ w(null);
2822
+ }), U(m.programId, m.line);
2823
+ }
2824
+ }) : null,
2825
+ m?.kind === "discard-for-starter" ? /* @__PURE__ */ Y(lr, {
2826
+ fileName: m.fileName,
2827
+ onKeep: () => {
2828
+ h((e) => e?.kind === "discard-for-starter" ? null : e);
2829
+ },
2830
+ onDiscard: () => {
2831
+ h({ kind: "starter" });
2832
+ }
2833
+ }) : null,
2834
+ m?.kind === "starter" ? /* @__PURE__ */ Y(Or, {
2835
+ workspaceId: e,
2836
+ endpointId: n,
2837
+ fileNames: A.map((e) => e.fileName),
2838
+ onClose: () => {
2839
+ h(null);
2840
+ },
2841
+ onBuilt: (e) => {
2842
+ h(null), T.current += 1, w({
2843
+ draft: e,
2844
+ over: o,
2845
+ build: T.current
2846
+ });
2847
+ }
2848
+ }) : null,
2849
+ m?.kind === "delete" ? /* @__PURE__ */ Y(kn, {
2850
+ workspaceId: e,
2851
+ program: m.program,
2852
+ onClose: () => {
2853
+ h(null);
2854
+ },
2855
+ onDeleted: () => {
2856
+ h(null), s(void 0);
2857
+ }
2858
+ }) : null,
2859
+ m?.kind === "settings" && k.data != null ? /* @__PURE__ */ Y(gr, {
2860
+ workspaceId: e,
2861
+ settings: k.data,
2862
+ onReload: async () => {
2863
+ await k.refetch({ throwOnError: !0 }), y((e) => e + 1);
2864
+ },
2865
+ onClose: () => {
2866
+ h(null);
2867
+ }
2868
+ }, v) : null
2869
+ ]
2870
+ });
2871
+ }
2872
+ //#endregion
2873
+ //#region src/workspace/setup/endpoints/status-recorded.tsx
2874
+ function Br({ endpointId: e, onCreateParameter: n }) {
2875
+ let r = i(), a = t.deviceLog.listAddresses.useQuery({ endpointId: e });
2876
+ return /* @__PURE__ */ Y(Oe, {
2877
+ query: {
2878
+ isLoading: a.isLoading,
2879
+ isError: a.isError,
2880
+ error: a.error,
2881
+ data: a.data
2882
+ },
2883
+ loading: /* @__PURE__ */ Y(O, { className: "h-48 w-full" }),
2884
+ error: (e) => /* @__PURE__ */ Y(De, {
2885
+ message: e == null ? r("error_request_failed") : j(e),
2886
+ onRetry: () => a.refetch()
2887
+ }),
2888
+ isEmpty: (e) => e.addresses.length === 0,
2889
+ empty: /* @__PURE__ */ Y(ie, { children: /* @__PURE__ */ X(te, { children: [
2890
+ /* @__PURE__ */ Y(ee, {
2891
+ variant: "icon",
2892
+ children: /* @__PURE__ */ Y(it, {})
2893
+ }),
2894
+ /* @__PURE__ */ Y(z, { children: r("endpoint_recorded_empty_title") }),
2895
+ /* @__PURE__ */ Y(re, { children: r("endpoint_recorded_empty_description") })
2896
+ ] }) }),
2897
+ children: (t) => /* @__PURE__ */ X("div", {
2898
+ className: "flex flex-col gap-3",
2899
+ children: [/* @__PURE__ */ Y("p", {
2900
+ className: "text-sm text-muted-foreground",
2901
+ children: r("endpoint_recorded_description")
2902
+ }), /* @__PURE__ */ X(R, { children: [/* @__PURE__ */ Y(L, { children: /* @__PURE__ */ X(N, { children: [
2903
+ /* @__PURE__ */ Y(I, { children: r("endpoint_recorded_unit") }),
2904
+ /* @__PURE__ */ Y(I, { children: r("endpoint_recorded_table") }),
2905
+ /* @__PURE__ */ Y(I, { children: r("endpoint_recorded_address") }),
2906
+ /* @__PURE__ */ Y(I, {
2907
+ className: "\n hidden\n sm:table-cell\n ",
2908
+ children: r("endpoint_recorded_records")
2909
+ }),
2910
+ /* @__PURE__ */ Y(I, {
2911
+ className: "\n hidden\n md:table-cell\n ",
2912
+ children: r("endpoint_recorded_last_at")
2913
+ }),
2914
+ /* @__PURE__ */ Y(I, {
2915
+ className: "\n hidden\n md:table-cell\n ",
2916
+ children: r("endpoint_recorded_last_value")
2917
+ }),
2918
+ /* @__PURE__ */ Y(I, { children: /* @__PURE__ */ Y("span", {
2919
+ className: "sr-only",
2920
+ children: r("endpoint_recorded_actions")
2921
+ }) })
2922
+ ] }) }), /* @__PURE__ */ Y(F, { children: t.addresses.map((t) => /* @__PURE__ */ X(N, { children: [
2923
+ /* @__PURE__ */ Y(P, {
2924
+ className: "tabular-nums",
2925
+ children: t.unitId
2926
+ }),
2927
+ /* @__PURE__ */ Y(P, { children: l(t.table) }),
2928
+ /* @__PURE__ */ Y(P, {
2929
+ className: "tabular-nums",
2930
+ children: t.address
2931
+ }),
2932
+ /* @__PURE__ */ Y(P, {
2933
+ className: "\n hidden tabular-nums\n sm:table-cell\n ",
2934
+ children: t.records
2935
+ }),
2936
+ /* @__PURE__ */ Y(P, {
2937
+ className: "\n hidden\n md:table-cell\n ",
2938
+ children: Q(t.lastAt)
2939
+ }),
2940
+ /* @__PURE__ */ Y(P, {
2941
+ className: "\n hidden tabular-nums\n md:table-cell\n ",
2942
+ children: t.lastValue
2943
+ }),
2944
+ /* @__PURE__ */ Y(P, {
2945
+ className: "text-right",
2946
+ children: n == null ? null : /* @__PURE__ */ X(x, {
2947
+ type: "button",
2948
+ variant: "outline",
2949
+ size: "sm",
2950
+ "aria-label": r("endpoint_recorded_create_parameter"),
2951
+ onClick: () => {
2952
+ n({
2953
+ endpointId: e,
2954
+ unitId: t.unitId,
2955
+ table: t.table,
2956
+ address: t.address
2957
+ });
2958
+ },
2959
+ children: [/* @__PURE__ */ Y(ct, { "data-icon": "inline-start" }), /* @__PURE__ */ Y("span", {
2960
+ className: "\n hidden\n sm:inline\n ",
2961
+ children: r("endpoint_recorded_create_parameter")
2962
+ })]
2963
+ })
2964
+ })
2965
+ ] }, `${String(t.unitId)}:${t.table}:${String(t.address)}`)) })] })]
2966
+ })
2967
+ });
2968
+ }
2969
+ //#endregion
2970
+ //#region src/workspace/setup/endpoints/sharing.tsx
2971
+ var Vr = gt(Z.Object({ authorizationCode: Z.String({ maxLength: 8 }) }));
2972
+ function Hr({ workspaceId: e, endpointId: n, pinCode: r }) {
2973
+ let a = i(), o = t.endpoint.listConnectedWorkspaces.useQuery({ endpointId: n }), [s, c] = q(!1), l = (o.data?.workspaces ?? []).filter((e) => !e.current);
2974
+ return l.length === 0 ? null : /* @__PURE__ */ X("div", {
2975
+ className: "flex w-full flex-wrap items-center gap-x-3 gap-y-1.5 border-t pt-2",
2976
+ children: [
2977
+ /* @__PURE__ */ X("span", {
2978
+ className: "min-w-0 text-muted-foreground",
2979
+ children: [/* @__PURE__ */ X("span", {
2980
+ className: "text-foreground/70",
2981
+ children: [a("endpoint_sharing_label"), ": "]
2982
+ }), l.map((e, t) => /* @__PURE__ */ X("span", { children: [t > 0 ? ", " : null, /* @__PURE__ */ X(ue, { children: [/* @__PURE__ */ Y(le, {
2983
+ render: /* @__PURE__ */ Y("span", { className: "underline decoration-dotted" }),
2984
+ children: e.name
2985
+ }), /* @__PURE__ */ Y(fe, {
2986
+ className: "font-mono",
2987
+ children: e.id
2988
+ })] })] }, e.id))]
2989
+ }),
2990
+ r == null ? null : /* @__PURE__ */ Y(x, {
2991
+ type: "button",
2992
+ variant: "ghost",
2993
+ size: "sm",
2994
+ className: "\n ml-auto text-destructive\n hover:text-destructive\n ",
2995
+ onClick: () => {
2996
+ c(!0);
2997
+ },
2998
+ children: a("endpoint_disconnect_others_action")
2999
+ }),
3000
+ s && r != null ? /* @__PURE__ */ Y(Wr, {
3001
+ workspaceId: e,
3002
+ endpointId: n,
3003
+ pinCode: r,
3004
+ onClose: () => {
3005
+ c(!1);
3006
+ }
3007
+ }) : null
3008
+ ]
3009
+ });
3010
+ }
3011
+ function Ur({ endpointId: e, challengeId: n, codeDisplayed: r, onClose: c, onDisconnected: l, onChallengeGone: d }) {
3012
+ let f = i(), p = a(), h = t.endpoint.disconnectOtherWorkspaces.useMutation(), g = o({
3013
+ defaultValues: { authorizationCode: "" },
3014
+ validators: u({
3015
+ schema: Vr,
3016
+ submit: async (t) => {
3017
+ let r = Le(t.authorizationCode);
3018
+ if (!r.ok) return { fields: { authorizationCode: () => f("endpoint_presence_code_invalid") } };
3019
+ try {
3020
+ await h.mutateAsync({
3021
+ endpointId: e,
3022
+ challengeId: n,
3023
+ ...r.code == null ? {} : { authorizationCode: r.code }
3024
+ });
3025
+ } catch (e) {
3026
+ throw M(e) === "endpoint_presence_invalid" && d(), e;
3027
+ }
3028
+ return await l(), null;
3029
+ },
3030
+ mapError: (e, t) => Ie(e, t, r)
3031
+ }),
3032
+ onSubmitInvalid: s,
3033
+ onSubmit: () => {
3034
+ p.success(f("endpoint_disconnect_others_toast")), c();
3035
+ }
3036
+ });
3037
+ return /* @__PURE__ */ Y(g.AppForm, { children: /* @__PURE__ */ X(g.FormRoot, {
3038
+ layout: "dialog",
3039
+ children: [
3040
+ /* @__PURE__ */ X(T, { children: [/* @__PURE__ */ Y(w, { children: f("endpoint_presence_title") }), /* @__PURE__ */ Y(C, { children: f("endpoint_presence_button") })] }),
3041
+ /* @__PURE__ */ X(m, { children: [
3042
+ /* @__PURE__ */ Y(g.Subscribe, {
3043
+ selector: (e) => e.isSubmitting,
3044
+ children: (e) => /* @__PURE__ */ Y(Fe, {
3045
+ challengeId: n,
3046
+ paused: e,
3047
+ onDone: () => {
3048
+ g.setFieldValue("authorizationCode", ""), g.handleSubmit();
3049
+ }
3050
+ })
3051
+ }),
3052
+ /* @__PURE__ */ Y("p", {
3053
+ className: "text-sm text-destructive",
3054
+ children: f("endpoint_disconnect_others_description")
3055
+ }),
3056
+ /* @__PURE__ */ Y("p", {
3057
+ className: "text-sm",
3058
+ children: f(r ? "endpoint_presence_or_code" : "endpoint_presence_button_only")
3059
+ }),
3060
+ r ? /* @__PURE__ */ Y(g.AppField, {
3061
+ name: "authorizationCode",
3062
+ children: (e) => /* @__PURE__ */ Y(e.TextField, {
3063
+ label: f("endpoint_presence_code_label"),
3064
+ id: "endpoint-disconnect-code",
3065
+ autoComplete: "off",
3066
+ spellCheck: !1,
3067
+ inputMode: "numeric",
3068
+ autoFocus: !0
3069
+ })
3070
+ }) : null
3071
+ ] }),
3072
+ /* @__PURE__ */ X(S, { children: [/* @__PURE__ */ Y(x, {
3073
+ type: "button",
3074
+ variant: "outline",
3075
+ onClick: () => {
3076
+ c();
3077
+ },
3078
+ children: f("action_cancel")
3079
+ }), /* @__PURE__ */ Y(g.SubmitButton, {
3080
+ label: f(r ? "endpoint_disconnect_others_submit" : "endpoint_presence_waiting"),
3081
+ pendingLabel: f("endpoint_disconnect_others_pending"),
3082
+ disabled: !r
3083
+ })] })
3084
+ ]
3085
+ }) });
3086
+ }
3087
+ function Wr({ workspaceId: e, endpointId: n, pinCode: r, onClose: a }) {
3088
+ let o = i(), s = t.useUtils(), c = t.endpoint.beginPinPresence.useMutation(), l = t.endpoint.cancelPinPresence.useMutation(), [u, d] = q(null), [f, p] = q(null), [m, h] = q(!1), [g, _] = q(0), v = K(l.mutate), y = K(c.mutateAsync);
3089
+ return G(() => {
3090
+ v.current = l.mutate, y.current = c.mutateAsync;
3091
+ }), G(() => {
3092
+ let t = !0, i = null;
3093
+ return y.current({
3094
+ workspaceId: e,
3095
+ pinCode: r,
3096
+ endpointId: n
3097
+ }).then((e) => {
3098
+ if (!e.presenceRequired) {
3099
+ t && h(!0);
3100
+ return;
3101
+ }
3102
+ if (i = e.challengeId, !t) {
3103
+ v.current({ challengeId: e.challengeId });
3104
+ return;
3105
+ }
3106
+ d({
3107
+ challengeId: e.challengeId,
3108
+ codeDisplayed: e.codeDisplayed
3109
+ });
3110
+ }).catch((e) => {
3111
+ t && p(j(e));
3112
+ }), () => {
3113
+ t = !1, i != null && v.current({ challengeId: i });
3114
+ };
3115
+ }, [
3116
+ g,
3117
+ n,
3118
+ r,
3119
+ e
3120
+ ]), /* @__PURE__ */ Y(D, {
3121
+ open: !0,
3122
+ onOpenChange: (e) => {
3123
+ e || a();
3124
+ },
3125
+ children: /* @__PURE__ */ Y(E, { children: u == null ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(T, { children: [/* @__PURE__ */ Y(w, { children: o("endpoint_presence_title") }), /* @__PURE__ */ Y(C, { children: f ?? o(m ? "error_endpoint_presence_unavailable" : "endpoint_presence_waiting") })] }), /* @__PURE__ */ Y(S, { children: /* @__PURE__ */ Y(x, {
3126
+ type: "button",
3127
+ variant: "outline",
3128
+ onClick: () => {
3129
+ a();
3130
+ },
3131
+ children: o("action_cancel")
3132
+ }) })] }) : /* @__PURE__ */ Y(Ur, {
3133
+ endpointId: n,
3134
+ challengeId: u.challengeId,
3135
+ codeDisplayed: u.codeDisplayed,
3136
+ onClose: a,
3137
+ onDisconnected: async () => {
3138
+ await s.endpoint.listConnectedWorkspaces.invalidate({ endpointId: n }), await s.endpoint.list.invalidate();
3139
+ },
3140
+ onChallengeGone: () => {
3141
+ d(null), _((e) => e + 1);
3142
+ }
3143
+ }) })
3144
+ });
3145
+ }
3146
+ //#endregion
3147
+ //#region src/workspace/setup/endpoints/status-page.tsx
3148
+ var Gr = /* @__PURE__ */ e({ SetupEndpointStatusPage: () => Kr });
3149
+ function Kr({ workspaceId: e, endpointId: n, tab: a = "connection", onTabChange: o, programId: s, onProgramChange: c, onCreateParameter: l, resolveDeviceUiOrigin: u }) {
3150
+ let f = i(), p = r(), { mintDeviceUiTicket: m } = A(), h = t.endpoint.get.useQuery({ id: n }), [g, _] = q(null), v = k(), y = v != null && yt(v.access), S = Rt(h.data != null && Mt(h.data) ? n : null);
3151
+ return /* @__PURE__ */ Y(Oe, {
3152
+ query: {
3153
+ isLoading: h.isLoading,
3154
+ isError: h.isError && h.data == null,
3155
+ error: h.error,
3156
+ data: h.data
3157
+ },
3158
+ loading: /* @__PURE__ */ X("div", {
3159
+ className: "mx-auto flex w-full max-w-5xl flex-col gap-4 p-4",
3160
+ children: [
3161
+ /* @__PURE__ */ Y(O, { className: "h-8 w-64" }),
3162
+ /* @__PURE__ */ Y(O, { className: "h-24 w-full" }),
3163
+ /* @__PURE__ */ Y(O, { className: "h-96 w-full" })
3164
+ ]
3165
+ }),
3166
+ error: (e) => /* @__PURE__ */ Y(De, {
3167
+ className: "flex-1 justify-center p-8",
3168
+ message: j(e ?? "endpoint_not_found"),
3169
+ onRetry: () => h.refetch()
3170
+ }),
3171
+ children: (t) => {
3172
+ let r = m != null && t.publicKey != null, i = Mt(t), v = i, C = r && a === "device-ui" ? "device-ui" : v && a === "recorded" ? "recorded" : i && a === "programs" ? "programs" : "connection";
3173
+ return /* @__PURE__ */ X("div", {
3174
+ className: "flex size-full min-h-0 flex-col",
3175
+ children: [/* @__PURE__ */ Y(Ce, {
3176
+ icon: /* @__PURE__ */ Y(Ze, {}),
3177
+ breadcrumbs: /* @__PURE__ */ Y(Pe, {
3178
+ workspaceId: e,
3179
+ section: "endpoints"
3180
+ }),
3181
+ title: ht(t.name, p)
3182
+ }), /* @__PURE__ */ X("div", {
3183
+ className: d("mx-auto flex min-h-0 w-full flex-1 flex-col gap-4 p-4", C === "programs" ? "min-h-auto max-w-7xl" : "max-w-5xl"),
3184
+ children: [
3185
+ r || v ? /* @__PURE__ */ X("div", {
3186
+ className: "flex items-center justify-between gap-2",
3187
+ children: [/* @__PURE__ */ Y(Ee, {
3188
+ className: "min-w-0",
3189
+ value: C,
3190
+ onValueChange: (e) => {
3191
+ typeof e == "string" && (e === "connection" || e === "programs" || e === "recorded" || e === "device-ui") && o?.(e);
3192
+ },
3193
+ children: /* @__PURE__ */ X(Te, {
3194
+ variant: "line",
3195
+ children: [
3196
+ /* @__PURE__ */ Y(we, {
3197
+ value: "connection",
3198
+ children: f("endpoint_status_tab_connection")
3199
+ }),
3200
+ i ? /* @__PURE__ */ Y(we, {
3201
+ value: "programs",
3202
+ children: f("endpoint_status_tab_programs")
3203
+ }) : null,
3204
+ v ? /* @__PURE__ */ Y(we, {
3205
+ value: "recorded",
3206
+ children: f("endpoint_status_tab_recorded")
3207
+ }) : null,
3208
+ r ? /* @__PURE__ */ Y(we, {
3209
+ value: "device-ui",
3210
+ children: f("endpoint_status_tab_device_ui")
3211
+ }) : null
3212
+ ]
3213
+ })
3214
+ }), C === "device-ui" && g != null ? /* @__PURE__ */ X("a", {
3215
+ className: d("shrink-0", b({
3216
+ variant: "outline",
3217
+ size: "sm"
3218
+ })),
3219
+ href: g,
3220
+ target: "_blank",
3221
+ rel: "noreferrer",
3222
+ children: [/* @__PURE__ */ Y(rt, { "data-icon": "inline-start" }), f("endpoint_status_device_ui_open_window")]
3223
+ }) : null]
3224
+ }) : null,
3225
+ h.isError ? /* @__PURE__ */ Y(ke, {
3226
+ message: j(h.error),
3227
+ onRetry: () => h.refetch()
3228
+ }) : null,
3229
+ S.status?.state === "conflict" ? /* @__PURE__ */ X(U, {
3230
+ variant: "destructive",
3231
+ children: [
3232
+ /* @__PURE__ */ Y(Ye, {}),
3233
+ /* @__PURE__ */ Y(B, { children: f("edge_deploy_conflict_title") }),
3234
+ /* @__PURE__ */ Y(H, { children: f("edge_deploy_state_conflict_description") }),
3235
+ C === "connection" ? null : /* @__PURE__ */ Y(V, { children: /* @__PURE__ */ Y(x, {
3236
+ type: "button",
3237
+ variant: "outline",
3238
+ size: "sm",
3239
+ onClick: () => {
3240
+ o?.("connection");
3241
+ },
3242
+ children: f("edge_deploy_conflict_show_connection")
3243
+ }) })
3244
+ ]
3245
+ }) : null,
3246
+ v && C !== "device-ui" ? /* @__PURE__ */ Y(Bt, { endpointId: n }) : null,
3247
+ t.disabledSince != null && C === "connection" ? /* @__PURE__ */ X(U, { children: [
3248
+ /* @__PURE__ */ Y(Ye, {}),
3249
+ /* @__PURE__ */ Y(B, { children: f("endpoint_disabled_banner_title") }),
3250
+ /* @__PURE__ */ Y(H, { children: f("endpoint_disabled_since", { since: Q(t.disabledSince) }) })
3251
+ ] }) : null,
3252
+ C === "programs" ? /* @__PURE__ */ Y(zr, {
3253
+ workspaceId: e,
3254
+ endpointId: n,
3255
+ deploy: S,
3256
+ canEdit: y,
3257
+ ...s == null ? {} : { programId: s },
3258
+ onProgramChange: (e) => {
3259
+ c?.(e);
3260
+ }
3261
+ }) : C === "recorded" ? /* @__PURE__ */ Y(Br, {
3262
+ endpointId: n,
3263
+ ...l == null ? {} : { onCreateParameter: l }
3264
+ }) : C === "device-ui" && m != null ? /* @__PURE__ */ Y(an, {
3265
+ mintTicket: m,
3266
+ endpointId: n,
3267
+ kind: t.kind,
3268
+ onTicketUrl: _,
3269
+ ...u == null ? {} : { resolveDeviceUiOrigin: u }
3270
+ }) : /* @__PURE__ */ Y(Zt, {
3271
+ endpointId: n,
3272
+ endpoint: t,
3273
+ statusDetails: t.kind === "pin" ? /* @__PURE__ */ Y(Hr, {
3274
+ workspaceId: e,
3275
+ endpointId: n,
3276
+ pinCode: t.pinCode
3277
+ }) : null
3278
+ })
3279
+ ]
3280
+ })]
3281
+ });
3282
+ }
3283
+ });
3284
+ }
3285
+ //#endregion
3286
+ export { Gr as n, Kr as t };