@getontime/cli 4.0.2 → 4.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 (339) hide show
  1. package/client/assets/{Backstage-CAjkmeJm.js → Backstage-BhtXVpms.js} +2 -2
  2. package/client/assets/Backstage-BhtXVpms.js.br +0 -0
  3. package/client/assets/Backstage-BhtXVpms.js.gz +0 -0
  4. package/client/assets/{Backstage-CAjkmeJm.js.map → Backstage-BhtXVpms.js.map} +1 -1
  5. package/client/assets/{Countdown-ChuA9az_.js → Countdown-NmGi1KMx.js} +2 -2
  6. package/client/assets/Countdown-NmGi1KMx.js.br +0 -0
  7. package/client/assets/Countdown-NmGi1KMx.js.gz +0 -0
  8. package/client/assets/Countdown-NmGi1KMx.js.map +1 -0
  9. package/client/assets/{CustomTranslationModal-C3R_2T5s.js → CustomTranslationModal-BBNxpds0.js} +2 -2
  10. package/client/assets/CustomTranslationModal-BBNxpds0.js.br +0 -0
  11. package/client/assets/CustomTranslationModal-BBNxpds0.js.gz +0 -0
  12. package/client/assets/{CustomTranslationModal-C3R_2T5s.js.map → CustomTranslationModal-BBNxpds0.js.map} +1 -1
  13. package/client/assets/{DelayIndicator-vT7n8ypf.js → DelayIndicator-CFCDQ7FN.js} +2 -2
  14. package/client/assets/DelayIndicator-CFCDQ7FN.js.br +0 -0
  15. package/client/assets/DelayIndicator-CFCDQ7FN.js.gz +0 -0
  16. package/client/assets/{DelayIndicator-vT7n8ypf.js.map → DelayIndicator-CFCDQ7FN.js.map} +1 -1
  17. package/client/assets/{EditorFeatureWrapper-DHfuO3EA.js → EditorFeatureWrapper-D55c8JBz.js} +2 -2
  18. package/client/assets/EditorFeatureWrapper-D55c8JBz.js.br +0 -0
  19. package/client/assets/EditorFeatureWrapper-D55c8JBz.js.gz +0 -0
  20. package/client/assets/{EditorFeatureWrapper-DHfuO3EA.js.map → EditorFeatureWrapper-D55c8JBz.js.map} +1 -1
  21. package/client/assets/{EditorUtils-Da5ALK1P.js → EditorUtils-CFE106qQ.js} +2 -2
  22. package/client/assets/EditorUtils-CFE106qQ.js.br +0 -0
  23. package/client/assets/EditorUtils-CFE106qQ.js.gz +0 -0
  24. package/client/assets/{EditorUtils-Da5ALK1P.js.map → EditorUtils-CFE106qQ.js.map} +1 -1
  25. package/client/assets/{Empty-gWT_HMeu.js → Empty-C-JO_XAr.js} +2 -2
  26. package/client/assets/Empty-C-JO_XAr.js.br +2 -0
  27. package/client/assets/Empty-C-JO_XAr.js.gz +0 -0
  28. package/client/assets/{Empty-gWT_HMeu.js.map → Empty-C-JO_XAr.js.map} +1 -1
  29. package/client/assets/{EmptyPage-Dcbg6rmF.js → EmptyPage-BSzsxpGg.js} +2 -2
  30. package/client/assets/EmptyPage-BSzsxpGg.js.br +1 -0
  31. package/client/assets/EmptyPage-BSzsxpGg.js.gz +0 -0
  32. package/client/assets/{EmptyPage-Dcbg6rmF.js.map → EmptyPage-BSzsxpGg.js.map} +1 -1
  33. package/client/assets/{FollowButton-CSqJSvix.js → FollowButton-Mox6N4JW.js} +2 -2
  34. package/client/assets/FollowButton-Mox6N4JW.js.br +0 -0
  35. package/client/assets/FollowButton-Mox6N4JW.js.gz +0 -0
  36. package/client/assets/{FollowButton-CSqJSvix.js.map → FollowButton-Mox6N4JW.js.map} +1 -1
  37. package/client/assets/MessageControlExport-BL2ip9qN.js +2 -0
  38. package/client/assets/MessageControlExport-BL2ip9qN.js.br +0 -0
  39. package/client/assets/MessageControlExport-BL2ip9qN.js.gz +0 -0
  40. package/client/assets/{MessageControlExport-lXK21piH.js.map → MessageControlExport-BL2ip9qN.js.map} +1 -1
  41. package/client/assets/{MilestoneEditor-Bge8xLrV.js → MilestoneEditor-DcWPGKNK.js} +2 -2
  42. package/client/assets/MilestoneEditor-DcWPGKNK.js.br +0 -0
  43. package/client/assets/MilestoneEditor-DcWPGKNK.js.gz +0 -0
  44. package/client/assets/{MilestoneEditor-Bge8xLrV.js.map → MilestoneEditor-DcWPGKNK.js.map} +1 -1
  45. package/client/assets/Modal-D3tAPV2u.css +1 -0
  46. package/client/assets/Modal-D3tAPV2u.css.br +0 -0
  47. package/client/assets/Modal-D3tAPV2u.css.gz +0 -0
  48. package/client/assets/Modal-krcwDRb-.js +2 -0
  49. package/client/assets/Modal-krcwDRb-.js.br +0 -0
  50. package/client/assets/Modal-krcwDRb-.js.gz +0 -0
  51. package/client/assets/Modal-krcwDRb-.js.map +1 -0
  52. package/client/assets/{MultiPartProgressBar-D3jJZjb5.js → MultiPartProgressBar-BXQbpM-j.js} +2 -2
  53. package/client/assets/MultiPartProgressBar-BXQbpM-j.js.br +0 -0
  54. package/client/assets/MultiPartProgressBar-BXQbpM-j.js.gz +0 -0
  55. package/client/assets/{MultiPartProgressBar-D3jJZjb5.js.map → MultiPartProgressBar-BXQbpM-j.js.map} +1 -1
  56. package/client/assets/{OperatorExport-BUhxjLUx.js → OperatorExport-C50KHBrD.js} +2 -2
  57. package/client/assets/OperatorExport-C50KHBrD.js.br +0 -0
  58. package/client/assets/OperatorExport-C50KHBrD.js.gz +0 -0
  59. package/client/assets/{OperatorExport-BUhxjLUx.js.map → OperatorExport-C50KHBrD.js.map} +1 -1
  60. package/client/assets/OverviewWrapper-MGJ1uE5W.js +2 -0
  61. package/client/assets/OverviewWrapper-MGJ1uE5W.js.br +0 -0
  62. package/client/assets/OverviewWrapper-MGJ1uE5W.js.gz +0 -0
  63. package/client/assets/OverviewWrapper-MGJ1uE5W.js.map +1 -0
  64. package/client/assets/{ProjectInfo-z4k3cipS.js → ProjectInfo-CJ-GLvVG.js} +2 -2
  65. package/client/assets/ProjectInfo-CJ-GLvVG.js.br +0 -0
  66. package/client/assets/ProjectInfo-CJ-GLvVG.js.gz +0 -0
  67. package/client/assets/{ProjectInfo-z4k3cipS.js.map → ProjectInfo-CJ-GLvVG.js.map} +1 -1
  68. package/client/assets/{ProtectRoute-CrcWfOlG.js → ProtectRoute-DJ9xZnPI.js} +2 -2
  69. package/client/assets/ProtectRoute-DJ9xZnPI.js.br +0 -0
  70. package/client/assets/ProtectRoute-DJ9xZnPI.js.gz +0 -0
  71. package/client/assets/{ProtectRoute-CrcWfOlG.js.map → ProtectRoute-DJ9xZnPI.js.map} +1 -1
  72. package/client/assets/{ProtectedCuesheet-Deo4Aw6f.js → ProtectedCuesheet-B8tg6Mmo.js} +2 -2
  73. package/client/assets/ProtectedCuesheet-B8tg6Mmo.js.br +0 -0
  74. package/client/assets/ProtectedCuesheet-B8tg6Mmo.js.gz +0 -0
  75. package/client/assets/{ProtectedCuesheet-Deo4Aw6f.js.map → ProtectedCuesheet-B8tg6Mmo.js.map} +1 -1
  76. package/client/assets/ProtectedEditor-Bl4wV72N.js +3 -0
  77. package/client/assets/ProtectedEditor-Bl4wV72N.js.br +0 -0
  78. package/client/assets/ProtectedEditor-Bl4wV72N.js.gz +0 -0
  79. package/client/assets/ProtectedEditor-Bl4wV72N.js.map +1 -0
  80. package/client/assets/{RundownEntry-D61IqkXb.js → RundownEntry-D9tXNXPy.js} +2 -2
  81. package/client/assets/RundownEntry-D9tXNXPy.js.br +0 -0
  82. package/client/assets/RundownEntry-D9tXNXPy.js.gz +0 -0
  83. package/client/assets/{RundownEntry-D61IqkXb.js.map → RundownEntry-D9tXNXPy.js.map} +1 -1
  84. package/client/assets/RundownExport-D6uAmFbb.js +3 -0
  85. package/client/assets/RundownExport-D6uAmFbb.js.br +0 -0
  86. package/client/assets/RundownExport-D6uAmFbb.js.gz +0 -0
  87. package/client/assets/RundownExport-D6uAmFbb.js.map +1 -0
  88. package/client/assets/{Select-CedN80WS.js → Select-BLA-yQMq.js} +2 -2
  89. package/client/assets/Select-BLA-yQMq.js.br +0 -0
  90. package/client/assets/Select-BLA-yQMq.js.gz +0 -0
  91. package/client/assets/{Select-CedN80WS.js.map → Select-BLA-yQMq.js.map} +1 -1
  92. package/client/assets/{Studio-DUzPBS6P.js → Studio-DbP92DTf.js} +2 -2
  93. package/client/assets/Studio-DbP92DTf.js.br +0 -0
  94. package/client/assets/Studio-DbP92DTf.js.gz +0 -0
  95. package/client/assets/{Studio-DUzPBS6P.js.map → Studio-DbP92DTf.js.map} +1 -1
  96. package/client/assets/{StyleEditor-D2z65PB7.js → StyleEditor-DNjZ46Qf.js} +2 -2
  97. package/client/assets/StyleEditor-DNjZ46Qf.js.br +0 -0
  98. package/client/assets/StyleEditor-DNjZ46Qf.js.gz +0 -0
  99. package/client/assets/{StyleEditor-D2z65PB7.js.map → StyleEditor-DNjZ46Qf.js.map} +1 -1
  100. package/client/assets/{SuperscriptTime-CIrcMcyg.js → SuperscriptTime-C8ypTVpH.js} +2 -2
  101. package/client/assets/SuperscriptTime-C8ypTVpH.js.br +0 -0
  102. package/client/assets/SuperscriptTime-C8ypTVpH.js.gz +0 -0
  103. package/client/assets/{SuperscriptTime-CIrcMcyg.js.map → SuperscriptTime-C8ypTVpH.js.map} +1 -1
  104. package/client/assets/{TimeElements-CALNfv6u.js → TimeElements-DlEBhXe0.js} +2 -2
  105. package/client/assets/TimeElements-DlEBhXe0.js.br +0 -0
  106. package/client/assets/TimeElements-DlEBhXe0.js.gz +0 -0
  107. package/client/assets/{TimeElements-CALNfv6u.js.map → TimeElements-DlEBhXe0.js.map} +1 -1
  108. package/client/assets/{TimeInput-Dg1naiy3.js → TimeInput-DU09ewqh.js} +2 -2
  109. package/client/assets/TimeInput-DU09ewqh.js.br +0 -0
  110. package/client/assets/TimeInput-DU09ewqh.js.gz +0 -0
  111. package/client/assets/{TimeInput-Dg1naiy3.js.map → TimeInput-DU09ewqh.js.map} +1 -1
  112. package/client/assets/{TimelinePage-Cwm0svjN.js → TimelinePage-DTwqRihn.js} +2 -2
  113. package/client/assets/TimelinePage-DTwqRihn.js.br +0 -0
  114. package/client/assets/TimelinePage-DTwqRihn.js.gz +0 -0
  115. package/client/assets/{TimelinePage-Cwm0svjN.js.map → TimelinePage-DTwqRihn.js.map} +1 -1
  116. package/client/assets/{Timer-BvEmZbmF.css → Timer-B7nk3TMf.css} +1 -1
  117. package/client/assets/Timer-B7nk3TMf.css.br +0 -0
  118. package/client/assets/Timer-B7nk3TMf.css.gz +0 -0
  119. package/client/assets/{Timer-BVXskRjc.js → Timer-jjWAunJc.js} +2 -2
  120. package/client/assets/Timer-jjWAunJc.js.br +0 -0
  121. package/client/assets/Timer-jjWAunJc.js.gz +0 -0
  122. package/client/assets/{Timer-BVXskRjc.js.map → Timer-jjWAunJc.js.map} +1 -1
  123. package/client/assets/TimerControlExport-i0ZDpUx7.js +2 -0
  124. package/client/assets/TimerControlExport-i0ZDpUx7.js.br +0 -0
  125. package/client/assets/TimerControlExport-i0ZDpUx7.js.gz +0 -0
  126. package/client/assets/{TimerControlExport-C8ECtLBd.js.map → TimerControlExport-i0ZDpUx7.js.map} +1 -1
  127. package/client/assets/{TitleCard-CZl9wSHS.js → TitleCard-BgOtucv6.js} +2 -2
  128. package/client/assets/TitleCard-BgOtucv6.js.br +0 -0
  129. package/client/assets/TitleCard-BgOtucv6.js.gz +0 -0
  130. package/client/assets/{TitleCard-CZl9wSHS.js.map → TitleCard-BgOtucv6.js.map} +1 -1
  131. package/client/assets/{Tooltip-D9XRnwOW.js → Tooltip-C0rGHLsB.js} +2 -2
  132. package/client/assets/Tooltip-C0rGHLsB.js.br +0 -0
  133. package/client/assets/Tooltip-C0rGHLsB.js.gz +0 -0
  134. package/client/assets/{Tooltip-D9XRnwOW.js.map → Tooltip-C0rGHLsB.js.map} +1 -1
  135. package/client/assets/{ViewLogo-_3Z1hIHi.js → ViewLogo--9miplQv.js} +2 -2
  136. package/client/assets/ViewLogo--9miplQv.js.br +0 -0
  137. package/client/assets/ViewLogo--9miplQv.js.gz +0 -0
  138. package/client/assets/{ViewLogo-_3Z1hIHi.js.map → ViewLogo--9miplQv.js.map} +1 -1
  139. package/client/assets/{ViewParamsEditor-Bca1TIDW.js → ViewParamsEditor-BFu_0oIb.js} +2 -2
  140. package/client/assets/ViewParamsEditor-BFu_0oIb.js.br +0 -0
  141. package/client/assets/ViewParamsEditor-BFu_0oIb.js.gz +0 -0
  142. package/client/assets/{ViewParamsEditor-Bca1TIDW.js.map → ViewParamsEditor-BFu_0oIb.js.map} +1 -1
  143. package/client/assets/{dateConfig-DRQGMWDF.js → dateConfig-WYqMzV9D.js} +2 -2
  144. package/client/assets/dateConfig-WYqMzV9D.js.br +0 -0
  145. package/client/assets/dateConfig-WYqMzV9D.js.gz +0 -0
  146. package/client/assets/{dateConfig-DRQGMWDF.js.map → dateConfig-WYqMzV9D.js.map} +1 -1
  147. package/client/assets/{editorSettings-BU0pTMSY.js → editorSettings-CCHx-wCx.js} +2 -2
  148. package/client/assets/editorSettings-CCHx-wCx.js.br +0 -0
  149. package/client/assets/editorSettings-CCHx-wCx.js.gz +0 -0
  150. package/client/assets/{editorSettings-BU0pTMSY.js.map → editorSettings-CCHx-wCx.js.map} +1 -1
  151. package/client/assets/{getProgress-Cw79NL_O.js → getProgress-B94Ieskb.js} +2 -2
  152. package/client/assets/getProgress-B94Ieskb.js.br +0 -0
  153. package/client/assets/getProgress-B94Ieskb.js.gz +0 -0
  154. package/client/assets/{getProgress-Cw79NL_O.js.map → getProgress-B94Ieskb.js.map} +1 -1
  155. package/client/assets/{index-BQEUaoAf.js → index-njXwwjfn.js} +3 -3
  156. package/client/assets/index-njXwwjfn.js.br +0 -0
  157. package/client/assets/index-njXwwjfn.js.gz +0 -0
  158. package/client/assets/{index-BQEUaoAf.js.map → index-njXwwjfn.js.map} +1 -1
  159. package/client/assets/{offset-DJAHqjFW.js → offset-D1q-72D-.js} +2 -2
  160. package/client/assets/offset-D1q-72D-.js.br +0 -0
  161. package/client/assets/offset-D1q-72D-.js.gz +0 -0
  162. package/client/assets/{offset-DJAHqjFW.js.map → offset-D1q-72D-.js.map} +1 -1
  163. package/client/assets/{parseUserTime-BeTKj08M.js → parseUserTime-Bc1pSJR2.js} +2 -2
  164. package/client/assets/parseUserTime-Bc1pSJR2.js.br +0 -0
  165. package/client/assets/parseUserTime-Bc1pSJR2.js.gz +0 -0
  166. package/client/assets/{parseUserTime-BeTKj08M.js.map → parseUserTime-Bc1pSJR2.js.map} +1 -1
  167. package/client/assets/{playbackstate-B_khF6xU.js → playbackstate-BpzbtG9F.js} +2 -2
  168. package/client/assets/playbackstate-BpzbtG9F.js.br +0 -0
  169. package/client/assets/playbackstate-BpzbtG9F.js.gz +0 -0
  170. package/client/assets/{playbackstate-B_khF6xU.js.map → playbackstate-BpzbtG9F.js.map} +1 -1
  171. package/client/assets/{presentation.utils-KwY-ACf7.js → presentation.utils-B2baBe3j.js} +2 -2
  172. package/client/assets/presentation.utils-B2baBe3j.js.br +0 -0
  173. package/client/assets/presentation.utils-B2baBe3j.js.gz +0 -0
  174. package/client/assets/{presentation.utils-KwY-ACf7.js.map → presentation.utils-B2baBe3j.js.map} +1 -1
  175. package/client/assets/{rundownUtils-BZHazkXR.js → rundownUtils-H6xvQyre.js} +2 -2
  176. package/client/assets/rundownUtils-H6xvQyre.js.br +0 -0
  177. package/client/assets/rundownUtils-H6xvQyre.js.gz +0 -0
  178. package/client/assets/{rundownUtils-BZHazkXR.js.map → rundownUtils-H6xvQyre.js.map} +1 -1
  179. package/client/assets/{useCustomFields-DqCYz8Kt.js → useCustomFields-Da0Li7nQ.js} +2 -2
  180. package/client/assets/useCustomFields-Da0Li7nQ.js.br +0 -0
  181. package/client/assets/useCustomFields-Da0Li7nQ.js.gz +0 -0
  182. package/client/assets/{useCustomFields-DqCYz8Kt.js.map → useCustomFields-Da0Li7nQ.js.map} +1 -1
  183. package/client/assets/{useFollowComponent-Ctfhf2or.js → useFollowComponent-Qo3FobyV.js} +2 -2
  184. package/client/assets/useFollowComponent-Qo3FobyV.js.br +0 -0
  185. package/client/assets/useFollowComponent-Qo3FobyV.js.gz +0 -0
  186. package/client/assets/{useFollowComponent-Ctfhf2or.js.map → useFollowComponent-Qo3FobyV.js.map} +1 -1
  187. package/client/assets/{useProjectData-C1hVamxc.js → useProjectData-DW06zQvF.js} +2 -2
  188. package/client/assets/useProjectData-DW06zQvF.js.br +0 -0
  189. package/client/assets/useProjectData-DW06zQvF.js.gz +0 -0
  190. package/client/assets/{useProjectData-C1hVamxc.js.map → useProjectData-DW06zQvF.js.map} +1 -1
  191. package/client/assets/{useReport-B4dMYcNL.js → useReport-DhFY2L8v.js} +2 -2
  192. package/client/assets/useReport-DhFY2L8v.js.br +0 -0
  193. package/client/assets/useReport-DhFY2L8v.js.gz +0 -0
  194. package/client/assets/{useReport-B4dMYcNL.js.map → useReport-DhFY2L8v.js.map} +1 -1
  195. package/client/assets/useRundown-ihoU8qBi.js +2 -0
  196. package/client/assets/useRundown-ihoU8qBi.js.br +0 -0
  197. package/client/assets/useRundown-ihoU8qBi.js.gz +0 -0
  198. package/client/assets/useRundown-ihoU8qBi.js.map +1 -0
  199. package/client/assets/{useWindowTitle-DqdFTWns.js → useWindowTitle-B2UzPuki.js} +2 -2
  200. package/client/assets/useWindowTitle-B2UzPuki.js.br +0 -0
  201. package/client/assets/useWindowTitle-B2UzPuki.js.gz +0 -0
  202. package/client/assets/{useWindowTitle-DqdFTWns.js.map → useWindowTitle-B2UzPuki.js.map} +1 -1
  203. package/client/assets/{validateEvent-P9sf7C10.js → validateEvent-BJMwP_mq.js} +2 -2
  204. package/client/assets/validateEvent-BJMwP_mq.js.br +0 -0
  205. package/client/assets/validateEvent-BJMwP_mq.js.gz +0 -0
  206. package/client/assets/{validateEvent-P9sf7C10.js.map → validateEvent-BJMwP_mq.js.map} +1 -1
  207. package/client/assets/{vendor-CCiSQ9k9.js → vendor-9UkPSc5K.js} +3 -3
  208. package/client/assets/vendor-9UkPSc5K.js.br +0 -0
  209. package/client/assets/vendor-9UkPSc5K.js.gz +0 -0
  210. package/client/assets/{vendor-CCiSQ9k9.js.map → vendor-9UkPSc5K.js.map} +1 -1
  211. package/client/assets/{viewLoader.utils-CmM-4-pk.js → viewLoader.utils-DQGhrjSp.js} +2 -2
  212. package/client/assets/viewLoader.utils-DQGhrjSp.js.br +0 -0
  213. package/client/assets/viewLoader.utils-DQGhrjSp.js.gz +0 -0
  214. package/client/assets/{viewLoader.utils-CmM-4-pk.js.map → viewLoader.utils-DQGhrjSp.js.map} +1 -1
  215. package/client/index.html +2 -2
  216. package/package.json +1 -1
  217. package/server/index.cjs +82 -82
  218. package/client/assets/Backstage-CAjkmeJm.js.br +0 -0
  219. package/client/assets/Backstage-CAjkmeJm.js.gz +0 -0
  220. package/client/assets/Countdown-ChuA9az_.js.br +0 -0
  221. package/client/assets/Countdown-ChuA9az_.js.gz +0 -0
  222. package/client/assets/Countdown-ChuA9az_.js.map +0 -1
  223. package/client/assets/CustomTranslationModal-C3R_2T5s.js.br +0 -0
  224. package/client/assets/CustomTranslationModal-C3R_2T5s.js.gz +0 -0
  225. package/client/assets/DelayIndicator-vT7n8ypf.js.br +0 -0
  226. package/client/assets/DelayIndicator-vT7n8ypf.js.gz +0 -0
  227. package/client/assets/EditorFeatureWrapper-DHfuO3EA.js.br +0 -0
  228. package/client/assets/EditorFeatureWrapper-DHfuO3EA.js.gz +0 -0
  229. package/client/assets/EditorUtils-Da5ALK1P.js.br +0 -0
  230. package/client/assets/EditorUtils-Da5ALK1P.js.gz +0 -0
  231. package/client/assets/Empty-gWT_HMeu.js.br +0 -0
  232. package/client/assets/Empty-gWT_HMeu.js.gz +0 -0
  233. package/client/assets/EmptyPage-Dcbg6rmF.js.br +0 -0
  234. package/client/assets/EmptyPage-Dcbg6rmF.js.gz +0 -0
  235. package/client/assets/FollowButton-CSqJSvix.js.br +0 -0
  236. package/client/assets/FollowButton-CSqJSvix.js.gz +0 -0
  237. package/client/assets/MessageControlExport-lXK21piH.js +0 -2
  238. package/client/assets/MessageControlExport-lXK21piH.js.br +0 -0
  239. package/client/assets/MessageControlExport-lXK21piH.js.gz +0 -0
  240. package/client/assets/MilestoneEditor-Bge8xLrV.js.br +0 -0
  241. package/client/assets/MilestoneEditor-Bge8xLrV.js.gz +0 -0
  242. package/client/assets/Modal-BgJx3SNK.css +0 -1
  243. package/client/assets/Modal-BgJx3SNK.css.br +0 -0
  244. package/client/assets/Modal-BgJx3SNK.css.gz +0 -0
  245. package/client/assets/Modal-C2sFA0zf.js +0 -2
  246. package/client/assets/Modal-C2sFA0zf.js.br +0 -0
  247. package/client/assets/Modal-C2sFA0zf.js.gz +0 -0
  248. package/client/assets/Modal-C2sFA0zf.js.map +0 -1
  249. package/client/assets/MultiPartProgressBar-D3jJZjb5.js.br +0 -0
  250. package/client/assets/MultiPartProgressBar-D3jJZjb5.js.gz +0 -0
  251. package/client/assets/OperatorExport-BUhxjLUx.js.br +0 -0
  252. package/client/assets/OperatorExport-BUhxjLUx.js.gz +0 -0
  253. package/client/assets/OverviewWrapper-BveJ6GjK.js +0 -2
  254. package/client/assets/OverviewWrapper-BveJ6GjK.js.br +0 -0
  255. package/client/assets/OverviewWrapper-BveJ6GjK.js.gz +0 -0
  256. package/client/assets/OverviewWrapper-BveJ6GjK.js.map +0 -1
  257. package/client/assets/ProjectInfo-z4k3cipS.js.br +0 -0
  258. package/client/assets/ProjectInfo-z4k3cipS.js.gz +0 -0
  259. package/client/assets/ProtectRoute-CrcWfOlG.js.br +0 -0
  260. package/client/assets/ProtectRoute-CrcWfOlG.js.gz +0 -0
  261. package/client/assets/ProtectedCuesheet-Deo4Aw6f.js.br +0 -0
  262. package/client/assets/ProtectedCuesheet-Deo4Aw6f.js.gz +0 -0
  263. package/client/assets/ProtectedEditor-C_SYWpL2.js +0 -3
  264. package/client/assets/ProtectedEditor-C_SYWpL2.js.br +0 -0
  265. package/client/assets/ProtectedEditor-C_SYWpL2.js.gz +0 -0
  266. package/client/assets/ProtectedEditor-C_SYWpL2.js.map +0 -1
  267. package/client/assets/RundownEntry-D61IqkXb.js.br +0 -0
  268. package/client/assets/RundownEntry-D61IqkXb.js.gz +0 -0
  269. package/client/assets/RundownExport-C6YhMGOC.js +0 -3
  270. package/client/assets/RundownExport-C6YhMGOC.js.br +0 -0
  271. package/client/assets/RundownExport-C6YhMGOC.js.gz +0 -0
  272. package/client/assets/RundownExport-C6YhMGOC.js.map +0 -1
  273. package/client/assets/Select-CedN80WS.js.br +0 -0
  274. package/client/assets/Select-CedN80WS.js.gz +0 -0
  275. package/client/assets/Studio-DUzPBS6P.js.br +0 -0
  276. package/client/assets/Studio-DUzPBS6P.js.gz +0 -0
  277. package/client/assets/StyleEditor-D2z65PB7.js.br +0 -0
  278. package/client/assets/StyleEditor-D2z65PB7.js.gz +0 -0
  279. package/client/assets/SuperscriptTime-CIrcMcyg.js.br +0 -0
  280. package/client/assets/SuperscriptTime-CIrcMcyg.js.gz +0 -0
  281. package/client/assets/TimeElements-CALNfv6u.js.br +0 -0
  282. package/client/assets/TimeElements-CALNfv6u.js.gz +0 -0
  283. package/client/assets/TimeInput-Dg1naiy3.js.br +0 -0
  284. package/client/assets/TimeInput-Dg1naiy3.js.gz +0 -0
  285. package/client/assets/TimelinePage-Cwm0svjN.js.br +0 -0
  286. package/client/assets/TimelinePage-Cwm0svjN.js.gz +0 -0
  287. package/client/assets/Timer-BVXskRjc.js.br +0 -0
  288. package/client/assets/Timer-BVXskRjc.js.gz +0 -0
  289. package/client/assets/Timer-BvEmZbmF.css.br +0 -0
  290. package/client/assets/Timer-BvEmZbmF.css.gz +0 -0
  291. package/client/assets/TimerControlExport-C8ECtLBd.js +0 -2
  292. package/client/assets/TimerControlExport-C8ECtLBd.js.br +0 -0
  293. package/client/assets/TimerControlExport-C8ECtLBd.js.gz +0 -0
  294. package/client/assets/TitleCard-CZl9wSHS.js.br +0 -0
  295. package/client/assets/TitleCard-CZl9wSHS.js.gz +0 -0
  296. package/client/assets/Tooltip-D9XRnwOW.js.br +0 -4
  297. package/client/assets/Tooltip-D9XRnwOW.js.gz +0 -0
  298. package/client/assets/ViewLogo-_3Z1hIHi.js.br +0 -0
  299. package/client/assets/ViewLogo-_3Z1hIHi.js.gz +0 -0
  300. package/client/assets/ViewParamsEditor-Bca1TIDW.js.br +0 -0
  301. package/client/assets/ViewParamsEditor-Bca1TIDW.js.gz +0 -0
  302. package/client/assets/dateConfig-DRQGMWDF.js.br +0 -0
  303. package/client/assets/dateConfig-DRQGMWDF.js.gz +0 -0
  304. package/client/assets/editorSettings-BU0pTMSY.js.br +0 -0
  305. package/client/assets/editorSettings-BU0pTMSY.js.gz +0 -0
  306. package/client/assets/getProgress-Cw79NL_O.js.br +0 -0
  307. package/client/assets/getProgress-Cw79NL_O.js.gz +0 -0
  308. package/client/assets/index-BQEUaoAf.js.br +0 -0
  309. package/client/assets/index-BQEUaoAf.js.gz +0 -0
  310. package/client/assets/offset-DJAHqjFW.js.br +0 -0
  311. package/client/assets/offset-DJAHqjFW.js.gz +0 -0
  312. package/client/assets/parseUserTime-BeTKj08M.js.br +0 -0
  313. package/client/assets/parseUserTime-BeTKj08M.js.gz +0 -0
  314. package/client/assets/playbackstate-B_khF6xU.js.br +0 -0
  315. package/client/assets/playbackstate-B_khF6xU.js.gz +0 -0
  316. package/client/assets/presentation.utils-KwY-ACf7.js.br +0 -0
  317. package/client/assets/presentation.utils-KwY-ACf7.js.gz +0 -0
  318. package/client/assets/rundownUtils-BZHazkXR.js.br +0 -0
  319. package/client/assets/rundownUtils-BZHazkXR.js.gz +0 -0
  320. package/client/assets/useCustomFields-DqCYz8Kt.js.br +0 -0
  321. package/client/assets/useCustomFields-DqCYz8Kt.js.gz +0 -0
  322. package/client/assets/useFollowComponent-Ctfhf2or.js.br +0 -0
  323. package/client/assets/useFollowComponent-Ctfhf2or.js.gz +0 -0
  324. package/client/assets/useProjectData-C1hVamxc.js.br +0 -0
  325. package/client/assets/useProjectData-C1hVamxc.js.gz +0 -0
  326. package/client/assets/useReport-B4dMYcNL.js.br +0 -0
  327. package/client/assets/useReport-B4dMYcNL.js.gz +0 -0
  328. package/client/assets/useRundown-BfpjcCEJ.js +0 -2
  329. package/client/assets/useRundown-BfpjcCEJ.js.br +0 -0
  330. package/client/assets/useRundown-BfpjcCEJ.js.gz +0 -0
  331. package/client/assets/useRundown-BfpjcCEJ.js.map +0 -1
  332. package/client/assets/useWindowTitle-DqdFTWns.js.br +0 -0
  333. package/client/assets/useWindowTitle-DqdFTWns.js.gz +0 -0
  334. package/client/assets/validateEvent-P9sf7C10.js.br +0 -3
  335. package/client/assets/validateEvent-P9sf7C10.js.gz +0 -0
  336. package/client/assets/vendor-CCiSQ9k9.js.br +0 -0
  337. package/client/assets/vendor-CCiSQ9k9.js.gz +0 -0
  338. package/client/assets/viewLoader.utils-CmM-4-pk.js.br +0 -0
  339. package/client/assets/viewLoader.utils-CmM-4-pk.js.gz +0 -0
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CustomTranslationModal-BBNxpds0.js","./vendor-9UkPSc5K.js","./vendor-4xP-6xVS.css","./index-njXwwjfn.js","./index-De0uf0Ta.css","./useWindowTitle-B2UzPuki.js","./useWindowTitle-DrFGLRMI.css","./Modal-krcwDRb-.js","./useProjectData-DW06zQvF.js","./useProjectData-Cw1aXCwD.css","./Modal-D3tAPV2u.css","./StyleEditor-DNjZ46Qf.js","./StyleEditor-Bie84LSc.css","./RundownExport-D6uAmFbb.js","./EditorUtils-CFE106qQ.js","./EditorUtils-BXko-IuN.css","./ProtectRoute-DJ9xZnPI.js","./ProtectRoute-Bm5sjStK.css","./useRundown-ihoU8qBi.js","./MilestoneEditor-DcWPGKNK.js","./TimeInput-DU09ewqh.js","./parseUserTime-Bc1pSJR2.js","./TimeInput-BrVdiuOQ.css","./dateConfig-WYqMzV9D.js","./validateEvent-BJMwP_mq.js","./editorSettings-CCHx-wCx.js","./editorSettings-BqHbWs9b.css","./rundownUtils-H6xvQyre.js","./useCustomFields-Da0Li7nQ.js","./Select-BLA-yQMq.js","./Select-Cd08aEcf.css","./Tooltip-C0rGHLsB.js","./Tooltip-CKb7gU2M.css","./offset-D1q-72D-.js","./MilestoneEditor-906SVj5M.css","./Empty-C-JO_XAr.js","./Empty-DvR62o5B.css","./useFollowComponent-Qo3FobyV.js","./RundownExport-1zBZurIG.css","./TimerControlExport-i0ZDpUx7.js","./useReport-DhFY2L8v.js","./Editor.module-DvV2efYs.js","./Editor-B_NlyOLw.css","./TimerControlExport-D8kqHQB0.css","./MessageControlExport-BL2ip9qN.js","./MessageControlExport-DPgqVb-4.css"])))=>i.map(i=>d[i]);
2
+ import{h as j,j as e,ac as Zt,e as Y,k as St,ad as ce,ae as Ns,af as Os,ag as et,ah as he,T as xe,aa as nt,ai as Ts,x as es,aj as As,ak as Ft,f as Fs,O as Ct,A as Is,al as Ls,am as $s,an as He,ao as Vs,P as Ue,C as Ee,ap as ts,aq as ss,ar as Ws,as as ns,at as It,au as Ms,l as rs,av as qs,$ as Qe,t as _t,aw as Us,v as zs,M as Bs,I as Ks,m as Gs}from"./vendor-9UkPSc5K.js";import{P as Hs}from"./ProtectRoute-DJ9xZnPI.js";import{i as ye,N as kt,Q as Qs,R as Ys,S as tt,r as Js,U as Xs,V as Pe,W as Ze,X as E,Y as We,Z as Ae,_ as N,$ as te,a0 as Q,a1 as gt,a2 as Zs,a3 as en,a4 as Dt,a5 as tn,a6 as as,a7 as F,B as f,a8 as ie,a9 as we,aa as Le,ab as ve,ac as oe,ad as M,ae as B,af as W,ag as V,ah as $e,ai as X,aj as be,ak as rt,al as sn,am as nn,an as Rt,g as Oe,ao as is,ap as Et,aq as ls,ar as ne,O as Re,as as rn,at as Lt,au as os,av as cs,aw as Pt,ax as an,ay as ln,az as Nt,aA as ct,y as Ie,l as on,aB as cn,aC as dn,aD as ge,aE as ds,aF as ft,T as Ye,aG as un,aH as us,aI as $t,aJ as hn,aK as mn,aL as xn,aM as Me,aN as jn,aO as pn,d as gn,aP as fn,K as yn,aQ as vn,aR as bn,aS as wn,c as Sn,aT as Cn,aU as _n,aV as Vt,aW as kn,aX as Wt,aY as Dn,aZ as Rn}from"./index-njXwwjfn.js";import{I as me,C as En,u as Pn}from"./useWindowTitle-B2UzPuki.js";import{e as Nn,u as at,T as G,t as dt,a as On,b as Tn,d as An,c as Fn,f as In,g as Ln,S as $n,h as Vn,D as hs,M as it}from"./Modal-krcwDRb-.js";import{S as ke,u as Wn,a as Mn,b as qn,c as ut}from"./useProjectData-DW06zQvF.js";import{i as ms,R as xs,s as Un,G as zn,a as Bn,O as Kn,T as Gn}from"./OverviewWrapper-MGJ1uE5W.js";import{e as Hn,f as Qn,g as Yn,i as js,h as ps,j as Jn,k as Xn,l as Zn,m as er,r as tr,n as sr,o as nr,p as rr,q as ar}from"./useRundown-ihoU8qBi.js";import{S as re}from"./Select-BLA-yQMq.js";import{u as lt,p as ir,e as lr,d as or}from"./useCustomFields-Da0Li7nQ.js";import{u as cr,d as dr}from"./useReport-DhFY2L8v.js";import{T as yt,u as gs,e as Be}from"./editorSettings-CCHx-wCx.js";import{S as ur,L as hr,T as mr}from"./EditorUtils-CFE106qQ.js";import{T as fs}from"./Tooltip-C0rGHLsB.js";import{A as ys,T as Ke}from"./TimeInput-DU09ewqh.js";import{T as Mt,E as ht}from"./validateEvent-BJMwP_mq.js";import{p as Ge}from"./parseUserTime-Bc1pSJR2.js";import{S as xr,P as jr,O as pr,M as gr,C as fr}from"./TimeElements-DlEBhXe0.js";import{s as mt}from"./Editor.module-DvV2efYs.js";import"./offset-D1q-72D-.js";import"./playbackstate-BpzbtG9F.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof wt<"u"?wt:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="e8109060-6198-4c49-ae82-470e7c258b6e",t._sentryDebugIdIdentifier="sentry-dbid-e8109060-6198-4c49-ae82-470e7c258b6e")}catch{}})();function yr(t){return t.trim().replaceAll(" ","_")}const vr={worksheet:"event schedule",flag:"flag",timeStart:"time start",linkStart:"link start",timeEnd:"time end",duration:"duration",cue:"cue",title:"title",countToEnd:"count to end",skip:"skip",note:"note",colour:"colour",endAction:"end action",timerType:"timer type",timeWarning:"warning time",timeDanger:"danger time",custom:{},id:"id"},br=(t,s,n={})=>{const{isDisabled:r=!1}=n,i=j.useCallback(l=>{l.key===s&&!l.repeat&&!r&&(l.preventDefault(),t())},[t,r,s]);j.useEffect(()=>(document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}),[i])},wr="_link_70oau_17",Sr="_inline_70oau_27",qt={link:wr,inline:Sr};function se({href:t,inline:s,children:n}){const r=i=>{i.preventDefault(),kt(t)};return e.jsxs("a",{href:"#!",target:"_blank",rel:"noreferrer",className:ye([qt.link,s&&qt.inline]),onClick:r,children:[n," ",e.jsx(Zt,{style:{fontSize:"1em"}})]})}async function Cr(){const t=await Y.get(Qs);return{url:t.data.html_url,version:t.data.tag_name}}const Ut={url:"",version:"",hasUpdates:!1};function vs(){const{data:t,status:s,isFetching:n,isError:r,refetch:i}=St({queryKey:Xs,queryFn:Cr,placeholderData:(c,m)=>c,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,staleTime:Js,enabled:tt}),l=(t==null?void 0:t.version)&&!t.version.includes(Ys);return{data:t?{...t,hasUpdates:l}:Ut,placeholder:Ut,status:s,isFetching:n,isError:r,refetch:i}}function _r(){const{data:t,isError:s}=vs();return s?e.jsxs(Pe,{children:[`You are currently using Ontime version ${Ze}`,e.jsx(E,{children:`Could not fetch version information: ${s}`})]}):t.hasUpdates?e.jsxs(Pe,{children:[`You are currently using Ontime version ${Ze}.`,e.jsx("br",{}),e.jsx("br",{}),`A new version ${t.version} is available.`," ",e.jsx("br",{}),We?"You can restart your stage to get the latest available version.":e.jsx(se,{href:t.url,children:"Please visit the release page to download"})]}):e.jsx(Pe,{children:`You are currently using the latest version of Ontime: ${Ze}`})}function kr(){return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"About Ontime"}),e.jsxs(N,{children:[e.jsxs(te,{children:[e.jsx(Q,{children:"Ontime"}),e.jsxs(Pe,{children:["Free, open-source software for managing rundowns and event timers",e.jsx(se,{href:gt,children:"www.getontime.no"})]}),e.jsxs(Pe,{children:["Considering sponsoring our work",e.jsx(se,{href:Zs,children:"GitHub Sponsors"}),e.jsx(se,{href:en,children:"Buy Me a Coffee"})]}),e.jsxs(Pe,{children:["If you are looking for an online version of Ontime, consider trying out our cloud service",e.jsx(se,{href:gt,children:"www.getontime.no"})]})]}),e.jsx(Q,{children:"Current version"}),e.jsx(_r,{}),e.jsx(Q,{children:"Links"}),e.jsx(se,{href:Dt,children:"Read the docs"}),e.jsx(se,{href:tn,children:"Follow the project on GitHub"}),e.jsx(se,{href:as,children:"Discord server"})]})]})}function ae(t,s){const n=j.useRef(null);return j.useEffect(()=>{s&&n.current&&s===t&&n.current.scrollIntoView({behavior:"smooth",block:"center"})},[s,t]),n}const Dr="https://docs.getontime.no/api/protocols/osc/";function Rr({enabledAutomations:t,enabledOscIn:s,oscPortIn:n}){var y,b,v;const{handleSubmit:r,reset:i,register:l,setError:a,watch:c,setValue:m,formState:{errors:o,isSubmitting:h,isDirty:u,isValid:d}}=ce({mode:"onChange",defaultValues:{enabledAutomations:t,enabledOscIn:s,oscPortIn:n},resetOptions:{keepDirtyValues:!1}}),x=async w=>{try{await Nn(w),i(w)}catch($){const R=V($);a("root",{message:R})}},p=()=>{i({enabledAutomations:t,enabledOscIn:s,oscPortIn:n})},g=!h&&u&&d;return e.jsxs(te,{children:[e.jsxs(Q,{children:["Automation settings",e.jsxs(F,{children:[e.jsx(f,{variant:"ghosted",onClick:p,disabled:!g,children:"Revert to saved"}),e.jsx(f,{variant:"primary",type:"submit",form:"automation-settings-form",disabled:!g,loading:h,children:"Save"})]})]}),(o==null?void 0:o.root)&&e.jsx(E,{children:o.root.message}),e.jsx(ie,{}),e.jsx(N,{children:e.jsxs(me,{children:[e.jsx("p",{children:"Control Ontime and share its data with external systems in your workflow."}),e.jsx("p",{children:"- Automations allow Ontime to send its data on lifecycle triggers."}),e.jsx("p",{children:"- OSC Input tells Ontime to listen to messages on the specific port."}),e.jsx("br",{}),e.jsx(se,{href:Dr,children:"See the docs"})]})}),e.jsxs(N,{as:"form",id:"automation-settings-form",onSubmit:r(x),onKeyDown:w=>we(w,p),children:[e.jsx(Le,{isLoading:!1}),e.jsx(ve,{children:"Automation"}),e.jsx(oe,{children:e.jsxs(M,{children:[e.jsx(B,{title:"Enable automations",description:"Allow Ontime to send messages on lifecycle triggers",error:(y=o.enabledAutomations)==null?void 0:y.message}),e.jsx(ke,{size:"large",checked:c("enabledAutomations"),onCheckedChange:w=>m("enabledAutomations",w,{shouldDirty:!0,shouldValidate:!0})})]})}),e.jsx(ve,{children:"OSC Input"}),e.jsxs(oe,{children:[We&&e.jsx(me,{children:"For security reasons OSC integrations are not available in the cloud service."}),e.jsxs(M,{children:[e.jsx(B,{title:"OSC input",description:"Allow control of Ontime through OSC",error:(b=o.enabledOscIn)==null?void 0:b.message}),e.jsx(ke,{size:"large",checked:c("enabledOscIn"),onCheckedChange:w=>m("enabledOscIn",w,{shouldDirty:!0,shouldValidate:!0})})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Listen on port",description:"Port for incoming OSC. Default: 8888",error:(v=o.oscPortIn)==null?void 0:v.message}),e.jsx(W,{id:"oscPortIn",placeholder:"8888",maxLength:5,style:{textAlign:"right",width:"5rem"},type:"number",fluid:!0,...l("oscPortIn",{required:{value:!0,message:"Required field"},max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"},pattern:{value:ms,message:"Value should be numeric"}})})]})]})]})]})}const Er=["{{human.clock}}","{{human.duration}}","{{human.expectedEnd}}","{{human.runningTimer}}","{{human.elapsedTime}}","{{human.startedAt}}"],Pr=["{{clock}}","{{timer.addedTime}}","{{timer.current}}","{{timer.duration}}","{{timer.elapsed}}","{{timer.expectedFinish}}","{{timer.secondaryTimer}}","{{timer.startedAt}}","{{rundown.selectedEventIndex}}","{{rundown.numEvents}}","{{rundown.plannedStart}}","{{rundown.plannedEnd}}","{{rundown.actualStart}}","{{offset.absolute}}","{{offset.relative}}","{{offset.expectedRundownEnd}}","{{offset.expectedGroupEnd}}","{{offset.expectedFlagStart}}"],Nr=["{{eventNow.id}}","{{eventNow.cue}}","{{eventNow.title}}","{{eventNow.note}}","{{eventNow.timeStart}}","{{eventNow.timeEnd}}","{{eventNow.duration}}","{{eventNow.colour}}","{{eventNow.delay}}"],Or=["{{eventNext.id}}","{{eventNext.cue}}","{{eventNext.title}}","{{eventNext.note}}","{{eventNext.timeStart}}","{{eventNext.timeEnd}}","{{eventNext.duration}}","{{eventNext.colour}}","{{eventNext.delay}}"];function Tr(t){return[...Er,...Pr,...Nr,...Object.entries(t).map(([s])=>`{{eventNow.custom.${s}}}`),...Or,...Object.entries(t).map(([s])=>`{{eventNext.custom.${s}}}`)]}function Ar(t,s){if(t===s)return"";if(t.endsWith("{{")&&s.startsWith("{{"))return s.substring(2);if(t.endsWith("{")&&s.startsWith("{{"))return s.substring(1);for(let n=0;n<s.length;n++){const r=s.substring(0,n+1);if(t.endsWith(r))return s.substring(n+1)}return""}function Fr(t){const s=t.lastIndexOf("{{");return s!==-1?t.slice(s):""}const Ir="_wrapper_11839_17",Lr="_suggestions_11839_21",zt={wrapper:Ir,suggestions:Lr},$r=j.forwardRef(function(s,n){const{value:r,onChange:i,...l}=s,{data:a}=lt(),c=Ns(()=>p(!1)),m=j.useMemo(()=>Tr(a),[a]),[o,h]=j.useState(r||""),[u,d]=j.useState([]),[x,p]=j.useState(!1),g=v=>{const w=Fr(v);return m.filter($=>$.startsWith(w))},y=v=>{h(v.target.value),v.target.value.endsWith("{")?(p(!0),d(g(v.target.value))):v.target.value===""||v.target.value.endsWith("}}")?p(!1):x&&d(g(v.target.value)),i==null||i(v)},b=v=>{h(w=>{const $=Ar(w,v);return w+$}),p(!1)};return e.jsxs("div",{className:zt.wrapper,ref:Os(c,n),children:[e.jsx(W,{value:o,...l,onChange:y,fluid:!0}),x&&u.length>0&&e.jsx("ul",{className:zt.suggestions,children:u.map(v=>e.jsx("li",{onClick:()=>b(v),children:v},v))})]})}),vt=[{id:1,label:"On Load",value:"onLoad"},{id:2,label:"On Start",value:"onStart"},{id:3,label:"On Pause",value:"onPause"},{id:4,label:"On Stop",value:"onStop"},{id:5,label:"Every second",value:"onClock"},{id:6,label:"On Timer Update",value:"onUpdate"},{id:7,label:"On Finish",value:"onFinish"},{id:8,label:"On Warning",value:"onWarning"},{id:9,label:"On Danger",value:"onDanger"}];function Bt(t){return Object.hasOwn(t,"id")}const Vr=[{value:"eventNow.id",label:"ID"},{value:"eventNow.title",label:"Title"},{value:"eventNow.cue",label:"Cue"},{value:"eventNow.countToEnd",label:"Count to end"},{value:"eventNow.note",label:"Note"},{value:"eventNow.colour",label:"Colour"}],Wr=[{value:"eventNext.id",label:"Next ID"},{value:"eventNext.title",label:"Next Title"},{value:"eventNext.cue",label:"Next Cue"}];function Mr(t){return[...Vr,...Object.entries(t).map(([s,{label:n}])=>({value:`eventNow.custom.${s}`,label:`Custom: ${n}`})),...Wr,...Object.entries(t).map(([s,{label:n}])=>({value:`eventNext.custom.${s}`,label:`Next custom: ${n}`}))]}function qr(t){const s={},n=[];for(let r=0;r<t.length;r++){const i=t[r];Object.hasOwn(s,i.trigger)||(s[i.trigger]=[]),s[i.trigger].includes(i.automationId)?n.push(r):s[i.trigger].push(i.automationId)}return n.length>0?n:void 0}const Ur="_outerColumn_dem8v_17",zr="_innerColumn_dem8v_25",Br="_ruleSection_dem8v_31",Kr="_titleSection_dem8v_37",Gr="_filterSection_dem8v_38",Hr="_oscSection_dem8v_39",Qr="_httpSection_dem8v_40",Yr="_actionSection_dem8v_41",Jr="_test_dem8v_95",Xr="_outputCard_dem8v_99",ue={outerColumn:Ur,innerColumn:zr,ruleSection:Br,titleSection:Kr,filterSection:Gr,oscSection:Hr,httpSection:Qr,actionSection:Yr,test:Jr,outputCard:Xr};function Zr({index:t,register:s,setValue:n,rowErrors:r,value:i,children:l,watch:a}){var h,u,d,x,p;const[c,m]=j.useState(i),o=g=>{n(`outputs.${t}.action`,g,{shouldDirty:!0}),m(g)};return e.jsxs("div",{className:ue.actionSection,children:[e.jsxs("label",{children:["Action",e.jsx(re,{onValueChange:g=>{o(g)},value:a(`outputs.${t}.action`),options:[{value:"aux1-pause",label:"Aux 1: pause"},{value:"aux2-pause",label:"Aux 2: pause"},{value:"aux3-pause",label:"Aux 3: pause"},{value:"aux1-start",label:"Aux 1: start"},{value:"aux2-start",label:"Aux 2: start"},{value:"aux3-start",label:"Aux 3: start"},{value:"aux1-stop",label:"Aux 1: stop"},{value:"aux2-stop",label:"Aux 2: stop"},{value:"aux3-stop",label:"Aux 3: stop"},{value:"aux1-set",label:"Aux 1: set"},{value:"aux2-set",label:"Aux 2: set"},{value:"aux3-set",label:"Aux 3: set"},{value:"message-set",label:"Primary Message: set"},{value:"message-secondary",label:"Secondary Message: source"}]}),e.jsx(E,{children:(h=r==null?void 0:r.action)==null?void 0:h.message})]}),c.startsWith("aux")&&c.endsWith("set")&&e.jsxs("label",{children:["New time",e.jsx(W,{...s(`outputs.${t}.time`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"eg: 10m5s"}),e.jsx(E,{children:(u=r==null?void 0:r.time)==null?void 0:u.message})]}),c==="message-set"&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["Text (leave empty for no change)",e.jsx(W,{...s(`outputs.${t}.text`),fluid:!0,placeholder:"eg: Timer is finished"}),e.jsx(E,{children:(d=r==null?void 0:r.text)==null?void 0:d.message})]}),e.jsxs("label",{children:["Visibility",e.jsx(re,{onValueChange:g=>{const y=g==="untouched"?void 0:g;n(`outputs.${t}.visible`,y,{shouldDirty:!0})},value:a(`outputs.${t}.visible`)===void 0?"untouched":a(`outputs.${t}.visible`),options:[{value:"untouched",label:"Untouched"},{value:!0,label:"Show"},{value:!1,label:"Hide"}]}),e.jsx(E,{children:(x=r==null?void 0:r.visible)==null?void 0:x.message})]})]}),c==="message-secondary"&&e.jsxs("label",{children:["Timer secondary source",e.jsx(re,{onValueChange:g=>{n(`outputs.${t}.secondarySource`,g,{shouldDirty:!0})},value:a(`outputs.${t}.secondarySource`),options:[{value:null,label:"Select secondary source",disabled:!0},{value:"aux1",label:"Auxiliary timer 1"},{value:"aux2",label:"Auxiliary timer 2"},{value:"aux3",label:"Auxiliary timer 3"},{value:"external",label:"External"},{value:"null",label:"None"}]}),e.jsx(E,{children:(p=r==null?void 0:r.secondarySource)==null?void 0:p.message})]}),e.jsx("div",{className:ue.test,children:l})]})}const ea="https://docs.getontime.no/api/automation/#using-variables-in-automation";function ta({automation:t,onClose:s}){var K;const n=Bt(t),{data:r}=lt(),{refetch:i}=at(),l=j.useMemo(()=>Mr(r),[r]),{control:a,handleSubmit:c,getValues:m,register:o,setError:h,setFocus:u,setValue:d,watch:x,formState:{errors:p,isSubmitting:g,isDirty:y,isValid:b}}=ce({mode:"onChange",defaultValues:{title:(t==null?void 0:t.title)??"",filterRule:(t==null?void 0:t.filterRule)??"all",filters:(t==null?void 0:t.filters)??[],outputs:(t==null?void 0:t.outputs)??[]},resetOptions:{keepDirtyValues:!0}}),{fields:v,append:w,remove:$}=et({name:"filters",control:a}),{fields:R,append:O,remove:T}=et({name:"outputs",control:a});j.useEffect(()=>{u("title")},[u]);const S=()=>{w({field:"",operator:"equals",value:""})},z=()=>{O({type:"osc",targetIP:"",targetPort:void 0,address:"",args:""})},_=()=>{O({type:"http",url:""})},H=()=>{O({type:"ontime",action:"aux1-start"})},q=async L=>{try{const k=m(`outputs.${L}`);if(!k.targetIP||!k.targetPort||!k.address)return;await dt({type:"osc",targetIP:k.targetIP,targetPort:k.targetPort,address:k.address,args:k.args})}catch{}},I=async L=>{try{const k=m(`outputs.${L}`);if(!k.url)return;await dt({type:"http",url:k.url})}catch{}},P=async L=>{try{const k=m(`outputs.${L}`);await dt({...k,type:"ontime"})}catch{}},A=async L=>{Bt(t)?await k(t.id,{id:t.id,...L}):await pe(L),i();async function k(de,le){try{await On(de,le),s()}catch(C){h("root",{message:V(C)})}}async function pe(de){try{await Tn(de),s()}catch(le){h("root",{message:V(le)})}}},D=!g&&y&&b;return e.jsxs($e,{as:"form",name:"automation-form",onSubmit:c(A),className:ue.outerColumn,onKeyDown:L=>we(L,s),children:[e.jsx(Q,{children:n?"Edit automation":"Create automation"}),e.jsxs("div",{className:ue.innerSection,children:[e.jsx("h3",{children:"Automation options"}),e.jsxs("div",{className:ue.titleSection,children:[e.jsxs("label",{children:["Title",e.jsx(W,{...o("title",{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"Load preset"})]}),e.jsx(E,{children:(K=p.title)==null?void 0:K.message})]})]}),e.jsxs("div",{className:ue.innerSection,children:[e.jsx("h3",{children:"Filters (optional)"}),e.jsxs("div",{className:ue.ruleSection,children:[e.jsxs("label",{children:["Trigger outputs if",e.jsx(xs,{orientation:"horizontal",value:x("filterRule"),onValueChange:L=>d("filterRule",L,{shouldDirty:!0}),items:[{value:"all",label:"All filters pass"},{value:"any",label:"Any filter passes"}]})]}),v.map((L,k)=>{var de,le,C,Z,Ce,De;const pe=`filters.${k}.field.${L.id}`;return e.jsxs("div",{className:ue.filterSection,children:[e.jsxs("label",{children:["Runtime data source",e.jsx(re,{value:x(`filters.${k}.field`),onValueChange:_e=>d(`filters.${k}.field`,_e,{shouldDirty:!0}),options:l.map(({value:_e,label:J})=>({value:_e,label:J})),"aria-label":"Event field"}),e.jsx(E,{children:(C=(le=(de=p.filters)==null?void 0:de[k])==null?void 0:le.field)==null?void 0:C.message})]}),e.jsxs("label",{children:["Matching condition",e.jsx(re,{value:x(`filters.${k}.operator`),onValueChange:_e=>d(`filters.${k}.operator`,_e,{shouldDirty:!0}),options:[{value:"equals",label:"equals"},{value:"not_equals",label:"not equals"},{value:"contains",label:"contains"}],"aria-label":"Operator"}),e.jsx(E,{children:(De=(Ce=(Z=p.filters)==null?void 0:Z[k])==null?void 0:Ce.operator)==null?void 0:De.message})]}),e.jsxs("label",{children:["Value to match",e.jsx(W,{...o(`filters.${k}.value`),fluid:!0,placeholder:"<empty / no value>"})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsx("div",{children:e.jsx(X,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>$(k),children:e.jsx(he,{})})})]})]},pe)}),e.jsx("div",{children:e.jsxs(f,{type:"submit",onClick:S,children:["Add filter ",e.jsx(xe,{})]})})]})]}),e.jsxs("div",{className:ue.innerColumn,children:[e.jsx("h3",{children:"Outputs"}),e.jsxs(me,{children:["Automation outputs can be used to send data from Ontime to external software.",e.jsx(se,{href:ea,children:"See the documentation for templates"})]}),R.map((L,k)=>{var pe,de,le,C,Z,Ce,De,_e;if(Hn(L)){const J=(pe=p.outputs)==null?void 0:pe[k];return e.jsxs("div",{className:ue.outputCard,children:[e.jsx(G,{children:"OSC"}),e.jsxs("div",{className:ue.oscSection,children:[e.jsxs("label",{children:["Target IP",e.jsx(W,{...o(`outputs.${k}.targetIP`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"127.0.0.1"}),e.jsx(E,{children:(de=J==null?void 0:J.targetIP)==null?void 0:de.message})]}),e.jsxs("label",{children:["Target Port",e.jsx(W,{...o(`outputs.${k}.targetPort`,{required:{value:!0,message:"Required field"},setValueAs:At=>At===""?0:Number(At),max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"}}),fluid:!0,type:"number",maxLength:5,placeholder:"8000"}),e.jsx(E,{children:(le=J==null?void 0:J.targetPort)==null?void 0:le.message})]}),e.jsxs("label",{children:["Address",e.jsx(W,{...o(`outputs.${k}.address`),fluid:!0,placeholder:"/cue/start"}),e.jsx(E,{children:(C=J==null?void 0:J.address)==null?void 0:C.message})]}),e.jsxs("label",{children:["Arguments",e.jsx($r,{...o(`outputs.${k}.args`),value:L.args,placeholder:"1"}),e.jsx(E,{children:(Z=J==null?void 0:J.args)==null?void 0:Z.message})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsxs(F,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>q(k),children:"Test"}),e.jsx(X,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>T(k),children:e.jsx(he,{})})]})]})]})]},L.id)}if(Qn(L)){const J=(Ce=p.outputs)==null?void 0:Ce[k];return e.jsxs("div",{className:ue.outputCard,children:[e.jsx(G,{children:"HTTP"}),e.jsxs("div",{className:ue.httpSection,children:[e.jsxs("label",{children:["Target URL",e.jsx(W,{...o(`outputs.${k}.url`,{required:{value:!0,message:"Required field"},pattern:{value:Un,message:"HTTP messages should target http:// or https://"}}),fluid:!0,placeholder:"http://127.0.0.1/start/1"}),e.jsx(E,{children:(De=J==null?void 0:J.url)==null?void 0:De.message})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsxs(F,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>I(k),children:"Test"}),e.jsx(X,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>T(k),children:e.jsx(he,{})})]})]})]})]},L.id)}if(Yn(L)){const J=(_e=p.outputs)==null?void 0:_e[k];return e.jsxs("div",{className:ue.outputCard,children:[e.jsx(G,{children:"Ontime action"}),e.jsxs(Zr,{value:L.action,index:k,register:o,rowErrors:J,setValue:d,watch:x,children:[e.jsx("span",{children:" "}),e.jsxs(F,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>P(k),children:"Test"}),e.jsx(X,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>T(k),children:e.jsx(he,{})})]})]})]},L.id)}return null}),e.jsxs(F,{relation:"inner",children:[e.jsxs(f,{onClick:z,children:["OSC ",e.jsx(xe,{})]}),e.jsxs(f,{onClick:_,children:["HTTP ",e.jsx(xe,{})]}),e.jsxs(f,{onClick:H,children:["Ontime action ",e.jsx(xe,{})]})]})]}),e.jsxs(F,{align:"end",children:[(p==null?void 0:p.root)&&e.jsx(E,{children:p.root.message}),e.jsx(f,{onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!D,loading:g,children:"Save"})]})]})}const Kt={title:"",filterRule:"all",filters:[],outputs:[]};function sa(t){const{automations:s}=t,{refetch:n}=at(),[r,i]=j.useState(null),[l,a]=j.useState(null),c=async o=>{try{a(null),await An(o)}catch(h){a(V(h))}finally{n()}},m=Object.keys(s);return e.jsxs(te,{children:[e.jsxs(Q,{children:["Manage automations",e.jsxs(f,{type:"submit",disabled:!!r,onClick:()=>i(Kt),children:["New ",e.jsx(xe,{})]})]}),e.jsx(ie,{}),r!==null&&e.jsx(ta,{automation:r,onClose:()=>i(null)}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{width:"45%"},children:"Title"}),e.jsx("th",{style:{width:"15%"},children:"Trigger rule"}),e.jsx("th",{style:{width:"15%"},children:"Filters"}),e.jsx("th",{style:{width:"15%"},children:"Outputs"}),e.jsx("th",{})]})}),e.jsxs("tbody",{children:[m.length===0&&e.jsx(rt,{handleClick:r?void 0:()=>i(Kt)}),m.map(o=>Object.hasOwn(s,o)?e.jsx(j.Fragment,{children:e.jsxs("tr",{children:[e.jsx("td",{children:s[o].title}),e.jsx("td",{children:e.jsx(G,{children:s[o].filterRule})}),e.jsx("td",{children:s[o].filters.length}),e.jsx("td",{children:s[o].outputs.length}),e.jsxs(F,{align:"end",relation:"inner",as:"td",children:[e.jsx(X,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>i(s[o]),children:e.jsx(nt,{})}),e.jsx(X,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>c(o),children:e.jsx(he,{})})]})]})},o):null),l&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,children:e.jsx(E,{children:l})})})]})]})]})}function bs({automations:t,initialId:s,initialTitle:n,initialAutomationId:r,initialTrigger:i,onCancel:l,postSubmit:a}){var $,R,O,T;const{handleSubmit:c,register:m,setFocus:o,setError:h,watch:u,setValue:d,formState:{errors:x,isSubmitting:p,isValid:g,isDirty:y}}=ce({defaultValues:{title:n,trigger:i??vt[0].value,automationId:r??(($=t==null?void 0:t[Object.keys(t)[0]])==null?void 0:$.id)},resetOptions:{keepDirtyValues:!0}});j.useEffect(()=>{o("title")},[o]);const b=async S=>{if(s){try{await Fn(s,{id:s,...S}),a()}catch(z){h("root",{message:`Failed to save changes to trigger ${V(z)}`})}return}try{await In(S),a()}catch(z){h("root",{message:`Failed to save trigger ${V(z)}`})}},v=Object.keys(t).map(S=>({value:S,label:t[S].title})),w=y&&g;return e.jsxs($e,{as:"form",name:"trigger-form",onSubmit:c(b),onKeyDown:S=>we(S,l),children:[e.jsx(Q,{children:s?"Edit trigger":"Create trigger"}),e.jsxs("label",{children:["Title",e.jsx(W,{...m("title",{required:{value:!0,message:"Required field"}}),fluid:!0,defaultValue:n}),e.jsx(E,{children:(R=x.title)==null?void 0:R.message})]}),e.jsxs("label",{children:["Lifecycle trigger",e.jsx(re,{value:u("trigger"),onValueChange:S=>d("trigger",S,{shouldDirty:!0}),options:vt.map(S=>({value:S.value,label:S.label})),"aria-label":"Lifecycle trigger"}),e.jsx(E,{children:(O=x.trigger)==null?void 0:O.message})]}),e.jsxs("label",{children:["Automation title",e.jsx(re,{value:u("automationId"),onValueChange:S=>d("automationId",S,{shouldDirty:!0}),options:v,"aria-label":"Automation title"}),e.jsx(E,{children:(T=x.automationId)==null?void 0:T.message})]}),e.jsxs(F,{align:"end",children:[e.jsx(f,{disabled:p,onClick:l,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:!w,loading:p,children:"Save"})]})]})}function na(t){var u,d;const{automations:s,id:n,title:r,trigger:i,automationId:l,duplicate:a,handleDelete:c,postSubmit:m}=t,[o,h]=j.useState(!1);return o?e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(bs,{automations:s,initialId:n,initialTitle:r,initialTrigger:i,initialAutomationId:l,onCancel:()=>h(!1),postSubmit:()=>{h(!1),m()}})})}):e.jsxs("tr",{"data-warn":a,children:[e.jsxs(F,{as:"td",relation:"inner",children:[a&&e.jsx(Ts,{color:"#FFBC56"}),r]}),e.jsx("td",{children:e.jsx(G,{children:(u=vt.find(x=>x.value===i))==null?void 0:u.label})}),e.jsx("td",{children:e.jsx(G,{children:(d=s==null?void 0:s[l])==null?void 0:d.title})}),e.jsxs(F,{align:"end",relation:"inner",as:"td",children:[e.jsx(X,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>h(!0),children:e.jsx(nt,{})}),e.jsx(X,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:c,children:e.jsx(he,{})})]})]})}function ra(t){const{triggers:s,automations:n}=t,[r,i]=j.useState(!1),{refetch:l}=at(),[a,c]=j.useState(null),m=async d=>{try{await Ln(d)}catch(x){c(V(x))}finally{l()}},o=()=>{i(!1),l()},h=j.useMemo(()=>qr(s),[s]),u=Object.keys(n).length>0;return e.jsxs(te,{children:[e.jsxs(Q,{children:["Manage triggers",e.jsxs(f,{type:"submit",form:"trigger-form",disabled:!u,loading:!1,onClick:()=>i(!0),children:["New ",e.jsx(xe,{})]})]}),e.jsx(ie,{}),e.jsxs(N,{children:[h&&e.jsx(E,{children:"You have created multiple links between the same trigger and automation which can performance issues."}),r&&e.jsx(bs,{automations:n,onCancel:()=>i(!1),postSubmit:o}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{width:"35%"},children:"Title"}),e.jsx("th",{style:{width:"25%"},children:"Lifecycle trigger"}),e.jsx("th",{style:{width:"25%"},children:"Automation"}),e.jsx("th",{})]})}),e.jsxs("tbody",{children:[!r&&s.length===0&&e.jsx(rt,{label:"Create an automation to attach triggers to",handleClick:u?()=>i(!0):void 0}),s.map((d,x)=>e.jsxs(j.Fragment,{children:[e.jsx(na,{automations:n,id:d.id,title:d.title,trigger:d.trigger,automationId:d.automationId,duplicate:h==null?void 0:h.includes(x),handleDelete:()=>m(d.id),postSubmit:o}),a&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,children:e.jsx(E,{children:a})})})]},d.id))]})]})]})]})}function aa({location:t}){const{data:s,status:n}=at(),r=ae("settings",t),i=ae("triggers",t),l=ae("automations",t),a=n==="pending";return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Automation"}),e.jsxs(N,{children:[e.jsx(Le,{isLoading:a}),e.jsx("div",{ref:r,children:e.jsx(Rr,{enabledAutomations:s.enabledAutomations,enabledOscIn:s.enabledOscIn,oscPortIn:s.oscPortIn})}),e.jsx("div",{ref:l,children:e.jsx(sa,{automations:s.automations})}),e.jsx("div",{ref:i,children:e.jsx(ra,{triggers:s.triggers,automations:s.automations})})]})]})}const ia="_goIcon_1fzu7_17",la={goIcon:ia};function oa(){const{data:t}=sn(),s=n=>kt(n);return e.jsx(F,{children:t.networkInterfaces.map(n=>{if(n.name==="localhost"&&!tt)return null;const r=nn(n.address);return e.jsxs(Rt,{copyValue:r,onClick:()=>s(r),children:[`${n.name} - ${n.address}`," ",e.jsx(es,{className:la.goIcon})]},n.name)})})}function ca(t){return As(t)}function da(t,s,n){if(Object.keys(t).length===0)return[];if(n.length===0)return[];const r=[];let i=1;for(let l=0;l<n.length;l++){const a=n[l],c=s[a];!c||!js(c)||(a in t||r.push({id:a,index:i,title:c.title,cue:c.cue,scheduledStart:c.timeStart,actualEnd:null,scheduledEnd:c.timeEnd,actualStart:null}),a in t&&r.push({id:a,index:i,title:c.title,cue:c.cue,scheduledStart:c.timeStart,actualEnd:t[a].endedAt,scheduledEnd:c.timeEnd,actualStart:t[a].startedAt}),i++)}return r}const ua=["Index","Title","Cue","Scheduled Start","Actual Start","Scheduled End","Actual End"];function ha(t){const s=[];s.push(ua);for(const n of t)s.push([String(n.index),n.title,n.cue,Oe(n.scheduledStart),Oe(n.actualStart),Oe(n.scheduledEnd),Oe(n.actualEnd)]);return ca(s)}const ma="_blink_15peo_1",xa="_fourtyfive_15peo_13",ja="_over_15peo_17",pa="_under_15peo_21",Je={blink:ma,fourtyfive:xa,over:ja,under:pa};function ga(){const{data:t}=cr(),{data:s}=ps(),n=async()=>await dr(),r=l=>{if(!l)return;const a=ha(l),c=is(a,"text/csv;charset=utf-8;");Et(c,"ontime-report.csv")},i=j.useMemo(()=>da(t,s.entries,s.flatOrder),[t,s.entries,s.flatOrder]);return e.jsx(N,{children:e.jsxs(te,{children:[e.jsx(Q,{children:"Report"}),e.jsx(ie,{}),e.jsx(N,{children:e.jsxs(ve,{children:["Manage report",e.jsxs(F,{children:[e.jsxs(f,{onClick:()=>r(i),disabled:i.length===0,children:[e.jsx(Ft,{}),"Export CSV"]}),e.jsxs(f,{variant:"subtle-destructive",onClick:n,disabled:i.length===0,children:[e.jsx(Ft,{}),"Clear All"]})]})]})}),e.jsx(N,{children:e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"#"}),e.jsx("th",{children:"Cue"}),e.jsx("th",{children:"Title"}),e.jsx("th",{children:"Scheduled Start"}),e.jsx("th",{children:"Actual Start"}),e.jsx("th",{children:"Scheduled End"}),e.jsx("th",{children:"Actual End"})]})}),e.jsxs("tbody",{children:[i.length===0&&e.jsx(rt,{label:"Reports are generated when running through the show."}),i.map(l=>{const a=l.actualStart===null?null:l.actualStart<=l.scheduledStart?"under":"over",c=l.actualEnd===null?null:l.actualEnd<=l.scheduledEnd?"under":"over";return e.jsxs("tr",{children:[e.jsx("th",{children:l.index}),e.jsx("th",{children:l.cue}),e.jsx("th",{children:l.title}),e.jsx("th",{className:ye([a&&Je[a]]),children:Oe(l.scheduledStart)}),e.jsx("th",{className:ye([a&&Je[a]]),children:Oe(l.actualStart)}),e.jsx("th",{className:ye([c&&Je[c]]),children:Oe(l.scheduledEnd)}),e.jsx("th",{className:ye([c&&Je[c]]),children:Oe(l.actualEnd)})]},l.id)})]})]})})]})})}const fa="_expand_1sy0c_17",ya="_column_1sy0c_21",Gt={expand:fa,column:ya},va=[{value:Re.Cuesheet,label:"Cuesheet"},{value:Re.Operator,label:"Operator"},{value:Re.Timer,label:"Timer"},{value:Re.Backstage,label:"Backstage"},{value:Re.Timeline,label:"Timeline"},{value:Re.StudioClock,label:"Studio Clock"},{value:Re.Countdown,label:"Countdown"},{value:Re.ProjectInfo,label:"Project Info"}],ba={alias:"",target:Re.Timer,search:"",enabled:!0};function wa({urlPreset:t,onClose:s}){var R,O;const{addPreset:n,updatePreset:r,isMutating:i}=ls(),{handleSubmit:l,register:a,setFocus:c,setError:m,clearErrors:o,setValue:h,getValues:u,watch:d,formState:{errors:x,isSubmitting:p,isValid:g,isDirty:y}}=ce({defaultValues:t??ba,resetOptions:{keepDirtyValues:!0}}),b=j.useRef(null),v=async T=>{try{t?await r(t.alias,T):await n(T),s()}catch(S){m("root",{message:V(S)})}};j.useEffect(()=>{c("alias")},[c]);const w=()=>{var T;o();try{const S=rn(u("alias"),((T=b.current)==null?void 0:T.value.trim())??"");h("target",S.target,{shouldDirty:!0,shouldValidate:!0}),h("search",S.search,{shouldDirty:!0,shouldValidate:!0})}catch(S){m("root",{message:Lt(S)});return}},$=T=>{try{return new URLSearchParams(T),!0}catch(S){return Lt(S)||"Invalid URL parameters"}};return e.jsxs($e,{as:"form",onSubmit:l(v),onKeyDown:T=>we(T,s),className:Gt.column,children:[e.jsx("input",{hidden:!0,name:"enabled",value:"true"}),e.jsx("div",{children:"1. Enter URL and let Ontime generate the preset options"}),e.jsxs(F,{children:[e.jsxs("div",{children:[e.jsx(ne,{children:"Alias"}),e.jsx(W,{...a("alias",{required:"Alias is required"})})]}),e.jsxs("div",{className:Gt.expand,children:[e.jsx(ne,{children:"Generate options (paste URL to generate options)"}),e.jsxs(F,{children:[e.jsx(W,{placeholder:"Paste URL",fluid:!0,ref:b}),e.jsx(f,{onClick:w,children:"Generate"})]})]})]}),e.jsx("div",{children:" - or -"}),e.jsx("div",{children:"2. Choose a view and its parameters"}),e.jsxs("div",{children:[e.jsx(ne,{children:"Target"}),e.jsx(re,{options:va,...a("target",{required:"Target is required"}),value:d("target"),onValueChange:T=>h("target",T,{shouldDirty:!0})})]}),e.jsxs("div",{children:[e.jsx(ne,{children:"Parameters"}),e.jsx(yt,{fluid:!0,rows:3,...a("search",{validate:$})}),e.jsx(E,{children:(R=x.search)==null?void 0:R.message})]}),e.jsxs("div",{children:[e.jsx(E,{children:(O=x.root)==null?void 0:O.message}),e.jsxs(F,{align:"end",children:[e.jsx(f,{onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!g||!y,loading:p||i,children:"Save"})]})]})]})}const Sa="https://docs.getontime.no/features/url-presets/";function Ca(){const[t,s]=j.useState({isOpen:!1,preset:void 0}),{data:n,status:r}=os(),{deletePreset:i,isMutating:l}=ls(),a=()=>s({isOpen:!0}),c=o=>s({isOpen:!0,preset:o}),m=()=>s({isOpen:!1,preset:void 0});return e.jsx(N,{children:e.jsxs(te,{children:[e.jsxs(Q,{children:["URL presets",e.jsxs(f,{onClick:a,children:["New ",e.jsx(xe,{})]})]}),e.jsx(ie,{}),e.jsx(N,{children:e.jsxs(me,{children:["URL presets are user pre-defined aliases to Ontime URLs.",e.jsx("br",{}),"This URL can contain full configuration including parameters, or simply route to a specific view.",e.jsx("br",{}),e.jsx("br",{}),"The easiest way to get started is to copy an URL from your browser and paste it into the form.",e.jsx(se,{href:Sa,children:"See the docs"})]})}),e.jsxs(N,{children:[e.jsx(Le,{isLoading:r==="pending"}),t.isOpen&&e.jsx(wa,{urlPreset:t.preset,onClose:m}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Enabled"}),e.jsx("th",{children:"Target view"}),e.jsx("th",{children:"Alias"}),e.jsx("th",{})]})}),e.jsxs("tbody",{children:[n.length===0&&e.jsx(rt,{handleClick:a}),n.map((o,h)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(ke,{defaultChecked:o.enabled,onCheckedChange:()=>{}})}),e.jsx("td",{children:e.jsx(G,{children:o.target})}),e.jsx("td",{style:{width:"100%"},children:o.alias}),e.jsxs(F,{relation:"inner",as:"td",children:[e.jsx(X,{variant:"ghosted-white",onClick:u=>cs(o.alias,u),disabled:l,children:e.jsx(Zt,{})}),e.jsx(X,{onClick:()=>c(o),variant:"ghosted-white","aria-label":"Edit entry","data-testid":`field__edit_${h}`,disabled:l,children:e.jsx(nt,{})}),e.jsx(X,{onClick:()=>i(o.alias),variant:"ghosted-destructive","aria-label":"Delete entry","data-testid":`field__delete_${h}`,disabled:l,children:e.jsx(he,{})})]})]},o.alias))]})]})]})]})})}function _a({location:t}){const s=ae("presets",t),n=ae("link",t),r=ae("report",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Sharing and reporting"}),e.jsx("div",{ref:s,children:e.jsx(Ca,{})}),e.jsx("div",{ref:n,children:e.jsx(N,{children:e.jsxs(te,{children:[e.jsx(Q,{children:"Share Ontime Link"}),!We&&e.jsxs(e.Fragment,{children:[e.jsx(Pe,{children:"Ontime is streaming on the following network interfaces"}),e.jsx(oa,{})]}),e.jsx(ie,{}),e.jsx(zn,{})]})})}),e.jsx("div",{ref:r,children:e.jsx(ga,{})})]})}const Ot=`${Pt}/excel`;async function ka(t){const s=new FormData;return s.append("excel",t),(await Y.post(`${Ot}/upload`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}async function Da(t){return(await Y.post(`${Ot}/preview`,{options:t})).data}async function Ra(t,s){try{const n=await Y.get(`${Ot}/${t}/export`,{responseType:"blob"});Et(n.data,`${s??"Ontime_rundown"}.xlsx`)}catch(n){console.error("Error downloading file:",n)}}const qe=`${Pt}/sheets`,Ea=async()=>(await Y.get(`${qe}/connect`)).data,Pa=async(t,s)=>{const n=new FormData;return n.append("client_secret",t),(await Y.post(`${qe}/${s}/connect`,n,{headers:{"Content-Type":"multipart/form-data"}})).data},Na=async()=>(await Y.post(`${qe}/revoke`)).data,Oa=async(t,s)=>(await Y.post(`${qe}/${t}/read`,{options:s})).data,ws=async t=>(await Y.post(`${qe}/${t}/worksheets`)).data,Ta=async(t,s)=>(await Y.post(`${qe}/${t}/write`,{options:s})).data;function Aa(t){if(!Fa(t))throw new Error("Unknown file type");if(t.size===0)throw new Error("File is empty");if(t.size>1e7)throw new Error("File size limit (10MB) exceeded")}function Ss(t){if(!Ia(t))throw new Error("Unknown file type");if(t.size===0)throw new Error("File is empty");if(t.size>2e6)throw new Error("File size limit (2MB) exceeded")}function Fa(t){return t==null?void 0:t.name.endsWith(".xlsx")}function Ia(t){return t==null?void 0:t.name.endsWith(".json")}function La(t){if(t.size===0)throw new Error("File is empty");if(t.size>15e5)throw new Error("File size limit (1.5MB) exceeded")}const Se=`${Pt}/db`;function Cs(t){return Y.post(`${Se}/download`,{filename:t})}async function $a(t){try{const{data:s,name:n}=await Ka(t),r=JSON.stringify(s,null,2),i=is(r,"application/json;charset=utf-8;");Et(i,`${n}.json`)}catch(s){console.error(s)}}async function _s(t){const s=new FormData;return s.append("project",t),(await Y.post(`${Se}/upload`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}async function ks(t){return await Y.patch(Se,t)}async function Va(t){return(await Y.post(`${Se}/new`,t)).data}async function Wa(t){return(await Y.post(`${Se}/quick`,t)).data}async function Ma(){return(await Y.get(`${Se}/all`)).data}async function Ds(t){return(await Y.post(`${Se}/load`,{filename:t})).data}async function qa(){return(await Y.post(`${Se}/demo`)).data}async function Ua(t,s){const n=`${Se}/${t}/duplicate`,r=decodeURIComponent(n);return(await Y.post(r,{newFilename:s})).data}async function za(t,s){const n=`${Se}/${t}/rename`,r=decodeURIComponent(n);return(await Y.put(r,{newFilename:s})).data}async function Ba(t){const s=`${Se}/${t}`,n=decodeURIComponent(s);return(await Y.delete(n)).data}async function Ka(t){const s=await Cs(t),n=s.headers["Content-Disposition"];let r=t;if(n!=null){const i=n.indexOf('"')+1,l=n.lastIndexOf('"');r=n.substring(i,l)}return{data:s.data,name:r}}const Ga={authenticate:{available:!1,error:""},sheetId:{available:!1,error:""},worksheet:{available:!1,error:""},pullPush:{available:!1,error:""}},Ht={stepData:Ga,worksheetNames:null,sheetId:null,authenticationStatus:"not_authenticated",rundown:null,customFields:null,summary:null,spreadsheetImportMap:vr},U=Fs((t,s)=>({...Ht,patchStepData:n=>{const r=s().stepData;t({stepData:{...r,...n}})},setWorksheets:n=>t({worksheetNames:n}),setSheetId:n=>t({sheetId:n}),setAuthenticationStatus:n=>t({authenticationStatus:n}),setRundown:n=>t({rundown:n}),setCustomFields:n=>t({customFields:n}),setSummary:n=>t({summary:n}),patchSpreadsheetImportMap:(n,r)=>{const i=s().spreadsheetImportMap;i[n]!==r&&(i[n]=r)},reset:()=>t(Ht),resetPreview:()=>t({rundown:null,customFields:null,summary:null})}));function ot(){const t=Ct(),s=U(u=>u.patchStepData),n=U(u=>u.setRundown),r=U(u=>u.setCustomFields),i=U(u=>u.setSummary);return{connect:async(u,d)=>{try{return await Pa(u,d)}catch(x){s({authenticate:{available:!1,error:V(x)}})}},revoke:async()=>{try{return await Na()}catch(u){s({authenticate:{available:!1,error:V(u)}})}},verifyAuth:async()=>{try{return await Ea()}catch(u){s({authenticate:{available:!1,error:V(u)}})}},importRundownPreview:async(u,d)=>{try{const x=await Oa(u,d);n(x.rundown),r(x.customFields),i(x.summary)}catch(x){s({pullPush:{available:!0,error:V(x)}})}},importRundown:async(u,d)=>{try{await ks({rundowns:u,customFields:d}),await t.invalidateQueries({queryKey:[an,ln]})}catch(x){s({pullPush:{available:!0,error:V(x)}})}},exportRundown:async(u,d)=>{try{await Ta(u,d),s({pullPush:{available:!1,error:""}})}catch(x){s({pullPush:{available:!0,error:V(x)}})}}}}const bt={Worksheet:"event schedule",Flag:"flag",Start:"time start","Link start":"link start",End:"time end",Duration:"duration",Cue:"cue",Title:"title","Count to end":"count to end",Skip:"skip",Note:"notes",Colour:"colour","End action":"end action","Timer type":"timer type","Time warning":"warning time","Time danger":"danger time",ID:"id",custom:[]};function Ha(t){return typeof t!="object"||t===null?!1:Object.keys(bt).every(n=>Object.hasOwn(t,n))}function Qt(t){const s=t.custom.reduce((n,{ontimeName:r,importName:i})=>(r&&i&&(n[r.trim()]=i.trim()),n),{});return{worksheet:t.Worksheet,flag:t.Flag,timeStart:t.Start,linkStart:t["Link start"],timeEnd:t.End,duration:t.Duration,cue:t.Cue,title:t.Title,countToEnd:t["Count to end"],skip:t.Skip,note:t.Note,colour:t.Colour,endAction:t["End action"],timerType:t["Timer type"],timeWarning:t["Time warning"],timeDanger:t["Time danger"],custom:s,id:t.ID}}function Qa(t){localStorage.setItem("import-options",JSON.stringify(t))}function Ya(){const t=localStorage.getItem("import-options");if(!t)throw new Error("no import options found");return JSON.parse(t)}function Ja(){try{const t=Ya();return Ha(t)?t:bt}catch{return bt}}const Xa="_uploadSection_10owf_17",Za="_finishSection_10owf_18",ei="_error_10owf_40",ti="_success_10owf_43",si="_singleActionCell_10owf_47",Te={uploadSection:Xa,finishSection:Za,error:ei,success:ti,singleActionCell:si};function ni({hasErrors:t,isSpreadsheet:s,onCancel:n,onSubmitExport:r,onSubmitImport:i}){const l=Ja(),{revoke:a}=ot(),{control:c,handleSubmit:m,register:o,setValue:h,watch:u,formState:{errors:d,isValid:x}}=ce({mode:"onChange",defaultValues:l,values:l}),{fields:p,append:g,remove:y}=et({control:c,name:"custom"}),b=U(P=>P.stepData),v=U(P=>P.worksheetNames),[w,$]=j.useState("");j.useEffect(()=>{!v||v.length===0||v.includes(l.Worksheet)||h("Worksheet",v[0],{shouldValidate:!0,shouldDirty:!0})},[v,h,l.Worksheet]);const R=async P=>{$("export");const A=Qt(P);await r(A),$("")},O=async()=>{await a(),n()},T=async P=>{$("import");const A=Qt(P);Qa(P),await i(A),$("")},S=P=>{y(P)},z=()=>{g({})},_=!!w,H=s&&!_,q=!_&&!b.worksheet.error,I=!t&&x&&(H||q);return e.jsxs(N,{as:"form",id:"import-map",children:[e.jsxs(ve,{children:["Import options",e.jsxs(F,{children:[!s&&e.jsx(fs,{text:"Revoke the google authentication",render:e.jsx(f,{}),onClick:O,disabled:_,children:"Revoke"}),e.jsx(f,{onClick:n,disabled:_,children:"Cancel"}),!s&&e.jsx(f,{variant:"primary",onClick:m(R),disabled:!q,loading:w==="export",children:"Export"}),e.jsx(f,{variant:"primary",onClick:m(T),disabled:!I,loading:w==="import",children:"Import preview"})]})]}),e.jsxs(me,{children:["Match your spreadsheet columns to Ontime fields. ",e.jsx("br",{}),"You can also add Custom Fields by providing a name for Ontime and the spreadsheet column name."]}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Ontime field"}),e.jsx("th",{children:"Column name in spreadsheet"}),e.jsx("th",{className:Te.singleActionCell})]})}),e.jsxs("tbody",{children:[Object.entries(l).map(([P,A])=>P==="custom"?null:P==="Worksheet"?e.jsxs("tr",{children:[e.jsx("td",{children:P}),e.jsx("td",{children:e.jsx(re,{id:A,value:u(P),onValueChange:D=>h(P,D,{shouldDirty:!0}),options:(v==null?void 0:v.map(D=>({value:D,label:D})))||[]})}),e.jsx("td",{className:Te.singleActionCell})]},A):e.jsxs("tr",{children:[e.jsx("td",{children:P}),e.jsx("td",{children:e.jsx(W,{id:A,fluid:!0,maxLength:25,defaultValue:A,placeholder:"Use default column name",...o(P)})}),e.jsx("td",{className:Te.singleActionCell})]},A)),p.map((P,A)=>{var pe,de,le;const D=P.ontimeName,K=P.importName,L=(le=(de=(pe=d.custom)==null?void 0:pe[A])==null?void 0:de.ontimeName)==null?void 0:le.message,k=`custom.${A}.ontimeName`;return e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx(W,{maxLength:25,fluid:!0,defaultValue:D,placeholder:"Name of the field as shown in Ontime",...o(`custom.${A}.ontimeName`,{validate:C=>Nt.isAlphanumericWithSpace(C)?!0:"Only alphanumeric characters and space are allowed"})}),L&&e.jsx(E,{children:L})]}),e.jsx("td",{children:e.jsx(W,{maxLength:25,fluid:!0,defaultValue:K,placeholder:"Name of the column in the spreadsheet",...o(`custom.${A}.importName`)})}),e.jsx("td",{className:Te.singleActionCell,children:e.jsx(X,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>S(A),children:e.jsx(he,{})})})]},k)}),e.jsxs("tr",{children:[e.jsx("td",{}),e.jsx(F,{as:"td",align:"end",children:e.jsxs(f,{onClick:z,children:["Add custom field ",e.jsx(xe,{})]})}),e.jsx("td",{})]})]})]}),e.jsx(E,{children:b.worksheet.error})]})}const ri="https://docs.getontime.no/features/import-spreadsheet-gsheet/";function ai(){return e.jsxs(me,{children:["Ontime can import data from spreadsheets by: ",e.jsx("br",{}),"- importing the spreadsheet file in Ontime ",e.jsx("br",{}),"- synchronising your project with a Google Sheet",e.jsx("br",{}),e.jsx("br",{}),"To synchronise with a Google Sheet, you will need to allow Ontime to authenticate with your Google account.",e.jsx(se,{href:ri,children:"See the docs"})]})}function ii(t){const{onCancel:s}=t,{revoke:n,connect:r,verifyAuth:i}=ot(),[l,a]=j.useState(null),[c,m]=j.useState(null),[o,h]=j.useState(""),[u,d]=j.useState(""),x=U(D=>D.sheetId),p=U(D=>D.setSheetId),g=U(D=>D.setWorksheets),y=U(D=>D.patchStepData),b=U(D=>D.authenticationStatus),v=U(D=>D.setAuthenticationStatus),w=U(D=>D.stepData.authenticate.error),$=async()=>{const D=await i();D&&v(D.authenticated)};j.useEffect(()=>{y({authenticate:{available:!1,error:""}}),z()},[]);const R=async()=>{h("cancel"),await n(),await $(),h("")},O=()=>{s()},T=D=>{var K;(K=D.target.files)!=null&&K.length&&a(D.target.files[0])},S=async()=>{if(!l||!x)return;y({worksheet:{available:!1,error:""}}),h("connect");const D=await r(l,x);D&&(d(D.verification_url),m(D.user_code)),h("")},z=async(D=0)=>{const K=await i();if(K!=null&&K.authenticated&&(v(K.authenticated),K.authenticated!=="pending")){if(K.authenticated=="authenticated")try{const L=await ws(K.sheetId);g(L)}catch(L){const k=V(L);y({worksheet:{available:!1,error:k}})}h("");return}if(D<=10){setTimeout(()=>z(D+1),2e3);return}h("")},_=async()=>{h("authenticate"),kt(u),window.addEventListener("focus",async()=>{z()},{once:!0})},H=l&&x,q=!!c&&!!u,I=!!o,P=b==="authenticated",A=b==="pending";return e.jsxs(N,{children:[e.jsxs(ve,{children:["Sync with Google Sheet (experimental)",P?e.jsx(f,{onClick:R,loading:o==="cancel",children:"Revoke Authentication"}):e.jsx(f,{onClick:O,children:"Go Back"})]}),e.jsxs(oe,{children:[e.jsx(ne,{children:"Upload Client Secret provided by Google"}),e.jsx(E,{children:w}),e.jsx(W,{fluid:!0,type:"file",onChange:T,accept:".json",disabled:I||q})]}),e.jsxs(oe,{children:[e.jsx(ne,{children:"Enter ID of sheet to synchronise"}),e.jsx(E,{children:void 0}),e.jsx(W,{fluid:!0,placeholder:"Sheet ID",onChange:D=>p(D.target.value),disabled:I||q})]}),q?e.jsx(oe,{children:e.jsxs(F,{children:[A&&e.jsx("span",{children:"Authenticating..."}),e.jsx(Rt,{copyValue:c??"",disabled:!q,children:c||"Upload files to generate Auth Key"}),e.jsxs(f,{onClick:_,disabled:!q,children:[e.jsx(Ls,{}),"Authenticate"]})]})}):e.jsx(oe,{children:e.jsx(F,{children:e.jsxs(f,{onClick:S,disabled:!H||I,loading:o==="connect",children:[e.jsx(Is,{}),"Connect"]})})})]})}const li="_center_1q0ge_17",oi="_nowrap_1q0ge_21",ci="_secondaryRow_1q0ge_25",di="_linkStartActive_1q0ge_30",ui="_flex_1q0ge_36",hi="_subdued_1q0ge_42",ee={center:li,nowrap:oi,secondaryRow:ci,linkStartActive:di,flex:ui,subdued:hi};function xt(t){return t?"Yes":void 0}function mi({rundown:t,customFields:s}){let n=0;const r=Object.keys(s),i=r.map(l=>s[l].label);return e.jsxs(be,{className:ee.nowrap,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"#"}),e.jsx("th",{children:"Type"}),e.jsx("th",{children:"Cue"}),e.jsx("th",{children:"Title"}),e.jsx("th",{children:"Flag"}),e.jsx("th",{children:"Time Start"}),e.jsx("th",{children:"Time End"}),e.jsx("th",{children:"Duration"}),e.jsx("th",{children:"Warning Time"}),e.jsx("th",{children:"Danger Time"}),e.jsx("th",{children:"Count to end"}),e.jsx("th",{children:"Skip"}),e.jsx("th",{children:"Colour"}),e.jsx("th",{children:"Timer Type"}),e.jsx("th",{children:"End Action"}),i.map(l=>e.jsx("th",{children:l},l)),e.jsx("th",{children:"ID"})]})}),e.jsx("tbody",{children:t.flatOrder.map(l=>{const a=t.entries[l];if(Jn(a)){const u=a.colour?ct(a.colour):{};return e.jsxs("tr",{children:[e.jsx("td",{})," ",e.jsx("td",{className:ee.center,children:e.jsx(G,{children:a.type})}),e.jsx("td",{})," ",e.jsx("td",{children:a.title}),e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{style:{...u},children:a.colour}),e.jsx("td",{})," ",e.jsx("td",{})," ",r.map(d=>{let x="";return d in a.custom&&(x=a.custom[d]),e.jsx("td",{children:x},d)}),e.jsx("td",{className:ee.center,children:e.jsx(G,{children:a.id})})]},a.id)}if(Xn(a)){const u=a.colour?ct(a.colour):{};return e.jsxs(j.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{})," ",e.jsx("td",{className:ee.center,children:e.jsx(G,{children:a.type})}),e.jsx("td",{className:ee.nowrap,children:a.cue}),e.jsx("td",{children:a.title}),e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{style:{...u},children:a.colour}),e.jsx("td",{})," ",e.jsx("td",{})," ",r.map(d=>{let x="";return d in a.custom&&(x=a.custom[d]),e.jsx("td",{children:x},d)}),e.jsx("td",{className:ee.center,children:e.jsx(G,{children:a.id})})]}),a.note&&e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:ee.secondaryRow,children:["Note: ",a.note]})})]},a.id)}if(!js(a))return null;n+=1;const c=a.colour?ct(a.colour):{},m=xt(a.countToEnd),o=xt(a.skip),h=xt(a.flag);return e.jsxs(j.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:ee.center,children:e.jsx(G,{children:n})}),e.jsx("td",{className:ee.center,children:e.jsx(G,{children:a.type})}),e.jsx("td",{className:ee.nowrap,children:a.cue}),e.jsx("td",{children:a.title}),e.jsx("td",{className:ee.center,children:h&&e.jsx(G,{children:h})}),e.jsxs("td",{className:ee.flex,children:[e.jsx("span",{className:a.linkStart?ee.subdued:void 0,children:Ie(a.timeStart)}),a.linkStart&&e.jsx($s,{className:ee.linkStartActive})]}),e.jsx("td",{children:Ie(a.timeEnd)}),e.jsx("td",{children:Ie(a.duration)}),e.jsx("td",{children:Ie(a.timeWarning)}),e.jsx("td",{children:Ie(a.timeDanger)}),e.jsx("td",{className:ee.center,children:m&&e.jsx(G,{children:m})}),e.jsx("td",{children:o&&e.jsx(G,{children:o})}),e.jsx("td",{style:{...c},children:a.colour}),e.jsx("td",{className:ee.center,children:e.jsx(G,{children:a.timerType})}),e.jsx("td",{className:ee.center,children:e.jsx(G,{children:a.endAction})}),r.map(u=>{let d="";return u in a.custom&&(d=a.custom[u]),e.jsx("td",{children:d},u)}),e.jsx("td",{className:ee.center,children:e.jsx(G,{children:a.id})})]}),a.note&&e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:ee.secondaryRow,children:["Note: ",a.note]})})]},a.id)})})]})}function xi({rundown:t,customFields:s,summary:n,onFinished:r,onCancel:i,onBack:l}){const{data:a}=ps(),[c,m]=j.useState(!1),{importRundown:o}=ot(),h=U(x=>x.resetPreview),u=()=>{h(),i()},d=async()=>{m(!0),await o({[a.id]:{...t,id:a.id,title:a.title}},s),m(!1),r()};return e.jsxs(N,{children:[e.jsxs(ve,{children:["Review Rundown",e.jsxs(F,{children:[e.jsx(f,{onClick:u,variant:"ghosted",disabled:c,children:"Cancel"}),e.jsx(f,{onClick:l,variant:"subtle",disabled:c,children:"Back"}),e.jsx(f,{onClick:d,variant:"primary",loading:c,children:"Apply"})]})]}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx("b",{children:"Title"})," ",t.title]}),e.jsxs(M,{children:[e.jsx("b",{children:"Number of entries"})," ",t.flatOrder.length]}),e.jsxs(M,{children:[e.jsx("b",{children:"Start time"})," ",Ie(n.start)]}),e.jsxs(M,{children:[e.jsx("b",{children:"End time"})," ",Ie(n.end)]}),e.jsxs(M,{children:[e.jsx("b",{children:"Total duration"})," ",on(n.duration)]})]}),e.jsx(mi,{rundown:t,customFields:s})]})}function ji(){const[t,s]=j.useState("none"),[n,r]=j.useState(""),[i,l]=j.useState("none"),{exportRundown:a,importRundownPreview:c,verifyAuth:m}=ot(),o=U(C=>C.setWorksheets),h=U(C=>C.authenticationStatus),u=U(C=>C.setAuthenticationStatus),d=U(C=>C.rundown),x=U(C=>C.setRundown),p=U(C=>C.customFields),g=U(C=>C.setCustomFields),y=U(C=>C.summary),b=U(C=>C.setSummary),v=U(C=>C.setSheetId),w=U(C=>C.sheetId),$=U(C=>C.resetPreview),R=j.useRef(null),O=async C=>{var Ce;const Z=(Ce=C.target.files)==null?void 0:Ce[0];if(!Z){o(null),l("none");return}try{l("loading"),Aa(Z);const De=await ka(Z);o(De),s("excel"),l("done")}catch(De){const _e=cn(De);r(`Error uploading file: ${_e}`),o(null),l("none")}},T=()=>{var C;(C=R.current)==null||C.click()},S=()=>{s("none"),x(null),l("none"),o(null),g(null),b(null),r(""),v(null)},z=async()=>{const C=await m();if(C&&(u(C.authenticated),v(C.sheetId),C.authenticated==="authenticated"&&C.sheetId))try{const Z=await ws(C.sheetId);o(Z)}catch(Z){const Ce=V(Z);r(`Error getting worksheets: ${Ce}`)}s("gsheet")},_=()=>{S()},H=async C=>{if(r(""),t==="excel")try{const Z=await Da(C);x(Z.rundown),g(Z.customFields),b(Z.summary)}catch(Z){r(V(Z))}if(t==="gsheet"){if(!w)return;await c(w,C)}},q=async()=>{if(S(),h==="authenticated"){const C=await m();C&&u(C.authenticated)}},I=()=>{s("finished"),x(null),l("none"),o(null),g(null),r("")},P=async C=>{w&&await a(w,C)},A=t==="excel",D=t==="gsheet",K=h==="authenticated",L=t==="none",k=t==="finished",pe=D&&!K,de=D&&K||A&&i==="done",le=d!==null&&p!==null&&y!==null;return e.jsx(N,{children:e.jsxs(te,{children:[e.jsx(Q,{children:"Synchronise your rundown with an external source"}),n&&e.jsx(E,{children:n}),L&&e.jsxs(e.Fragment,{children:[e.jsx(ai,{}),e.jsx("input",{ref:R,style:{display:"none"},type:"file",onChange:O,accept:".xlsx","data-testid":"file-input"}),e.jsxs("div",{className:Te.uploadSection,children:[e.jsxs("div",{children:[e.jsxs(f,{variant:"primary",onClick:T,loading:i==="loading",children:[e.jsx(He,{}),"Import from spreadsheet"]}),e.jsx(ne,{children:"Accepts .xlsx files"})]}),e.jsx(ur,{orientation:"vertical"}),e.jsxs("div",{children:[e.jsxs(f,{variant:"primary",onClick:z,disabled:i!=="none",children:[e.jsx(Vs,{}),"Synchronise with Google"]}),e.jsx(ne,{children:"Start authentication process"})]})]})]}),k&&e.jsxs("div",{className:Te.finishSection,children:[n?e.jsx("span",{className:Te.error,children:"Import failed"},"finish__error"):e.jsx("span",{className:Te.success,children:"Import successful"},"finish__success"),e.jsx(f,{variant:"primary",onClick:S,children:"Return"})]}),pe&&e.jsx(ii,{onCancel:_}),de&&!le&&e.jsx(ni,{hasErrors:!!n,isSpreadsheet:A,onCancel:q,onSubmitExport:P,onSubmitImport:H}),le&&e.jsx(xi,{rundown:d,customFields:p,summary:y,onFinished:I,onCancel:q,onBack:$})]})})}const pi="_halfWidth_6p65m_17",gi="_fullWidth_6p65m_21",fi="_twoCols_6p65m_25",yi="_current_6p65m_31",st={halfWidth:pi,fullWidth:gi,twoCols:fi,current:yi};function Rs({onSubmit:t,onCancel:s,initialColour:n,initialLabel:r,initialKey:i}){const{data:l}=lt(),[a,c]=j.useState(n||""),{handleSubmit:m,register:o,setFocus:h,setError:u,setValue:d,getValues:x,watch:p,formState:{errors:g,isSubmitting:y,isValid:b,isDirty:v}}=ce({defaultValues:{type:"text",label:r||"",colour:n||""},resetOptions:{keepDirtyValues:!0}}),w=async S=>{const{type:z,label:_,colour:H}=S,q={type:z,colour:H,label:_};try{await t(q)}catch(I){u("root",{type:"custom",message:V(I)})}};j.useEffect(()=>{h("label")},[h]);const $=S=>{c(S),d("colour",S,{shouldDirty:!0})},R=x("colour"),O=v&&b,T=i!==void 0;return e.jsxs($e,{as:"form",onSubmit:m(w),onKeyDown:S=>we(S,s),children:[e.jsxs(me,{children:["Please note that images can quickly deteriorate your app's performance.",e.jsx("br",{}),"Prefer using small, and compressed images."]}),e.jsxs("div",{children:[e.jsx(ne,{children:"Type"}),e.jsx(xs,{orientation:"horizontal",disabled:T,onValueChange:S=>d("type",S,{shouldDirty:!0}),value:p("type"),items:[{value:"text",label:"Text"},{value:"image",label:"Image"}]})]}),e.jsxs("div",{className:st.twoCols,children:[e.jsxs("label",{children:[e.jsx(ne,{children:"Label (only alphanumeric characters are allowed)"}),g.label&&e.jsx(E,{children:g.label.message}),e.jsx(W,{...o("label",{required:{value:!0,message:"Required field"},onChange:()=>d("key",yr(x("label"))??"N/A"),validate:S=>S.trim().length===0?"Required field":Nt.isAlphanumericWithSpace(S)?!T&&T&&Object.keys(l).includes(S)?"Custom fields must be unique":!0:"Only alphanumeric characters and space are allowed"}),fluid:!0})]}),e.jsxs("label",{children:[e.jsx(ne,{children:"Key (use in Integrations and API)"}),e.jsx(W,{...o("key"),variant:"ghosted",readOnly:!0,fluid:!0})]})]}),e.jsxs("label",{children:[e.jsx(ne,{children:"Colour"}),e.jsx($n,{name:"colour",value:R,handleChange:(S,z)=>$(z)})]}),g.root&&e.jsx(E,{children:g.root.message}),e.jsxs(F,{relation:"inner",align:"end",children:[e.jsx(f,{variant:"ghosted",onClick:s,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:!O,loading:y,children:"Save"})]})]})}function vi(t){const{colour:s,label:n,fieldKey:r,type:i,onEdit:l,onDelete:a}=t,[c,m]=j.useState(!1),o=async h=>{await l(r,h),m(!1)};return c?e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(Rs,{onCancel:()=>m(!1),onSubmit:o,initialColour:s,initialLabel:n,initialKey:r})})}):e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(Vn,{color:s})}),e.jsx("td",{children:e.jsx(G,{children:i})}),e.jsx("td",{className:st.halfWidth,children:n}),e.jsx("td",{className:st.fullWidth,children:e.jsx(Rt,{size:"small",copyValue:r,children:r})}),e.jsxs(F,{relation:"inner",as:"td",children:[e.jsx(X,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>m(!0),children:e.jsx(nt,{})}),e.jsx(X,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>a(r),children:e.jsx(he,{})})]})]})}function bi(){const{data:t,refetch:s}=lt(),[n,r]=j.useState(!1),i=()=>{r(!0)},l=()=>{r(!1)},a=async o=>{await ir(o),s(),r(!1)},c=async(o,h)=>{await lr(o,h),s()},m=async o=>{try{await or(o),s()}catch{}};return e.jsx(N,{children:e.jsxs(te,{children:[e.jsxs(Q,{children:["Custom fields",e.jsxs(f,{onClick:i,children:["New ",e.jsx(xe,{})]})]}),e.jsx(ie,{}),e.jsx(N,{children:e.jsxs(me,{children:["Custom fields allow for additional information to be added to an event.",e.jsx("br",{}),e.jsx("br",{}),"To use custom fields as a data source in an"," ",e.jsx(ys,{search:"settings=automation__automations",children:"Automation"}),", please note the generated key.",e.jsx(se,{href:dn,children:"See the docs"})]})}),e.jsxs(N,{children:[n&&e.jsx(Rs,{onSubmit:a,onCancel:l}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Colour"}),e.jsx("th",{children:"Type"}),e.jsx("th",{children:"Name"}),e.jsx("th",{children:"Key (used in Automations)"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:Object.entries(t).map(([o,{colour:h,label:u,type:d}])=>e.jsx(vi,{fieldKey:o,colour:h,label:u,type:d,onEdit:c,onDelete:m},o))})]})]})]})})}function wi(){const{data:t,status:s,isError:n,refetch:r,isFetching:i}=St({queryKey:ge,queryFn:rr,placeholderData:(l,a)=>l,refetchInterval:ds});return{data:t??{loaded:"",rundowns:[]},status:s,isError:n,refetch:r,isFetching:i}}function Es(){const t=Ct(),{mutateAsync:s}=Ue({mutationFn:Zn,onMutate:()=>{t.cancelQueries({queryKey:ge})},onSuccess:a=>{t.setQueryData(ge,a.data)}}),{mutateAsync:n}=Ue({mutationFn:er,onMutate:()=>{t.cancelQueries({queryKey:ge})},onSuccess:a=>{t.setQueryData(ge,a.data)}}),{mutateAsync:r}=Ue({mutationFn:([a,c])=>tr(a,c),onMutate:()=>{t.cancelQueries({queryKey:ge})},onSuccess:a=>{t.setQueryData(ge,a.data)}}),{mutateAsync:i}=Ue({mutationFn:sr,onMutate:()=>{t.cancelQueries({queryKey:ge})},onSuccess:a=>{t.setQueryData(ge,a.data)}}),{mutateAsync:l}=Ue({mutationFn:nr,onMutate:()=>{t.cancelQueries({queryKey:ge})},onSuccess:a=>{t.setQueryData(ge,a.data)}});return{create:s,duplicate:n,remove:i,load:l,rename:r}}function Si({onSubmit:t,onCancel:s,initialTitle:n}){const{handleSubmit:r,register:i,setFocus:l,setError:a,formState:{errors:c,isSubmitting:m,isValid:o,isDirty:h}}=ce({defaultValues:{title:n},mode:"onChange"}),u=async x=>{try{await t(x.title)}catch(p){a("root",{type:"custom",message:V(p)})}};j.useEffect(()=>{l("title")},[l]);const d=h&&o;return e.jsxs($e,{as:"form",onSubmit:r(u),onKeyDown:x=>we(x,s),children:[e.jsxs("label",{children:[e.jsx(ne,{children:"Rundown title"}),e.jsx(W,{...i("title",{required:{value:!0,message:"Title is required"},validate:x=>x.trim().length===0?"Title cannot be empty":Nt.isAlphanumericWithSpace(x)===!1?"Title can only contain alphanumeric characters, spaces and underscores":!0}),fluid:!0}),c.title&&e.jsx(E,{children:c.title.message})]}),c.root&&e.jsx(E,{children:c.root.message}),e.jsxs(F,{relation:"inner",align:"end",children:[e.jsx(f,{variant:"ghosted",onClick:s,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:!d,loading:m,children:"Save"})]})]})}function Ci({onClose:t}){const{create:s}=Es(),{handleSubmit:n,register:r,setFocus:i,setError:l,formState:{errors:a,isSubmitting:c}}=ce({defaultValues:{title:""}}),m=async o=>{try{await s(o.title||"untitled"),t()}catch(h){l("root",{message:`Failed to create rundown. ${h}`})}};return j.useEffect(()=>{i("title")},[i]),e.jsxs($e,{as:"form",onSubmit:n(m),children:[e.jsx(N,{children:e.jsxs("label",{children:[e.jsx(ne,{children:"Rundown title"}),e.jsx(W,{...r("title"),fluid:!0,placeholder:"Your rundown name"})]})}),e.jsxs(F,{relation:"inner",align:"end",children:[e.jsx(f,{variant:"ghosted",disabled:c,onClick:t,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:c,children:"Create rundown"})]}),a.root&&e.jsx(E,{children:a.root.message})]})}function _i(){var z;const{data:t}=wi(),{duplicate:s,remove:n,load:r,rename:i}=Es(),[l,a]=Ee(),[c,m]=Ee(),[o,h]=Ee(),[u,d]=j.useState(""),[x,p]=j.useState(null),[g,y]=j.useState(null),b=_=>{y(null),d(_),m.open()},v=_=>{y(null),d(_),a.open()},w=_=>{y(null),p(_)},$=async()=>{try{await r(u)}catch(_){y(`Failed to load rundown. ${V(_)}`)}finally{m.close()}},R=async _=>{y(null),p(null),d("");try{await s(_)}catch(H){y(`Failed to duplicate rundown. ${V(H)}`)}},O=async(_,H)=>{try{await i([_,H]),p(null)}catch(q){y(`Failed to rename rundown. ${V(q)}`)}},T=async()=>{try{await n(u)}catch(_){y(`Failed to delete rundown. ${V(_)}`)}finally{a.close()}},S=async(_,H)=>{await Ra(_,H)};return e.jsxs(e.Fragment,{children:[e.jsx(N,{children:e.jsxs(te,{children:[e.jsxs(Q,{children:["Manage project rundowns",e.jsx(F,{children:e.jsxs(f,{onClick:()=>{y(null),h.open()},children:["New ",e.jsx(xe,{})]})})]}),e.jsx(ie,{}),e.jsxs(N,{children:[o&&e.jsx(Ci,{onClose:h.close}),g&&e.jsx(E,{children:g}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"# Entries"}),e.jsx("th",{style:{width:"100%"},children:"Title"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:(z=t==null?void 0:t.rundowns)==null?void 0:z.map(({id:_,numEntries:H,title:q})=>{const I=t.loaded===_;return x===_?e.jsx("tr",{children:e.jsx("td",{colSpan:3,children:e.jsx(Si,{onCancel:()=>p(null),onSubmit:A=>O(_,A),initialTitle:q})})},_):e.jsxs("tr",{className:ye([I&&st.current]),children:[e.jsx("td",{children:H}),e.jsxs("td",{children:[q," ",I&&e.jsx(G,{children:"Loaded"})]}),e.jsx("td",{children:e.jsx(hs,{render:e.jsx(X,{variant:"ghosted-white"}),items:[{type:"item",icon:ts,label:"Rename",onClick:()=>w(_)},{type:"item",icon:He,label:"Load",onClick:()=>b(_),disabled:I},{type:"item",icon:ss,label:"Download .xlsx",onClick:()=>S(_,q)},{type:"item",icon:Ws,label:"Duplicate",onClick:()=>R(_)},{type:"divider"},{type:"destructive",icon:he,label:"Delete",onClick:()=>v(_),disabled:I}],children:e.jsx(ns,{})})})]},_)})})]})]})]})}),e.jsx(ft,{isOpen:l,onClose:a.close,title:"Delete rundown",showBackdrop:!0,showCloseButton:!0,bodyElements:e.jsxs(e.Fragment,{children:["You will lose all data in your rundown. ",e.jsx("br",{})," Are you sure?"]}),footerElements:e.jsxs(e.Fragment,{children:[e.jsx(f,{size:"large",onClick:a.close,children:"Cancel"}),e.jsx(f,{variant:"destructive",size:"large",onClick:T,children:"Delete rundown"})]})}),e.jsx(ft,{isOpen:c,onClose:m.close,title:"Load rundown",showBackdrop:!0,showCloseButton:!0,bodyElements:e.jsxs(e.Fragment,{children:["The current playback will be stopped. ",e.jsx("br",{})," Are you sure?"]}),footerElements:e.jsxs(e.Fragment,{children:[e.jsx(f,{size:"large",onClick:m.close,children:"Cancel"}),e.jsx(f,{variant:"primary",size:"large",onClick:$,children:"Load rundown"})]})})]})}function ki(){const{defaultDuration:t,linkPrevious:s,defaultTimeStrategy:n,defaultWarnTime:r,defaultDangerTime:i,defaultTimerType:l,defaultEndAction:a,setDefaultDuration:c,setLinkPrevious:m,setTimeStrategy:o,setWarnTime:h,setDangerTime:u,setDefaultTimerType:d,setDefaultEndAction:x}=gs(b=>b),p=Ge(t),g=Ge(r),y=Ge(i);return e.jsx(N,{children:e.jsxs(te,{children:[e.jsx(Q,{children:"Rundown defaults"}),e.jsx(ie,{}),e.jsxs(N,{children:[e.jsx(ve,{children:"Default settings for new events"}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(B,{title:"Link previous",description:"Whether the start time of new events should be linked to the previous event end time"}),e.jsx(ke,{size:"large",checked:s,onCheckedChange:m})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Timer strategy",description:"Which time should be maintained when event schedule is recalculated"}),e.jsx(re,{value:n,onValueChange:b=>o(b),options:[{value:Mt.LockDuration,label:"Duration"},{value:Mt.LockEnd,label:"End Time"}]})]})]}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(B,{title:"Default duration",description:"Default duration for new events"}),e.jsx(Ke,{name:"defaultDuration",submitHandler:(b,v)=>c(v),time:p,placeholder:Be.duration})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Timer type",description:"Default type of timer for new events"}),e.jsx(re,{value:l,onValueChange:b=>d(b),options:[{value:Ye.CountDown,label:"Count down"},{value:Ye.CountUp,label:"Count up"},{value:Ye.Clock,label:"Clock"},{value:Ye.None,label:"None"}]})]}),e.jsxs(M,{children:[e.jsx(B,{title:"End Action",description:"Default end action for new events"}),e.jsx(re,{value:a,onValueChange:b=>x(b),options:[{value:ht.None,label:"None"},{value:ht.LoadNext,label:"Load next"},{value:ht.PlayNext,label:"Play next"}]})]})]}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(B,{title:"Warning time",description:"Default threshold for warning time in an event"}),e.jsx(Ke,{name:"warnTime",submitHandler:(b,v)=>h(v),time:g,placeholder:Be.warnTime})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Danger time",description:"Default threshold for danger time in an event"}),e.jsx(Ke,{name:"dangerTime",submitHandler:(b,v)=>u(v),time:y,placeholder:Be.dangerTime})]})]})]})]})})}function Di({location:t}){const s=ae("defaults",t),n=ae("custom",t),r=ae("rundowns",t),i=ae("sheets",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Project data"}),e.jsx("div",{ref:s,children:e.jsx(ki,{})}),e.jsx("div",{ref:n,children:e.jsx(bi,{})}),e.jsx("div",{ref:r,children:e.jsx(_i,{})}),e.jsx("div",{ref:i,children:e.jsx(ji,{})})]})}const Ri="_textEntry_dpb46_17",Ei="_inlineEntry_dpb46_25",Pi="_redirect_dpb46_32",Ni="_label_dpb46_36",Ne={textEntry:Ri,inlineEntry:Ei,redirect:Pi,label:Ni};function Oi({id:t,isOpen:s,name:n,currentPath:r,origin:i,onClose:l}){const{data:a}=os(),[c,m]=j.useState(r),[o,h]=j.useState("/"),{setRedirect:u}=us,d=g=>{g==="/"||g===r||(g.startsWith("preset-")?u({target:t,redirect:g.slice(7)}):u({target:t,redirect:g}),l())},x=a.filter(g=>g.enabled),p=[...un.map(g=>({value:`/${g.url}`,label:g.label})),...x.map(g=>({value:`preset-${g.alias}`,label:`URL Preset: ${g.alias}`}))];return e.jsx(it,{isOpen:s,onClose:l,showCloseButton:!0,showBackdrop:!0,title:`Redirect: ${n}`,bodyElements:e.jsxs(e.Fragment,{children:[e.jsxs(me,{children:["Remotely redirect the client to a different URL. ",e.jsx("br",{}),"Either by entering a custom path or selecting a URL Preset.",e.jsx("br",{}),e.jsx("br",{}),e.jsx(ys,{search:"settings=sharing__presets",children:"Manage URL Presets"})]}),e.jsxs("div",{className:Ne.inlineEntry,children:[e.jsx("span",{className:Ne.label,children:"Enter custom path"}),e.jsxs("label",{className:Ne.textEntry,children:[i,e.jsx(W,{placeholder:"eg. /timer",fluid:!0,value:c,onChange:g=>m(g.target.value)})]}),e.jsxs(f,{variant:"primary","aria-label":"Redirect",disabled:c===r||c==="",className:Ne.redirect,onClick:()=>d(c),children:["Redirect",e.jsx(It,{})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:Ne.label,children:"Select View or URL Preset"}),e.jsxs("div",{className:Ne.inlineEntry,children:[e.jsxs("label",{className:Ne.textEntry,children:[i,e.jsx(re,{fluid:!0,options:p,defaultValue:p[0].value,onValueChange:g=>h(g),disabled:x.length===0})]}),e.jsxs(f,{variant:"primary","aria-label":"Redirect to preset",className:Ne.redirect,disabled:x.length===0||o==="/",onClick:()=>d(o),children:["Redirect ",e.jsx(It,{})]})]})]})]})})}const Ti="_blink_vtewd_1",Ai="_halfWidthNoWrap_vtewd_25",Fi="_copiable_vtewd_30",wt="_self_vtewd_35",ze={blink:Ti,halfWidthNoWrap:Ai,copiable:Fi,self:wt};function Ii(){const t=$t(p=>p.id),s=$t(p=>p.clients),[n,r]=Ee(),[i,l]=Ee(),{setIdentify:a}=us,[c,m]=j.useState(""),o=p=>{m(p),l.open()},h=p=>{m(p),r.open()},u=Object.entries(s).filter(([p,{type:g}])=>g==="ontime"),d=Object.entries(s).filter(([p,{type:g}])=>g!=="ontime"),x=s[c];return e.jsxs(e.Fragment,{children:[n&&x!==void 0&&e.jsx(Oi,{id:c,name:x.name,origin:x.origin,currentPath:x.path,isOpen:n,onClose:r.close}),i&&e.jsx(hn,{id:c,name:x==null?void 0:x.name,isOpen:i,onClose:l.close}),e.jsxs(N,{children:[e.jsxs(ve,{children:["Ontime Clients (",u.length,")"]}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:{width:"20%"},children:"Client Name"}),e.jsx("td",{children:"Path"}),e.jsx("td",{})]})}),e.jsx("tbody",{children:u.map(([p,g])=>{const{identify:y,name:b,path:v}=g,w=t===p;return e.jsxs("tr",{className:ye([w&&ze.self]),children:[e.jsxs(F,{relation:"inner",as:"td",children:[w&&e.jsx(G,{children:"SELF"}),b]}),e.jsx("td",{className:ze.copiable,children:v}),e.jsxs(F,{relation:"inner",as:"td",children:[e.jsx(f,{size:"small",className:`${y?ze.blink:""}`,disabled:w,variant:y?"primary":"subtle","data-testid":w?"":"not-self-identify",onClick:()=>{a({target:p,identify:!y})},children:"Identify"}),e.jsx(f,{size:"small","data-testid":w?"":"not-self-rename",onClick:()=>o(p),children:"Rename"}),e.jsx(f,{size:"small",disabled:w,"data-testid":w?"":"not-self-redirect",onClick:()=>h(p),children:"Redirect"})]})]},p)})})]})]}),e.jsx(ie,{}),e.jsxs(N,{children:[e.jsxs(ve,{children:["Other Clients (",d.length,")"]}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:ze.halfWidthNoWrap,children:"Client Name"}),e.jsx("td",{className:ze.halfWidthNoWrap,children:"Client type"})]})}),e.jsx("tbody",{children:d.map(([p,g])=>{const{name:y,type:b}=g;return e.jsxs("tr",{children:[e.jsx("td",{children:y}),e.jsx("td",{children:b})]},p)})})]})]})]})}function Li(){return e.jsx(N,{children:e.jsxs(te,{children:[e.jsx(Q,{children:"Manage clients"}),e.jsx(ie,{}),e.jsx(Ii,{})]})})}const $i="_iconRotate_l21m9_17",Vi={iconRotate:$i};function Wi(){const t=s=>{cs("log",s)};return e.jsx(N,{children:e.jsxs(te,{children:[e.jsxs(Q,{children:["Event log",e.jsxs(f,{onClick:t,children:["Extract ",e.jsx(es,{className:Vi.iconRotate})]})]}),e.jsx(ie,{}),e.jsx(mn,{})]})})}function Mi({location:t}){const s=ae("clients",t),n=ae("log",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Network"}),xn,e.jsx("div",{ref:n,children:e.jsx(Wi,{})}),e.jsx("div",{ref:s,children:e.jsx(Li,{})})]})}const Yt={project:{title:""},settings:{timeFormat:"24",language:"en"}};function qi({isOpen:t,onClose:s}){var b,v,w,$;const{defaultWarnTime:n,defaultDangerTime:r,setDangerTime:i,setWarnTime:l}=gs(),{handleSubmit:a,register:c,formState:{errors:m,isSubmitting:o,isValid:h},watch:u,setError:d,setValue:x}=ce({defaultValues:Yt,values:Yt,resetOptions:{keepDirtyValues:!0}}),p=async R=>{try{R.project.title===""&&(R.project.title="untitled"),await Wa(R),await Me(),s()}catch(O){d("root",{message:V(O)})}},g=Ge(n),y=Ge(r);return e.jsx(it,{isOpen:t,onClose:s,showBackdrop:!0,showCloseButton:!0,title:"Create new project...",bodyElements:e.jsxs("form",{onSubmit:a(p),id:"quick-start",children:[e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(B,{title:"Project title",description:"Shown as the title in some views"}),e.jsx(W,{maxLength:150,placeholder:"Project title",fluid:!0,...c("project.title")})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Time format",description:"Default time format to show in views 12 /24 hours",error:(v=(b=m.settings)==null?void 0:b.timeFormat)==null?void 0:v.message}),e.jsx(re,{value:u("settings.timeFormat"),onValueChange:R=>x("settings.timeFormat",R,{shouldDirty:!0}),defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Views language",description:"Language to be displayed in views",error:($=(w=m.settings)==null?void 0:w.language)==null?void 0:$.message}),e.jsx(re,{value:u("settings.language"),onValueChange:R=>x("settings.language",R,{shouldDirty:!0}),defaultValue:"en",options:[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"es",label:"Spanish"}]})]})]}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(B,{title:"Warning time",description:"Default threshold for warning time in an event"}),e.jsx(Ke,{name:"warnTime",submitHandler:(R,O)=>l(O),time:g,placeholder:Be.warnTime})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Danger time",description:"Default threshold for danger time in an event"}),e.jsx(Ke,{name:"dangerTime",submitHandler:(R,O)=>i(O),time:y,placeholder:Be.dangerTime})]})]})]}),footerElements:e.jsxs(e.Fragment,{children:[(m==null?void 0:m.root)&&e.jsx(E,{children:m.root.message}),e.jsx(f,{variant:"ghosted",onClick:s,disabled:!1,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",form:"quick-start",disabled:!h,loading:o,children:"Create project"})]})})}const Ui="_current_1iru7_17",zi="_isEditing_1iru7_21",Bi="_form_1iru7_25",Ki="_formInput_1iru7_33",Gi="_saveButton_1iru7_37",Hi="_containCell_1iru7_41",Qi="_innerColumn_1iru7_49",Yi="_inlineLabels_1iru7_57",Ji="_warningInfo_1iru7_62",Xi="_empty_1iru7_66",je={current:Ui,isEditing:zi,form:Bi,formInput:Ki,saveButton:Gi,containCell:Hi,innerColumn:Qi,inlineLabels:Yi,warningInfo:Ji,empty:Xi};function Zi({onClose:t}){const[s,n]=j.useState(null),{handleSubmit:r,register:i,formState:{isSubmitting:l,isValid:a},setFocus:c}=ce({defaultValues:{title:""},values:{title:""},resetOptions:{keepDirtyValues:!0}});j.useEffect(()=>{c("title")},[c]);const m=async o=>{try{n(null);const h=o.title??"untitled";await Va({filename:h}),t()}catch(h){n(V(h))}};return e.jsxs($e,{as:"form",onSubmit:r(m),onKeyDown:o=>we(o,t),children:[e.jsxs(ve,{children:["Create new project",e.jsxs(F,{children:[e.jsx(f,{onClick:t,variant:"ghosted",disabled:l,children:"Cancel"}),e.jsx(f,{disabled:!a,type:"submit",loading:l,variant:"primary",children:"Create project"})]})]}),s&&e.jsx(E,{children:s}),e.jsxs(N,{className:je.innerColumn,children:[e.jsx(ne,{children:"Project title"}),e.jsx(W,{fluid:!0,placeholder:"Your project name",...i("title")})]})]})}const el={files:[],lastLoadedProject:""};function tl(){const{data:t,status:s,refetch:n}=St({queryKey:jn,queryFn:Ma,placeholderData:(r,i)=>r,retry:5,retryDelay:r=>r*2500,refetchInterval:ds,networkMode:"always"});return{data:t??el,status:s,refetch:n}}function Ps(){const t=tl(),{files:s,lastLoadedProject:n}=t.data,r=j.useMemo(()=>{if(!s.length)return[];const i=s.findIndex(c=>c.filename===n);if(i===-1)return s;const l=[...s];return[l.splice(i,1)[0],...l]},[s,n]);return{...t,data:{reorderedProjectFiles:r,lastLoadedProject:t.data.lastLoadedProject}}}function sl({action:t,filename:s,onSubmit:n,onCancel:r}){const{handleSubmit:i,register:l,formState:{isSubmitting:a,isDirty:c,isValid:m},setFocus:o}=ce({defaultValues:{filename:s},values:{filename:s},resetOptions:{keepDirtyValues:!0}});return j.useEffect(()=>{o("filename")},[o]),e.jsxs("form",{onSubmit:i(n),onKeyDown:h=>we(h,r),className:je.form,children:[e.jsx(W,{className:je.formInput,id:"filename",placeholder:"Enter new name",...l("filename",{required:!0})}),e.jsxs(F,{relation:"inner",children:[e.jsx(f,{onClick:r,variant:"ghosted",disabled:a,children:"Cancel"}),e.jsx(f,{variant:"primary",disabled:!c||!m||a,type:"submit",className:je.saveButton,children:t})]})]})}async function nl(t,s){const n={};for(const r in s)ar(r,t)&&s[r]&&(r==="rundowns"&&(n.customFields=t.customFields),Object.assign(n,{[r]:t[r]}));return n}function rl({onClose:t,fileName:s}){const[n,r]=j.useState(null),i=Ct(),{handleSubmit:l,watch:a,setValue:c,formState:{isSubmitting:m,isValid:o,isDirty:h}}=ce({defaultValues:{project:!1,rundowns:!1,viewSettings:!1,urlPresets:!1,automation:!1},resetOptions:{keepDirtyValues:!0}}),u=async d=>{if(Object.values(d).every(p=>!p)){r("At least one option must be selected");return}try{r(null);const{data:p}=await Cs(s);if(!p.settings.version.startsWith("4.")){r("The project you are attempting to merge is from an older version and it need to be migrated first");return}const g=await nl(p,d);await ks(g),await i.invalidateQueries({queryKey:pn}),t()}catch(p){r(V(p))}};return e.jsxs(N,{as:"form",onSubmit:l(u),children:[e.jsxs(ve,{children:["Partial project merge",e.jsxs(F,{children:[e.jsx(f,{onClick:t,variant:"ghosted",disabled:m,children:"Cancel"}),e.jsx(f,{type:"submit",disabled:!o||!h,loading:m,variant:"primary",children:"Merge"})]})]}),n&&e.jsx(E,{children:n}),e.jsxs(N,{className:ye([je.innerColumn,je.inlineLabels]),children:[e.jsxs(ne,{children:["Select data from ",e.jsx("i",{children:`"${s}"`})," to merge into the current project."]}),e.jsxs(me,{type:"warning",children:["This process is irreversible and can result in data loss. ",e.jsx("br",{}),"You may want to create a duplicate backup beforehand."]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("project"),onCheckedChange:d=>c("project",d,{shouldDirty:!0})}),"Project data"]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("rundowns"),onCheckedChange:d=>c("rundowns",d,{shouldDirty:!0})}),"Rundown + Custom Fields"]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("viewSettings"),onCheckedChange:d=>c("viewSettings",d,{shouldDirty:!0})}),"View Settings"]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("urlPresets"),onCheckedChange:d=>c("urlPresets",d,{shouldDirty:!0})}),"URL Presets"]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("automation"),onCheckedChange:d=>c("automation",d,{shouldDirty:!0})}),"Automation Settings"]})]})]})}function al({current:t,updatedAt:s,editingFilename:n,editingMode:r,filename:i,onRefetch:l,onSubmit:a,onToggleEditMode:c}){const[m,o]=j.useState(null),[h,u]=j.useState(!1),d=R=>async O=>{u(!0),o(null);try{if(!O.filename){o("Filename cannot be blank");return}await(R==="rename"?za:Ua)(i,O.filename),await l(),a()}catch(T){o(V(T))}finally{u(!1)}},x=async R=>{u(!0),o(null);try{await Ds(R),await l(),await Me()}catch(O){o(V(O))}finally{u(!1)}},p=async R=>{u(!0),o(null);try{await Ba(R),await l()}catch(O){o(V(O))}finally{u(!1)}},g=(R,O)=>{o(null),c(R,O)},y=()=>{g(null,null)},b=i===n,v=(r==="rename"||r==="duplicate")&&i===n,w=r==="merge"&&b,$=ye([t&&!b&&je.current,b&&je.isEditing]);return e.jsxs(e.Fragment,{children:[m&&e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(E,{children:m})})},"filename-error"),e.jsx("tr",{className:$,children:v?e.jsx("td",{colSpan:99,children:e.jsx(sl,{action:r,filename:i,onSubmit:d(r==="duplicate"?"duplicate":"rename"),onCancel:y})}):e.jsxs(e.Fragment,{children:[e.jsx("td",{className:je.containCell,children:i}),e.jsx("td",{children:t?"Currently loaded":new Date(s).toLocaleString()}),e.jsx("td",{children:e.jsx(il,{current:t,filename:i,onChangeEditMode:g,onDelete:p,onLoad:x,isDisabled:h||w,onMerge:R=>g("merge",R)})})]})},i),w&&e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(rl,{onClose:y,fileName:i})})})]})}function il(t){const{current:s,filename:n,isDisabled:r,onChangeEditMode:i,onDelete:l,onLoad:a,onMerge:c}=t,m=()=>{i("rename",n)},o=()=>{i("duplicate",n)},h=async()=>{await $a(n)};return e.jsx(hs,{render:e.jsx(X,{variant:"ghosted-white"}),disabled:r,items:[{type:"item",icon:He,label:"Load",onClick:()=>a(n),disabled:s},{type:"item",icon:He,label:"Partial Load",onClick:()=>c(n),disabled:s},{type:"item",icon:ts,label:"Rename",onClick:m},{type:"item",icon:Ms,label:"Duplicate",onClick:o},{type:"item",icon:ss,label:"Download",onClick:h},{type:"divider"},{type:"item",icon:he,label:"Delete",onClick:()=>l(n),disabled:s}],children:e.jsx(ns,{})})}function ll(){const{data:t,refetch:s,status:n}=Ps(),[r,i]=j.useState(null),[l,a]=j.useState(null),c=(u,d)=>{i(x=>x===u&&d===l?null:u),a(d)},m=()=>{i(null),a(null)},o=async()=>{await s()};if(n==="pending")return e.jsx("div",{className:je.empty,children:e.jsx(Le,{isLoading:!0})});const h=t.reorderedProjectFiles.length;return e.jsxs(e.Fragment,{children:[h>20&&e.jsxs(me,{className:je.warningInfo,type:"warning",children:["You have ",h," projects. Consider deleting unused projects to improve performance."]}),e.jsxs(be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:je.containCell,children:"File Name"}),e.jsx("th",{children:"Last Used"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:t.reorderedProjectFiles.map(u=>e.jsx(al,{filename:u.filename,updatedAt:u.updatedAt,onToggleEditMode:c,onSubmit:m,onRefetch:o,editingFilename:l,editingMode:r,current:u.filename===t.lastLoadedProject},u.filename))})]})]})}function ol(){const[t,s]=rs(),[n,r]=j.useState(""),[i,l]=j.useState(null),a=j.useRef(null),c=t.get("new")==="true",m=()=>{t.set("new",c?"false":"true"),s(t)},o=()=>{var d;(d=a.current)==null||d.click()},h=async d=>{var p,g;const x=(g=(p=d.target)==null?void 0:p.files)==null?void 0:g[0];if(x){l("import");try{Ss(x),await _s(x)}catch(y){const b=V(y);r(`Error uploading file: ${b}`)}finally{await Me()}l(null)}},u=()=>{t.delete("new"),s(t)};return e.jsxs(N,{children:[e.jsx("input",{ref:a,style:{display:"none"},type:"file",onChange:h,accept:".json","data-testid":"file-input"}),e.jsxs(te,{children:[e.jsxs(Q,{children:["Manage projects",e.jsxs(F,{children:[e.jsx(f,{onClick:o,disabled:!!i||c,loading:i==="import",children:"Import"}),e.jsxs(f,{onClick:m,disabled:!!i||c,children:["New ",e.jsx(xe,{})]})]})]}),n&&e.jsx(E,{children:n}),e.jsx(ie,{}),c&&e.jsx(Zi,{onClose:u}),e.jsx(ll,{})]})]})}function cl({location:t,setLocation:s}){const n=ae("list",t),r=()=>{s("project")};return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Project"}),e.jsx(qi,{isOpen:t==="create",onClose:r}),e.jsx("div",{ref:n,children:e.jsx(ol,{})})]})}const dl="_container_cq029_17",ul={container:dl};function Jt({register:t,formName:s,disabled:n}){const[r,i]=j.useState(!1);return e.jsxs("div",{className:ul.container,children:[e.jsx(W,{type:r?"text":"password",maxLength:4,...t(s,{pattern:{value:Bn,message:"Only alphanumeric characters are allowed"}}),placeholder:"-",disabled:n}),e.jsx(X,{onMouseDown:()=>i(!0),onMouseUp:()=>i(!1),variant:"ghosted","aria-label":"Show pin code",children:e.jsx(qs,{})})]})}const hl=j.lazy(()=>Qe(()=>import("./CustomTranslationModal-BBNxpds0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url));function ml(){var R,O,T,S,z;const{data:t,status:s,refetch:n}=gn(),{handleSubmit:r,register:i,reset:l,setError:a,watch:c,setValue:m,formState:{isSubmitting:o,isDirty:h,isValid:u,errors:d}}=ce({mode:"onChange",defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0}}),[x,p]=Ee();j.useEffect(()=>{t&&l(t)},[t,l]);const g=async _=>{try{await fn(_)}catch(H){const q=V(H);a("root",{message:q})}finally{await n()}},y=s==="pending",b=o||!h||!u,v="",w=()=>{l(t)},$=s==="pending";return e.jsxs(e.Fragment,{children:[e.jsx(hl,{isOpen:x,onClose:p.close}),e.jsx(N,{as:"form",onSubmit:r(g),onKeyDown:_=>we(_,w),id:"app-settings",children:e.jsxs(te,{children:[e.jsxs(Q,{children:["General settings",e.jsxs(F,{children:[e.jsx(f,{disabled:!h||o,variant:"ghosted",onClick:w,children:"Revert to saved"}),e.jsx(f,{type:"submit",form:"app-settings",name:"general-settings-submit",loading:o,disabled:b,variant:"primary",children:"Save"})]})]}),v,e.jsx(ie,{}),e.jsxs(N,{children:[e.jsx(Le,{isLoading:$}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(B,{title:"Ontime server port",description:We?"Server port disabled for Ontime Cloud":"Port ontime server listens in. Defaults to 4001 (needs app restart)",error:(R=d.serverPort)==null?void 0:R.message}),e.jsx(W,{id:"serverPort",type:"number",maxLength:5,style:{width:"75px"},disabled:We,...i("serverPort",{required:{value:!0,message:"Required field"},max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"},pattern:{value:ms,message:"Value should be numeric"}})})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Editor pin code",description:"Protect the editor view with a pin code",error:(O=d.editorKey)==null?void 0:O.message}),e.jsx(Jt,{register:i,formName:"editorKey",disabled:y})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Operator pin code",description:"Protect the operator and cuesheet views with a pin code",error:(T=d.operatorKey)==null?void 0:T.message}),e.jsx(Jt,{register:i,formName:"operatorKey",disabled:y})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Time format",description:"Default time format to show in views 12 /24 hours",error:(S=d.timeFormat)==null?void 0:S.message}),e.jsx(re,{value:c("timeFormat"),onValueChange:_=>m("timeFormat",_,{shouldDirty:!0}),defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Views language",description:"Language to be displayed in views",error:(z=d.language)==null?void 0:z.message}),e.jsx(re,{value:c("language"),onValueChange:_=>m("language",_,{shouldDirty:!0}),disabled:y,defaultValue:"en",options:[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"es",label:"Spanish"},{value:"custom",label:"Custom"}]}),e.jsx(f,{onClick:p.open,children:"Edit custom translation"})]})]})]})]})})]})}const xl="_uploadLogoCard_m5263_17",jl="_customDataItem_m5263_32",pl="_titleRow_m5263_39",gl="_customImage_m5263_48",fl="_imageContainer_m5263_54",Ve={uploadLogoCard:xl,customDataItem:jl,titleRow:pl,customImage:gl,imageContainer:fl};function yl(){var q;const{data:t,status:s}=Wn(),{updateProjectData:n}=Mn(),{handleSubmit:r,register:i,reset:l,formState:{isSubmitting:a,isValid:c,isDirty:m,errors:o},setError:h,clearErrors:u,watch:d,control:x,setValue:p}=ce({defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0},mode:"onChange"}),{fields:g,append:y,remove:b}=et({control:x,name:"custom"});j.useEffect(()=>{t&&l(t)},[t,l]);const v=async I=>{var A;const P=(A=I.target.files)==null?void 0:A[0];if(u("logo"),!!P)try{La(P);const D=await qn(P);p("logo",D.data.logoFilename,{shouldDirty:!0})}catch(D){const K=V(D);h("logo",{message:K})}},{ref:w,...$}=i("logo"),R=j.useRef(null),O=()=>{var I;(I=R.current)==null||I.click()},T=I=>{I.preventDefault(),I.stopPropagation(),p("logo",null,{shouldDirty:!0})},S=()=>{y({title:"",value:"",url:""})},z=async I=>{try{u(),await n(I)}catch(P){const A=V(P);h("root",{message:A})}},_=()=>{l(t)},H=s==="pending";return e.jsx(N,{as:"form",onSubmit:r(z),onKeyDown:I=>we(I,_),children:e.jsxs(te,{children:[e.jsxs(Q,{children:["Project data",e.jsxs(F,{children:[e.jsx(f,{onClick:_,disabled:a||!m,children:"Revert to saved"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!m||!c,loading:a,children:"Save"})]})]}),e.jsx(ie,{}),e.jsxs(N,{children:[e.jsx(Le,{isLoading:H}),e.jsxs("label",{children:["Project title",e.jsx(W,{fluid:!0,maxLength:50,placeholder:"Project title is shown in production views",...i("title")})]}),e.jsx(N,{style:{marginTop:0},children:e.jsxs("label",{children:["Project logo",e.jsx("input",{type:"file",style:{display:"none"},accept:"image/*",...$,ref:I=>{w(I),R.current=I},onChange:v}),e.jsxs(te,{className:Ve.uploadLogoCard,children:[d("logo")?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:`${yn}/${d("logo")}`}),e.jsxs(f,{variant:"subtle-destructive",disabled:a||!d("logo"),onClick:T,children:[e.jsx(he,{}),"Delete"]})]}):e.jsxs(f,{disabled:a,onClick:O,type:"button",children:[e.jsx(He,{}),"Upload logo"]}),((q=o==null?void 0:o.logo)==null?void 0:q.message)&&e.jsx(E,{children:o.logo.message})]})]})}),e.jsxs("label",{children:["Project description",e.jsx(W,{fluid:!0,maxLength:100,placeholder:"Euro Love, Malmö 2024",...i("description")})]}),e.jsxs("label",{children:["Project info",e.jsx(yt,{fluid:!0,maxLength:150,placeholder:"Wi-Fi password: 1234",resize:"vertical",...i("info")})]}),e.jsxs("label",{children:["Project QR code URL",e.jsx(W,{fluid:!0,placeholder:Dt,...i("url")})]}),e.jsxs(N,{style:{marginTop:0},children:[e.jsxs(M,{children:[e.jsx(B,{title:"Custom data",description:""}),e.jsxs(f,{onClick:S,children:["Add ",e.jsx(xe,{})]})]}),g.length>0&&g.map((I,P)=>{var D,K,L;const A=(D=o.custom)==null?void 0:D[P];return e.jsxs("div",{className:Ve.customDataItem,children:[e.jsxs("div",{className:Ve.titleRow,children:[e.jsxs("label",{className:Ve.title,children:["Title",e.jsx(W,{fluid:!0,defaultValue:I.title,placeholder:"Title of your custom data",...i(`custom.${P}.title`,{required:{value:!0,message:"Field cannot be empty"}})})]}),e.jsxs(f,{variant:"subtle-destructive",onClick:()=>b(P),children:[e.jsx(he,{}),"Delete"]})]}),((K=A==null?void 0:A.title)==null?void 0:K.message)&&e.jsx(E,{children:A.title.message}),e.jsxs("label",{children:["Text",e.jsx(yt,{fluid:!0,rows:3,resize:"vertical",defaultValue:I.value,placeholder:"Text of your custom data",...i(`custom.${P}.value`,{required:{value:!0,message:"Field cannot be empty"}})}),((L=A==null?void 0:A.value)==null?void 0:L.message)&&e.jsx(E,{children:A.value.message})]}),e.jsxs("label",{children:["Image URL (optional)",e.jsxs("div",{className:Ve.customImage,children:[e.jsx(W,{fluid:!0,defaultValue:I.url,placeholder:"Paste image URL (optional)",...i(`custom.${P}.url`)}),e.jsx("div",{className:Ve.imageContainer,children:d(`custom.${P}.url`)&&e.jsx("img",{src:d(`custom.${P}.url`),alt:"",loading:"lazy",className:"info__image"})})]})]})]},I.id)})]})]})]})})}const vl="_editorActions_18rtd_17",bl="_right_18rtd_21",wl="_column_18rtd_26",jt={editorActions:vl,right:bl,column:wl},Sl=j.lazy(()=>Qe(()=>import("./StyleEditor-DNjZ46Qf.js"),__vite__mapDeps([11,1,2,12]),import.meta.url));function Cl({isOpen:t,onClose:s}){const[n,r]=j.useState(""),[i,l]=j.useState(!1),[a,c]=j.useState(!1),[m,o]=j.useState(!1),[h,u]=j.useState(null),d=j.useRef(null),x=async()=>{try{o(!0);const y=await vn();r(y)}catch{}finally{o(!1)}},p=async()=>{try{c(!0),d.current&&(await bn(d.current.getCss()),r(d.current.getCss()),l(!1))}catch{}finally{c(!1)}},g=()=>r("");return j.useEffect(()=>{async function y(){if(t)try{const b=await wn();r(b)}catch{u("Failed to load CSS from server")}}y()},[t]),e.jsx(it,{title:"Edit CSS override",isOpen:t,onClose:s,showCloseButton:!0,showBackdrop:!0,bodyElements:e.jsx(Sl,{ref:d,initialValue:n,language:"css",isDirty:i,setIsDirty:l}),footerElements:e.jsxs("div",{className:jt.column,children:[e.jsx(me,{children:"Invalid CSS will be refused by the browser"}),h&&e.jsx(E,{className:jt.right,children:`Error: ${h}`}),e.jsxs(F,{align:"apart",className:jt.editorActions,children:[e.jsx(f,{variant:"ghosted",size:"large",onClick:x,disabled:a||m,children:"Reset to example"}),e.jsxs(F,{children:[e.jsx(f,{variant:"ghosted",size:"large",onClick:g,children:"Clear"}),e.jsx(f,{size:"large",onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",size:"large",onClick:p,disabled:a||m||!i,loading:a,children:"Save changes"})]})]})]})})}const _l="https://docs.getontime.no/features/custom-styling/";function kl(){var y;const{data:t,status:s,mutateAsync:n}=Sn(),[r,i]=Ee(),{control:l,handleSubmit:a,setError:c,reset:m,setValue:o,watch:h,formState:{isSubmitting:u,isDirty:d,errors:x}}=ce({defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0}});j.useEffect(()=>{t&&m(t)},[t,m]);const p=async b=>{try{n(b)}catch(v){const w=V(v);c("root",{message:w})}},g=()=>{m(t)};return l?e.jsx(N,{as:"form",onSubmit:a(p),onKeyDown:b=>we(b,g),id:"view-settings",children:e.jsxs(te,{children:[e.jsxs(Q,{children:["View settings",e.jsxs(F,{children:[e.jsx(f,{disabled:!d,variant:"ghosted",onClick:g,children:"Revert to saved"}),e.jsx(f,{type:"submit",loading:u,disabled:!d,variant:"primary",children:"Save"})]})]}),e.jsx(ie,{}),e.jsxs(me,{children:["You can customise the styles applied to Ontime views by providing overriding CSS rules.",e.jsx("br",{}),e.jsx(se,{href:_l,children:"See the docs"})]}),e.jsxs(N,{children:[e.jsx(Le,{isLoading:s==="pending"}),e.jsx(E,{children:(y=x.root)==null?void 0:y.message}),e.jsxs(oe,{children:[e.jsx(Cl,{isOpen:r,onClose:i.close}),e.jsxs(M,{children:[e.jsx(B,{title:"Override CSS styles",description:"Enables overriding view styles with custom stylesheet"}),e.jsx(ke,{size:"large",checked:h("overrideStyles"),onCheckedChange:b=>o("overrideStyles",b,{shouldDirty:!0})}),e.jsx(f,{onClick:i.open,disabled:u,children:"Edit CSS override"})]})]}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(B,{title:"Timer colour",description:"Default colour of a running timer"}),e.jsx(ut,{name:"normalColor",control:l})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Warning colour",description:"Colour of a running timer in warning mode"}),e.jsx(ut,{name:"warningColor",control:l})]}),e.jsxs(M,{children:[e.jsx(B,{title:"Danger colour",description:"Colour of a running timer in danger mode"}),e.jsx(ut,{name:"dangerColor",control:l})]})]})]})]})}):null}function Dl({location:t}){const s=ae("data",t),n=ae("general",t),r=ae("view",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Settings"}),e.jsx("div",{ref:s,children:e.jsx(yl,{})}),e.jsx("div",{ref:n,children:e.jsx(ml,{})}),e.jsx("div",{ref:r,children:e.jsx(kl,{})})]})}function Rl(){const{isElectron:t,sendToElectron:s}=Cn(),[n,r]=Ee(),i=j.useRef(null),l=()=>{s("shutdown","now"),r.close()},a=t||tt;return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Shutdown Ontime"}),e.jsxs(N,{children:[We?e.jsx(_n,{children:"For security reasons, shutting down the server must be done from the Ontime Cloud dashboard."}):e.jsxs(Pe,{children:["This will shutdown the Ontime server. ",e.jsx("br",{}),"The runtime state will be lost, but your project is kept for next time."]}),e.jsx(f,{variant:"destructive",onClick:r.open,disabled:!(t||tt),children:"Shutdown ontime"}),!a&&e.jsx(ne,{children:"Note: Ontime can only be shutdown from the machine it is running in."}),e.jsx(ft,{isOpen:n,title:"Shutdown Ontime",showCloseButton:!0,onClose:r.close,bodyElements:e.jsxs(Pe,{children:["This will shutdown the Ontime server. ",e.jsx("br",{})," Are you sure?"]}),footerElements:e.jsxs(e.Fragment,{children:[e.jsx(f,{ref:i,onClick:r.close,variant:"ghosted-white",children:"Cancel"}),e.jsx(f,{variant:"destructive",onClick:l,disabled:!a,children:"Shutdown"})]})})]})]})}const El="_corner_1dxip_17",Pl="_contentWrapper_1dxip_24",Nl="_content_1dxip_24",pt={corner:El,contentWrapper:Pl,content:Nl};function Ol({onClose:t,children:s}){return e.jsxs("div",{className:pt.contentWrapper,children:[e.jsx("div",{className:pt.content,children:s}),e.jsx("div",{className:pt.corner,children:e.jsxs(f,{size:"large",onClick:t,children:["Close settings ",e.jsx(_t,{})]})})]})}const Tl=[{id:"settings",label:"Settings",secondary:[{id:"settings__data",label:"Project data"},{id:"settings__general",label:"General settings"},{id:"settings__view",label:"View settings"}]},{id:"project",label:"Project",split:!0,secondary:[{id:"project__create",label:"Create..."},{id:"project__list",label:"Manage projects"}]},{id:"manage",label:"Project settings",secondary:[{id:"manage__defaults",label:"Rundown defaults"},{id:"manage__custom",label:"Custom fields"},{id:"manage__rundowns",label:"Manage rundowns"},{id:"manage__sheets",label:"Import spreadsheet"},{id:"manage__sheets",label:"Sync with Google Sheet"}]},{id:"automation",label:"Automation",split:!0,secondary:[{id:"automation__settings",label:"Automation settings"},{id:"automation__automations",label:"Manage automations"},{id:"automation__triggers",label:"Manage triggers"}]},{id:"sharing",label:"Sharing and reporting",split:!0,secondary:[{id:"sharing__presets",label:"URL Presets"},{id:"sharing__link",label:"Share link"},{id:"sharing__report",label:"Runtime report"}]},{id:"network",label:"Network",split:!0,secondary:[{id:"network__log",label:"Event log"},{id:"network__clients",label:"Manage clients"}]},{id:"about",label:"About",split:!0},{id:"shutdown",label:"Shutdown",split:!0}];function Al(){const{data:t}=vs();return{options:j.useMemo(()=>Tl.map(n=>({...n,highlight:n.id==="about"&&t.hasUpdates?"New version available":void 0})),[t])}}const Xe="settings";function Tt(){const[t,s]=rs(),n=j.useMemo(()=>t.get(Xe)??"project",[t]),r=j.useMemo(()=>!!t.get(Xe),[t]),[i,l]=n.split("__"),a=j.useCallback(()=>{t.delete(Xe),s(t)},[t,s]),c=j.useCallback(m=>{t.set(Xe,m),s(t)},[t,s]);return{isOpen:r,panel:i,location:l,setLocation:c,close:a}}const Fl="_tabs_86c70_17",Il="_primary_86c70_31",Ll="_secondary_86c70_32",$l="_active_86c70_54",Vl="_highlight_86c70_58",Wl="_split_86c70_68",Fe={tabs:Fl,primary:Il,secondary:Ll,active:$l,highlight:Vl,split:Wl};function Ml({selectedPanel:t,location:s}){const{options:n}=Al();return e.jsx("ul",{className:Fe.tabs,children:n.map(r=>{const i=t===r.id;return r.highlight?e.jsx(fs,{text:r.highlight,render:e.jsx("span",{}),children:e.jsx(Xt,{panel:r,location:s,isSelected:i})},r.id):e.jsx(Xt,{panel:r,location:s,isSelected:i},r.id)})})}function Xt(t){var a;const{panel:s,isSelected:n,location:r}=t,{setLocation:i}=Tt(),l=ye([Fe.primary,n&&Fe.active,s.split&&Fe.split,s.highlight&&Fe.highlight]);return e.jsxs(j.Fragment,{children:[e.jsx("li",{onClick:()=>i(s.id),onKeyDown:c=>{Vt(c)&&i(s.id)},className:l,tabIndex:0,role:"button",children:s.label},s.id),(a=s.secondary)==null?void 0:a.map((c,m)=>{const o=c.id.split("__")[1],h=ye([Fe.secondary,n&&r===o?Fe.active:null]);return e.jsx("li",{onClick:()=>i(c.id),onKeyDown:u=>{Vt(u)&&i(c.id)},className:h,role:"button",children:c.label},c.id+m)})]},s.id)}const ql="_container_1fy3l_17",Ul={container:ql};function zl(){const{close:t,panel:s,location:n,setLocation:r}=Tt();return br(t,"Escape"),e.jsx("div",{className:Ul.container,children:e.jsxs(Us,{children:[e.jsx(Ml,{selectedPanel:s,location:n}),e.jsxs(Ol,{onClose:t,children:[s==="settings"&&e.jsx(Dl,{location:n}),s==="project"&&e.jsx(cl,{location:n,setLocation:r}),s==="manage"&&e.jsx(Di,{location:n}),s==="automation"&&e.jsx(aa,{location:n}),s==="sharing"&&e.jsx(_a,{location:n}),s==="network"&&e.jsx(Mi,{location:n}),s==="about"&&e.jsx(kr,{}),s==="shutdown"&&e.jsx(Rl,{})]})]})})}const Bl=j.memo(Kl);function Kl({children:t}){return e.jsxs(Kn,{navElements:t,children:[e.jsx(Gn,{}),e.jsx(xr,{}),e.jsx(jr,{}),e.jsx(pr,{}),e.jsx(gr,{}),e.jsx(fr,{})]})}function Gl({onFinish:t}){const s=j.useRef(null),n=()=>{var i;(i=s.current)==null||i.click()},r=async i=>{var a,c;const l=(c=(a=i.target)==null?void 0:a.files)==null?void 0:c[0];if(l)try{Ss(l),await _s(l)}catch{}finally{await Me(),t()}};return e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:s,style:{display:"none"},type:"file",onChange:r,accept:".json","data-testid":"file-input"}),e.jsx(f,{onClick:n,children:"Import project"})]})}const Hl="_sections_khqv6_17",Ql="_column_khqv6_23",Yl="_about_khqv6_23",Jl="_inline_khqv6_35",Xl="_header_khqv6_41",Zl="_logo_khqv6_48",eo="_buttonRow_khqv6_53",to="_tableContainer_khqv6_62",so="_table_khqv6_62",no="_current_khqv6_75",fe={sections:Hl,column:Ql,about:Yl,inline:Jl,header:Xl,logo:Zl,buttonRow:eo,tableContainer:to,table:so,current:no};function ro(t){const{loadProject:s,onClose:n}=t,{data:r}=Ps();return e.jsx("tbody",{children:r.reorderedProjectFiles.map(i=>i.filename===r.lastLoadedProject?e.jsxs("tr",{className:fe.current,onClick:n,children:[e.jsx("td",{children:i.filename}),e.jsx("td",{children:"Loaded from last session"})]},i.filename):e.jsxs("tr",{onClick:()=>s(i.filename),children:[e.jsx("td",{children:i.filename}),e.jsx("td",{children:new Date(i.updatedAt).toLocaleString()})]},i.filename))})}function ao({onClose:t}){const s=zs(),n=async l=>{try{await Ds(l),await Me(),t()}catch{}},r=async()=>{try{await qa(),await Me(),t()}catch{}},i=()=>{s("/editor?settings=project__create"),t()};return e.jsx(it,{isOpen:!0,onClose:()=>t(),showBackdrop:!0,bodyElements:e.jsxs("div",{className:fe.sections,children:[e.jsxs("div",{className:fe.about,children:[e.jsx("img",{src:"ontime-logo.png",alt:"ontime",className:fe.logo}),e.jsxs("div",{children:["Ontime v",Ze]}),e.jsx(se,{href:gt,children:"Website"}),e.jsx(se,{href:Dt,children:"Read the docs"}),e.jsx(se,{href:as,children:"Discord server"})]}),e.jsxs("div",{className:fe.column,children:[e.jsxs("div",{className:fe.header,children:["Welcome to Ontime",e.jsx(X,{"aria-label":"close welcome modal",variant:"subtle-white",onClick:()=>t(),children:e.jsx(_t,{})})]}),e.jsx(mr,{children:"Select project"}),e.jsx("div",{className:fe.tableContainer,children:e.jsxs("table",{className:fe.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"File Name"}),e.jsx("th",{children:"Last Used"})]})}),e.jsx(ro,{loadProject:n,onClose:()=>t()})]})})]})]}),footerElements:e.jsxs("div",{className:fe.column,children:[e.jsxs("div",{className:fe.buttonRow,children:[e.jsx(f,{onClick:r,children:"Load demo project"}),e.jsx(Gl,{onFinish:()=>t()}),e.jsx(f,{variant:"primary",onClick:i,children:"Create new..."})]}),e.jsxs(hr,{className:fe.inline,children:[e.jsx(En,{defaultChecked:!0,onCheckedChange:l=>kn(l)}),"Show this modal on next startup"]})]})})}function io(){const t=Wt(n=>n.showDialog),s=Wt(n=>n.clearDialog);return t?e.jsx(ao,{onClose:s}):null}const lo=j.lazy(()=>Qe(()=>import("./RundownExport-D6uAmFbb.js").then(t=>t.R),__vite__mapDeps([13,1,2,14,3,4,15,16,17,18,8,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,7,10,33,34,35,36,37,38]),import.meta.url)),oo=j.lazy(()=>Qe(()=>import("./TimerControlExport-i0ZDpUx7.js"),__vite__mapDeps([39,1,2,14,3,4,15,16,17,20,21,22,31,32,40,41,42,43]),import.meta.url)),co=j.lazy(()=>Qe(()=>import("./MessageControlExport-BL2ip9qN.js"),__vite__mapDeps([44,1,2,14,3,4,15,16,17,29,30,31,32,41,42,45]),import.meta.url));function uo(){const{isOpen:t,setLocation:s,close:n}=Tt(),[r,i]=Ee();Pn("Editor"),Dn(),j.useEffect(()=>{var a;((a=window.process)==null?void 0:a.type)==="renderer"&&window.ipcRenderer.on("user-request-shutdown",()=>{s("shutdown")})},[s]);const l=j.useCallback(()=>{t?n():s("settings")},[n,t,s]);return Bs([["mod + ,",l]]),e.jsxs("div",{className:mt.mainContainer,"data-testid":"event-editor",children:[e.jsx(io,{}),e.jsx(Rn,{isOpen:r,onClose:i.close}),e.jsxs(Bl,{children:[e.jsx(X,{"aria-label":"Toggle navigation",variant:"subtle-white",size:"xlarge",onClick:i.open,children:e.jsx(Ks,{})}),e.jsx(X,{"aria-label":"Toggle settings",variant:"subtle-white",size:"xlarge",onClick:l,children:t?e.jsx(_t,{}):e.jsx(Gs,{})})]}),t?e.jsx(zl,{}):e.jsxs("div",{id:"panels",className:mt.panelContainer,children:[e.jsxs("div",{className:mt.left,children:[e.jsx(oo,{}),e.jsx(co,{})]}),e.jsx(lo,{})]})]})}function To(){return e.jsx(Hs,{permission:"editor",children:e.jsx(uo,{})})}export{To as default};
3
+ //# sourceMappingURL=ProtectedEditor-Bl4wV72N.js.map