@getontime/cli 4.4.1 → 4.4.2

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 (333) hide show
  1. package/client/assets/{Backstage-BY9GL_rk.js → Backstage-BdrcXNr9.js} +2 -2
  2. package/client/assets/Backstage-BdrcXNr9.js.br +0 -0
  3. package/client/assets/Backstage-BdrcXNr9.js.gz +0 -0
  4. package/client/assets/{Backstage-BY9GL_rk.js.map → Backstage-BdrcXNr9.js.map} +1 -1
  5. package/client/assets/{Countdown-CXFgDHND.js → Countdown-DQM2ppPg.js} +2 -2
  6. package/client/assets/Countdown-DQM2ppPg.js.br +0 -0
  7. package/client/assets/Countdown-DQM2ppPg.js.gz +0 -0
  8. package/client/assets/{Countdown-CXFgDHND.js.map → Countdown-DQM2ppPg.js.map} +1 -1
  9. package/client/assets/{CuesheetTable-BLICUNky.js → CuesheetTable-B5LQVh5m.js} +2 -2
  10. package/client/assets/CuesheetTable-B5LQVh5m.js.br +0 -0
  11. package/client/assets/CuesheetTable-B5LQVh5m.js.gz +0 -0
  12. package/client/assets/{CuesheetTable-BLICUNky.js.map → CuesheetTable-B5LQVh5m.js.map} +1 -1
  13. package/client/assets/{CustomTranslationModal-4PVZBtkC.js → CustomTranslationModal-CML7Vsot.js} +2 -2
  14. package/client/assets/CustomTranslationModal-CML7Vsot.js.br +0 -0
  15. package/client/assets/CustomTranslationModal-CML7Vsot.js.gz +0 -0
  16. package/client/assets/{CustomTranslationModal-4PVZBtkC.js.map → CustomTranslationModal-CML7Vsot.js.map} +1 -1
  17. package/client/assets/{DelayIndicator-DUbpd6DG.js → DelayIndicator-DKS6mZdB.js} +2 -2
  18. package/client/assets/DelayIndicator-DKS6mZdB.js.br +0 -0
  19. package/client/assets/DelayIndicator-DKS6mZdB.js.gz +0 -0
  20. package/client/assets/{DelayIndicator-DUbpd6DG.js.map → DelayIndicator-DKS6mZdB.js.map} +1 -1
  21. package/client/assets/{EditorFeatureWrapper-CV_zaDoG.js → EditorFeatureWrapper-C1vLQxiy.js} +2 -2
  22. package/client/assets/EditorFeatureWrapper-C1vLQxiy.js.br +0 -0
  23. package/client/assets/EditorFeatureWrapper-C1vLQxiy.js.gz +0 -0
  24. package/client/assets/{EditorFeatureWrapper-CV_zaDoG.js.map → EditorFeatureWrapper-C1vLQxiy.js.map} +1 -1
  25. package/client/assets/{EditorUtils-CLBWDP4k.js → EditorUtils-BLcTuWz1.js} +2 -2
  26. package/client/assets/EditorUtils-BLcTuWz1.js.br +0 -0
  27. package/client/assets/EditorUtils-BLcTuWz1.js.gz +0 -0
  28. package/client/assets/{EditorUtils-CLBWDP4k.js.map → EditorUtils-BLcTuWz1.js.map} +1 -1
  29. package/client/assets/{EmptyPage-DmpOAg7R.js → EmptyPage-CYVrjOvI.js} +2 -2
  30. package/client/assets/EmptyPage-CYVrjOvI.js.br +0 -0
  31. package/client/assets/EmptyPage-CYVrjOvI.js.gz +0 -0
  32. package/client/assets/{EmptyPage-DmpOAg7R.js.map → EmptyPage-CYVrjOvI.js.map} +1 -1
  33. package/client/assets/{FollowButton-CAUWz5Ma.js → FollowButton-DcSbb4R_.js} +2 -2
  34. package/client/assets/FollowButton-DcSbb4R_.js.br +0 -0
  35. package/client/assets/FollowButton-DcSbb4R_.js.gz +0 -0
  36. package/client/assets/{FollowButton-CAUWz5Ma.js.map → FollowButton-DcSbb4R_.js.map} +1 -1
  37. package/client/assets/{MessageControlExport-Dm8IjSr4.js → MessageControlExport-BgT9JaXk.js} +3 -3
  38. package/client/assets/MessageControlExport-BgT9JaXk.js.br +0 -0
  39. package/client/assets/MessageControlExport-BgT9JaXk.js.gz +0 -0
  40. package/client/assets/{MessageControlExport-Dm8IjSr4.js.map → MessageControlExport-BgT9JaXk.js.map} +1 -1
  41. package/client/assets/{MultiPartProgressBar-Fp-sTN2u.js → MultiPartProgressBar-W2a-JWPY.js} +2 -2
  42. package/client/assets/MultiPartProgressBar-W2a-JWPY.js.br +0 -0
  43. package/client/assets/MultiPartProgressBar-W2a-JWPY.js.gz +0 -0
  44. package/client/assets/{MultiPartProgressBar-Fp-sTN2u.js.map → MultiPartProgressBar-W2a-JWPY.js.map} +1 -1
  45. package/client/assets/{OperatorExport-CE4ajLPS.js → OperatorExport-CbWojpp6.js} +2 -2
  46. package/client/assets/OperatorExport-CbWojpp6.js.br +0 -0
  47. package/client/assets/OperatorExport-CbWojpp6.js.gz +0 -0
  48. package/client/assets/{OperatorExport-CE4ajLPS.js.map → OperatorExport-CbWojpp6.js.map} +1 -1
  49. package/client/assets/{OverviewWrapper-BNnAIUP1.js → OverviewWrapper-B2i8d3rt.js} +2 -2
  50. package/client/assets/OverviewWrapper-B2i8d3rt.js.br +0 -0
  51. package/client/assets/OverviewWrapper-B2i8d3rt.js.gz +0 -0
  52. package/client/assets/{OverviewWrapper-BNnAIUP1.js.map → OverviewWrapper-B2i8d3rt.js.map} +1 -1
  53. package/client/assets/{PipHost-CbNFsfqp.js → PipHost-Dz2oy7XG.js} +2 -2
  54. package/client/assets/PipHost-Dz2oy7XG.js.br +0 -0
  55. package/client/assets/PipHost-Dz2oy7XG.js.gz +0 -0
  56. package/client/assets/{PipHost-CbNFsfqp.js.map → PipHost-Dz2oy7XG.js.map} +1 -1
  57. package/client/assets/{ProjectInfo-Bf5z4Xsv.js → ProjectInfo-BR_7Hp5u.js} +2 -2
  58. package/client/assets/ProjectInfo-BR_7Hp5u.js.br +0 -0
  59. package/client/assets/ProjectInfo-BR_7Hp5u.js.gz +0 -0
  60. package/client/assets/{ProjectInfo-Bf5z4Xsv.js.map → ProjectInfo-BR_7Hp5u.js.map} +1 -1
  61. package/client/assets/{ProtectRoute-CCHzyy0I.js → ProtectRoute-Bxq6q7ba.js} +2 -2
  62. package/client/assets/ProtectRoute-Bxq6q7ba.js.br +0 -0
  63. package/client/assets/ProtectRoute-Bxq6q7ba.js.gz +0 -0
  64. package/client/assets/{ProtectRoute-CCHzyy0I.js.map → ProtectRoute-Bxq6q7ba.js.map} +1 -1
  65. package/client/assets/{ProtectedCuesheet-COI1W_V3.js → ProtectedCuesheet-C7AqD2dy.js} +2 -2
  66. package/client/assets/ProtectedCuesheet-C7AqD2dy.js.br +0 -0
  67. package/client/assets/ProtectedCuesheet-C7AqD2dy.js.gz +0 -0
  68. package/client/assets/{ProtectedCuesheet-COI1W_V3.js.map → ProtectedCuesheet-C7AqD2dy.js.map} +1 -1
  69. package/client/assets/{ProtectedEditor-BvTFmv-F.js → ProtectedEditor-CsfvVyOU.js} +3 -3
  70. package/client/assets/ProtectedEditor-CsfvVyOU.js.br +0 -0
  71. package/client/assets/ProtectedEditor-CsfvVyOU.js.gz +0 -0
  72. package/client/assets/{ProtectedEditor-BvTFmv-F.js.map → ProtectedEditor-CsfvVyOU.js.map} +1 -1
  73. package/client/assets/{RundownExport-C_q3KYN_.js → RundownExport-25orDQIW.js} +2 -2
  74. package/client/assets/RundownExport-25orDQIW.js.br +0 -0
  75. package/client/assets/RundownExport-25orDQIW.js.gz +0 -0
  76. package/client/assets/{RundownExport-C_q3KYN_.js.map → RundownExport-25orDQIW.js.map} +1 -1
  77. package/client/assets/{Select-DQwYPDyI.js → Select-BnGTAeXJ.js} +2 -2
  78. package/client/assets/Select-BnGTAeXJ.js.br +0 -0
  79. package/client/assets/Select-BnGTAeXJ.js.gz +0 -0
  80. package/client/assets/{Select-DQwYPDyI.js.map → Select-BnGTAeXJ.js.map} +1 -1
  81. package/client/assets/{Studio-DzXTmBx4.js → Studio-BK2Klo_K.js} +2 -2
  82. package/client/assets/Studio-BK2Klo_K.js.br +0 -0
  83. package/client/assets/Studio-BK2Klo_K.js.gz +0 -0
  84. package/client/assets/{Studio-DzXTmBx4.js.map → Studio-BK2Klo_K.js.map} +1 -1
  85. package/client/assets/{StyleEditor-ClMEMaWh.js → StyleEditor-DIHQ1PUV.js} +2 -2
  86. package/client/assets/StyleEditor-DIHQ1PUV.js.br +0 -0
  87. package/client/assets/StyleEditor-DIHQ1PUV.js.gz +0 -0
  88. package/client/assets/{StyleEditor-ClMEMaWh.js.map → StyleEditor-DIHQ1PUV.js.map} +1 -1
  89. package/client/assets/{SuperscriptPeriod-CBiZU34J.js → SuperscriptPeriod-EEedc9rG.js} +2 -2
  90. package/client/assets/SuperscriptPeriod-EEedc9rG.js.br +0 -0
  91. package/client/assets/SuperscriptPeriod-EEedc9rG.js.gz +0 -0
  92. package/client/assets/{SuperscriptPeriod-CBiZU34J.js.map → SuperscriptPeriod-EEedc9rG.js.map} +1 -1
  93. package/client/assets/{SuperscriptTime-DP1CDlOX.js → SuperscriptTime-BVanhNvd.js} +2 -2
  94. package/client/assets/SuperscriptTime-BVanhNvd.js.br +0 -0
  95. package/client/assets/SuperscriptTime-BVanhNvd.js.gz +0 -0
  96. package/client/assets/{SuperscriptTime-DP1CDlOX.js.map → SuperscriptTime-BVanhNvd.js.map} +1 -1
  97. package/client/assets/{SwatchPicker-Dyxkxf3_.js → SwatchPicker-Ckpchvjo.js} +2 -2
  98. package/client/assets/SwatchPicker-Ckpchvjo.js.br +0 -0
  99. package/client/assets/SwatchPicker-Ckpchvjo.js.gz +0 -0
  100. package/client/assets/{SwatchPicker-Dyxkxf3_.js.map → SwatchPicker-Ckpchvjo.js.map} +1 -1
  101. package/client/assets/{TimeElements-pDYJeFbV.js → TimeElements-CYIgGk0T.js} +2 -2
  102. package/client/assets/TimeElements-CYIgGk0T.js.br +0 -0
  103. package/client/assets/TimeElements-CYIgGk0T.js.gz +0 -0
  104. package/client/assets/{TimeElements-pDYJeFbV.js.map → TimeElements-CYIgGk0T.js.map} +1 -1
  105. package/client/assets/{TimeInput-DTWDnaum.js → TimeInput-Cwl9vLWA.js} +2 -2
  106. package/client/assets/TimeInput-Cwl9vLWA.js.br +0 -0
  107. package/client/assets/TimeInput-Cwl9vLWA.js.gz +0 -0
  108. package/client/assets/{TimeInput-DTWDnaum.js.map → TimeInput-Cwl9vLWA.js.map} +1 -1
  109. package/client/assets/{TimelinePage-DbLt9rQi.js → TimelinePage-D4QNdk-Z.js} +2 -2
  110. package/client/assets/TimelinePage-D4QNdk-Z.js.br +0 -0
  111. package/client/assets/TimelinePage-D4QNdk-Z.js.gz +0 -0
  112. package/client/assets/{TimelinePage-DbLt9rQi.js.map → TimelinePage-D4QNdk-Z.js.map} +1 -1
  113. package/client/assets/{Timer-BfyVKQ8U.js → Timer-BJQKNHfo.js} +2 -2
  114. package/client/assets/Timer-BJQKNHfo.js.br +0 -0
  115. package/client/assets/Timer-BJQKNHfo.js.gz +0 -0
  116. package/client/assets/{Timer-BfyVKQ8U.js.map → Timer-BJQKNHfo.js.map} +1 -1
  117. package/client/assets/{TimerControlExport-BJfhJc07.js → TimerControlExport-Ba1vifNg.js} +2 -2
  118. package/client/assets/TimerControlExport-Ba1vifNg.js.br +0 -0
  119. package/client/assets/TimerControlExport-Ba1vifNg.js.gz +0 -0
  120. package/client/assets/{TimerControlExport-BJfhJc07.js.map → TimerControlExport-Ba1vifNg.js.map} +1 -1
  121. package/client/assets/{TimerDisplay-Dgmbqf65.js → TimerDisplay-tVcUk9j3.js} +2 -2
  122. package/client/assets/TimerDisplay-tVcUk9j3.js.br +0 -0
  123. package/client/assets/TimerDisplay-tVcUk9j3.js.gz +0 -0
  124. package/client/assets/{TimerDisplay-Dgmbqf65.js.map → TimerDisplay-tVcUk9j3.js.map} +1 -1
  125. package/client/assets/{TitleCard-MUurHeZ7.js → TitleCard-BNjv58eq.js} +2 -2
  126. package/client/assets/TitleCard-BNjv58eq.js.br +0 -0
  127. package/client/assets/TitleCard-BNjv58eq.js.gz +0 -0
  128. package/client/assets/{TitleCard-MUurHeZ7.js.map → TitleCard-BNjv58eq.js.map} +1 -1
  129. package/client/assets/{Tooltip-DXph8P8p.js → Tooltip-DZJ7u9gm.js} +2 -2
  130. package/client/assets/Tooltip-DZJ7u9gm.js.br +4 -0
  131. package/client/assets/Tooltip-DZJ7u9gm.js.gz +0 -0
  132. package/client/assets/{Tooltip-DXph8P8p.js.map → Tooltip-DZJ7u9gm.js.map} +1 -1
  133. package/client/assets/{ViewLogo-Ckp7i75x.js → ViewLogo-2I7w5Yms.js} +2 -2
  134. package/client/assets/ViewLogo-2I7w5Yms.js.br +0 -0
  135. package/client/assets/ViewLogo-2I7w5Yms.js.gz +0 -0
  136. package/client/assets/{ViewLogo-Ckp7i75x.js.map → ViewLogo-2I7w5Yms.js.map} +1 -1
  137. package/client/assets/{ViewParamsEditor-Cxngd15h.js → ViewParamsEditor-BX2RM8sx.js} +2 -2
  138. package/client/assets/ViewParamsEditor-BX2RM8sx.js.br +0 -0
  139. package/client/assets/ViewParamsEditor-BX2RM8sx.js.gz +0 -0
  140. package/client/assets/{ViewParamsEditor-Cxngd15h.js.map → ViewParamsEditor-BX2RM8sx.js.map} +1 -1
  141. package/client/assets/{editorSettings-D4jfu68W.js → editorSettings-_x6YKRfR.js} +2 -2
  142. package/client/assets/editorSettings-_x6YKRfR.js.br +6 -0
  143. package/client/assets/editorSettings-_x6YKRfR.js.gz +0 -0
  144. package/client/assets/{editorSettings-D4jfu68W.js.map → editorSettings-_x6YKRfR.js.map} +1 -1
  145. package/client/assets/{getProgress-B9UANc25.js → getProgress-ZUTmCn_v.js} +2 -2
  146. package/client/assets/getProgress-ZUTmCn_v.js.br +0 -0
  147. package/client/assets/getProgress-ZUTmCn_v.js.gz +0 -0
  148. package/client/assets/{getProgress-B9UANc25.js.map → getProgress-ZUTmCn_v.js.map} +1 -1
  149. package/client/assets/{index-2lQ-45a9.js → index-Dm-4OTmY.js} +3 -3
  150. package/client/assets/index-Dm-4OTmY.js.br +0 -0
  151. package/client/assets/index-Dm-4OTmY.js.gz +0 -0
  152. package/client/assets/{index-2lQ-45a9.js.map → index-Dm-4OTmY.js.map} +1 -1
  153. package/client/assets/{offset-DAyBfv5b.js → offset-VthsmtrO.js} +2 -2
  154. package/client/assets/offset-VthsmtrO.js.br +0 -0
  155. package/client/assets/offset-VthsmtrO.js.gz +0 -0
  156. package/client/assets/{offset-DAyBfv5b.js.map → offset-VthsmtrO.js.map} +1 -1
  157. package/client/assets/{parseUserTime-WkVNjkkE.js → parseUserTime-sZbEBi61.js} +2 -2
  158. package/client/assets/parseUserTime-sZbEBi61.js.br +0 -0
  159. package/client/assets/parseUserTime-sZbEBi61.js.gz +0 -0
  160. package/client/assets/{parseUserTime-WkVNjkkE.js.map → parseUserTime-sZbEBi61.js.map} +1 -1
  161. package/client/assets/{playbackstate-znZk3SSJ.js → playbackstate-Dl_ZJABT.js} +2 -2
  162. package/client/assets/playbackstate-Dl_ZJABT.js.br +0 -0
  163. package/client/assets/playbackstate-Dl_ZJABT.js.gz +0 -0
  164. package/client/assets/{playbackstate-znZk3SSJ.js.map → playbackstate-Dl_ZJABT.js.map} +1 -1
  165. package/client/assets/{presentation.utils-CjjYs5II.js → presentation.utils-Z61KykAH.js} +2 -2
  166. package/client/assets/presentation.utils-Z61KykAH.js.br +0 -0
  167. package/client/assets/presentation.utils-Z61KykAH.js.gz +0 -0
  168. package/client/assets/{presentation.utils-CjjYs5II.js.map → presentation.utils-Z61KykAH.js.map} +1 -1
  169. package/client/assets/{rundownUtils-BTQ3EeqN.js → rundownUtils-CXZRD6yP.js} +2 -2
  170. package/client/assets/rundownUtils-CXZRD6yP.js.br +0 -0
  171. package/client/assets/rundownUtils-CXZRD6yP.js.gz +0 -0
  172. package/client/assets/{rundownUtils-BTQ3EeqN.js.map → rundownUtils-CXZRD6yP.js.map} +1 -1
  173. package/client/assets/timer.utils-B4bvsns3.js +2 -0
  174. package/client/assets/timer.utils-B4bvsns3.js.br +0 -0
  175. package/client/assets/timer.utils-B4bvsns3.js.gz +0 -0
  176. package/client/assets/{timer.utils-B-Ui91P7.js.map → timer.utils-B4bvsns3.js.map} +1 -1
  177. package/client/assets/{useCustomFields-zr9SUl5o.js → useCustomFields-BBE4LBBr.js} +2 -2
  178. package/client/assets/useCustomFields-BBE4LBBr.js.br +0 -0
  179. package/client/assets/useCustomFields-BBE4LBBr.js.gz +0 -0
  180. package/client/assets/{useCustomFields-zr9SUl5o.js.map → useCustomFields-BBE4LBBr.js.map} +1 -1
  181. package/client/assets/{useEventSelection-B9mbj1cM.js → useEventSelection-Bpbu89c7.js} +2 -2
  182. package/client/assets/useEventSelection-Bpbu89c7.js.br +0 -0
  183. package/client/assets/useEventSelection-Bpbu89c7.js.gz +0 -0
  184. package/client/assets/{useEventSelection-B9mbj1cM.js.map → useEventSelection-Bpbu89c7.js.map} +1 -1
  185. package/client/assets/{useProjectData-DD_BQ9eJ.js → useProjectData-C110zIXC.js} +2 -2
  186. package/client/assets/useProjectData-C110zIXC.js.br +0 -0
  187. package/client/assets/useProjectData-C110zIXC.js.gz +0 -0
  188. package/client/assets/{useProjectData-DD_BQ9eJ.js.map → useProjectData-C110zIXC.js.map} +1 -1
  189. package/client/assets/{useReport-DozG5uz5.js → useReport-DqSBq4MG.js} +2 -2
  190. package/client/assets/useReport-DqSBq4MG.js.br +0 -0
  191. package/client/assets/useReport-DqSBq4MG.js.gz +0 -0
  192. package/client/assets/{useReport-DozG5uz5.js.map → useReport-DqSBq4MG.js.map} +1 -1
  193. package/client/assets/{useRundown-D6vokFHi.js → useRundown-DAo6huE4.js} +2 -2
  194. package/client/assets/useRundown-DAo6huE4.js.br +0 -0
  195. package/client/assets/useRundown-DAo6huE4.js.gz +0 -0
  196. package/client/assets/{useRundown-D6vokFHi.js.map → useRundown-DAo6huE4.js.map} +1 -1
  197. package/client/assets/{useSelectAndRevealEntry-Dd6MpVHe.js → useSelectAndRevealEntry-DTg0hmxA.js} +2 -2
  198. package/client/assets/useSelectAndRevealEntry-DTg0hmxA.js.br +0 -0
  199. package/client/assets/useSelectAndRevealEntry-DTg0hmxA.js.gz +0 -0
  200. package/client/assets/{useSelectAndRevealEntry-Dd6MpVHe.js.map → useSelectAndRevealEntry-DTg0hmxA.js.map} +1 -1
  201. package/client/assets/{useWindowTitle-bg-fLPOk.js → useWindowTitle-DM8dIp8L.js} +2 -2
  202. package/client/assets/useWindowTitle-DM8dIp8L.js.br +0 -0
  203. package/client/assets/useWindowTitle-DM8dIp8L.js.gz +0 -0
  204. package/client/assets/{useWindowTitle-bg-fLPOk.js.map → useWindowTitle-DM8dIp8L.js.map} +1 -1
  205. package/client/assets/{validateEvent-BUgLWn7x.js → validateEvent-GnPt-e9-.js} +2 -2
  206. package/client/assets/validateEvent-GnPt-e9-.js.br +0 -0
  207. package/client/assets/validateEvent-GnPt-e9-.js.gz +0 -0
  208. package/client/assets/{validateEvent-BUgLWn7x.js.map → validateEvent-GnPt-e9-.js.map} +1 -1
  209. package/client/assets/{vendor-CKDP5hij.js → vendor-BKUJ0_Du.js} +2 -2
  210. package/client/assets/vendor-BKUJ0_Du.js.br +0 -0
  211. package/client/assets/{vendor-CKDP5hij.js.gz → vendor-BKUJ0_Du.js.gz} +0 -0
  212. package/client/assets/{vendor-CKDP5hij.js.map → vendor-BKUJ0_Du.js.map} +1 -1
  213. package/client/assets/{viewLoader.utils-Bn5zu5sz.js → viewLoader.utils-4lL4PiNI.js} +2 -2
  214. package/client/assets/viewLoader.utils-4lL4PiNI.js.br +0 -0
  215. package/client/assets/viewLoader.utils-4lL4PiNI.js.gz +0 -0
  216. package/client/assets/{viewLoader.utils-Bn5zu5sz.js.map → viewLoader.utils-4lL4PiNI.js.map} +1 -1
  217. package/client/assets/{viewUtils-DQFwr7hm.js → viewUtils-29a3Mmiu.js} +2 -2
  218. package/client/assets/viewUtils-29a3Mmiu.js.br +0 -0
  219. package/client/assets/viewUtils-29a3Mmiu.js.gz +0 -0
  220. package/client/assets/{viewUtils-DQFwr7hm.js.map → viewUtils-29a3Mmiu.js.map} +1 -1
  221. package/client/index.html +2 -2
  222. package/package.json +1 -1
  223. package/server/index.cjs +1 -1
  224. package/client/assets/Backstage-BY9GL_rk.js.br +0 -0
  225. package/client/assets/Backstage-BY9GL_rk.js.gz +0 -0
  226. package/client/assets/Countdown-CXFgDHND.js.br +0 -0
  227. package/client/assets/Countdown-CXFgDHND.js.gz +0 -0
  228. package/client/assets/CuesheetTable-BLICUNky.js.br +0 -0
  229. package/client/assets/CuesheetTable-BLICUNky.js.gz +0 -0
  230. package/client/assets/CustomTranslationModal-4PVZBtkC.js.br +0 -0
  231. package/client/assets/CustomTranslationModal-4PVZBtkC.js.gz +0 -0
  232. package/client/assets/DelayIndicator-DUbpd6DG.js.br +0 -0
  233. package/client/assets/DelayIndicator-DUbpd6DG.js.gz +0 -0
  234. package/client/assets/EditorFeatureWrapper-CV_zaDoG.js.br +0 -0
  235. package/client/assets/EditorFeatureWrapper-CV_zaDoG.js.gz +0 -0
  236. package/client/assets/EditorUtils-CLBWDP4k.js.br +0 -0
  237. package/client/assets/EditorUtils-CLBWDP4k.js.gz +0 -0
  238. package/client/assets/EmptyPage-DmpOAg7R.js.br +0 -2
  239. package/client/assets/EmptyPage-DmpOAg7R.js.gz +0 -0
  240. package/client/assets/FollowButton-CAUWz5Ma.js.br +0 -0
  241. package/client/assets/FollowButton-CAUWz5Ma.js.gz +0 -0
  242. package/client/assets/MessageControlExport-Dm8IjSr4.js.br +0 -0
  243. package/client/assets/MessageControlExport-Dm8IjSr4.js.gz +0 -0
  244. package/client/assets/MultiPartProgressBar-Fp-sTN2u.js.br +0 -0
  245. package/client/assets/MultiPartProgressBar-Fp-sTN2u.js.gz +0 -0
  246. package/client/assets/OperatorExport-CE4ajLPS.js.br +0 -0
  247. package/client/assets/OperatorExport-CE4ajLPS.js.gz +0 -0
  248. package/client/assets/OverviewWrapper-BNnAIUP1.js.br +0 -0
  249. package/client/assets/OverviewWrapper-BNnAIUP1.js.gz +0 -0
  250. package/client/assets/PipHost-CbNFsfqp.js.br +0 -0
  251. package/client/assets/PipHost-CbNFsfqp.js.gz +0 -0
  252. package/client/assets/ProjectInfo-Bf5z4Xsv.js.br +0 -0
  253. package/client/assets/ProjectInfo-Bf5z4Xsv.js.gz +0 -0
  254. package/client/assets/ProtectRoute-CCHzyy0I.js.br +0 -0
  255. package/client/assets/ProtectRoute-CCHzyy0I.js.gz +0 -0
  256. package/client/assets/ProtectedCuesheet-COI1W_V3.js.br +0 -0
  257. package/client/assets/ProtectedCuesheet-COI1W_V3.js.gz +0 -0
  258. package/client/assets/ProtectedEditor-BvTFmv-F.js.br +0 -0
  259. package/client/assets/ProtectedEditor-BvTFmv-F.js.gz +0 -0
  260. package/client/assets/RundownExport-C_q3KYN_.js.br +0 -0
  261. package/client/assets/RundownExport-C_q3KYN_.js.gz +0 -0
  262. package/client/assets/Select-DQwYPDyI.js.br +0 -0
  263. package/client/assets/Select-DQwYPDyI.js.gz +0 -0
  264. package/client/assets/Studio-DzXTmBx4.js.br +0 -0
  265. package/client/assets/Studio-DzXTmBx4.js.gz +0 -0
  266. package/client/assets/StyleEditor-ClMEMaWh.js.br +0 -0
  267. package/client/assets/StyleEditor-ClMEMaWh.js.gz +0 -0
  268. package/client/assets/SuperscriptPeriod-CBiZU34J.js.br +0 -0
  269. package/client/assets/SuperscriptPeriod-CBiZU34J.js.gz +0 -0
  270. package/client/assets/SuperscriptTime-DP1CDlOX.js.br +0 -0
  271. package/client/assets/SuperscriptTime-DP1CDlOX.js.gz +0 -0
  272. package/client/assets/SwatchPicker-Dyxkxf3_.js.br +0 -0
  273. package/client/assets/SwatchPicker-Dyxkxf3_.js.gz +0 -0
  274. package/client/assets/TimeElements-pDYJeFbV.js.br +0 -0
  275. package/client/assets/TimeElements-pDYJeFbV.js.gz +0 -0
  276. package/client/assets/TimeInput-DTWDnaum.js.br +0 -0
  277. package/client/assets/TimeInput-DTWDnaum.js.gz +0 -0
  278. package/client/assets/TimelinePage-DbLt9rQi.js.br +0 -0
  279. package/client/assets/TimelinePage-DbLt9rQi.js.gz +0 -0
  280. package/client/assets/Timer-BfyVKQ8U.js.br +0 -0
  281. package/client/assets/Timer-BfyVKQ8U.js.gz +0 -0
  282. package/client/assets/TimerControlExport-BJfhJc07.js.br +0 -0
  283. package/client/assets/TimerControlExport-BJfhJc07.js.gz +0 -0
  284. package/client/assets/TimerDisplay-Dgmbqf65.js.br +0 -0
  285. package/client/assets/TimerDisplay-Dgmbqf65.js.gz +0 -0
  286. package/client/assets/TitleCard-MUurHeZ7.js.br +0 -0
  287. package/client/assets/TitleCard-MUurHeZ7.js.gz +0 -0
  288. package/client/assets/Tooltip-DXph8P8p.js.br +0 -0
  289. package/client/assets/Tooltip-DXph8P8p.js.gz +0 -0
  290. package/client/assets/ViewLogo-Ckp7i75x.js.br +0 -0
  291. package/client/assets/ViewLogo-Ckp7i75x.js.gz +0 -0
  292. package/client/assets/ViewParamsEditor-Cxngd15h.js.br +0 -0
  293. package/client/assets/ViewParamsEditor-Cxngd15h.js.gz +0 -0
  294. package/client/assets/editorSettings-D4jfu68W.js.br +0 -0
  295. package/client/assets/editorSettings-D4jfu68W.js.gz +0 -0
  296. package/client/assets/getProgress-B9UANc25.js.br +0 -0
  297. package/client/assets/getProgress-B9UANc25.js.gz +0 -0
  298. package/client/assets/index-2lQ-45a9.js.br +0 -0
  299. package/client/assets/index-2lQ-45a9.js.gz +0 -0
  300. package/client/assets/offset-DAyBfv5b.js.br +0 -4
  301. package/client/assets/offset-DAyBfv5b.js.gz +0 -0
  302. package/client/assets/parseUserTime-WkVNjkkE.js.br +0 -0
  303. package/client/assets/parseUserTime-WkVNjkkE.js.gz +0 -0
  304. package/client/assets/playbackstate-znZk3SSJ.js.br +0 -0
  305. package/client/assets/playbackstate-znZk3SSJ.js.gz +0 -0
  306. package/client/assets/presentation.utils-CjjYs5II.js.br +0 -0
  307. package/client/assets/presentation.utils-CjjYs5II.js.gz +0 -0
  308. package/client/assets/rundownUtils-BTQ3EeqN.js.br +0 -0
  309. package/client/assets/rundownUtils-BTQ3EeqN.js.gz +0 -0
  310. package/client/assets/timer.utils-B-Ui91P7.js +0 -2
  311. package/client/assets/timer.utils-B-Ui91P7.js.br +0 -0
  312. package/client/assets/timer.utils-B-Ui91P7.js.gz +0 -0
  313. package/client/assets/useCustomFields-zr9SUl5o.js.br +0 -0
  314. package/client/assets/useCustomFields-zr9SUl5o.js.gz +0 -0
  315. package/client/assets/useEventSelection-B9mbj1cM.js.br +0 -0
  316. package/client/assets/useEventSelection-B9mbj1cM.js.gz +0 -0
  317. package/client/assets/useProjectData-DD_BQ9eJ.js.br +0 -0
  318. package/client/assets/useProjectData-DD_BQ9eJ.js.gz +0 -0
  319. package/client/assets/useReport-DozG5uz5.js.br +0 -0
  320. package/client/assets/useReport-DozG5uz5.js.gz +0 -0
  321. package/client/assets/useRundown-D6vokFHi.js.br +0 -0
  322. package/client/assets/useRundown-D6vokFHi.js.gz +0 -0
  323. package/client/assets/useSelectAndRevealEntry-Dd6MpVHe.js.br +0 -0
  324. package/client/assets/useSelectAndRevealEntry-Dd6MpVHe.js.gz +0 -0
  325. package/client/assets/useWindowTitle-bg-fLPOk.js.br +0 -0
  326. package/client/assets/useWindowTitle-bg-fLPOk.js.gz +0 -0
  327. package/client/assets/validateEvent-BUgLWn7x.js.br +0 -0
  328. package/client/assets/validateEvent-BUgLWn7x.js.gz +0 -0
  329. package/client/assets/vendor-CKDP5hij.js.br +0 -0
  330. package/client/assets/viewLoader.utils-Bn5zu5sz.js.br +0 -0
  331. package/client/assets/viewLoader.utils-Bn5zu5sz.js.gz +0 -0
  332. package/client/assets/viewUtils-DQFwr7hm.js.br +0 -0
  333. package/client/assets/viewUtils-DQFwr7hm.js.gz +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Countdown-CXFgDHND.js","sources":["../../src/views/countdown/countdown.options.ts","../../src/views/countdown/countdown.utils.ts","../../src/views/common/clock-time/ClockTime.tsx","../../src/views/countdown/CountdownSelect.tsx","../../src/views/countdown/CountdownSubscriptions.tsx","../../src/views/countdown/SingleEventCountdown.tsx","../../src/views/countdown/useCountdownData.ts","../../src/views/countdown/Countdown.tsx"],"sourcesContent":["import { use, useMemo } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { CustomFields, EntryId, OntimeEvent } from 'ontime-types';\n\nimport { getTimeOption } from '../../common/components/view-params-editor/common.options';\nimport { OptionTitle } from '../../common/components/view-params-editor/constants';\nimport { ViewOption } from '../../common/components/view-params-editor/viewParams.types';\nimport { makeOptionsFromCustomFields } from '../../common/components/view-params-editor/viewParams.utils';\nimport { PresetContext } from '../../common/context/PresetContext';\nimport { isStringBoolean } from '../common/viewUtils';\n\nexport const getCountdownOptions = (\n timeFormat: string,\n customFields: CustomFields,\n persistedSubscriptions: EntryId[],\n): ViewOption[] => {\n const mainOptions = makeOptionsFromCustomFields(customFields, [{ value: 'title', label: 'Title' }]);\n const secondaryOptions = makeOptionsFromCustomFields(customFields, [\n { value: 'none', label: 'None' },\n { value: 'note', label: 'Note' },\n ]);\n\n return [\n { title: OptionTitle.ClockOptions, collapsible: true, options: [getTimeOption(timeFormat)] },\n {\n title: OptionTitle.DataSources,\n collapsible: true,\n options: [\n {\n id: 'main',\n title: 'Main text',\n description: 'Select the data source for the main text',\n type: 'option',\n values: mainOptions,\n defaultValue: 'title',\n },\n {\n id: 'secondary-src',\n title: 'Event secondary text',\n description: 'Select the data source for auxiliary text shown in the card',\n type: 'option',\n values: secondaryOptions,\n defaultValue: 'none',\n },\n ],\n },\n {\n title: OptionTitle.BehaviourOptions,\n collapsible: true,\n options: [\n {\n id: 'showExpected',\n title: 'Show expected time',\n description: 'Whether the times shown should account for the runtime offset.',\n type: 'boolean',\n defaultValue: false,\n },\n ],\n },\n {\n title: OptionTitle.ElementVisibility,\n collapsible: true,\n options: [\n {\n id: 'hidePast',\n title: 'Hide Past Events',\n description: 'Whether to hide events that have passed',\n type: 'boolean',\n defaultValue: false,\n },\n ],\n },\n {\n title: OptionTitle.Hidden,\n options: [\n {\n id: 'sub',\n title: 'Event subscription',\n description: 'The events to follow',\n values: persistedSubscriptions,\n type: 'persist',\n },\n ],\n },\n ];\n};\n\ntype CountdownOptions = {\n subscriptions: EntryId[];\n mainSource: keyof OntimeEvent | null;\n secondarySource: keyof OntimeEvent | null;\n showExpected: boolean;\n hidePast: boolean;\n};\n\n/**\n * Utility extract the view options from URL Params\n * the names and fallback are manually matched with timerOptions\n */\nfunction getOptionsFromParams(searchParams: URLSearchParams, defaultValues?: URLSearchParams): CountdownOptions {\n // Helper to get single value from either source, prioritizing defaultValues\n const getValue = (key: string) => defaultValues?.get(key) ?? searchParams.get(key);\n\n // Helper to get array values from either source\n const getArrayValues = (key: string): EntryId[] => {\n if (defaultValues?.has(key)) {\n return defaultValues.getAll(key) as EntryId[];\n }\n return searchParams.getAll(key) as EntryId[];\n };\n\n return {\n subscriptions: getArrayValues('sub'),\n mainSource: getValue('main') as keyof OntimeEvent | null,\n secondarySource: getValue('secondary-src') as keyof OntimeEvent | null,\n showExpected: isStringBoolean(getValue('showExpected')),\n hidePast: isStringBoolean(getValue('hidePast')),\n };\n}\n\n/**\n * Hook exposes the countdown view options\n */\nexport function useCountdownOptions(): CountdownOptions {\n const [searchParams] = useSearchParams();\n const maybePreset = use(PresetContext);\n\n const options = useMemo(() => {\n const defaultValues = maybePreset ? new URLSearchParams(maybePreset.search) : undefined;\n return getOptionsFromParams(searchParams, defaultValues);\n }, [maybePreset, searchParams]);\n\n return options;\n}\n","import { EntryId, MaybeNumber, OffsetMode, OntimeEntry, OntimeEvent, OntimeReport, Playback } from 'ontime-types';\nimport { getExpectedStart, MILLIS_PER_MINUTE, millisToString, removeLeadingZero } from 'ontime-utils';\n\nimport { useCountdownSocket } from '../../common/hooks/useSocket';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { formatDuration, formatTime } from '../../common/utils/time';\nimport { type TranslationKey, useTranslation } from '../../translation/TranslationProvider';\n\n/**\n * Parses string as a title\n */\nexport function sanitiseTitle(title: string | null) {\n return title ?? '{no title}';\n}\n\nexport const preferredFormat12 = 'h:mm a';\nexport const preferredFormat24 = 'HH:mm';\n\n/**\n * Whether the current event is live\n */\nexport function getIsLive(currentId: EntryId, selectedId: EntryId | null, playback: Playback): boolean {\n return currentId === selectedId && playback !== Playback.Armed;\n}\n\nexport type ProgressStatus = 'future' | 'due' | 'live' | 'done' | 'pending' | 'loaded';\ntype TimerMessage = Record<ProgressStatus, TranslationKey>;\n\nexport const timerProgress: TimerMessage = {\n future: 'countdown.to_start',\n due: 'timeline.due',\n live: 'countdown.running',\n pending: 'countdown.waiting',\n loaded: 'countdown.loaded',\n done: 'countdown.ended',\n};\n\n/**\n * Returns a parsed timer and relevant status message\n * Handles events in different days but disregards whether an event has actually played\n */\nexport function useSubscriptionDisplayData(\n subscribedEvent: ExtendedEntry<OntimeEvent> & { endedAt: MaybeNumber; expectedStart: number },\n): { status: ProgressStatus; statusDisplay: string; timeDisplay: string } {\n const { playback, current, clock } = useCountdownSocket();\n const { getLocalizedString } = useTranslation();\n\n const bigDuration = (value: number) => {\n if (value <= 0) return getLocalizedString('countdown.overtime').toUpperCase();\n if (value < MILLIS_PER_MINUTE * 10) {\n return removeLeadingZero(millisToString(value));\n }\n\n return formatDuration(value, value > MILLIS_PER_MINUTE * 10)\n .replace('m', `${getLocalizedString('common.minutes')} `)\n .replace('s', getLocalizedString('common.seconds'));\n };\n\n if (subscribedEvent.isLoaded) {\n if (playback === Playback.Armed) {\n return {\n status: 'loaded',\n statusDisplay: getLocalizedString(timerProgress['loaded']),\n timeDisplay: bigDuration(subscribedEvent.duration),\n };\n }\n\n return {\n status: 'live',\n statusDisplay: getLocalizedString(timerProgress['live']),\n timeDisplay: bigDuration(current ?? 0),\n };\n }\n\n if (playback === Playback.Stop || playback === Playback.Armed) {\n return {\n status: 'pending',\n statusDisplay: getLocalizedString(timerProgress['pending']),\n timeDisplay: ' ',\n };\n }\n\n if (subscribedEvent.isPast) {\n return {\n status: 'done',\n statusDisplay: getLocalizedString(timerProgress['done']),\n timeDisplay: formatTime(subscribedEvent.endedAt, { format12: preferredFormat12, format24: preferredFormat24 }),\n };\n }\n\n if (subscribedEvent.expectedStart - clock <= 0) {\n return {\n status: 'due',\n statusDisplay: getLocalizedString(timerProgress['future']), // We use future here on purpose for the look of it\n timeDisplay: getLocalizedString(timerProgress['due']).toUpperCase(),\n };\n }\n\n return {\n status: 'future',\n statusDisplay: getLocalizedString(timerProgress['future']),\n timeDisplay: bigDuration(subscribedEvent.expectedStart - clock),\n };\n}\n\n/**\n * Adds a set of subscriptions to the URL parameters\n */\nexport function makeSubscriptionsUrl(urlRef: string, subscriptions: EntryId[]) {\n const url = new URL(urlRef);\n const newParams = new URLSearchParams();\n\n // copy existing parameters except for 'sub'\n for (const [key, value] of url.searchParams.entries()) {\n if (key !== 'sub') {\n newParams.append(key, value);\n }\n }\n\n // add new subscriptions\n subscriptions.forEach((id) => {\n newParams.append('sub', id);\n });\n\n url.search = newParams.toString();\n\n return url;\n}\n\n/**\n * Returns an array of events subscribed events ordered by scheduled\n * Since the original array is already ordered, we simply filter out the events\n * which are not in the subscriptions list.\n */\nexport function getOrderedSubscriptions<T extends OntimeEntry>(subscriptions: EntryId[], playableEvents: T[]): T[] {\n return playableEvents.filter((event) => subscriptions.includes(event.id));\n}\n\n/**\n * Checks through the rundown whether the current event is linked to the loaded event\n */\nexport function isLinkedToLoadedEvent(events: OntimeEvent[], loadedId: EntryId | null, currentId: EntryId): boolean {\n // if nothing is loaded, we return true to simplify the logic\n if (!loadedId) {\n return true;\n }\n\n const loadedIndex = events.findIndex((event) => event.id === loadedId);\n if (loadedIndex === -1) {\n return true;\n }\n\n for (let i = loadedIndex; i < events.length; i++) {\n const event = events[i];\n if (event.id === currentId) {\n return true;\n }\n\n if (event.linkStart === null) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function isOutsideRange(a: number, b: number): boolean {\n return Math.abs(a - b) > MILLIS_PER_MINUTE;\n}\n\nexport type CountdownEvent = ExtendedEntry<OntimeEvent> & { expectedStart: number; endedAt: MaybeNumber };\n\nexport function extendEventData(\n event: ExtendedEntry<OntimeEvent>,\n currentDay: number,\n actualStart: MaybeNumber,\n plannedStart: MaybeNumber,\n offset: number,\n mode: OffsetMode,\n reportData: OntimeReport,\n): CountdownEvent {\n const { totalGap, isLinkedToLoaded } = event;\n const expectedStart = getExpectedStart(event, {\n currentDay,\n totalGap,\n actualStart,\n plannedStart,\n isLinkedToLoaded,\n offset,\n mode,\n });\n const { endedAt } = reportData[event.id] ?? { endedAt: null };\n return { ...event, expectedStart, endedAt };\n}\n","/**\n * encapsulate logic related to showing a clock timer\n */\n\nimport { MaybeNumber } from 'ontime-types';\n\nimport { formatTime } from '../../../common/utils/time';\nimport { FORMAT_12, FORMAT_24 } from '../../../viewerConfig';\nimport SuperscriptTime from '../superscript-time/SuperscriptTime';\n\ninterface ClockTimeProps {\n value: MaybeNumber;\n preferredFormat12?: string;\n preferredFormat24?: string;\n className?: string;\n}\n\nexport default function ClockTime(props: ClockTimeProps) {\n const { value, preferredFormat12 = FORMAT_12, preferredFormat24 = FORMAT_24, className } = props;\n\n // TODO: should we get the params from URL here to see if the user is overriding the default?\n const formattedTime = formatTime(value, { format12: preferredFormat12, format24: preferredFormat24 });\n\n return <SuperscriptTime className={className} time={formattedTime} />;\n}\n","import { useState } from 'react';\nimport { IoArrowBack, IoClose, IoSaveOutline } from 'react-icons/io5';\nimport { useNavigate } from 'react-router';\nimport { EntryId, PlayableEvent } from 'ontime-types';\n\nimport Button from '../../common/components/buttons/Button';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { cx } from '../../common/utils/styleUtils';\nimport ClockTime from '../common/clock-time/ClockTime';\n\nimport { makeSubscriptionsUrl } from './countdown.utils';\n\nimport './Countdown.scss';\n\ninterface CountdownSelectProps {\n events: ExtendedEntry<PlayableEvent>[];\n subscriptions: EntryId[];\n disableEdit: () => void;\n}\n\nexport default function CountdownSelect({ events, subscriptions, disableEdit }: CountdownSelectProps) {\n const [selected, setSelected] = useState<EntryId[]>(subscriptions);\n const navigate = useNavigate();\n\n /**\n * Toggles an entry from the selected set\n */\n const toggleSelect = (entryId: EntryId) => {\n setSelected((prev) => {\n if (prev.includes(entryId)) {\n // If the entry is already selected, remove it\n return prev.filter((id) => id !== entryId);\n }\n return [...prev, entryId];\n });\n };\n\n /**\n * Creates a URL with the selected subscriptions\n * and navigates to it\n */\n const applySelection = () => {\n // we remove events that no longer exist to avoid stale subscriptions\n const filteredSelected = selected.filter((id) => events.some((event) => event.id === id));\n const url = makeSubscriptionsUrl(window.location.href, filteredSelected);\n disableEdit();\n setSelected([]);\n navigate(url.search.toString());\n };\n\n // make a copy of the selected array for quick lookup\n const selectedIds = new Set(selected);\n\n return (\n <div className='list-container'>\n {events.map((event, index) => {\n const title = event.title || '{no title}';\n const isSelected = selectedIds.has(event.id);\n\n return (\n <div\n key={index}\n role='button'\n tabIndex={0}\n onClick={() => toggleSelect(event.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n toggleSelect(event.id);\n e.stopPropagation();\n }\n }}\n className={cx(['sub', isSelected && 'sub--selected'])}\n >\n <div className='sub__binder' style={{ '--user-color': event?.colour ?? '' }} />\n <div className='sub__schedule'>\n <ClockTime value={event.timeStart} preferredFormat12='h:mm a' preferredFormat24='HH:mm' />\n →\n <ClockTime value={event.timeEnd} preferredFormat12='h:mm a' preferredFormat24='HH:mm' />\n </div>\n <div className='sub__label'>{isSelected ? 'Click to remove' : 'Click to add'}</div>\n <div className='sub__title'>{title}</div>\n </div>\n );\n })}\n\n <div className='fab-container'>\n <Button variant='subtle' size='xlarge' onClick={disableEdit}>\n <IoArrowBack /> Go back\n </Button>\n <Button variant='subtle' size='xlarge' onClick={() => setSelected([])} disabled={selected.length === 0}>\n <IoClose /> Clear\n </Button>\n <Button variant='primary' size='xlarge' disabled={events.length < 1} onClick={applySelection}>\n <IoSaveOutline /> Save\n </Button>\n </div>\n </div>\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { IoPencil } from 'react-icons/io5';\nimport { MaybeNumber, OntimeEvent } from 'ontime-types';\nimport { dayInMs } from 'ontime-utils';\n\nimport Button from '../../common/components/buttons/Button';\nimport { useFadeOutOnInactivity } from '../../common/hooks/useFadeOutOnInactivity';\nimport useFollowComponent from '../../common/hooks/useFollowComponent';\nimport { useExpectedStartData, usePlayback, useSelectedEventId } from '../../common/hooks/useSocket';\nimport useReport from '../../common/hooks-query/useReport';\nimport { getOffsetState } from '../../common/utils/offset';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { cx } from '../../common/utils/styleUtils';\nimport { throttle } from '../../common/utils/throttle';\nimport FollowButton from '../../features/operator/follow-button/FollowButton';\nimport ClockTime from '../common/clock-time/ClockTime';\nimport SuperscriptTime from '../common/superscript-time/SuperscriptTime';\nimport { getPropertyValue } from '../common/viewUtils';\n\nimport { useCountdownOptions } from './countdown.options';\nimport {\n CountdownEvent,\n extendEventData,\n getIsLive,\n isOutsideRange,\n preferredFormat12,\n preferredFormat24,\n useSubscriptionDisplayData,\n} from './countdown.utils';\n\nimport './Countdown.scss';\n\ninterface CountdownSubscriptionsProps {\n subscribedEvents: ExtendedEntry<OntimeEvent>[];\n goToEditMode: () => void;\n}\n\nexport default function CountdownSubscriptions({ subscribedEvents, goToEditMode }: CountdownSubscriptionsProps) {\n const { mainSource, secondarySource, showExpected } = useCountdownOptions();\n const playback = usePlayback();\n const selectedEventId = useSelectedEventId();\n const showFab = useFadeOutOnInactivity(true);\n\n const { data: reportData } = useReport();\n const { offset, currentDay, actualStart, plannedStart, mode } = useExpectedStartData();\n\n const timeoutId = useRef<NodeJS.Timeout | null>(null);\n const [lockAutoScroll, setLockAutoScroll] = useState(false);\n const selectedRef = useRef<HTMLDivElement | null>(null);\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const scrollToComponent = useFollowComponent({\n followRef: selectedRef,\n scrollRef,\n doFollow: !lockAutoScroll,\n topOffset: 0,\n followTrigger: selectedEventId,\n });\n\n // reset scroll if nothing is selected\n useEffect(() => {\n if (!selectedEventId) {\n if (!lockAutoScroll) {\n scrollRef.current?.scrollTo(0, 0);\n }\n }\n }, [selectedEventId, lockAutoScroll, scrollRef]);\n\n // scroll to component if user clicks the Follow button\n const handleOffset = () => {\n if (selectedEventId) {\n scrollToComponent();\n }\n setLockAutoScroll(false);\n };\n\n // prevent considering automated scrolls as user scrolls\n const handleUserScroll = () => {\n if (selectedRef?.current && scrollRef?.current) {\n const selectedRect = selectedRef.current.getBoundingClientRect();\n const scrollerRect = scrollRef.current.getBoundingClientRect();\n if (selectedRect && scrollerRect) {\n const distanceFromTop = selectedRect.top - scrollerRect.top;\n const hasScrolledOutOfThreshold = distanceFromTop < -8 || distanceFromTop > 50;\n setLockAutoScroll(hasScrolledOutOfThreshold);\n }\n }\n };\n const throttledHandleScroll = throttle(handleUserScroll, 1000);\n\n // when the user scrolls we check if we need to show the button\n const handleScroll = () => {\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n }\n\n throttledHandleScroll();\n };\n\n return (\n <div className='list-container' onWheel={handleScroll} onTouchMove={handleScroll} ref={scrollRef}>\n {subscribedEvents.map((event) => {\n const secondaryData = getPropertyValue(event, secondarySource);\n const isLive = getIsLive(event.id, selectedEventId, playback);\n const isArmed = !isLive && event.id === selectedEventId;\n const countdownEvent = extendEventData(event, currentDay, actualStart, plannedStart, offset, mode, reportData);\n const displayTitle = getPropertyValue(event, mainSource ?? 'title');\n return (\n <div\n key={event.id}\n ref={isLive ? selectedRef : undefined}\n className={cx(['sub', isLive && 'sub--live', isArmed && 'sub--armed'])}\n data-testid={event.cue}\n >\n <div className='sub__binder' style={{ '--user-color': event.colour }} />\n <ScheduleTime event={countdownEvent} showExpected={showExpected} />\n <SubscriptionStatus event={countdownEvent} />\n <div className={cx(['sub__title', !displayTitle && 'subdued'])}>{displayTitle}</div>\n {secondaryData && <div className='sub__secondary'>{secondaryData}</div>}\n </div>\n );\n })}\n <div className={cx(['fab-container', !showFab && 'fab-container--hidden'])}>\n <Button variant='primary' size='xlarge' onClick={goToEditMode}>\n <IoPencil /> Edit\n </Button>\n </div>\n <FollowButton isVisible={lockAutoScroll} onClickHandler={handleOffset} />\n </div>\n );\n}\n\ntype ScheduleTimeProps = {\n event: CountdownEvent;\n showExpected: boolean;\n};\n//TODO: consider relative mode\nexport function ScheduleTime(props: ScheduleTimeProps) {\n const { event, showExpected } = props;\n const { timeStart, duration, delay, expectedStart, countToEnd } = event;\n\n const plannedStart = timeStart + delay + event.dayOffset * dayInMs;\n\n // only show new exacted value if outside range of the planned value\n const isExpectedValueShow = showExpected && isOutsideRange(plannedStart, expectedStart);\n\n const plannedStateClass = isExpectedValueShow ? 'sub__schedule--strike' : delay !== 0 ? 'sub__schedule--delayed' : '';\n\n const expectedStateClass = `sub__schedule--${getOffsetState(expectedStart - plannedStart)}`;\n const plannedEnd = plannedStart + duration + delay;\n const expectedEnd = countToEnd ? Math.max(expectedStart + duration, plannedEnd) : expectedStart + duration;\n const expectedEndClass = `sub__schedule--${getOffsetState(expectedEnd - plannedEnd)}`;\n\n return (\n <div className='sub__schedule'>\n <ClockTime\n value={plannedStart}\n preferredFormat12={preferredFormat12}\n preferredFormat24={preferredFormat24}\n className={plannedStateClass}\n />\n {!isExpectedValueShow && (\n <>\n →\n <ClockTime\n value={plannedEnd}\n preferredFormat12={preferredFormat12}\n preferredFormat24={preferredFormat24}\n className={plannedStateClass}\n />\n </>\n )}\n {isExpectedValueShow && (\n <>\n <ClockTime\n value={expectedStart}\n className={expectedStateClass}\n preferredFormat12={preferredFormat12}\n preferredFormat24={preferredFormat24}\n />\n →\n <ClockTime\n value={expectedEnd}\n className={expectedEndClass}\n preferredFormat12={preferredFormat12}\n preferredFormat24={preferredFormat24}\n />\n </>\n )}\n </div>\n );\n}\n\ninterface SubscriptionStatusProps {\n event: ExtendedEntry<OntimeEvent> & { endedAt: MaybeNumber; expectedStart: number };\n}\n\nfunction SubscriptionStatus({ event }: SubscriptionStatusProps) {\n const { status, statusDisplay, timeDisplay } = useSubscriptionDisplayData(event);\n\n return (\n <>\n <div className='sub__status'>{statusDisplay}</div>\n {status === 'done' ? (\n <SuperscriptTime className='sub__timer' time={timeDisplay} />\n ) : (\n <div className='sub__timer'>{timeDisplay}</div>\n )}\n </>\n );\n}\n","import { IoPencil } from 'react-icons/io5';\nimport { MaybeNumber, OntimeEvent } from 'ontime-types';\nimport { getExpectedStart } from 'ontime-utils';\n\nimport Button from '../../common/components/buttons/Button';\nimport { useFadeOutOnInactivity } from '../../common/hooks/useFadeOutOnInactivity';\nimport { useExpectedStartData } from '../../common/hooks/useSocket';\nimport useReport from '../../common/hooks-query/useReport';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { cx } from '../../common/utils/styleUtils';\nimport SuperscriptTime from '../common/superscript-time/SuperscriptTime';\nimport { getPropertyValue } from '../common/viewUtils';\n\nimport { useCountdownOptions } from './countdown.options';\nimport { useSubscriptionDisplayData } from './countdown.utils';\nimport { ScheduleTime } from './CountdownSubscriptions';\n\nimport './SingleEventCountdown.scss';\n\ninterface SingleEventCountdownProps {\n subscribedEvent: ExtendedEntry<OntimeEvent>;\n goToEditMode: () => void;\n}\n\nexport default function SingleEventCountdown({ subscribedEvent, goToEditMode }: SingleEventCountdownProps) {\n const { mainSource, secondarySource, showExpected } = useCountdownOptions();\n const showFab = useFadeOutOnInactivity(true);\n const { data: reportData } = useReport();\n\n const { offset, currentDay, actualStart, plannedStart, mode } = useExpectedStartData();\n const { totalGap, isLinkedToLoaded } = subscribedEvent;\n const expectedStart = getExpectedStart(subscribedEvent, {\n currentDay,\n totalGap,\n actualStart,\n plannedStart,\n isLinkedToLoaded,\n offset,\n mode,\n });\n\n const { endedAt } = reportData[subscribedEvent.id] ?? { endedAt: null };\n const countdownEvent = { ...subscribedEvent, expectedStart, endedAt };\n const titleTmp = getPropertyValue(subscribedEvent, mainSource ?? 'title');\n const title = titleTmp?.length ? titleTmp : ' '; // insert utf-8 empty space to avoid the line collapsing;\n const secondaryData = getPropertyValue(subscribedEvent, secondarySource);\n\n return (\n <div className='single-container' data-testid='countdown-event'>\n <SubscriptionStatus event={countdownEvent} />\n <div className='event__title' style={{ borderColor: countdownEvent.colour }}>\n <ScheduleTime event={countdownEvent} showExpected={showExpected} />\n {title}\n {secondaryData && <div className='secondary'>{secondaryData}</div>}\n </div>\n <div className={cx(['fab-container', !showFab && 'fab-container--hidden'])}>\n <Button variant='primary' size='xlarge' onClick={goToEditMode}>\n <IoPencil /> Edit\n </Button>\n </div>\n </div>\n );\n}\n\ninterface SubscriptionStatusProps {\n event: ExtendedEntry<OntimeEvent> & { endedAt: MaybeNumber; expectedStart: number };\n}\n\nfunction SubscriptionStatus({ event }: SubscriptionStatusProps) {\n const { status, statusDisplay, timeDisplay } = useSubscriptionDisplayData(event);\n\n return (\n <>\n <div className='event__status'>{statusDisplay}</div>\n {status === 'done' ? (\n <SuperscriptTime className='event__timer' time={timeDisplay} />\n ) : (\n <div className='event__timer'>{timeDisplay}</div>\n )}\n </>\n );\n}\n","import { CustomFields, OntimeEntry, ProjectData, Settings } from 'ontime-types';\n\nimport useCustomFields from '../../common/hooks-query/useCustomFields';\nimport useProjectData from '../../common/hooks-query/useProjectData';\nimport { useFlatRundownWithMetadata } from '../../common/hooks-query/useRundown';\nimport useSettings from '../../common/hooks-query/useSettings';\nimport { useViewOptionsStore } from '../../common/stores/viewOptions';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { aggregateQueryStatus, ViewData } from '../utils/viewLoader.utils';\n\nexport interface CountdownData {\n customFields: CustomFields;\n rundownData: ExtendedEntry<OntimeEntry>[];\n projectData: ProjectData;\n isMirrored: boolean;\n settings: Settings;\n}\n\nexport function useCountdownData(): ViewData<CountdownData> {\n // persisted app state\n const isMirrored = useViewOptionsStore((state) => state.mirror);\n\n // HTTP API data\n const { data: rundownData, status: rundownStatus } = useFlatRundownWithMetadata();\n const { data: projectData, status: projectDataStatus } = useProjectData();\n const { data: settings, status: settingsStatus } = useSettings();\n const { data: customFields, status: customFieldsStatus } = useCustomFields();\n\n return {\n data: {\n customFields,\n rundownData,\n projectData,\n isMirrored,\n settings,\n },\n status: aggregateQueryStatus([rundownStatus, projectDataStatus, settingsStatus, customFieldsStatus]),\n };\n}\n","import { useMemo, useState } from 'react';\nimport { IoAdd } from 'react-icons/io5';\nimport { EntryId, isOntimeEvent, isPlayableEvent, OntimeEvent, OntimeView, PlayableEvent } from 'ontime-types';\n\nimport Button from '../../common/components/buttons/Button';\nimport Empty from '../../common/components/state/Empty';\nimport EmptyPage from '../../common/components/state/EmptyPage';\nimport ViewLogo from '../../common/components/view-logo/ViewLogo';\nimport ViewParamsEditor from '../../common/components/view-params-editor/ViewParamsEditor';\nimport { useClock } from '../../common/hooks/useSocket';\nimport { useWindowTitle } from '../../common/hooks/useWindowTitle';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { formatTime, getDefaultFormat } from '../../common/utils/time';\nimport { useTranslation } from '../../translation/TranslationProvider';\nimport Loader from '../common/loader/Loader';\nimport SuperscriptTime from '../common/superscript-time/SuperscriptTime';\n\nimport { getCountdownOptions, useCountdownOptions } from './countdown.options';\nimport { getOrderedSubscriptions } from './countdown.utils';\nimport CountdownSelect from './CountdownSelect';\nimport CountdownSubscriptions from './CountdownSubscriptions';\nimport SingleEventCountdown from './SingleEventCountdown';\nimport { CountdownData, useCountdownData } from './useCountdownData';\n\nimport './Countdown.scss';\n\nexport default function CountdownLoader() {\n const { data, status } = useCountdownData();\n\n useWindowTitle('Countdown');\n\n if (status === 'pending') {\n return <Loader />;\n }\n\n if (status === 'error') {\n return <EmptyPage text='There was an error fetching data, please refresh the page.' />;\n }\n\n return <Countdown {...data} />;\n}\n\nfunction Countdown({ customFields, rundownData, projectData, isMirrored, settings }: CountdownData) {\n const { getLocalizedString } = useTranslation();\n const { subscriptions } = useCountdownOptions();\n\n const [editMode, setEditMode] = useState(false);\n\n // gather rundown data\n const playableEvents = rundownData.filter((entry): entry is ExtendedEntry<PlayableEvent> => {\n return isOntimeEvent(entry) && isPlayableEvent(entry);\n });\n\n // gather presentation data\n const hasEvents = playableEvents.length > 0;\n\n // gather option data\n const defaultFormat = getDefaultFormat(settings?.timeFormat);\n const countdownOptions = useMemo(\n () => getCountdownOptions(defaultFormat, customFields, subscriptions),\n [defaultFormat, customFields, subscriptions],\n );\n\n return (\n <div className={`countdown ${isMirrored ? 'mirror' : ''}`} data-testid='countdown-view'>\n <ViewParamsEditor target={OntimeView.Countdown} viewOptions={countdownOptions} />\n <div className='project-header'>\n {projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}\n <div className='title'>{projectData.title}</div>\n <CountdownClock />\n </div>\n\n {!hasEvents && <Empty text={getLocalizedString('common.no_data')} className='empty-container' />}\n\n {hasEvents && editMode && (\n <CountdownSelect events={playableEvents} subscriptions={subscriptions} disableEdit={() => setEditMode(false)} />\n )}\n\n {hasEvents && !editMode && (\n <CountdownContents\n playableEvents={playableEvents}\n subscriptions={subscriptions}\n goToEditMode={() => setEditMode(true)}\n />\n )}\n </div>\n );\n}\n\ninterface CountdownContentsProps {\n playableEvents: ExtendedEntry<OntimeEvent>[];\n subscriptions: EntryId[];\n goToEditMode: () => void;\n}\n\nfunction CountdownContents({ playableEvents, subscriptions, goToEditMode }: CountdownContentsProps) {\n const { getLocalizedString } = useTranslation();\n const { hidePast } = useCountdownOptions();\n\n if (subscriptions.length === 0) {\n return (\n <div className='empty-container'>\n <Empty text={getLocalizedString('countdown.select_event')} className='empty-container' />\n <Button variant='primary' size='xlarge' onClick={goToEditMode}>\n <IoAdd /> Add\n </Button>\n </div>\n );\n }\n\n const subscribedEvents = getOrderedSubscriptions(subscriptions, playableEvents);\n const eventsToShow = !hidePast ? subscribedEvents : subscribedEvents.filter((event) => !event.isPast);\n\n if (subscribedEvents.length === 0) {\n return (\n <div className='empty-container'>\n <Empty text={getLocalizedString('countdown.select_event')} className='empty-container' />\n <Button variant='primary' size='xlarge' onClick={goToEditMode}>\n <IoAdd /> Add\n </Button>\n </div>\n );\n }\n\n if (subscribedEvents.length === 1 && eventsToShow.length === 1) {\n const event = subscribedEvents.at(0);\n if (!event) return null;\n return <SingleEventCountdown subscribedEvent={event} goToEditMode={goToEditMode} />;\n }\n\n if (eventsToShow.length === 0) {\n return (\n <div className='empty-container'>\n <Empty text={getLocalizedString('countdown.all_have_finished')} className='empty-container' />\n </div>\n );\n }\n\n return <CountdownSubscriptions subscribedEvents={eventsToShow} goToEditMode={goToEditMode} />;\n}\n\nfunction CountdownClock() {\n const { getLocalizedString } = useTranslation();\n const clock = useClock();\n\n // gather timer data\n const formattedClock = formatTime(clock);\n\n return (\n <div className='clock-container'>\n <div className='label'>{getLocalizedString('common.time_now')}</div>\n <SuperscriptTime time={formattedClock} className='time' />\n </div>\n );\n}\n"],"names":["getCountdownOptions","timeFormat","customFields","persistedSubscriptions","mainOptions","makeOptionsFromCustomFields","value","label","secondaryOptions","title","OptionTitle","ClockOptions","collapsible","options","getTimeOption","DataSources","id","description","type","values","defaultValue","BehaviourOptions","ElementVisibility","Hidden","getOptionsFromParams","searchParams","defaultValues","getValue","key","get","subscriptions","has","getAll","mainSource","secondarySource","showExpected","isStringBoolean","hidePast","useCountdownOptions","useSearchParams","maybePreset","use","PresetContext","useMemo","URLSearchParams","search","undefined","preferredFormat12","preferredFormat24","getIsLive","currentId","selectedId","playback","Playback","Armed","timerProgress","future","due","live","pending","loaded","done","useSubscriptionDisplayData","subscribedEvent","current","clock","useCountdownSocket","getLocalizedString","useTranslation","bigDuration","toUpperCase","MILLIS_PER_MINUTE","removeLeadingZero","millisToString","formatDuration","replace","isLoaded","status","statusDisplay","timeDisplay","duration","Stop","isPast","formatTime","endedAt","format12","format24","expectedStart","makeSubscriptionsUrl","urlRef","url","URL","newParams","entries","append","forEach","toString","getOrderedSubscriptions","playableEvents","filter","event","includes","isOutsideRange","a","b","Math","abs","extendEventData","currentDay","actualStart","plannedStart","offset","mode","reportData","totalGap","isLinkedToLoaded","getExpectedStart","ClockTime","props","FORMAT_12","FORMAT_24","className","formattedTime","jsx","SuperscriptTime","CountdownSelect","events","disableEdit","selected","setSelected","useState","navigate","useNavigate","toggleSelect","entryId","prev","applySelection","filteredSelected","some","window","location","href","selectedIds","Set","jsxs","map","index","isSelected","e","stopPropagation","cx","colour","timeStart","timeEnd","Button","IoArrowBack","length","IoClose","IoSaveOutline","CountdownSubscriptions","subscribedEvents","goToEditMode","usePlayback","selectedEventId","useSelectedEventId","showFab","useFadeOutOnInactivity","data","useReport","useExpectedStartData","timeoutId","useRef","lockAutoScroll","setLockAutoScroll","selectedRef","scrollRef","scrollToComponent","useFollowComponent","followRef","doFollow","topOffset","followTrigger","useEffect","scrollTo","handleOffset","throttledHandleScroll","throttle","handleUserScroll","selectedRect","getBoundingClientRect","scrollerRect","distanceFromTop","top","hasScrolledOutOfThreshold","handleScroll","clearTimeout","secondaryData","getPropertyValue","isLive","isArmed","countdownEvent","displayTitle","cue","ScheduleTime","SubscriptionStatus","IoPencil","FollowButton","delay","countToEnd","dayOffset","dayInMs","isExpectedValueShow","plannedStateClass","expectedStateClass","getOffsetState","plannedEnd","expectedEnd","max","expectedEndClass","Fragment","SingleEventCountdown","titleTmp","borderColor","useCountdownData","isMirrored","useViewOptionsStore","state","mirror","rundownData","rundownStatus","useFlatRundownWithMetadata","projectData","projectDataStatus","useProjectData","settings","settingsStatus","useSettings","customFieldsStatus","useCustomFields","aggregateQueryStatus","CountdownLoader","useWindowTitle","Loader","EmptyPage","Countdown","editMode","setEditMode","entry","isOntimeEvent","isPlayableEvent","hasEvents","defaultFormat","getDefaultFormat","countdownOptions","ViewParamsEditor","OntimeView","logo","ViewLogo","CountdownClock","Empty","CountdownContents","IoAdd","eventsToShow","at","useClock","formattedClock"],"mappings":"s7CAWO,MAAMA,GAAsBA,CACjCC,EACAC,EACAC,IACiB,CACXC,MAAAA,EAAcC,EAA4BH,EAAc,CAAC,CAAEI,MAAO,QAASC,MAAO,OAAA,CAAS,CAAC,EAC5FC,EAAmBH,EAA4BH,EAAc,CACjE,CAAEI,MAAO,OAAQC,MAAO,MAAA,EACxB,CAAED,MAAO,OAAQC,MAAO,MAAA,CAAQ,CACjC,EAED,MAAO,CACL,CAAEE,MAAOC,EAAYC,aAAcC,YAAa,GAAMC,QAAS,CAACC,GAAcb,CAAU,CAAC,CAAA,EACzF,CACEQ,MAAOC,EAAYK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ACb,SAAA,CAAArB,MAACwI,GAAM,KAAMhM,EAAmB,wBAAwB,EAAG,UAAU,kBAAiB,SACrFuF,EAAO,CAAA,QAAQ,UAAU,KAAK,SAAS,QAASO,EAC/C,SAAA,CAAAtC,EAAA,IAAC0I,EAAQ,EAAA,EAAA,MAAA,CACX,CAAA,CAAA,EACF,EAIJ,GAAIrG,EAAiBJ,SAAW,GAAK0G,EAAa1G,SAAW,EAAG,CACxDxD,MAAAA,EAAQ4D,EAAiBuG,GAAG,CAAC,EAC/B,OAACnK,EACGuB,EAAAA,IAAAiG,GAAA,CAAqB,gBAAiBxH,EAAO,aAAA6D,CAA8B,CAAA,EADhE,IACgE,CAGjFqG,OAAAA,EAAa1G,SAAW,EAEvBjC,EAAAA,IAAA,MAAA,CAAI,UAAU,kBACb,SAACA,MAAAwI,EAAA,CAAM,KAAMhM,EAAmB,6BAA6B,EAAG,UAAU,iBAAiB,CAAA,EAC7F,EAIIwD,EAAAA,IAAAoC,GAAA,CAAuB,iBAAkBuG,EAAc,aAAArG,CAA8B,CAAA,CAC/F,CAEA,SAASiG,IAAiB,CAClB,KAAA,CAAE/L,mBAAAA,GAAuBC,EAAe,EACxCH,EAAQuM,GAAS,EAGjBC,EAAiBtL,EAAWlB,CAAK,EAGrC,OAAA+E,EAAA,KAAC,MAAI,CAAA,UAAU,kBACb,SAAA,CAAArB,MAAC,MAAI,CAAA,UAAU,QAASxD,SAAAA,EAAmB,iBAAiB,EAAE,EAC7DwD,EAAA,IAAAC,EAAA,CAAgB,KAAM6I,EAAgB,UAAU,MAAM,CAAA,CAAA,EACzD,CAEJ"}
1
+ {"version":3,"file":"Countdown-DQM2ppPg.js","sources":["../../src/views/countdown/countdown.options.ts","../../src/views/countdown/countdown.utils.ts","../../src/views/common/clock-time/ClockTime.tsx","../../src/views/countdown/CountdownSelect.tsx","../../src/views/countdown/CountdownSubscriptions.tsx","../../src/views/countdown/SingleEventCountdown.tsx","../../src/views/countdown/useCountdownData.ts","../../src/views/countdown/Countdown.tsx"],"sourcesContent":["import { use, useMemo } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { CustomFields, EntryId, OntimeEvent } from 'ontime-types';\n\nimport { getTimeOption } from '../../common/components/view-params-editor/common.options';\nimport { OptionTitle } from '../../common/components/view-params-editor/constants';\nimport { ViewOption } from '../../common/components/view-params-editor/viewParams.types';\nimport { makeOptionsFromCustomFields } from '../../common/components/view-params-editor/viewParams.utils';\nimport { PresetContext } from '../../common/context/PresetContext';\nimport { isStringBoolean } from '../common/viewUtils';\n\nexport const getCountdownOptions = (\n timeFormat: string,\n customFields: CustomFields,\n persistedSubscriptions: EntryId[],\n): ViewOption[] => {\n const mainOptions = makeOptionsFromCustomFields(customFields, [{ value: 'title', label: 'Title' }]);\n const secondaryOptions = makeOptionsFromCustomFields(customFields, [\n { value: 'none', label: 'None' },\n { value: 'note', label: 'Note' },\n ]);\n\n return [\n { title: OptionTitle.ClockOptions, collapsible: true, options: [getTimeOption(timeFormat)] },\n {\n title: OptionTitle.DataSources,\n collapsible: true,\n options: [\n {\n id: 'main',\n title: 'Main text',\n description: 'Select the data source for the main text',\n type: 'option',\n values: mainOptions,\n defaultValue: 'title',\n },\n {\n id: 'secondary-src',\n title: 'Event secondary text',\n description: 'Select the data source for auxiliary text shown in the card',\n type: 'option',\n values: secondaryOptions,\n defaultValue: 'none',\n },\n ],\n },\n {\n title: OptionTitle.BehaviourOptions,\n collapsible: true,\n options: [\n {\n id: 'showExpected',\n title: 'Show expected time',\n description: 'Whether the times shown should account for the runtime offset.',\n type: 'boolean',\n defaultValue: false,\n },\n ],\n },\n {\n title: OptionTitle.ElementVisibility,\n collapsible: true,\n options: [\n {\n id: 'hidePast',\n title: 'Hide Past Events',\n description: 'Whether to hide events that have passed',\n type: 'boolean',\n defaultValue: false,\n },\n ],\n },\n {\n title: OptionTitle.Hidden,\n options: [\n {\n id: 'sub',\n title: 'Event subscription',\n description: 'The events to follow',\n values: persistedSubscriptions,\n type: 'persist',\n },\n ],\n },\n ];\n};\n\ntype CountdownOptions = {\n subscriptions: EntryId[];\n mainSource: keyof OntimeEvent | null;\n secondarySource: keyof OntimeEvent | null;\n showExpected: boolean;\n hidePast: boolean;\n};\n\n/**\n * Utility extract the view options from URL Params\n * the names and fallback are manually matched with timerOptions\n */\nfunction getOptionsFromParams(searchParams: URLSearchParams, defaultValues?: URLSearchParams): CountdownOptions {\n // Helper to get single value from either source, prioritizing defaultValues\n const getValue = (key: string) => defaultValues?.get(key) ?? searchParams.get(key);\n\n // Helper to get array values from either source\n const getArrayValues = (key: string): EntryId[] => {\n if (defaultValues?.has(key)) {\n return defaultValues.getAll(key) as EntryId[];\n }\n return searchParams.getAll(key) as EntryId[];\n };\n\n return {\n subscriptions: getArrayValues('sub'),\n mainSource: getValue('main') as keyof OntimeEvent | null,\n secondarySource: getValue('secondary-src') as keyof OntimeEvent | null,\n showExpected: isStringBoolean(getValue('showExpected')),\n hidePast: isStringBoolean(getValue('hidePast')),\n };\n}\n\n/**\n * Hook exposes the countdown view options\n */\nexport function useCountdownOptions(): CountdownOptions {\n const [searchParams] = useSearchParams();\n const maybePreset = use(PresetContext);\n\n const options = useMemo(() => {\n const defaultValues = maybePreset ? new URLSearchParams(maybePreset.search) : undefined;\n return getOptionsFromParams(searchParams, defaultValues);\n }, [maybePreset, searchParams]);\n\n return options;\n}\n","import { EntryId, MaybeNumber, OffsetMode, OntimeEntry, OntimeEvent, OntimeReport, Playback } from 'ontime-types';\nimport { getExpectedStart, MILLIS_PER_MINUTE, millisToString, removeLeadingZero } from 'ontime-utils';\n\nimport { useCountdownSocket } from '../../common/hooks/useSocket';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { formatDuration, formatTime } from '../../common/utils/time';\nimport { type TranslationKey, useTranslation } from '../../translation/TranslationProvider';\n\n/**\n * Parses string as a title\n */\nexport function sanitiseTitle(title: string | null) {\n return title ?? '{no title}';\n}\n\nexport const preferredFormat12 = 'h:mm a';\nexport const preferredFormat24 = 'HH:mm';\n\n/**\n * Whether the current event is live\n */\nexport function getIsLive(currentId: EntryId, selectedId: EntryId | null, playback: Playback): boolean {\n return currentId === selectedId && playback !== Playback.Armed;\n}\n\nexport type ProgressStatus = 'future' | 'due' | 'live' | 'done' | 'pending' | 'loaded';\ntype TimerMessage = Record<ProgressStatus, TranslationKey>;\n\nexport const timerProgress: TimerMessage = {\n future: 'countdown.to_start',\n due: 'timeline.due',\n live: 'countdown.running',\n pending: 'countdown.waiting',\n loaded: 'countdown.loaded',\n done: 'countdown.ended',\n};\n\n/**\n * Returns a parsed timer and relevant status message\n * Handles events in different days but disregards whether an event has actually played\n */\nexport function useSubscriptionDisplayData(\n subscribedEvent: ExtendedEntry<OntimeEvent> & { endedAt: MaybeNumber; expectedStart: number },\n): { status: ProgressStatus; statusDisplay: string; timeDisplay: string } {\n const { playback, current, clock } = useCountdownSocket();\n const { getLocalizedString } = useTranslation();\n\n const bigDuration = (value: number) => {\n if (value <= 0) return getLocalizedString('countdown.overtime').toUpperCase();\n if (value < MILLIS_PER_MINUTE * 10) {\n return removeLeadingZero(millisToString(value));\n }\n\n return formatDuration(value, value > MILLIS_PER_MINUTE * 10)\n .replace('m', `${getLocalizedString('common.minutes')} `)\n .replace('s', getLocalizedString('common.seconds'));\n };\n\n if (subscribedEvent.isLoaded) {\n if (playback === Playback.Armed) {\n return {\n status: 'loaded',\n statusDisplay: getLocalizedString(timerProgress['loaded']),\n timeDisplay: bigDuration(subscribedEvent.duration),\n };\n }\n\n return {\n status: 'live',\n statusDisplay: getLocalizedString(timerProgress['live']),\n timeDisplay: bigDuration(current ?? 0),\n };\n }\n\n if (playback === Playback.Stop || playback === Playback.Armed) {\n return {\n status: 'pending',\n statusDisplay: getLocalizedString(timerProgress['pending']),\n timeDisplay: ' ',\n };\n }\n\n if (subscribedEvent.isPast) {\n return {\n status: 'done',\n statusDisplay: getLocalizedString(timerProgress['done']),\n timeDisplay: formatTime(subscribedEvent.endedAt, { format12: preferredFormat12, format24: preferredFormat24 }),\n };\n }\n\n if (subscribedEvent.expectedStart - clock <= 0) {\n return {\n status: 'due',\n statusDisplay: getLocalizedString(timerProgress['future']), // We use future here on purpose for the look of it\n timeDisplay: getLocalizedString(timerProgress['due']).toUpperCase(),\n };\n }\n\n return {\n status: 'future',\n statusDisplay: getLocalizedString(timerProgress['future']),\n timeDisplay: bigDuration(subscribedEvent.expectedStart - clock),\n };\n}\n\n/**\n * Adds a set of subscriptions to the URL parameters\n */\nexport function makeSubscriptionsUrl(urlRef: string, subscriptions: EntryId[]) {\n const url = new URL(urlRef);\n const newParams = new URLSearchParams();\n\n // copy existing parameters except for 'sub'\n for (const [key, value] of url.searchParams.entries()) {\n if (key !== 'sub') {\n newParams.append(key, value);\n }\n }\n\n // add new subscriptions\n subscriptions.forEach((id) => {\n newParams.append('sub', id);\n });\n\n url.search = newParams.toString();\n\n return url;\n}\n\n/**\n * Returns an array of events subscribed events ordered by scheduled\n * Since the original array is already ordered, we simply filter out the events\n * which are not in the subscriptions list.\n */\nexport function getOrderedSubscriptions<T extends OntimeEntry>(subscriptions: EntryId[], playableEvents: T[]): T[] {\n return playableEvents.filter((event) => subscriptions.includes(event.id));\n}\n\n/**\n * Checks through the rundown whether the current event is linked to the loaded event\n */\nexport function isLinkedToLoadedEvent(events: OntimeEvent[], loadedId: EntryId | null, currentId: EntryId): boolean {\n // if nothing is loaded, we return true to simplify the logic\n if (!loadedId) {\n return true;\n }\n\n const loadedIndex = events.findIndex((event) => event.id === loadedId);\n if (loadedIndex === -1) {\n return true;\n }\n\n for (let i = loadedIndex; i < events.length; i++) {\n const event = events[i];\n if (event.id === currentId) {\n return true;\n }\n\n if (event.linkStart === null) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function isOutsideRange(a: number, b: number): boolean {\n return Math.abs(a - b) > MILLIS_PER_MINUTE;\n}\n\nexport type CountdownEvent = ExtendedEntry<OntimeEvent> & { expectedStart: number; endedAt: MaybeNumber };\n\nexport function extendEventData(\n event: ExtendedEntry<OntimeEvent>,\n currentDay: number,\n actualStart: MaybeNumber,\n plannedStart: MaybeNumber,\n offset: number,\n mode: OffsetMode,\n reportData: OntimeReport,\n): CountdownEvent {\n const { totalGap, isLinkedToLoaded } = event;\n const expectedStart = getExpectedStart(event, {\n currentDay,\n totalGap,\n actualStart,\n plannedStart,\n isLinkedToLoaded,\n offset,\n mode,\n });\n const { endedAt } = reportData[event.id] ?? { endedAt: null };\n return { ...event, expectedStart, endedAt };\n}\n","/**\n * encapsulate logic related to showing a clock timer\n */\n\nimport { MaybeNumber } from 'ontime-types';\n\nimport { formatTime } from '../../../common/utils/time';\nimport { FORMAT_12, FORMAT_24 } from '../../../viewerConfig';\nimport SuperscriptTime from '../superscript-time/SuperscriptTime';\n\ninterface ClockTimeProps {\n value: MaybeNumber;\n preferredFormat12?: string;\n preferredFormat24?: string;\n className?: string;\n}\n\nexport default function ClockTime(props: ClockTimeProps) {\n const { value, preferredFormat12 = FORMAT_12, preferredFormat24 = FORMAT_24, className } = props;\n\n // TODO: should we get the params from URL here to see if the user is overriding the default?\n const formattedTime = formatTime(value, { format12: preferredFormat12, format24: preferredFormat24 });\n\n return <SuperscriptTime className={className} time={formattedTime} />;\n}\n","import { useState } from 'react';\nimport { IoArrowBack, IoClose, IoSaveOutline } from 'react-icons/io5';\nimport { useNavigate } from 'react-router';\nimport { EntryId, PlayableEvent } from 'ontime-types';\n\nimport Button from '../../common/components/buttons/Button';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { cx } from '../../common/utils/styleUtils';\nimport ClockTime from '../common/clock-time/ClockTime';\n\nimport { makeSubscriptionsUrl } from './countdown.utils';\n\nimport './Countdown.scss';\n\ninterface CountdownSelectProps {\n events: ExtendedEntry<PlayableEvent>[];\n subscriptions: EntryId[];\n disableEdit: () => void;\n}\n\nexport default function CountdownSelect({ events, subscriptions, disableEdit }: CountdownSelectProps) {\n const [selected, setSelected] = useState<EntryId[]>(subscriptions);\n const navigate = useNavigate();\n\n /**\n * Toggles an entry from the selected set\n */\n const toggleSelect = (entryId: EntryId) => {\n setSelected((prev) => {\n if (prev.includes(entryId)) {\n // If the entry is already selected, remove it\n return prev.filter((id) => id !== entryId);\n }\n return [...prev, entryId];\n });\n };\n\n /**\n * Creates a URL with the selected subscriptions\n * and navigates to it\n */\n const applySelection = () => {\n // we remove events that no longer exist to avoid stale subscriptions\n const filteredSelected = selected.filter((id) => events.some((event) => event.id === id));\n const url = makeSubscriptionsUrl(window.location.href, filteredSelected);\n disableEdit();\n setSelected([]);\n navigate(url.search.toString());\n };\n\n // make a copy of the selected array for quick lookup\n const selectedIds = new Set(selected);\n\n return (\n <div className='list-container'>\n {events.map((event, index) => {\n const title = event.title || '{no title}';\n const isSelected = selectedIds.has(event.id);\n\n return (\n <div\n key={index}\n role='button'\n tabIndex={0}\n onClick={() => toggleSelect(event.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n toggleSelect(event.id);\n e.stopPropagation();\n }\n }}\n className={cx(['sub', isSelected && 'sub--selected'])}\n >\n <div className='sub__binder' style={{ '--user-color': event?.colour ?? '' }} />\n <div className='sub__schedule'>\n <ClockTime value={event.timeStart} preferredFormat12='h:mm a' preferredFormat24='HH:mm' />\n →\n <ClockTime value={event.timeEnd} preferredFormat12='h:mm a' preferredFormat24='HH:mm' />\n </div>\n <div className='sub__label'>{isSelected ? 'Click to remove' : 'Click to add'}</div>\n <div className='sub__title'>{title}</div>\n </div>\n );\n })}\n\n <div className='fab-container'>\n <Button variant='subtle' size='xlarge' onClick={disableEdit}>\n <IoArrowBack /> Go back\n </Button>\n <Button variant='subtle' size='xlarge' onClick={() => setSelected([])} disabled={selected.length === 0}>\n <IoClose /> Clear\n </Button>\n <Button variant='primary' size='xlarge' disabled={events.length < 1} onClick={applySelection}>\n <IoSaveOutline /> Save\n </Button>\n </div>\n </div>\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { IoPencil } from 'react-icons/io5';\nimport { MaybeNumber, OntimeEvent } from 'ontime-types';\nimport { dayInMs } from 'ontime-utils';\n\nimport Button from '../../common/components/buttons/Button';\nimport { useFadeOutOnInactivity } from '../../common/hooks/useFadeOutOnInactivity';\nimport useFollowComponent from '../../common/hooks/useFollowComponent';\nimport { useExpectedStartData, usePlayback, useSelectedEventId } from '../../common/hooks/useSocket';\nimport useReport from '../../common/hooks-query/useReport';\nimport { getOffsetState } from '../../common/utils/offset';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { cx } from '../../common/utils/styleUtils';\nimport { throttle } from '../../common/utils/throttle';\nimport FollowButton from '../../features/operator/follow-button/FollowButton';\nimport ClockTime from '../common/clock-time/ClockTime';\nimport SuperscriptTime from '../common/superscript-time/SuperscriptTime';\nimport { getPropertyValue } from '../common/viewUtils';\n\nimport { useCountdownOptions } from './countdown.options';\nimport {\n CountdownEvent,\n extendEventData,\n getIsLive,\n isOutsideRange,\n preferredFormat12,\n preferredFormat24,\n useSubscriptionDisplayData,\n} from './countdown.utils';\n\nimport './Countdown.scss';\n\ninterface CountdownSubscriptionsProps {\n subscribedEvents: ExtendedEntry<OntimeEvent>[];\n goToEditMode: () => void;\n}\n\nexport default function CountdownSubscriptions({ subscribedEvents, goToEditMode }: CountdownSubscriptionsProps) {\n const { mainSource, secondarySource, showExpected } = useCountdownOptions();\n const playback = usePlayback();\n const selectedEventId = useSelectedEventId();\n const showFab = useFadeOutOnInactivity(true);\n\n const { data: reportData } = useReport();\n const { offset, currentDay, actualStart, plannedStart, mode } = useExpectedStartData();\n\n const timeoutId = useRef<NodeJS.Timeout | null>(null);\n const [lockAutoScroll, setLockAutoScroll] = useState(false);\n const selectedRef = useRef<HTMLDivElement | null>(null);\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const scrollToComponent = useFollowComponent({\n followRef: selectedRef,\n scrollRef,\n doFollow: !lockAutoScroll,\n topOffset: 0,\n followTrigger: selectedEventId,\n });\n\n // reset scroll if nothing is selected\n useEffect(() => {\n if (!selectedEventId) {\n if (!lockAutoScroll) {\n scrollRef.current?.scrollTo(0, 0);\n }\n }\n }, [selectedEventId, lockAutoScroll, scrollRef]);\n\n // scroll to component if user clicks the Follow button\n const handleOffset = () => {\n if (selectedEventId) {\n scrollToComponent();\n }\n setLockAutoScroll(false);\n };\n\n // prevent considering automated scrolls as user scrolls\n const handleUserScroll = () => {\n if (selectedRef?.current && scrollRef?.current) {\n const selectedRect = selectedRef.current.getBoundingClientRect();\n const scrollerRect = scrollRef.current.getBoundingClientRect();\n if (selectedRect && scrollerRect) {\n const distanceFromTop = selectedRect.top - scrollerRect.top;\n const hasScrolledOutOfThreshold = distanceFromTop < -8 || distanceFromTop > 50;\n setLockAutoScroll(hasScrolledOutOfThreshold);\n }\n }\n };\n const throttledHandleScroll = throttle(handleUserScroll, 1000);\n\n // when the user scrolls we check if we need to show the button\n const handleScroll = () => {\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n }\n\n throttledHandleScroll();\n };\n\n return (\n <div className='list-container' onWheel={handleScroll} onTouchMove={handleScroll} ref={scrollRef}>\n {subscribedEvents.map((event) => {\n const secondaryData = getPropertyValue(event, secondarySource);\n const isLive = getIsLive(event.id, selectedEventId, playback);\n const isArmed = !isLive && event.id === selectedEventId;\n const countdownEvent = extendEventData(event, currentDay, actualStart, plannedStart, offset, mode, reportData);\n const displayTitle = getPropertyValue(event, mainSource ?? 'title');\n return (\n <div\n key={event.id}\n ref={isLive ? selectedRef : undefined}\n className={cx(['sub', isLive && 'sub--live', isArmed && 'sub--armed'])}\n data-testid={event.cue}\n >\n <div className='sub__binder' style={{ '--user-color': event.colour }} />\n <ScheduleTime event={countdownEvent} showExpected={showExpected} />\n <SubscriptionStatus event={countdownEvent} />\n <div className={cx(['sub__title', !displayTitle && 'subdued'])}>{displayTitle}</div>\n {secondaryData && <div className='sub__secondary'>{secondaryData}</div>}\n </div>\n );\n })}\n <div className={cx(['fab-container', !showFab && 'fab-container--hidden'])}>\n <Button variant='primary' size='xlarge' onClick={goToEditMode}>\n <IoPencil /> Edit\n </Button>\n </div>\n <FollowButton isVisible={lockAutoScroll} onClickHandler={handleOffset} />\n </div>\n );\n}\n\ntype ScheduleTimeProps = {\n event: CountdownEvent;\n showExpected: boolean;\n};\n//TODO: consider relative mode\nexport function ScheduleTime(props: ScheduleTimeProps) {\n const { event, showExpected } = props;\n const { timeStart, duration, delay, expectedStart, countToEnd } = event;\n\n const plannedStart = timeStart + delay + event.dayOffset * dayInMs;\n\n // only show new exacted value if outside range of the planned value\n const isExpectedValueShow = showExpected && isOutsideRange(plannedStart, expectedStart);\n\n const plannedStateClass = isExpectedValueShow ? 'sub__schedule--strike' : delay !== 0 ? 'sub__schedule--delayed' : '';\n\n const expectedStateClass = `sub__schedule--${getOffsetState(expectedStart - plannedStart)}`;\n const plannedEnd = plannedStart + duration + delay;\n const expectedEnd = countToEnd ? Math.max(expectedStart + duration, plannedEnd) : expectedStart + duration;\n const expectedEndClass = `sub__schedule--${getOffsetState(expectedEnd - plannedEnd)}`;\n\n return (\n <div className='sub__schedule'>\n <ClockTime\n value={plannedStart}\n preferredFormat12={preferredFormat12}\n preferredFormat24={preferredFormat24}\n className={plannedStateClass}\n />\n {!isExpectedValueShow && (\n <>\n →\n <ClockTime\n value={plannedEnd}\n preferredFormat12={preferredFormat12}\n preferredFormat24={preferredFormat24}\n className={plannedStateClass}\n />\n </>\n )}\n {isExpectedValueShow && (\n <>\n <ClockTime\n value={expectedStart}\n className={expectedStateClass}\n preferredFormat12={preferredFormat12}\n preferredFormat24={preferredFormat24}\n />\n →\n <ClockTime\n value={expectedEnd}\n className={expectedEndClass}\n preferredFormat12={preferredFormat12}\n preferredFormat24={preferredFormat24}\n />\n </>\n )}\n </div>\n );\n}\n\ninterface SubscriptionStatusProps {\n event: ExtendedEntry<OntimeEvent> & { endedAt: MaybeNumber; expectedStart: number };\n}\n\nfunction SubscriptionStatus({ event }: SubscriptionStatusProps) {\n const { status, statusDisplay, timeDisplay } = useSubscriptionDisplayData(event);\n\n return (\n <>\n <div className='sub__status'>{statusDisplay}</div>\n {status === 'done' ? (\n <SuperscriptTime className='sub__timer' time={timeDisplay} />\n ) : (\n <div className='sub__timer'>{timeDisplay}</div>\n )}\n </>\n );\n}\n","import { IoPencil } from 'react-icons/io5';\nimport { MaybeNumber, OntimeEvent } from 'ontime-types';\nimport { getExpectedStart } from 'ontime-utils';\n\nimport Button from '../../common/components/buttons/Button';\nimport { useFadeOutOnInactivity } from '../../common/hooks/useFadeOutOnInactivity';\nimport { useExpectedStartData } from '../../common/hooks/useSocket';\nimport useReport from '../../common/hooks-query/useReport';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { cx } from '../../common/utils/styleUtils';\nimport SuperscriptTime from '../common/superscript-time/SuperscriptTime';\nimport { getPropertyValue } from '../common/viewUtils';\n\nimport { useCountdownOptions } from './countdown.options';\nimport { useSubscriptionDisplayData } from './countdown.utils';\nimport { ScheduleTime } from './CountdownSubscriptions';\n\nimport './SingleEventCountdown.scss';\n\ninterface SingleEventCountdownProps {\n subscribedEvent: ExtendedEntry<OntimeEvent>;\n goToEditMode: () => void;\n}\n\nexport default function SingleEventCountdown({ subscribedEvent, goToEditMode }: SingleEventCountdownProps) {\n const { mainSource, secondarySource, showExpected } = useCountdownOptions();\n const showFab = useFadeOutOnInactivity(true);\n const { data: reportData } = useReport();\n\n const { offset, currentDay, actualStart, plannedStart, mode } = useExpectedStartData();\n const { totalGap, isLinkedToLoaded } = subscribedEvent;\n const expectedStart = getExpectedStart(subscribedEvent, {\n currentDay,\n totalGap,\n actualStart,\n plannedStart,\n isLinkedToLoaded,\n offset,\n mode,\n });\n\n const { endedAt } = reportData[subscribedEvent.id] ?? { endedAt: null };\n const countdownEvent = { ...subscribedEvent, expectedStart, endedAt };\n const titleTmp = getPropertyValue(subscribedEvent, mainSource ?? 'title');\n const title = titleTmp?.length ? titleTmp : ' '; // insert utf-8 empty space to avoid the line collapsing;\n const secondaryData = getPropertyValue(subscribedEvent, secondarySource);\n\n return (\n <div className='single-container' data-testid='countdown-event'>\n <SubscriptionStatus event={countdownEvent} />\n <div className='event__title' style={{ borderColor: countdownEvent.colour }}>\n <ScheduleTime event={countdownEvent} showExpected={showExpected} />\n {title}\n {secondaryData && <div className='secondary'>{secondaryData}</div>}\n </div>\n <div className={cx(['fab-container', !showFab && 'fab-container--hidden'])}>\n <Button variant='primary' size='xlarge' onClick={goToEditMode}>\n <IoPencil /> Edit\n </Button>\n </div>\n </div>\n );\n}\n\ninterface SubscriptionStatusProps {\n event: ExtendedEntry<OntimeEvent> & { endedAt: MaybeNumber; expectedStart: number };\n}\n\nfunction SubscriptionStatus({ event }: SubscriptionStatusProps) {\n const { status, statusDisplay, timeDisplay } = useSubscriptionDisplayData(event);\n\n return (\n <>\n <div className='event__status'>{statusDisplay}</div>\n {status === 'done' ? (\n <SuperscriptTime className='event__timer' time={timeDisplay} />\n ) : (\n <div className='event__timer'>{timeDisplay}</div>\n )}\n </>\n );\n}\n","import { CustomFields, OntimeEntry, ProjectData, Settings } from 'ontime-types';\n\nimport useCustomFields from '../../common/hooks-query/useCustomFields';\nimport useProjectData from '../../common/hooks-query/useProjectData';\nimport { useFlatRundownWithMetadata } from '../../common/hooks-query/useRundown';\nimport useSettings from '../../common/hooks-query/useSettings';\nimport { useViewOptionsStore } from '../../common/stores/viewOptions';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { aggregateQueryStatus, ViewData } from '../utils/viewLoader.utils';\n\nexport interface CountdownData {\n customFields: CustomFields;\n rundownData: ExtendedEntry<OntimeEntry>[];\n projectData: ProjectData;\n isMirrored: boolean;\n settings: Settings;\n}\n\nexport function useCountdownData(): ViewData<CountdownData> {\n // persisted app state\n const isMirrored = useViewOptionsStore((state) => state.mirror);\n\n // HTTP API data\n const { data: rundownData, status: rundownStatus } = useFlatRundownWithMetadata();\n const { data: projectData, status: projectDataStatus } = useProjectData();\n const { data: settings, status: settingsStatus } = useSettings();\n const { data: customFields, status: customFieldsStatus } = useCustomFields();\n\n return {\n data: {\n customFields,\n rundownData,\n projectData,\n isMirrored,\n settings,\n },\n status: aggregateQueryStatus([rundownStatus, projectDataStatus, settingsStatus, customFieldsStatus]),\n };\n}\n","import { useMemo, useState } from 'react';\nimport { IoAdd } from 'react-icons/io5';\nimport { EntryId, isOntimeEvent, isPlayableEvent, OntimeEvent, OntimeView, PlayableEvent } from 'ontime-types';\n\nimport Button from '../../common/components/buttons/Button';\nimport Empty from '../../common/components/state/Empty';\nimport EmptyPage from '../../common/components/state/EmptyPage';\nimport ViewLogo from '../../common/components/view-logo/ViewLogo';\nimport ViewParamsEditor from '../../common/components/view-params-editor/ViewParamsEditor';\nimport { useClock } from '../../common/hooks/useSocket';\nimport { useWindowTitle } from '../../common/hooks/useWindowTitle';\nimport { ExtendedEntry } from '../../common/utils/rundownMetadata';\nimport { formatTime, getDefaultFormat } from '../../common/utils/time';\nimport { useTranslation } from '../../translation/TranslationProvider';\nimport Loader from '../common/loader/Loader';\nimport SuperscriptTime from '../common/superscript-time/SuperscriptTime';\n\nimport { getCountdownOptions, useCountdownOptions } from './countdown.options';\nimport { getOrderedSubscriptions } from './countdown.utils';\nimport CountdownSelect from './CountdownSelect';\nimport CountdownSubscriptions from './CountdownSubscriptions';\nimport SingleEventCountdown from './SingleEventCountdown';\nimport { CountdownData, useCountdownData } from './useCountdownData';\n\nimport './Countdown.scss';\n\nexport default function CountdownLoader() {\n const { data, status } = useCountdownData();\n\n useWindowTitle('Countdown');\n\n if (status === 'pending') {\n return <Loader />;\n }\n\n if (status === 'error') {\n return <EmptyPage text='There was an error fetching data, please refresh the page.' />;\n }\n\n return <Countdown {...data} />;\n}\n\nfunction Countdown({ customFields, rundownData, projectData, isMirrored, settings }: CountdownData) {\n const { getLocalizedString } = useTranslation();\n const { subscriptions } = useCountdownOptions();\n\n const [editMode, setEditMode] = useState(false);\n\n // gather rundown data\n const playableEvents = rundownData.filter((entry): entry is ExtendedEntry<PlayableEvent> => {\n return isOntimeEvent(entry) && isPlayableEvent(entry);\n });\n\n // gather presentation data\n const hasEvents = playableEvents.length > 0;\n\n // gather option data\n const defaultFormat = getDefaultFormat(settings?.timeFormat);\n const countdownOptions = useMemo(\n () => getCountdownOptions(defaultFormat, customFields, subscriptions),\n [defaultFormat, customFields, subscriptions],\n );\n\n return (\n <div className={`countdown ${isMirrored ? 'mirror' : ''}`} data-testid='countdown-view'>\n <ViewParamsEditor target={OntimeView.Countdown} viewOptions={countdownOptions} />\n <div className='project-header'>\n {projectData?.logo && <ViewLogo name={projectData.logo} className='logo' />}\n <div className='title'>{projectData.title}</div>\n <CountdownClock />\n </div>\n\n {!hasEvents && <Empty text={getLocalizedString('common.no_data')} className='empty-container' />}\n\n {hasEvents && editMode && (\n <CountdownSelect events={playableEvents} subscriptions={subscriptions} disableEdit={() => setEditMode(false)} />\n )}\n\n {hasEvents && !editMode && (\n <CountdownContents\n playableEvents={playableEvents}\n subscriptions={subscriptions}\n goToEditMode={() => setEditMode(true)}\n />\n )}\n </div>\n );\n}\n\ninterface CountdownContentsProps {\n playableEvents: ExtendedEntry<OntimeEvent>[];\n subscriptions: EntryId[];\n goToEditMode: () => void;\n}\n\nfunction CountdownContents({ playableEvents, subscriptions, goToEditMode }: CountdownContentsProps) {\n const { getLocalizedString } = useTranslation();\n const { hidePast } = useCountdownOptions();\n\n if (subscriptions.length === 0) {\n return (\n <div className='empty-container'>\n <Empty text={getLocalizedString('countdown.select_event')} className='empty-container' />\n <Button variant='primary' size='xlarge' onClick={goToEditMode}>\n <IoAdd /> Add\n </Button>\n </div>\n );\n }\n\n const subscribedEvents = getOrderedSubscriptions(subscriptions, playableEvents);\n const eventsToShow = !hidePast ? subscribedEvents : subscribedEvents.filter((event) => !event.isPast);\n\n if (subscribedEvents.length === 0) {\n return (\n <div className='empty-container'>\n <Empty text={getLocalizedString('countdown.select_event')} className='empty-container' />\n <Button variant='primary' size='xlarge' onClick={goToEditMode}>\n <IoAdd /> Add\n </Button>\n </div>\n );\n }\n\n if (subscribedEvents.length === 1 && eventsToShow.length === 1) {\n const event = subscribedEvents.at(0);\n if (!event) return null;\n return <SingleEventCountdown subscribedEvent={event} goToEditMode={goToEditMode} />;\n }\n\n if (eventsToShow.length === 0) {\n return (\n <div className='empty-container'>\n <Empty text={getLocalizedString('countdown.all_have_finished')} className='empty-container' />\n </div>\n );\n }\n\n return <CountdownSubscriptions subscribedEvents={eventsToShow} goToEditMode={goToEditMode} />;\n}\n\nfunction CountdownClock() {\n const { getLocalizedString } = useTranslation();\n const clock = useClock();\n\n // gather timer data\n const formattedClock = formatTime(clock);\n\n return (\n <div className='clock-container'>\n <div className='label'>{getLocalizedString('common.time_now')}</div>\n <SuperscriptTime time={formattedClock} className='time' />\n </div>\n );\n}\n"],"names":["getCountdownOptions","timeFormat","customFields","persistedSubscriptions","mainOptions","makeOptionsFromCustomFields","value","label","secondaryOptions","title","OptionTitle","ClockOptions","collapsible","options","getTimeOption","DataSources","id","description","type","values","defaultValue","BehaviourOptions","ElementVisibility","Hidden","getOptionsFromParams","searchParams","defaultValues","getValue","key","get","subscriptions","has","getAll","mainSource","secondarySource","showExpected","isStringBoolean","hidePast","useCountdownOptions","useSearchParams","maybePreset","use","PresetContext","useMemo","URLSearchParams","search","undefined","preferredFormat12","preferredFormat24","getIsLive","currentId","selectedId","playback","Playback","Armed","timerProgress","future","due","live","pending","loaded","done","useSubscriptionDisplayData","subscribedEvent","current","clock","useCountdownSocket","getLocalizedString","useTranslation","bigDuration","toUpperCase","MILLIS_PER_MINUTE","removeLeadingZero","millisToString","formatDuration","replace","isLoaded","status","statusDisplay","timeDisplay","duration","Stop","isPast","formatTime","endedAt","format12","format24","expectedStart","makeSubscriptionsUrl","urlRef","url","URL","newParams","entries","append","forEach","toString","getOrderedSubscriptions","playableEvents","filter","event","includes","isOutsideRange","a","b","Math","abs","extendEventData","currentDay","actualStart","plannedStart","offset","mode","reportData","totalGap","isLinkedToLoaded","getExpectedStart","ClockTime","props","FORMAT_12","FORMAT_24","className","formattedTime","jsx","SuperscriptTime","CountdownSelect","events","disableEdit","selected","setSelected","useState","navigate","useNavigate","toggleSelect","entryId","prev","applySelection","filteredSelected","some","window","location","href","selectedIds","Set","jsxs","map","index","isSelected","e","stopPropagation","cx","colour","timeStart","timeEnd","Button","IoArrowBack","length","IoClose","IoSaveOutline","CountdownSubscriptions","subscribedEvents","goToEditMode","usePlayback","selectedEventId","useSelectedEventId","showFab","useFadeOutOnInactivity","data","useReport","useExpectedStartData","timeoutId","useRef","lockAutoScroll","setLockAutoScroll","selectedRef","scrollRef","scrollToComponent","useFollowComponent","followRef","doFollow","topOffset","followTrigger","useEffect","scrollTo","handleOffset","throttledHandleScroll","throttle","handleUserScroll","selectedRect","getBoundingClientRect","scrollerRect","distanceFromTop","top","hasScrolledOutOfThreshold","handleScroll","clearTimeout","secondaryData","getPropertyValue","isLive","isArmed","countdownEvent","displayTitle","cue","ScheduleTime","SubscriptionStatus","IoPencil","FollowButton","delay","countToEnd","dayOffset","dayInMs","isExpectedValueShow","plannedStateClass","expectedStateClass","getOffsetState","plannedEnd","expectedEnd","max","expectedEndClass","Fragment","SingleEventCountdown","titleTmp","borderColor","useCountdownData","isMirrored","useViewOptionsStore","state","mirror","rundownData","rundownStatus","useFlatRundownWithMetadata","projectData","projectDataStatus","useProjectData","settings","settingsStatus","useSettings","customFieldsStatus","useCustomFields","aggregateQueryStatus","CountdownLoader","useWindowTitle","Loader","EmptyPage","Countdown","editMode","setEditMode","entry","isOntimeEvent","isPlayableEvent","hasEvents","defaultFormat","getDefaultFormat","countdownOptions","ViewParamsEditor","OntimeView","logo","ViewLogo","CountdownClock","Empty","CountdownContents","IoAdd","eventsToShow","at","useClock","formattedClock"],"mappings":"s7CAWO,MAAMA,GAAsBA,CACjCC,EACAC,EACAC,IACiB,CACXC,MAAAA,EAAcC,EAA4BH,EAAc,CAAC,CAAEI,MAAO,QAASC,MAAO,OAAA,CAAS,CAAC,EAC5FC,EAAmBH,EAA4BH,EAAc,CACjE,CAAEI,MAAO,OAAQC,M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ot,bl as Ft,bu as Ne,bv as we,bw as Wt,bx as At,ah as rt,by as Ht,bc as Pt,f as be,ay as lt,a$ as Bt,b0 as Ue,bo as qt,bz as Ut,bA as Kt,b1 as Vt,bn as Gt,bB as Jt,C as Xt,aX as ee,aG as Yt,aY as ct,aZ as Zt,a_ as Ke,bC as dt,bD as ut,bE as mt,aN as ht,bF as Qt,b3 as en,b4 as tn,bG as se,bq as nn,bH as sn,as as Oe,ar as Ve,T as Ge,y as an,av as on,bI as rn,bJ as ln,bK as cn,bL as dn}from"./vendor-CKDP5hij.js";import{S as Le,u as xt,T as Je,M as ft,G as un,p as ie,P as mn,l as Xe}from"./useEventSelection-B9mbj1cM.js";import{ah as Y,aD as G,e as W,ak as A,s as hn,m as R,T as le,B as F,bC as xn,x as fe,bk as Ye,bD as Me,f as te,b6 as D,k as Ze,bE as fn,an as gn,aw as pn,O as jn,P as bn,bd as Qe,bF as De,bG as ze,o as Cn}from"./index-2lQ-45a9.js";import{u as yn,i as ae,k as gt,j as pt,w as $e,S as ne,a as vn}from"./useRundown-D6vokFHi.js";import{L as C,T as O,S as _n}from"./EditorUtils-CLBWDP4k.js";import{T as Q,A as ge,s as En}from"./TimeInput-DTWDnaum.js";import{u as Fe}from"./useCustomFields-zr9SUl5o.js";import{T as K,E as Se}from"./validateEvent-BUgLWn7x.js";import{S as pe}from"./Select-DQwYPDyI.js";import{S as jt,P as bt,C as Z}from"./SwatchPicker-Dyxkxf3_.js";import{T as P}from"./Tooltip-DXph8P8p.js";import{a as Ct,D as je}from"./DelayIndicator-DUbpd6DG.js";import{p as Ce}from"./parseUserTime-WkVNjkkE.js";import{g as kn}from"./offset-DAyBfv5b.js";import{T as Sn}from"./editorSettings-D4jfu68W.js";import{E as Tn}from"./EmptyPage-DmpOAg7R.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="f6b8f6f3-323d-4c38-865d-88a6822b6338",t._sentryDebugIdIdentifier="sentry-dbid-f6b8f6f3-323d-4c38-865d-88a6822b6338")}catch{}})();var $=(t=>(t.onLoad="onLoad",t.onStart="onStart",t.onPause="onPause",t.onStop="onStop",t.onClock="onClock",t.onUpdate="onUpdate",t.onFinish="onFinish",t.onWarning="onWarning",t.onDanger="onDanger",t))($||{});const In=Object.keys($);function Nn(t){return t.replaceAll(" ","").replaceAll(",",".")}const yt=m.createContext(null);function ba({children:t,actions:s}){return e.jsx(yt.Provider,{value:s,children:t})}function L(){const t=m.useContext(yt);if(!t)throw new Error("useEntryActionsContext must be used within EntryActionsProvider");return t}const wn="_imageContainer_1k5qa_17",Dn="_imageOverlay_1k5qa_25",et={imageContainer:wn,imageOverlay:Dn};function zn({src:t}){return e.jsxs("div",{className:et.imageContainer,children:[!!t&&e.jsx("img",{loading:"lazy",src:t}),e.jsx("div",{className:et.imageOverlay})]})}function vt({value:t,inputref:s,...i}){return m.useEffect(()=>{const n=s.current;return qe(s.current),()=>{qe.destroy(n)}},[s,t]),e.jsx(Sn,{ref:s,value:t,...i})}function ye(t,s,i,n){const[r,o]=m.useState(t),a=m.useRef(!1);m.useEffect(()=>{o(typeof t>"u"?"":t)},[t]);const l=m.useCallback(x=>{x!==r&&o(x)},[r]),c=m.useCallback(x=>{var f;if(x===t&&!(n!=null&&n.allowSubmitSameValue))(f=n==null?void 0:n.onCancelUpdate)==null||f.call(n);else{const u=x.trim();s(u),u!==x&&o(u)}setTimeout(()=>{var u,j,p;n!=null&&n.allowKeyboardNavigation?(j=(u=i.current)==null?void 0:u.parentElement)==null||j.focus():(p=i.current)==null||p.blur()})},[t,n,i,s]),d=m.useCallback(()=>{var x;o(t),i.current&&(i.current.value=t),(x=n==null?void 0:n.onCancelUpdate)==null||x.call(n),setTimeout(()=>{var f;return(f=i.current)==null?void 0:f.blur()})},[t,n,i]),h=m.useMemo(()=>{const x=[["Escape",u=>{u.preventDefault(),d()},{preventDefault:!0}]];n!=null&&n.submitOnEnter&&x.push(["Enter",()=>{a.current=!0,c(r),setTimeout(()=>{a.current=!1},0)}]),n!=null&&n.submitOnCtrlEnter&&x.push(["mod + Enter",()=>{a.current=!0,c(r),setTimeout(()=>{a.current=!1},0)}]);const f=$t(x);return u=>{(u.key==="ArrowLeft"||u.key==="ArrowRight"||u.key==="ArrowUp"||u.key==="ArrowDown")&&u.stopPropagation(),f(u)}},[d,c,n==null?void 0:n.submitOnCtrlEnter,n==null?void 0:n.submitOnEnter,r]);return{value:r,onChange:x=>l(x.target.value),onBlur:x=>{a.current||c(x.target.value)},onKeyDown:h}}function ve({className:t,field:s,label:i,initialValue:n,style:r,submitHandler:o}){const a=m.useRef(null),l=m.useCallback(f=>o(s,f),[s,o]),{value:c,onChange:d,onBlur:h,onKeyDown:x}=ye(n,l,a,{submitOnCtrlEnter:!0});return e.jsxs("div",{children:[e.jsx(C,{className:t,htmlFor:s,style:r,children:i}),e.jsx(vt,{id:s,inputref:a,rows:1,"data-testid":"input-textarea",fluid:!0,value:c,onChange:d,onBlur:h,onKeyDown:x})]})}function J({className:t,field:s,label:i,initialValue:n,style:r,submitHandler:o,maxLength:a,placeholder:l}){const c=m.useRef(null),d=m.useCallback(j=>o(s,j),[s,o]),{value:h,onChange:x,onBlur:f,onKeyDown:u}=ye(n,d,c,{submitOnEnter:!0});return e.jsxs("div",{children:[e.jsx(C,{className:t,htmlFor:s,style:r,children:i}),e.jsx(Y,{id:s,ref:c,maxLength:a,fluid:!0,"data-testid":"input-textfield",value:h,placeholder:l,onChange:x,onBlur:f,onKeyDown:u})]})}const Rn="_rundownEditor_d7rpz_19",On="_content_d7rpz_29",Ln="_column_d7rpz_48",Mn="_decorated_d7rpz_57",$n="_delayLabel_d7rpz_65",Fn="_switchLabel_d7rpz_73",Wn="_inline_d7rpz_83",An="_splitTwo_d7rpz_89",Hn="_splitThree_d7rpz_96",Pn="_tooltipIcon_d7rpz_103",Bn="_customImage_d7rpz_110",qn="_textLikeInput_d7rpz_117",Un="_inactive_d7rpz_125",Kn="_active_d7rpz_129",b={rundownEditor:Rn,content:On,column:Ln,decorated:Mn,delayLabel:$n,switchLabel:Fn,inline:Wn,splitTwo:An,splitThree:Hn,tooltipIcon:Pn,customImage:Bn,textLikeInput:qn,inactive:Un,active:Kn};function We({fields:t,handleSubmit:s,entry:i}){return e.jsx(m.Fragment,{children:Object.keys(t).map(n=>{const r=`${i.id}-${n}`,o=`custom-${n}`,a=i.custom[n]??"",{backgroundColor:l,color:c}=G(t[n].colour),d=t[n].label;return t[n].type==="text"?e.jsx(ve,{field:o,label:d,initialValue:a,submitHandler:s,className:b.decorated,style:{"--decorator-bg":l,"--decorator-color":c}},r):t[n].type==="image"?e.jsxs("div",{className:b.customImage,children:[e.jsx(J,{field:o,label:d,initialValue:a,placeholder:"Paste image URL",submitHandler:s,className:b.decorated,maxLength:255,style:{"--decorator-bg":l,"--decorator-color":c}},r),e.jsx(zn,{src:a})]},r):null})})}const Vn="_inputGroup_1e1jq_17",Gn="_delayed_1e1jq_24",tt={inputGroup:Vn,delayed:Gn};function he({hasDelay:t,children:s}){return e.jsx("div",{className:W([tt.inputGroup,t&&tt.delayed]),children:s})}const Jn="_fourtyfive_ezj8b_13",Xn="_timerNote_ezj8b_21",Yn="_inactive_ezj8b_27",Zn="_active_ezj8b_31",Qn="_inputWrapper_ezj8b_35",es="_hoverLabel_ezj8b_39",N={fourtyfive:Jn,timerNote:Xn,inactive:Yn,active:Zn,inputWrapper:Qn,hoverLabel:es},ts=m.memo(ns);function ns({eventId:t,countToEnd:s,timeStart:i,timeEnd:n,duration:r,timeStrategy:o,linkStart:a,delay:l,showLabels:c}){const{updateEntry:d,updateTimer:h}=L(),x=(_,v)=>{h(t,_,v)},f=_=>{d({id:t,timeStrategy:_})},u=_=>{d({id:t,linkStart:_})},j=[];i+r>hn&&j.push("Over midnight"),s&&j.push("Count to End");const p=l!==0,g=o===K.LockEnd,y=o===K.LockDuration;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:N.inputWrapper,children:[c&&e.jsx(C,{className:N.sectionTitle,children:"Start time"}),e.jsx(C,{className:N.hoverLabel,children:"Start"}),e.jsxs(he,{hasDelay:p,children:[e.jsx(Q,{name:"timeStart",submitHandler:x,time:i,placeholder:"Start",align:"left",disabled:a}),e.jsx(P,{text:"Link start to previous end",onClick:()=>u(!a),render:e.jsx(A,{variant:"subtle-white",className:a?N.active:N.inactive}),children:e.jsx("span",{className:N.fourtyfive,children:a?e.jsx(ot,{}):e.jsx(Ft,{})})})]})]}),e.jsxs("div",{className:N.inputWrapper,children:[c&&e.jsx(C,{children:"End time"}),e.jsx(C,{className:N.hoverLabel,children:"End"}),e.jsxs(he,{hasDelay:p,children:[e.jsx(Q,{name:"timeEnd",submitHandler:x,time:n,placeholder:"End",align:"left",disabled:y}),e.jsx(P,{text:"Lock end",render:e.jsx(A,{variant:"subtle-white",className:g?N.active:N.inactive}),onClick:()=>f(K.LockEnd),"data-testid":"lock__end",children:g?e.jsx(Ne,{}):e.jsx(we,{})})]})]}),e.jsxs("div",{className:N.inputWrapper,children:[c&&e.jsx(C,{children:"Duration"}),e.jsx(C,{className:N.hoverLabel,children:"Duration"}),e.jsxs(he,{hasDelay:p,children:[e.jsx(Q,{name:"duration",submitHandler:x,time:r,placeholder:"Duration",align:"left",disabled:g}),e.jsx(P,{text:"Lock duration",render:e.jsx(A,{variant:"subtle-white",className:y?N.active:N.inactive}),onClick:()=>f(K.LockDuration),"data-testid":"lock__duration",children:y?e.jsx(Ne,{}):e.jsx(we,{})})]})]}),j.length>0&&e.jsx(P,{text:j.join(" - "),className:N.timerNote,"data-testid":"event-warning",render:e.jsx("span",{}),children:e.jsx(Wt,{})})]})}const ss=m.memo(is);function is({eventId:t,timeStart:s,timeEnd:i,duration:n,timeStrategy:r,linkStart:o,countToEnd:a,delay:l,endAction:c,timerType:d,timeWarning:h,timeDanger:x}){const{updateEntry:f}=L(),u=(g,y)=>{if(g==="countToEnd"){f({id:t,countToEnd:y});return}if(g==="timeWarning"||g==="timeDanger"){const _=Ce(y);f({id:t,[g]:_});return}if(g==="timerType"||g==="endAction"){f({id:t,[g]:y});return}},p=l!==0?`Event is ${Ct(l,"expanded")}. New schedule ${R(s+l)} → ${R(i+l)}`:"";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Event schedule"}),e.jsxs("div",{children:[e.jsx("div",{className:b.inline,children:e.jsx(ts,{eventId:t,timeStart:s,timeEnd:i,duration:n,timeStrategy:r,linkStart:o,delay:l,countToEnd:a,showLabels:!0})}),e.jsx("div",{className:b.delayLabel,children:p})]})]}),e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Event Behaviour"}),e.jsxs("div",{className:b.splitTwo,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"endAction",children:"End Action"}),e.jsx(pe,{value:c,onValueChange:g=>{g!==null&&u("endAction",g)},options:[{value:Se.None,label:"None"},{value:Se.LoadNext,label:"Load next event"},{value:Se.PlayNext,label:"Play next event"}]})]}),e.jsxs("div",{children:[e.jsx(C,{htmlFor:"countToEnd",children:"Count to End"}),e.jsxs(C,{className:b.switchLabel,children:[e.jsx(jt,{id:"countToEnd",checked:a,onCheckedChange:g=>u("countToEnd",g)}),a?"On":"Off"]})]})]})]}),e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:e.jsxs(P,{text:"Changes how the timer is displayed in different views. It is not reflected in the rundown",render:e.jsx("span",{}),children:["Display Options",e.jsx(At,{className:b.tooltipIcon})]})}),e.jsxs("div",{className:b.splitTwo,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"timerType",children:"Timer Type"}),e.jsx(pe,{value:d,onValueChange:g=>{g!==null&&u("timerType",g)},options:[{value:le.CountDown,label:"Count down"},{value:le.CountUp,label:"Count up"},{value:le.Clock,label:"Clock"},{value:le.None,label:"None"}]})]}),e.jsxs("div",{className:b.inline,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"timeWarning",children:"Warning Time"}),e.jsx(Q,{id:"timeWarning",name:"timeWarning",submitHandler:u,time:h,placeholder:"Duration"})]}),e.jsxs("div",{children:[e.jsx(C,{htmlFor:"timeDanger",children:"Danger Time"}),e.jsx(Q,{id:"timeDanger",name:"timeDanger",submitHandler:u,time:x,placeholder:"Duration"})]})]})]})]})]})}const as=m.memo(os);function os({eventId:t,cue:s,flag:i,title:n,note:r,colour:o}){const{updateEntry:a}=L(),l=(h,x)=>{a({id:t,cue:Nn(x)})},c=h=>{a({id:t,flag:h})},d=(h,x)=>{a({id:t,[h]:x})};return e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Event Data"}),e.jsxs("div",{className:b.splitThree,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"eventId",children:"Event ID (read only)"}),e.jsx(Y,{id:"eventId","data-testid":"input-textfield",value:t,readOnly:!0,fluid:!0})]}),e.jsx(J,{field:"cue",label:"Cue",initialValue:s,submitHandler:l,maxLength:10}),e.jsxs("div",{children:[e.jsx(C,{htmlFor:"flag",children:"Flag"}),e.jsxs(C,{className:b.switchLabel,children:[e.jsx(jt,{id:"flag",checked:i,onCheckedChange:c}),i?"On":"Off"]})]})]}),e.jsxs("div",{children:[e.jsx(C,{children:"Colour"}),e.jsx(Le,{name:"colour",value:o,handleChange:d})]}),e.jsx(J,{field:"title",label:"Title",initialValue:n,submitHandler:d}),e.jsx(ve,{field:"note",label:"Note",initialValue:r,submitHandler:d})]})}const rs=[$.onLoad,$.onStart,$.onPause,$.onFinish,$.onWarning,$.onDanger],ls="_triggerForm_l7413_17",cs="_trigger_l7413_17",ds="_errorLabel_l7413_38",us="_success_l7413_42",xe={triggerForm:ls,trigger:cs,errorLabel:ds,success:us};function ms({triggers:t,eventId:s}){const i=t.length>0;return e.jsxs(e.Fragment,{children:[i&&e.jsx(xs,{triggers:t,eventId:s}),e.jsx(hs,{triggers:t,eventId:s})]})}function hs({eventId:t,triggers:s}){const{data:i}=xt(),{updateEntry:n}=L(),[r,o]=m.useState(void 0),[a,l]=m.useState($.onStart),c=(u,j)=>{const p=s??new Array,g=xn();p.push({id:g,title:"",trigger:u,automationId:j}),n({id:t,triggers:p})},h=((u,j)=>{if(j===void 0)return"Select an automation";if(!Object.keys(i.automations).includes(j))return"This automation does not exist";if(s!==void 0)return Object.values(s).some(p=>p.automationId===j&&p.trigger===u)?"Automation can only be used once":void 0})(a,r),x=m.useMemo(()=>[{value:null,label:"Select Trigger"},...rs.map(u=>({value:u,label:u}))],[]),f=m.useMemo(()=>[{value:null,label:"Select Automation"},...Object.values(i.automations).map(({id:u,title:j})=>({value:u,label:j}))],[i.automations]);return e.jsxs("div",{className:xe.triggerForm,children:[e.jsx(pe,{value:a,onValueChange:u=>{u!==null&&l(u)},options:x}),e.jsx(pe,{value:r??null,onValueChange:u=>{u!==null&&o(u)},options:f}),e.jsx(F,{disabled:h!==void 0,onClick:()=>r&&c(a,r),children:"Add"}),h!==void 0?e.jsx(P,{text:h,render:e.jsx("span",{}),children:e.jsx(Ht,{className:xe.errorLabel})}):e.jsx(Pt,{className:xe.success})]})}function xs({eventId:t,triggers:s}){const{updateEntry:i}=L(),{data:n}=xt(),r=m.useCallback(a=>{const l=s.filter(c=>c.id!==a);i({id:t,triggers:l})},[t,s,i]),o={};return In.forEach(a=>{const l=s.filter(c=>c.trigger===a);l.length&&Object.assign(o,{[a]:l})}),e.jsx("div",{children:Object.entries(o).map(([a,l])=>e.jsx(m.Fragment,{children:l.map(c=>{var f;const{id:d,automationId:h}=c,x=((f=n.automations[h])==null?void 0:f.title)??"<MISSING AUTOMATION>";return e.jsxs("div",{className:xe.trigger,children:[e.jsx(Je,{children:a}),e.jsx(Je,{children:x}),e.jsx(A,{variant:"ghosted-destructive",onClick:()=>r(d),children:e.jsx(rt,{})})]},d)})},a))})}function fs({event:t}){const{data:s}=Fe(),{updateEntry:i}=L(),n=window.location.pathname.includes("editor"),r=m.useCallback((o,a)=>{if(o.startsWith("custom-")){const l=o.split("custom-")[1];i({id:t.id,custom:{[l]:a}})}else i({id:t.id,[o]:a})},[t.id,i]);return e.jsxs("div",{className:b.content,children:[e.jsx(ss,{eventId:t.id,timeStart:t.timeStart,timeEnd:t.timeEnd,duration:t.duration,timeStrategy:t.timeStrategy,linkStart:t.linkStart,countToEnd:t.countToEnd,delay:t.delay,endAction:t.endAction,timerType:t.timerType,timeWarning:t.timeWarning,timeDanger:t.timeDanger},`${t.id}-times`),e.jsx(as,{eventId:t.id,cue:t.cue,flag:t.flag,title:t.title,note:t.note,colour:t.colour},`${t.id}-titles`),e.jsxs("div",{className:b.column,children:[e.jsxs(O,{children:["Custom Fields",n&&e.jsx(ge,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(We,{fields:s,handleSubmit:r,entry:t})]}),e.jsxs("div",{className:b.column,children:[e.jsxs(O,{children:["Automations",n&&e.jsx(ge,{search:"settings=automation",children:"Manage Automations"})]}),e.jsx(ms,{triggers:t.triggers,eventId:t.id})]})]})}const gs="_blink_1qqxl_1",ps="_fourtyfive_1qqxl_13",js="_textInput_1qqxl_18",bs="_under_1qqxl_31",Cs="_over_1qqxl_34",ys="_muted_1qqxl_37",vs="_disabled_1qqxl_40",ce={blink:gs,fourtyfive:ps,textInput:js,under:bs,over:Cs,muted:ys,disabled:vs},_t=m.forwardRef(({offset:t,muted:s,disabled:i,children:n,className:r,...o},a)=>{const l=m.useRef(null),c=W([ce.textInput,t&&ce[t],s&&ce.muted,i&&ce.disabled,r]);return m.useImperativeHandle(a,()=>({focusParentElement(){var d,h;(h=(d=l.current)==null?void 0:d.parentElement)==null||h.focus()}})),e.jsx("div",{className:c,tabIndex:i?-1:0,...o,ref:l,children:n})});_t.displayName="TextLikeInput";const V=m.memo(_t);function _s({id:t,name:s,submitHandler:i,time:n,emptyDisplay:r,placeholder:o,disabled:a,align:l="center",className:c}){const d=m.useRef(null),[h,x]=m.useState(""),f=m.useRef(!1),u=m.useCallback(()=>{typeof n!="number"||isNaN(n)?x(r):x(R(n))},[r,n]),j=m.useCallback(()=>{var v;(v=d.current)==null||v.select()},[]),p=m.useCallback(v=>{if(v===""&&n===null)return!1;const E=Ce(v);return E===n?!1:(i(s,E),!0)},[s,i,n]),g=m.useCallback(v=>{p(v)||u()},[p,u]),y=m.useCallback(v=>{var E,H;v.key==="Enter"&&((E=d.current)==null||E.blur()),v.key==="Escape"&&(f.current=!0,(H=d.current)==null||H.blur(),u())},[u]),_=m.useCallback(v=>{if(f.current){f.current=!1;return}g(v.target.value)},[g]);return m.useEffect(()=>{u()},[u]),e.jsx(Y,{id:t,disabled:a,ref:d,"data-testid":`time-input-${s}`,className:W([En.timeInput,c]),placeholder:o,onFocus:j,onChange:v=>x(v.target.value),onBlur:_,onKeyDown:y,value:h,maxLength:8,autoComplete:"off",style:{textAlign:l}})}function Es({duration:t,targetDuration:s,submitHandler:i}){const n=s!==null;return e.jsxs("div",{children:[e.jsx(C,{htmlFor:"targetDuration",children:"Target duration"}),e.jsxs(he,{hasDelay:n&&s!==t,children:[e.jsx(_s,{name:"targetDuration",time:s,submitHandler:i,emptyDisplay:fe,className:n?"":b.inactive}),e.jsx(P,{text:"Lock to target duration",className:W([b.timeAction,n&&b.active]),onClick:()=>i("targetDuration",n?null:t),"data-testid":"lock__duration",render:e.jsx(A,{variant:"subtle-white",className:n?b.active:b.inactive}),children:n?e.jsx(Ne,{}):e.jsx(we,{})})]})]})}function ks({group:t}){const{data:s}=Fe(),{updateEntry:i}=L(),n=m.useCallback((l,c)=>{if(typeof l=="string"&&l.startsWith("custom-")){const d=l.split("custom-")[1];i({id:t.id,custom:{[d]:c}});return}return i(l==="targetDuration"?{id:t.id,targetDuration:c}:{id:t.id,[l]:c})},[t.id,i]),r=window.location.pathname.includes("editor"),o=t.targetDuration===null?null:t.duration-t.targetDuration,a=o!==null?kn(o):null;return e.jsxs("div",{className:b.content,children:[e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Group schedule"}),e.jsxs("div",{className:b.inline,children:[e.jsxs("div",{children:[e.jsx(C,{children:"First event start"}),e.jsx(V,{className:b.textLikeInput,disabled:!0,children:R(t.timeStart,{fallback:Ye})})]}),e.jsxs("div",{children:[e.jsx(C,{children:"Last event end"}),e.jsx(V,{className:b.textLikeInput,disabled:!0,children:R(t.timeEnd,{fallback:Ye})})]}),e.jsxs("div",{children:[e.jsx(C,{htmlFor:"duration",children:"Scheduled duration"}),e.jsx(V,{className:b.textLikeInput,disabled:!0,children:R(t.duration,{fallback:fe})})]})]}),e.jsxs("div",{className:b.inline,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"eventId",children:"Plan offset"}),e.jsxs(V,{offset:a,className:W([b.textLikeInput,o===null&&b.inactive]),disabled:!0,children:[o!==null&&o>0?"+":"",R(o,{fallback:fe})]})]}),e.jsx(Es,{duration:t.duration,targetDuration:t.targetDuration,submitHandler:n})]})]}),e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Group data"}),e.jsxs("div",{children:[e.jsx(C,{children:"Colour"}),e.jsx(Le,{name:"colour",value:t.colour,handleChange:n})]}),e.jsx(J,{field:"title",label:"Title",initialValue:t.title,submitHandler:n}),e.jsx(ve,{field:"note",label:"Note",initialValue:t.note,submitHandler:n})]}),e.jsxs("div",{className:b.column,children:[e.jsxs(O,{children:["Custom Fields",r&&e.jsx(ge,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(We,{fields:s,handleSubmit:n,entry:t})]})]})}function Ss({milestone:t}){const{data:s}=Fe(),{updateEntry:i}=L(),n=m.useCallback((o,a)=>{if(typeof o=="string"&&o.startsWith("custom-")){const l=o.split("custom-")[1];i({id:t.id,custom:{[l]:a}});return}return i({id:t.id,[o]:a})},[t.id,i]),r=window.location.pathname.includes("editor");return e.jsxs("div",{className:b.content,children:[e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Milestone data"}),e.jsxs("div",{className:b.splitTwo,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"entryId",children:"Milestone ID (read only)"}),e.jsx(Y,{id:"entryId","data-testid":"input-textfield",value:t.id,readOnly:!0,fluid:!0})]}),e.jsx(J,{field:"cue",label:"Cue",initialValue:t.cue,submitHandler:n,maxLength:10})]}),e.jsxs("div",{children:[e.jsx(C,{children:"Colour"}),e.jsx(Le,{name:"colour",value:t.colour,handleChange:n})]}),e.jsx(J,{field:"title",label:"Title",initialValue:t.title,submitHandler:n}),e.jsx(ve,{field:"note",label:"Note",initialValue:t.note,submitHandler:n})]}),e.jsxs("div",{className:b.column,children:[e.jsxs(O,{children:["Custom Fields",r&&e.jsx(ge,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(We,{fields:s,handleSubmit:n,entry:t})]})]})}function Ts({entryId:t}){const{data:s}=yn(),i=m.useMemo(()=>s.order.length===0?null:s.entries[t]??null,[t,s.order,s.entries]);return ae(i)?e.jsx("div",{className:b.entryEditor,"data-testid":"editor-container",children:e.jsx(fs,{event:i})}):gt(i)?e.jsx("div",{className:b.inModal,"data-testid":"editor-container",children:e.jsx(Ss,{milestone:i})}):pt(i)?e.jsx("div",{className:b.inModal,"data-testid":"editor-container",children:e.jsx(ks,{group:i})}):null}const Re=be(t=>({selectedEntryId:null,setEditableEntry:s=>t({selectedEntryId:s}),clearSelection:()=>t({selectedEntryId:null})})),Ca=m.memo(Is);function Is(){const t=Re(i=>i.selectedEntryId),s=Re(i=>i.clearSelection);return t===null?null:e.jsx(ft,{isOpen:!0,onClose:s,title:"Edit entry",showCloseButton:!0,bodyElements:e.jsx(Ts,{entryId:t})})}function Ns(t,s){let i;return(...n)=>{i&&clearTimeout(i),i=setTimeout(()=>{i=null,t(...n)},s)}}function ws(t="cuesheet"){const s=m.useMemo(()=>Me(`${t}-table-sizes`),[t]),[i,n]=m.useState(()=>{try{const o=localStorage.getItem(s);return o?JSON.parse(o):{}}catch{return{}}});m.useEffect(()=>{Ns(a=>{localStorage.setItem(s,JSON.stringify(a))},500)(i)},[i,s]);const r=m.useCallback(o=>{n(o)},[]);return{columnSizing:i,setColumnSizing:r}}function Et(t,s="cuesheet"){const i=m.useMemo(()=>Me(`${s}-table-order`),[s]),[n,r]=lt({key:i,defaultValue:t.map(a=>a.id)});m.useEffect(()=>{const a=t.map(l=>l.id);a.some(l=>!n.includes(l))&&r(a)},[n,t,r]);const o=m.useCallback(()=>{r(t.map(a=>a.id))},[t,r]);return{columnOrder:n,saveColumnOrder:r,resetColumnOrder:o}}function Ds(t="cuesheet"){const s=m.useMemo(()=>Me(`${t}-table-hidden`),[t]),[i,n]=lt({key:s,defaultValue:{}});return{columnVisibility:i,setColumnVisibility:n}}function ya({columns:t,tableRoot:s="cuesheet",children:i}){const{columnOrder:n,saveColumnOrder:r}=Et(t,s),o=Bt(Ue(Vt,{activationConstraint:{delay:100,tolerance:50}}),Ue(Kt,{activationConstraint:{delay:100,tolerance:50}})),a=l=>{const{delta:c,active:d,over:h}=l;if(c.y>200||(h==null?void 0:h.id)==null)return;const x=n.indexOf(d.id),f=n.indexOf(h.id);if(f===-1)return;const u=[...n],j=u.splice(x,1);u.splice(f,0,j[0]),r(u)};return e.jsx(qt,{sensors:o,collisionDetection:Ut,onDragEnd:a,children:i})}const kt=m.forwardRef(({initialValue:t,fieldId:s,fieldLabel:i,allowSubmitSameValue:n,handleUpdate:r,handleCancelUpdate:o},a)=>{const l=m.useRef(null),c=m.useCallback(u=>r(u),[r]),{value:d,onChange:h,onBlur:x,onKeyDown:f}=ye(t,c,l,{allowSubmitSameValue:n,allowKeyboardNavigation:!0,submitOnEnter:!0,submitOnCtrlEnter:!0,onCancelUpdate:o});return m.useImperativeHandle(a,()=>({focus(){var u;(u=l.current)==null||u.focus()},select(){var u;(u=l.current)==null||u.select()},focusParentElement(){var u,j;(j=(u=l.current)==null?void 0:u.parentElement)==null||j.focus()}}),[l]),e.jsx(Y,{ref:l,variant:"ghosted",fluid:!0,value:d,onChange:h,onBlur:x,onKeyDown:f,"data-testid":s?`cuesheet-editor-${s}`:void 0,"aria-label":i?`${i} editor`:void 0})});kt.displayName="SingleLineCell";const Ae=m.memo(kt),zs=m.memo(Rs);function Rs({initialValue:t,lockedValue:s,delayed:i,onSubmit:n,children:r}){const[o,a]=m.useState(!1),[l,c]=m.useState(t),d=m.useRef(null),h=m.useRef(null);m.useEffect(()=>{o&&d.current&&(d.current.focus(),d.current.select())},[o]),m.useEffect(()=>{o||c(t)},[t,o]);const x=()=>a(!0),f=()=>{a(!1),setTimeout(()=>{var p;return(p=h.current)==null?void 0:p.focusParentElement()})},u=m.useCallback(p=>{var y,_,v;if(a(!1),p===""){n(p),(y=d.current)==null||y.focusParentElement();return}if(p.startsWith("p")||p.startsWith("+")){n(p),(_=d.current)==null||_.focusParentElement();return}const g=Ce(p);if(g<0||isNaN(g)){c(t),setTimeout(()=>{var E;return(E=h.current)==null?void 0:E.focusParentElement()});return}if(g===t&&s){(v=d.current)==null||v.focusParentElement();return}n(p),c(Number(p)),setTimeout(()=>{var E;return(E=h.current)==null?void 0:E.focusParentElement()})},[t,s,n]),j=R(l);return o?e.jsx(Ae,{ref:d,initialValue:j,allowSubmitSameValue:!s,handleUpdate:u,handleCancelUpdate:f}):e.jsx(V,{onClick:x,onFocus:x,muted:!s,offset:i?"over":void 0,ref:h,children:r})}const Os="_imageInput_1dtk5_17",Ls="_imageCell_1dtk5_24",Ms="_overlay_1dtk5_28",$s="_image_1dtk5_17",de={imageInput:Os,imageCell:Ls,overlay:Ms,image:$s},Fs=m.memo(Ws);function Ws({initialValue:t,readOnly:s,updateValue:i}){const n=o=>{o!==t&&(o!==""&&!o.startsWith("http")||i(o))},r=()=>{t&&window.open(t,"_blank","noopener,noreferrer")};return t?e.jsxs("div",{className:de.imageCell,children:[!s&&e.jsxs("div",{className:de.overlay,children:[e.jsx(F,{onClick:r,children:"Preview"}),e.jsx(F,{variant:"subtle-destructive",onClick:()=>n(""),children:"Delete"})]}),!!t&&e.jsx("img",{loading:"lazy",src:t,className:de.image})]}):e.jsx(Y,{variant:"ghosted",className:de.imageInput,fluid:!0,readOnly:s,disabled:s,placeholder:"Paste image URL",onBlur:o=>n(o.currentTarget.value),onKeyDown:o=>{o.key==="Enter"&&n(o.currentTarget.value)},defaultValue:t})}const As="_flag_yy7ty_17",Hs={flag:As};function Ps(){return e.jsx("div",{className:Hs.flag,children:e.jsx(Gt,{})})}const Bs="_ghostedText_18xqt_17",qs="_multiline_18xqt_24",nt={ghostedText:Bs,multiline:qs};function He({children:t,multiline:s}){return e.jsx("div",{className:`${nt.ghostedText} ${s?nt.multiline:""}`,children:t})}const St=m.memo(Us);function Us({initialValue:t,fieldId:s,fieldLabel:i,handleUpdate:n}){const r=m.useRef(null),o=m.useCallback(h=>n(h),[n]),{value:a,onChange:l,onBlur:c,onKeyDown:d}=ye(t,o,r,{submitOnCtrlEnter:!0,allowKeyboardNavigation:!0});return e.jsx(vt,{inputref:r,variant:"ghosted",fluid:!0,rows:1,value:a,onChange:l,onBlur:c,onKeyDown:d,spellCheck:!1,"data-testid":s?`cuesheet-editor-${s}`:void 0,"aria-label":i?`${i} editor`:void 0})}const Ks="_muted_1u021_17",Vs="_numeric_1u021_22",st={muted:Ks,numeric:Vs};function X({numeric:t,children:s}){return e.jsx("span",{className:W([st.muted,t&&st.numeric]),children:s})}const Tt=m.memo(Gs);function Gs({initialValue:t,lockedValue:s,delayed:i,onSubmit:n,children:r}){const[o,a]=m.useState(!1),[l,c]=m.useState(t),d=m.useRef(null),h=m.useRef(null);m.useEffect(()=>{o&&d.current&&(d.current.focus(),d.current.select())},[o]),m.useEffect(()=>{o||c(t)},[t,o]);const x=()=>a(!0),f=()=>{a(!1),setTimeout(()=>{var p;return(p=h.current)==null?void 0:p.focusParentElement()})},u=m.useCallback(p=>{var y,_,v;if(a(!1),p===""){n(p),(y=d.current)==null||y.focusParentElement();return}if(p.startsWith("p")||p.startsWith("+")){n(p),(_=d.current)==null||_.focusParentElement();return}const g=Ce(p);if(g<0||isNaN(g)){c(t),setTimeout(()=>{var E;return(E=h.current)==null?void 0:E.focusParentElement()});return}if(g===t&&s){(v=d.current)==null||v.focusParentElement();return}n(p),c(Number(p)),setTimeout(()=>{var E;return(E=h.current)==null?void 0:E.focusParentElement()})},[t,s,n]),j=te(l);return o?e.jsx(Ae,{ref:d,initialValue:j,allowSubmitSameValue:!s,handleUpdate:u,handleCancelUpdate:f}):e.jsx(V,{onClick:x,onFocus:x,muted:!s,offset:i?"over":void 0,ref:h,children:r})}function Pe(t){return typeof t.columnDef.header=="string"?t.columnDef.header:t.id}function Js({getValue:t,row:s,table:i,column:n}){var p;if(!i.options.meta)return null;const{showDelayedTimes:r,hideTableSeconds:o}=i.options.meta.options,a=o?{format12:"h:mm a",format24:"HH:mm"}:void 0,l=s.original;if(!ae(l))return e.jsx(X,{numeric:!0,children:te(t(),a)});const{handleUpdateTimer:c}=i.options.meta,d=g=>c(s.original.id,"timeStart",g),h=t(),x=!l.linkStart,f=r?h+l.delay:h,u=te(f,a);return((p=n.columnDef.meta)==null?void 0:p.canWrite)?e.jsxs(Tt,{initialValue:h,onSubmit:d,lockedValue:x,delayed:l.delay!==0,children:[u,e.jsx(je,{delayValue:l.delay,tooltipPrefix:R(h)})]}):e.jsxs(X,{numeric:!0,children:[u,e.jsx(je,{delayValue:l.delay,tooltipPrefix:R(h)})]})}function Xs({getValue:t,row:s,table:i,column:n}){var p;if(!i.options.meta)return null;const{showDelayedTimes:r,hideTableSeconds:o}=i.options.meta.options,a=o?{format12:"h:mm a",format24:"HH:mm"}:void 0,l=s.original;if(!ae(l))return e.jsx(X,{numeric:!0,children:te(t(),a)});const{handleUpdateTimer:c}=i.options.meta,d=g=>c(s.original.id,"timeEnd",g),h=t(),x=l.timeStrategy===K.LockEnd,f=r?h+l.delay:h,u=te(f,a);return((p=n.columnDef.meta)==null?void 0:p.canWrite)?e.jsxs(Tt,{initialValue:h,onSubmit:d,lockedValue:x,delayed:l.delay!==0,children:[u,e.jsx(je,{delayValue:l.delay,tooltipPrefix:R(h)})]}):e.jsxs(X,{numeric:!0,children:[u,e.jsx(je,{delayValue:l.delay,tooltipPrefix:R(h)})]})}function Ys({getValue:t,row:s,table:i,column:n}){var f;if(!i.options.meta)return null;const{hideTableSeconds:r}=i.options.meta.options,o=s.original;if(!ae(o))return e.jsx(X,{numeric:!0,children:Ze(t(),r)});const{handleUpdateTimer:a}=i.options.meta,l=u=>a(s.original.id,"duration",u),c=t(),d=o.timeStrategy===K.LockDuration,h=Ze(c,r);return((f=n.columnDef.meta)==null?void 0:f.canWrite)?e.jsx(zs,{initialValue:c,onSubmit:l,lockedValue:d,children:h}):e.jsx(X,{numeric:!0,children:h})}function Zs({row:t,column:s,table:i}){var a;const n=m.useCallback(l=>{var c;(c=i.options.meta)==null||c.handleUpdate(t.index,s.id,l,!1)},[s.id,t.index,i.options.meta]),r=t.original[s.id];return typeof r!="string"?null:((a=s.columnDef.meta)==null?void 0:a.canWrite)?e.jsx(St,{initialValue:r,fieldId:s.id,fieldLabel:Pe(s),handleUpdate:n}):e.jsx(He,{multiline:!0,children:r})}function Qs({row:t,column:s,table:i}){var l;const n=m.useCallback(c=>{var d;(d=i.options.meta)==null||d.handleUpdate(t.index,s.id,c,!0)},[s.id,t.index,i.options.meta]),r=t.original;if($e(r))return null;const o=(l=s.columnDef.meta)==null?void 0:l.canWrite,a=r.custom[s.id];return e.jsx(Fs,{initialValue:a,updateValue:n,readOnly:!o})}function it({row:t,column:s,table:i}){var a;const n=m.useCallback(l=>{var c;(c=i.options.meta)==null||c.handleUpdate(t.index,s.id,l,!1)},[s.id,t.index,i.options.meta]),r=t.original[s.id];return typeof r!="string"?null:((a=s.columnDef.meta)==null?void 0:a.canWrite)?e.jsx(Ae,{initialValue:r,fieldId:s.id,fieldLabel:Pe(s),handleUpdate:n}):e.jsx(He,{children:r})}function ei({row:t}){const s=t.original;return!ae(s)||!s.flag?null:e.jsx(Ps,{})}function ti({row:t,column:s,table:i}){var l;const n=m.useCallback(c=>{var d;(d=i.options.meta)==null||d.handleUpdate(t.index,s.id,c,!0)},[s.id,t.index,i.options.meta]),r=t.original;if($e(r))return null;const o=r.custom[s.id]??"";return((l=s.columnDef.meta)==null?void 0:l.canWrite)?e.jsx(St,{initialValue:o,fieldId:s.id,fieldLabel:Pe(s),handleUpdate:n}):e.jsx(He,{multiline:!0,children:o})}function va(t,s,i){var f,u,j,p;const n=[],r=s===D.Edit,o=i?((f=i.options)==null?void 0:f.read)==="full":!0,a=i?((u=i.options)==null?void 0:u.write)==="full":!0,l=(j=i==null?void 0:i.options)!=null&&j.write?new Set(i.options.write.split(",")):new Set,c=(p=i==null?void 0:i.options)!=null&&p.read?new Set(i.options.read.split(",")):new Set,d=g=>o||c.has(g),h=g=>r&&(a||l.has(g));d("flag")&&n.push({accessorKey:"flag",id:"flag",header:"Flag",cell:ei,size:45,minSize:45,meta:{canWrite:h("flag")}}),d("cue")&&n.push({accessorKey:"cue",id:"cue",header:"Cue",cell:it,size:75,minSize:40,meta:{canWrite:h("cue")}}),d("timeStart")&&n.push({accessorKey:"timeStart",id:"timeStart",header:"Start",cell:Js,size:75,minSize:75,meta:{canWrite:h("timeStart")}}),d("timeEnd")&&n.push({accessorKey:"timeEnd",id:"timeEnd",header:"End",cell:Xs,size:75,minSize:75,meta:{canWrite:h("timeEnd")}}),d("duration")&&n.push({accessorKey:"duration",id:"duration",header:"Duration",cell:Ys,size:75,minSize:75,meta:{canWrite:h("duration")}}),d("title")&&n.push({accessorKey:"title",id:"title",header:"Title",cell:it,size:250,minSize:75,meta:{canWrite:h("title")}}),d("note")&&n.push({accessorKey:"note",id:"note",header:"Note",cell:Zs,size:250,minSize:75,meta:{canWrite:h("note")}});const x=Object.keys(t);for(let g=0;g<x.length;g++){const y=x[g],_=`custom-${y}`;d(_)&&n.push({accessorKey:y,id:y,header:t[y].label,cell:t[y].type==="text"?ti:Qs,size:250,minSize:75,meta:{colour:t[y].colour,canWrite:h(_)}})}return n}const ni="_emptyContainer_1dp7m_17",si="_emptyCell_1dp7m_21",ii="_empty_1dp7m_17",ai="_text_1dp7m_30",ue={emptyContainer:ni,emptyCell:si,empty:ii,text:ai};function oi({text:t}){return e.jsx("tbody",{className:ue.emptyContainer,children:e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:ue.emptyCell,children:[e.jsx(fn,{className:ue.empty}),t&&e.jsx("span",{className:ue.text,children:t})]})})})}const at={hideTableSeconds:!1,hideIndexColumn:!1,showDelayedTimes:!1,hideDelays:!1},It=be()(Jt(t=>({...at,setOption:(s,i)=>t(n=>({...n,[s]:i})),toggleOption:s=>t(i=>({...i,[s]:!i[s]})),resetOptions:()=>t(at)}),{name:"editor-options"}));var ri=(t=>(t.List="list",t.Table="table",t))(ri||{});const Nt=be(t=>({canChangeMode:!1,canCreateEntries:!1,canEditEntries:!1,canFlag:!1,canShare:!1,setPermissions(s){t({canChangeMode:s.canChangeMode,canFlag:s.canFlag,canCreateEntries:s.canCreateEntries,canEditEntries:s.canEditEntries,canShare:s.canShare})}}));function li(t){return e.jsx(ot,{style:{transform:"rotate(-45deg)"},...t})}function ci(){const{data:t}=gn(),{data:s}=pn(),[i,n]=Xt(),r=i&&t&&s;return e.jsxs(e.Fragment,{children:[e.jsxs(ee,{onClick:n.open,render:e.jsx(F,{}),children:[e.jsx(li,{}),"Share..."]}),e.jsx(ft,{isOpen:i,onClose:n.close,title:"Share cuesheet view",showBackdrop:!0,showCloseButton:!0,bodyElements:r?e.jsx(un,{lockedPath:{value:jn.Cuesheet,label:"Cuesheet"}}):null})]})}const di="_tableSettings_18k3s_17",ui="_sectionTitle_18k3s_29",mi="_option_18k3s_40",hi="_column_18k3s_47",xi="_inline_18k3s_54",fi="_apart_18k3s_60",gi="_group_18k3s_65",pi="_radioButton_18k3s_76",S={tableSettings:di,sectionTitle:ui,option:mi,column:hi,inline:xi,apart:fi,group:gi,radioButton:pi};function ji({columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n}){const r=Nt(h=>h.canShare),o=m.use(bn),a=ie(),[l,c]=Yt({key:o?`${o.alias}${Qe.cuesheetMode}`:Qe.cuesheetMode,defaultValue:o?D.Run:D.Edit}),d=h=>{const x=h.at(0);x&&c(x)};return e.jsxs(ct,{className:S.tableSettings,children:[e.jsx(wt,{optionsStore:a}),e.jsx(Dt,{columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n}),e.jsxs(Zt,{value:[l],onValueChange:d,className:W([S.group,S.apart]),children:[e.jsx(ee,{render:e.jsx(Ke,{}),value:D.Run,className:S.radioButton,children:"Run"}),e.jsx(ee,{render:e.jsx(Ke,{}),value:D.Edit,className:S.radioButton,children:"Edit"})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx(_n,{orientation:"vertical"}),e.jsx(ci,{})]})]})}function wt({optionsStore:t}){const s=t;return e.jsxs(dt,{children:[e.jsx(ut,{render:e.jsx(ee,{render:e.jsxs(F,{variant:"ghosted-white",children:[e.jsx(mt,{})," Settings",e.jsx(ht,{})]})})}),e.jsxs(bt,{align:"start",className:S.inline,children:[e.jsxs("div",{className:S.column,children:[e.jsx(C,{className:S.sectionTitle,children:"Element visibility"}),e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:s.hideTableSeconds,onCheckedChange:i=>s.setOption("hideTableSeconds",i)}),"Hide seconds in table"]}),e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:s.hideIndexColumn,onCheckedChange:i=>s.setOption("hideIndexColumn",i)}),"Hide index column"]})]}),e.jsxs("div",{className:S.column,children:[e.jsx(C,{className:S.sectionTitle,children:"Table Behaviour"}),e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:s.showDelayedTimes,onCheckedChange:i=>s.setOption("showDelayedTimes",i)}),"Show delayed times"]}),e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:s.hideDelays,onCheckedChange:i=>s.setOption("hideDelays",i)}),"Hide delay entries"]})]})]})]})}function Dt({columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n}){return e.jsxs(dt,{children:[e.jsx(ut,{render:e.jsx(ee,{render:e.jsxs(F,{variant:"ghosted-white",children:[e.jsx(Qt,{})," Columns",e.jsx(ht,{})]})})}),e.jsxs(bt,{align:"start",className:S.inline,children:[e.jsxs("div",{className:S.column,children:[e.jsx(C,{className:S.sectionTitle,children:"Column visibility"}),t.map(r=>{const o=r.columnDef.header,a=r.getIsVisible();return e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:a,onCheckedChange:r.toggleVisibility}),o]},`${r.id}-${a}`)})]}),e.jsxs("div",{className:S.column,children:[e.jsx(C,{className:S.sectionTitle,children:"Reset Options"}),e.jsx(F,{size:"small",fluid:!0,onClick:n,children:"Show All"}),e.jsx(F,{size:"small",fluid:!0,onClick:s,children:"Reset Resizing"}),e.jsx(F,{size:"small",fluid:!0,onClick:i,children:"Reset Reordering"})]})]})]})}function bi({columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n}){const r=It();return e.jsxs(ct,{className:S.tableSettings,children:[e.jsx(wt,{optionsStore:r}),e.jsx(Dt,{columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n})]})}const Ci="_actionColumn_1gx4m_17",yi="_indexColumn_1gx4m_26",vi="_cuesheet_1gx4m_37",_i="_resizer_1gx4m_61",Ei="_tableHeader_1gx4m_77",B={actionColumn:Ci,indexColumn:yi,cuesheet:vi,resizer:_i,tableHeader:Ei};function ki({columnId:t,colSpan:s,injectedStyles:i,children:n,draggable:r}){const{attributes:o,listeners:a,setNodeRef:l,transform:c,transition:d,isDragging:h}=en({id:t}),x={...i,zIndex:h?2:"inherit",transform:tn.Translate.toString(c),transition:d};return e.jsxs("th",{ref:l,style:x,colSpan:s,tabIndex:-1,children:[e.jsx("div",{...o,...a,children:n}),r]})}function Si({colSpan:t,injectedStyles:s,children:i,draggable:n}){return e.jsxs("th",{style:s,colSpan:t,tabIndex:-1,children:[e.jsx("div",{children:i}),n]})}function zt({header:t}){return e.jsx("div",{onDoubleClick:()=>t.column.resetSize(),onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:B.resizer})}function Ti({headerGroup:t,cuesheetMode:s}){const i=ie(n=>n.hideIndexColumn);return e.jsxs("tr",{children:[s===D.Edit&&e.jsx("th",{className:B.actionColumn,tabIndex:-1}),!i&&e.jsx("th",{className:B.indexColumn,tabIndex:-1,children:"#"}),e.jsx(nn,{items:t.headers,strategy:sn,children:t.headers.map(n=>{var l,c;const r=(l=n.column.columnDef.meta)==null?void 0:l.colour,a={opacity:((c=n.column.columnDef.meta)==null?void 0:c.canWrite)?1:.6};if(r){const d=G(r);a.backgroundColor=d.backgroundColor,a.color=d.color}return e.jsx(ki,{columnId:n.column.id,colSpan:n.colSpan,injectedStyles:{width:`calc(var(--header-${n==null?void 0:n.id}-size) * 1px)`,...a},draggable:e.jsx(zt,{header:n}),children:n.isPlaceholder?null:se(n.column.columnDef.header,n.getContext())},n.column.columnDef.id)})},t.id)]},t.id)}function Ii({headerGroup:t,cuesheetMode:s}){const i=ie(n=>n.hideIndexColumn);return e.jsxs("tr",{children:[s===D.Edit&&e.jsx("th",{className:B.actionColumn,tabIndex:-1}),!i&&e.jsx("th",{className:B.indexColumn,tabIndex:-1,children:"#"}),t.headers.map(n=>{var l,c;const r=(l=n.column.columnDef.meta)==null?void 0:l.colour,a={opacity:((c=n.column.columnDef.meta)==null?void 0:c.canWrite)?1:.6};if(r){const d=G(r);a.backgroundColor=d.backgroundColor,a.color=d.color}return e.jsx(Si,{columnId:n.column.id,colSpan:n.colSpan,injectedStyles:{width:`calc(var(--header-${n==null?void 0:n.id}-size) * 1px)`,...a},draggable:e.jsx(zt,{header:n}),children:n.isPlaceholder?null:se(n.column.columnDef.header,n.getContext())},n.column.columnDef.id)})]},t.id)}const Ni="_delayRow_1yrjh_37",wi="_delayRowHidden_1yrjh_55",Te={delayRow:Ni,delayRowHidden:wi};function Di({duration:t,injectedStyles:s,hasCursor:i,...n}){if(ie(a=>a.hideDelays)||t===0)return e.jsx("tr",{className:`${Te.delayRow} ${Te.delayRowHidden}`,"data-testid":"cuesheet-delay-hidden",style:s,...n,children:e.jsx("td",{})});const o=Ct(t,"expanded");return e.jsx("tr",{className:Te.delayRow,"data-testid":"cuesheet-delay",style:s,"data-cursor":i,...n,children:e.jsx("td",{tabIndex:0,children:o})})}const zi=m.memo(Di),_e=be(t=>({isOpen:!1,entryId:null,entryType:null,entryIndex:null,parentId:null,position:{x:0,y:0},flag:null,openMenu:(s,i,n,r,o,a)=>t({isOpen:!0,position:s,entryId:i,entryType:n,entryIndex:r,parentId:o,flag:a}),closeMenu:()=>t({isOpen:!1})})),Ri="_actionColumn_xqld8_17",Oi="_indexColumn_xqld8_26",Li="_eventRow_xqld8_37",Mi="_firstAfterGroup_xqld8_52",$i="_skip_xqld8_55",U={actionColumn:Ri,indexColumn:Oi,eventRow:Li,firstAfterGroup:Mi,skip:$i};function Fi({rowId:t,id:s,eventIndex:i,colour:n,isFirstAfterGroup:r,isLoaded:o,isPast:a,groupColour:l,flag:c,skip:d,parent:h,rowIndex:x,table:f,injectedStyles:u,hasCursor:j,...p}){var oe;const{cuesheetMode:g,hideIndexColumn:y}=((oe=f.options.meta)==null?void 0:oe.options)??{cuesheetMode:D.Edit,hideIndexColumn:!1},_=_e(I=>I.openMenu),{color:v,backgroundColor:E}=G(n),H=De(v),Ee=ze({...H,alpha:H.alpha*.8}),w=m.useMemo(()=>{if(o)return"#087A27";if(n){const I=De(G(n).backgroundColor);if(I!==null)return ze({...I,alpha:I.alpha*.25})}},[n,o]);return e.jsxs("tr",{id:t,className:W([U.eventRow,d&&U.skip,r&&U.firstAfterGroup,h&&U.hasParent]),style:{...u,opacity:`${a?"0.2":"1"}`,"--user-bg":l??"transparent"},"data-cursor":j,"data-testid":"cuesheet-event","data-entry-id":s,...p,children:[g===D.Edit&&e.jsx("td",{className:U.actionColumn,tabIndex:-1,role:"cell",children:e.jsx(A,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:I=>{const q=I.currentTarget.getBoundingClientRect(),ke=8+q.y+q.height/2;_({x:q.x,y:ke},s,ne.Event,x,h,c)},children:e.jsx(Oe,{})})}),!y&&e.jsx("td",{className:U.indexColumn,style:{backgroundColor:E,color:Ee},tabIndex:-1,role:"cell",children:i}),f.getRow(t).getVisibleCells().map(I=>e.jsx("td",{style:{width:`calc(var(--col-${I.column.id}-size) * 1px)`,backgroundColor:w},tabIndex:-1,role:"cell","data-testid":`cuesheet-cell-${I.column.id}`,"data-column-id":I.column.id,children:se(I.column.columnDef.cell,I.getContext())},I.id))]})}const Wi="_actionColumn_1sgq2_17",Ai="_indexColumn_1sgq2_26",Hi="_groupRow_1sgq2_37",Ie={actionColumn:Wi,indexColumn:Ai,groupRow:Hi};function Pi({groupId:t,colour:s,rowId:i,rowIndex:n,table:r,injectedStyles:o,hasCursor:a,...l}){var x;const{cuesheetMode:c,hideIndexColumn:d}=((x=r.options.meta)==null?void 0:x.options)??{cuesheetMode:D.Edit,hideIndexColumn:!1},h=_e(f=>f.openMenu);return e.jsxs("tr",{className:Ie.groupRow,style:{...o,"--user-bg":s},"data-testid":"cuesheet-group","data-cursor":a,...l,children:[c===D.Edit&&e.jsx("td",{className:Ie.actionColumn,tabIndex:-1,role:"cell",children:e.jsx(A,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:f=>{const u=f.currentTarget.getBoundingClientRect(),j=8+u.y+u.height/2;h({x:u.x,y:j},t,ne.Group,n,null,null)},children:e.jsx(Oe,{})})}),!d&&e.jsx("td",{className:Ie.indexColumn,tabIndex:-1,role:"cell"}),r.getRow(i).getVisibleCells().map(f=>e.jsx("td",{tabIndex:-1,style:{width:`calc(var(--col-${f.column.id}-size) * 1px)`},role:"cell",children:se(f.column.columnDef.cell,f.getContext())},f.id))]})}const Bi="_actionColumn_tym0z_17",qi="_indexColumn_tym0z_26",Ui="_milestoneRow_tym0z_37",me={actionColumn:Bi,indexColumn:qi,milestoneRow:Ui};function Ki({entryId:t,isPast:s,parentBgColour:i,parentId:n,colour:r,rowId:o,rowIndex:a,hasCursor:l,table:c,injectedStyles:d,...h}){var p;const{cuesheetMode:x,hideIndexColumn:f}=((p=c.options.meta)==null?void 0:p.options)??{cuesheetMode:D.Edit,hideIndexColumn:!1},u=_e(g=>g.openMenu);let j;if(r){const g=De(G(r).backgroundColor);g!==null&&(j=ze({...g,alpha:g.alpha*.25}))}return e.jsxs("tr",{className:W([me.milestoneRow,!!i&&me.hasParent]),style:{...d,opacity:`${s?"0.2":"1"}`,"--user-bg":i??"transparent"},"data-testid":"cuesheet-milestone","data-cursor":l,...h,children:[x===D.Edit&&e.jsx("td",{className:me.actionColumn,tabIndex:-1,role:"cell",children:e.jsx(A,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:g=>{const y=g.currentTarget.getBoundingClientRect(),_=8+y.y+y.height/2;u({x:y.x,y:_},t,ne.Milestone,a,n,null)},children:e.jsx(Oe,{})})}),!f&&e.jsx("td",{className:me.indexColumn,tabIndex:-1,role:"cell",children:fe}),c.getRow(o).getVisibleCells().map(g=>{const y=g.column.id!=="duration"&&g.column.id!=="timeStart"&&g.column.id!=="timeEnd";return e.jsx("td",{style:{width:`calc(var(--col-${g.column.id}-size) * 1px)`,backgroundColor:j,opacity:y?1:.4},tabIndex:-1,children:y&&se(g.column.columnDef.cell,g.getContext())},g.id)})]})}const Vi=m.memo(Gi);function Gi(){const{isOpen:t,entryId:s,entryIndex:i,parentId:n,flag:r,position:o,closeMenu:a}=_e(),{addEntry:l,clone:c,deleteEntry:d,move:h,updateEntry:x}=L(),f=Re(j=>j.setEditableEntry),u=Nt();return t?e.jsx(mn,{isOpen:!0,onClose:a,items:[{type:"item",label:"Edit...",onClick:()=>f(s),icon:mt,disabled:!u.canEditEntries},{type:"divider"},{type:"item",label:r?"Remove flag":"Add flag",onClick:()=>x({id:s,flag:!r}),icon:Ve,disabled:r===null||!u.canFlag},{type:"divider"},{type:"item",label:"Add event above",onClick:()=>l({type:ne.Event,parent:n},{before:s}),icon:Ge,disabled:!u.canCreateEntries},{type:"item",label:"Add event below",onClick:()=>l({type:ne.Event,parent:n},{after:s}),icon:Ge,disabled:!u.canCreateEntries},{type:"item",label:"Clone event",onClick:()=>c(s),icon:Ve,disabled:!u.canCreateEntries},{type:"divider"},{type:"item",label:"Move up",onClick:()=>h(s,"up"),icon:an,disabled:i<1||!u.canEditEntries},{type:"item",label:"Move down",onClick:()=>h(s,"down"),icon:on,disabled:!u.canEditEntries},{type:"divider"},{type:"item",label:"Delete",onClick:()=>d([s]),icon:rt,disabled:!u.canEditEntries}],position:o}):null}function _a({columns:t,cuesheetMode:s,tableRoot:i="cuesheet"}){const{data:n,status:r}=vn(),{updateEntry:o,updateTimer:a}=L(),l=i==="editor"?It:ie,c=l(k=>k.showDelayedTimes),d=l(k=>k.hideTableSeconds),h=l(k=>k.hideIndexColumn),x=Cn(),f=Xe(k=>k.cursor),u=Xe(k=>k.setScrollHandler),j=m.useRef(null),{listeners:p}=rn(),g=m.useMemo(()=>({handleUpdate:(k,T,z,M=!1)=>{const re=n[k];if(!(!re||re[T]===z)){if(M){o({id:re.id,custom:{[T]:z}});return}o({id:re.id,[T]:z})}},handleUpdateTimer:(k,T,z)=>{a(k,T,z,!0)},options:{showDelayedTimes:c,hideTableSeconds:d,cuesheetMode:s,hideIndexColumn:h}}),[s,n,h,d,c,o,a]),{columnOrder:y,resetColumnOrder:_}=Et(t,i),{columnSizing:v,setColumnSizing:E}=ws(i),{columnVisibility:H,setColumnVisibility:Ee}=Ds(i),w=ln({data:n,columns:t,columnResizeMode:"onChange",state:{columnOrder:y,columnVisibility:H,columnSizing:v},onColumnVisibilityChange:Ee,onColumnSizingChange:E,getCoreRowModel:dn(),meta:g}),oe=m.useCallback(()=>{w.toggleAllColumnsVisible(!0)},[w]),I=m.useCallback(()=>{E({})},[E]);m.useEffect(()=>{if(j.current===null||s!==D.Run||!x)return;const k=n.findIndex(T=>T.id===x);k!==-1&&j.current.scrollToIndex({index:k,behavior:"auto",align:"start",offset:-50})},[s,n,x]),m.useEffect(()=>(u(T=>{if(j.current===null)return;const z=n.findIndex(M=>M.id===T);z!==-1&&j.current.scrollToIndex({index:z,behavior:"auto",align:"start",offset:-50})}),()=>{u(null)}),[n,u]);const q=m.useMemo(()=>{const k=w.getFlatHeaders(),T={};for(let z=0;z<k.length;z++){const M=k[z];M&&(T[`--header-${M.id}-size`]=M.getSize(),T[`--col-${M.column.id}-size`]=M.column.getSize())}return T},[w.getState().columnSizingInfo,w.getState().columnSizing]),ke=w.getAllLeafColumns(),{rows:Be}=w.getRowModel(),Rt=m.useMemo(()=>({columnSizeVars:q,cursor:f,listeners:p,rows:Be,table:w}),[q,f,p,Be,w]),Ot=m.useCallback((k,T)=>T.id,[]),Lt=m.useCallback(()=>w.getHeaderGroups().map(k=>{const T=w.getState().columnSizingInfo.isResizingColumn?Ii:Ti;return e.jsx(T,{cuesheetMode:s,headerGroup:k},k.id)}),[s,w]);if(!n||r==="pending")return e.jsx(Tn,{text:"Loading..."});const Mt=i==="editor"?bi:ji;return e.jsxs(e.Fragment,{children:[e.jsx(Mt,{columns:ke,handleResetResizing:I,handleResetReordering:_,handleClearToggles:oe}),e.jsx(cn,{ref:j,data:n,context:Rt,style:i==="editor"?{paddingLeft:"1rem"}:void 0,computeItemKey:Ot,increaseViewportBy:{top:100,bottom:200},components:Qi,fixedHeaderContent:Lt}),e.jsx(Vi,{})]})}const Ji=m.memo(function(){return e.jsx(oi,{text:"No data in rundown"})}),Xi=m.memo(function({style:s,context:i,...n}){return e.jsx("table",{className:B.cuesheet,id:"cuesheet",style:{...s,...i.columnSizeVars},...i.listeners,...n})}),Yi=m.memo(function({context:s,className:i,...n}){return e.jsx("thead",{className:B.tableHeader,...n})}),Zi=m.memo(function({item:s,style:i,context:n,...r}){const o=r["data-index"],a=n.rows[o];if(!a)return null;const l=a.original.id,c=a.original,d=c.id===n.cursor;return pt(c)?e.jsx(Pi,{groupId:c.id,colour:c.colour,rowId:a.id,rowIndex:a.index,table:n.table,injectedStyles:i,hasCursor:d,...r},l):$e(c)?e.jsx(zi,{duration:c.duration,injectedStyles:i,hasCursor:d,...r},l):gt(c)?e.jsx(Ki,{entryId:c.id,isPast:c.isPast,parentBgColour:c.groupColour,parentId:c.parent,colour:c.colour,rowId:a.id,rowIndex:o,table:n.table,injectedStyles:i,hasCursor:d,...r},l):e.jsx(Fi,{id:c.id,eventIndex:c.eventIndex,colour:c.colour,isFirstAfterGroup:c.isFirstAfterGroup,isLoaded:c.isLoaded,isPast:c.isPast,groupColour:c.groupColour,flag:c.flag,skip:c.skip,parent:c.parent,rowId:a.id,rowIndex:o,table:n.table,injectedStyles:i,hasCursor:d,...r},a.id)}),Qi={EmptyPlaceholder:Ji,Table:Xi,TableHead:Yi,TableRow:Zi};export{ya as C,ba as E,ks as G,Ss as M,ri as R,ts as T,_a as a,Ca as b,fs as c,L as d,ye as e,va as m,b as s,Nt as u};
2
- //# sourceMappingURL=CuesheetTable-BLICUNky.js.map
1
+ import{j as e,h as m,bs as qe,bt as $t,am as ot,bl as Ft,bu as Ne,bv as we,bw as Wt,bx as At,ah as rt,by as Ht,bc as Pt,f as be,ay as lt,a$ as Bt,b0 as Ue,bo as qt,bz as Ut,bA as Kt,b1 as Vt,bn as Gt,bB as Jt,C as Xt,aX as ee,aG as Yt,aY as ct,aZ as Zt,a_ as Ke,bC as dt,bD as ut,bE as mt,aN as ht,bF as Qt,b3 as en,b4 as tn,bG as se,bq as nn,bH as sn,as as Oe,ar as Ve,T as Ge,y as an,av as on,bI as rn,bJ as ln,bK as cn,bL as dn}from"./vendor-BKUJ0_Du.js";import{S as Le,u as xt,T as Je,M as ft,G as un,p as ie,P as mn,l as Xe}from"./useEventSelection-Bpbu89c7.js";import{ah as Y,aD as G,e as W,ak as A,s as hn,m as R,T as le,B as F,bC as xn,x as fe,bk as Ye,bD as Me,f as te,b6 as D,k as Ze,bE as fn,an as gn,aw as pn,O as jn,P as bn,bd as Qe,bF as De,bG as ze,o as Cn}from"./index-Dm-4OTmY.js";import{u as yn,i as ae,k as gt,j as pt,w as $e,S as ne,a as vn}from"./useRundown-DAo6huE4.js";import{L as C,T as O,S as _n}from"./EditorUtils-BLcTuWz1.js";import{T as Q,A as ge,s as En}from"./TimeInput-Cwl9vLWA.js";import{u as Fe}from"./useCustomFields-BBE4LBBr.js";import{T as K,E as Se}from"./validateEvent-GnPt-e9-.js";import{S as pe}from"./Select-BnGTAeXJ.js";import{S as jt,P as bt,C as Z}from"./SwatchPicker-Ckpchvjo.js";import{T as P}from"./Tooltip-DZJ7u9gm.js";import{a as Ct,D as je}from"./DelayIndicator-DKS6mZdB.js";import{p as Ce}from"./parseUserTime-sZbEBi61.js";import{g as kn}from"./offset-VthsmtrO.js";import{T as Sn}from"./editorSettings-_x6YKRfR.js";import{E as Tn}from"./EmptyPage-CYVrjOvI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="f6b8f6f3-323d-4c38-865d-88a6822b6338",t._sentryDebugIdIdentifier="sentry-dbid-f6b8f6f3-323d-4c38-865d-88a6822b6338")}catch{}})();var $=(t=>(t.onLoad="onLoad",t.onStart="onStart",t.onPause="onPause",t.onStop="onStop",t.onClock="onClock",t.onUpdate="onUpdate",t.onFinish="onFinish",t.onWarning="onWarning",t.onDanger="onDanger",t))($||{});const In=Object.keys($);function Nn(t){return t.replaceAll(" ","").replaceAll(",",".")}const yt=m.createContext(null);function ba({children:t,actions:s}){return e.jsx(yt.Provider,{value:s,children:t})}function L(){const t=m.useContext(yt);if(!t)throw new Error("useEntryActionsContext must be used within EntryActionsProvider");return t}const wn="_imageContainer_1k5qa_17",Dn="_imageOverlay_1k5qa_25",et={imageContainer:wn,imageOverlay:Dn};function zn({src:t}){return e.jsxs("div",{className:et.imageContainer,children:[!!t&&e.jsx("img",{loading:"lazy",src:t}),e.jsx("div",{className:et.imageOverlay})]})}function vt({value:t,inputref:s,...i}){return m.useEffect(()=>{const n=s.current;return qe(s.current),()=>{qe.destroy(n)}},[s,t]),e.jsx(Sn,{ref:s,value:t,...i})}function ye(t,s,i,n){const[r,o]=m.useState(t),a=m.useRef(!1);m.useEffect(()=>{o(typeof t>"u"?"":t)},[t]);const l=m.useCallback(x=>{x!==r&&o(x)},[r]),c=m.useCallback(x=>{var f;if(x===t&&!(n!=null&&n.allowSubmitSameValue))(f=n==null?void 0:n.onCancelUpdate)==null||f.call(n);else{const u=x.trim();s(u),u!==x&&o(u)}setTimeout(()=>{var u,j,p;n!=null&&n.allowKeyboardNavigation?(j=(u=i.current)==null?void 0:u.parentElement)==null||j.focus():(p=i.current)==null||p.blur()})},[t,n,i,s]),d=m.useCallback(()=>{var x;o(t),i.current&&(i.current.value=t),(x=n==null?void 0:n.onCancelUpdate)==null||x.call(n),setTimeout(()=>{var f;return(f=i.current)==null?void 0:f.blur()})},[t,n,i]),h=m.useMemo(()=>{const x=[["Escape",u=>{u.preventDefault(),d()},{preventDefault:!0}]];n!=null&&n.submitOnEnter&&x.push(["Enter",()=>{a.current=!0,c(r),setTimeout(()=>{a.current=!1},0)}]),n!=null&&n.submitOnCtrlEnter&&x.push(["mod + Enter",()=>{a.current=!0,c(r),setTimeout(()=>{a.current=!1},0)}]);const f=$t(x);return u=>{(u.key==="ArrowLeft"||u.key==="ArrowRight"||u.key==="ArrowUp"||u.key==="ArrowDown")&&u.stopPropagation(),f(u)}},[d,c,n==null?void 0:n.submitOnCtrlEnter,n==null?void 0:n.submitOnEnter,r]);return{value:r,onChange:x=>l(x.target.value),onBlur:x=>{a.current||c(x.target.value)},onKeyDown:h}}function ve({className:t,field:s,label:i,initialValue:n,style:r,submitHandler:o}){const a=m.useRef(null),l=m.useCallback(f=>o(s,f),[s,o]),{value:c,onChange:d,onBlur:h,onKeyDown:x}=ye(n,l,a,{submitOnCtrlEnter:!0});return e.jsxs("div",{children:[e.jsx(C,{className:t,htmlFor:s,style:r,children:i}),e.jsx(vt,{id:s,inputref:a,rows:1,"data-testid":"input-textarea",fluid:!0,value:c,onChange:d,onBlur:h,onKeyDown:x})]})}function J({className:t,field:s,label:i,initialValue:n,style:r,submitHandler:o,maxLength:a,placeholder:l}){const c=m.useRef(null),d=m.useCallback(j=>o(s,j),[s,o]),{value:h,onChange:x,onBlur:f,onKeyDown:u}=ye(n,d,c,{submitOnEnter:!0});return e.jsxs("div",{children:[e.jsx(C,{className:t,htmlFor:s,style:r,children:i}),e.jsx(Y,{id:s,ref:c,maxLength:a,fluid:!0,"data-testid":"input-textfield",value:h,placeholder:l,onChange:x,onBlur:f,onKeyDown:u})]})}const Rn="_rundownEditor_d7rpz_19",On="_content_d7rpz_29",Ln="_column_d7rpz_48",Mn="_decorated_d7rpz_57",$n="_delayLabel_d7rpz_65",Fn="_switchLabel_d7rpz_73",Wn="_inline_d7rpz_83",An="_splitTwo_d7rpz_89",Hn="_splitThree_d7rpz_96",Pn="_tooltipIcon_d7rpz_103",Bn="_customImage_d7rpz_110",qn="_textLikeInput_d7rpz_117",Un="_inactive_d7rpz_125",Kn="_active_d7rpz_129",b={rundownEditor:Rn,content:On,column:Ln,decorated:Mn,delayLabel:$n,switchLabel:Fn,inline:Wn,splitTwo:An,splitThree:Hn,tooltipIcon:Pn,customImage:Bn,textLikeInput:qn,inactive:Un,active:Kn};function We({fields:t,handleSubmit:s,entry:i}){return e.jsx(m.Fragment,{children:Object.keys(t).map(n=>{const r=`${i.id}-${n}`,o=`custom-${n}`,a=i.custom[n]??"",{backgroundColor:l,color:c}=G(t[n].colour),d=t[n].label;return t[n].type==="text"?e.jsx(ve,{field:o,label:d,initialValue:a,submitHandler:s,className:b.decorated,style:{"--decorator-bg":l,"--decorator-color":c}},r):t[n].type==="image"?e.jsxs("div",{className:b.customImage,children:[e.jsx(J,{field:o,label:d,initialValue:a,placeholder:"Paste image URL",submitHandler:s,className:b.decorated,maxLength:255,style:{"--decorator-bg":l,"--decorator-color":c}},r),e.jsx(zn,{src:a})]},r):null})})}const Vn="_inputGroup_1e1jq_17",Gn="_delayed_1e1jq_24",tt={inputGroup:Vn,delayed:Gn};function he({hasDelay:t,children:s}){return e.jsx("div",{className:W([tt.inputGroup,t&&tt.delayed]),children:s})}const Jn="_fourtyfive_ezj8b_13",Xn="_timerNote_ezj8b_21",Yn="_inactive_ezj8b_27",Zn="_active_ezj8b_31",Qn="_inputWrapper_ezj8b_35",es="_hoverLabel_ezj8b_39",N={fourtyfive:Jn,timerNote:Xn,inactive:Yn,active:Zn,inputWrapper:Qn,hoverLabel:es},ts=m.memo(ns);function ns({eventId:t,countToEnd:s,timeStart:i,timeEnd:n,duration:r,timeStrategy:o,linkStart:a,delay:l,showLabels:c}){const{updateEntry:d,updateTimer:h}=L(),x=(_,v)=>{h(t,_,v)},f=_=>{d({id:t,timeStrategy:_})},u=_=>{d({id:t,linkStart:_})},j=[];i+r>hn&&j.push("Over midnight"),s&&j.push("Count to End");const p=l!==0,g=o===K.LockEnd,y=o===K.LockDuration;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:N.inputWrapper,children:[c&&e.jsx(C,{className:N.sectionTitle,children:"Start time"}),e.jsx(C,{className:N.hoverLabel,children:"Start"}),e.jsxs(he,{hasDelay:p,children:[e.jsx(Q,{name:"timeStart",submitHandler:x,time:i,placeholder:"Start",align:"left",disabled:a}),e.jsx(P,{text:"Link start to previous end",onClick:()=>u(!a),render:e.jsx(A,{variant:"subtle-white",className:a?N.active:N.inactive}),children:e.jsx("span",{className:N.fourtyfive,children:a?e.jsx(ot,{}):e.jsx(Ft,{})})})]})]}),e.jsxs("div",{className:N.inputWrapper,children:[c&&e.jsx(C,{children:"End time"}),e.jsx(C,{className:N.hoverLabel,children:"End"}),e.jsxs(he,{hasDelay:p,children:[e.jsx(Q,{name:"timeEnd",submitHandler:x,time:n,placeholder:"End",align:"left",disabled:y}),e.jsx(P,{text:"Lock end",render:e.jsx(A,{variant:"subtle-white",className:g?N.active:N.inactive}),onClick:()=>f(K.LockEnd),"data-testid":"lock__end",children:g?e.jsx(Ne,{}):e.jsx(we,{})})]})]}),e.jsxs("div",{className:N.inputWrapper,children:[c&&e.jsx(C,{children:"Duration"}),e.jsx(C,{className:N.hoverLabel,children:"Duration"}),e.jsxs(he,{hasDelay:p,children:[e.jsx(Q,{name:"duration",submitHandler:x,time:r,placeholder:"Duration",align:"left",disabled:g}),e.jsx(P,{text:"Lock duration",render:e.jsx(A,{variant:"subtle-white",className:y?N.active:N.inactive}),onClick:()=>f(K.LockDuration),"data-testid":"lock__duration",children:y?e.jsx(Ne,{}):e.jsx(we,{})})]})]}),j.length>0&&e.jsx(P,{text:j.join(" - "),className:N.timerNote,"data-testid":"event-warning",render:e.jsx("span",{}),children:e.jsx(Wt,{})})]})}const ss=m.memo(is);function is({eventId:t,timeStart:s,timeEnd:i,duration:n,timeStrategy:r,linkStart:o,countToEnd:a,delay:l,endAction:c,timerType:d,timeWarning:h,timeDanger:x}){const{updateEntry:f}=L(),u=(g,y)=>{if(g==="countToEnd"){f({id:t,countToEnd:y});return}if(g==="timeWarning"||g==="timeDanger"){const _=Ce(y);f({id:t,[g]:_});return}if(g==="timerType"||g==="endAction"){f({id:t,[g]:y});return}},p=l!==0?`Event is ${Ct(l,"expanded")}. New schedule ${R(s+l)} → ${R(i+l)}`:"";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Event schedule"}),e.jsxs("div",{children:[e.jsx("div",{className:b.inline,children:e.jsx(ts,{eventId:t,timeStart:s,timeEnd:i,duration:n,timeStrategy:r,linkStart:o,delay:l,countToEnd:a,showLabels:!0})}),e.jsx("div",{className:b.delayLabel,children:p})]})]}),e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Event Behaviour"}),e.jsxs("div",{className:b.splitTwo,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"endAction",children:"End Action"}),e.jsx(pe,{value:c,onValueChange:g=>{g!==null&&u("endAction",g)},options:[{value:Se.None,label:"None"},{value:Se.LoadNext,label:"Load next event"},{value:Se.PlayNext,label:"Play next event"}]})]}),e.jsxs("div",{children:[e.jsx(C,{htmlFor:"countToEnd",children:"Count to End"}),e.jsxs(C,{className:b.switchLabel,children:[e.jsx(jt,{id:"countToEnd",checked:a,onCheckedChange:g=>u("countToEnd",g)}),a?"On":"Off"]})]})]})]}),e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:e.jsxs(P,{text:"Changes how the timer is displayed in different views. It is not reflected in the rundown",render:e.jsx("span",{}),children:["Display Options",e.jsx(At,{className:b.tooltipIcon})]})}),e.jsxs("div",{className:b.splitTwo,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"timerType",children:"Timer Type"}),e.jsx(pe,{value:d,onValueChange:g=>{g!==null&&u("timerType",g)},options:[{value:le.CountDown,label:"Count down"},{value:le.CountUp,label:"Count up"},{value:le.Clock,label:"Clock"},{value:le.None,label:"None"}]})]}),e.jsxs("div",{className:b.inline,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"timeWarning",children:"Warning Time"}),e.jsx(Q,{id:"timeWarning",name:"timeWarning",submitHandler:u,time:h,placeholder:"Duration"})]}),e.jsxs("div",{children:[e.jsx(C,{htmlFor:"timeDanger",children:"Danger Time"}),e.jsx(Q,{id:"timeDanger",name:"timeDanger",submitHandler:u,time:x,placeholder:"Duration"})]})]})]})]})]})}const as=m.memo(os);function os({eventId:t,cue:s,flag:i,title:n,note:r,colour:o}){const{updateEntry:a}=L(),l=(h,x)=>{a({id:t,cue:Nn(x)})},c=h=>{a({id:t,flag:h})},d=(h,x)=>{a({id:t,[h]:x})};return e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Event Data"}),e.jsxs("div",{className:b.splitThree,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"eventId",children:"Event ID (read only)"}),e.jsx(Y,{id:"eventId","data-testid":"input-textfield",value:t,readOnly:!0,fluid:!0})]}),e.jsx(J,{field:"cue",label:"Cue",initialValue:s,submitHandler:l,maxLength:10}),e.jsxs("div",{children:[e.jsx(C,{htmlFor:"flag",children:"Flag"}),e.jsxs(C,{className:b.switchLabel,children:[e.jsx(jt,{id:"flag",checked:i,onCheckedChange:c}),i?"On":"Off"]})]})]}),e.jsxs("div",{children:[e.jsx(C,{children:"Colour"}),e.jsx(Le,{name:"colour",value:o,handleChange:d})]}),e.jsx(J,{field:"title",label:"Title",initialValue:n,submitHandler:d}),e.jsx(ve,{field:"note",label:"Note",initialValue:r,submitHandler:d})]})}const rs=[$.onLoad,$.onStart,$.onPause,$.onFinish,$.onWarning,$.onDanger],ls="_triggerForm_l7413_17",cs="_trigger_l7413_17",ds="_errorLabel_l7413_38",us="_success_l7413_42",xe={triggerForm:ls,trigger:cs,errorLabel:ds,success:us};function ms({triggers:t,eventId:s}){const i=t.length>0;return e.jsxs(e.Fragment,{children:[i&&e.jsx(xs,{triggers:t,eventId:s}),e.jsx(hs,{triggers:t,eventId:s})]})}function hs({eventId:t,triggers:s}){const{data:i}=xt(),{updateEntry:n}=L(),[r,o]=m.useState(void 0),[a,l]=m.useState($.onStart),c=(u,j)=>{const p=s??new Array,g=xn();p.push({id:g,title:"",trigger:u,automationId:j}),n({id:t,triggers:p})},h=((u,j)=>{if(j===void 0)return"Select an automation";if(!Object.keys(i.automations).includes(j))return"This automation does not exist";if(s!==void 0)return Object.values(s).some(p=>p.automationId===j&&p.trigger===u)?"Automation can only be used once":void 0})(a,r),x=m.useMemo(()=>[{value:null,label:"Select Trigger"},...rs.map(u=>({value:u,label:u}))],[]),f=m.useMemo(()=>[{value:null,label:"Select Automation"},...Object.values(i.automations).map(({id:u,title:j})=>({value:u,label:j}))],[i.automations]);return e.jsxs("div",{className:xe.triggerForm,children:[e.jsx(pe,{value:a,onValueChange:u=>{u!==null&&l(u)},options:x}),e.jsx(pe,{value:r??null,onValueChange:u=>{u!==null&&o(u)},options:f}),e.jsx(F,{disabled:h!==void 0,onClick:()=>r&&c(a,r),children:"Add"}),h!==void 0?e.jsx(P,{text:h,render:e.jsx("span",{}),children:e.jsx(Ht,{className:xe.errorLabel})}):e.jsx(Pt,{className:xe.success})]})}function xs({eventId:t,triggers:s}){const{updateEntry:i}=L(),{data:n}=xt(),r=m.useCallback(a=>{const l=s.filter(c=>c.id!==a);i({id:t,triggers:l})},[t,s,i]),o={};return In.forEach(a=>{const l=s.filter(c=>c.trigger===a);l.length&&Object.assign(o,{[a]:l})}),e.jsx("div",{children:Object.entries(o).map(([a,l])=>e.jsx(m.Fragment,{children:l.map(c=>{var f;const{id:d,automationId:h}=c,x=((f=n.automations[h])==null?void 0:f.title)??"<MISSING AUTOMATION>";return e.jsxs("div",{className:xe.trigger,children:[e.jsx(Je,{children:a}),e.jsx(Je,{children:x}),e.jsx(A,{variant:"ghosted-destructive",onClick:()=>r(d),children:e.jsx(rt,{})})]},d)})},a))})}function fs({event:t}){const{data:s}=Fe(),{updateEntry:i}=L(),n=window.location.pathname.includes("editor"),r=m.useCallback((o,a)=>{if(o.startsWith("custom-")){const l=o.split("custom-")[1];i({id:t.id,custom:{[l]:a}})}else i({id:t.id,[o]:a})},[t.id,i]);return e.jsxs("div",{className:b.content,children:[e.jsx(ss,{eventId:t.id,timeStart:t.timeStart,timeEnd:t.timeEnd,duration:t.duration,timeStrategy:t.timeStrategy,linkStart:t.linkStart,countToEnd:t.countToEnd,delay:t.delay,endAction:t.endAction,timerType:t.timerType,timeWarning:t.timeWarning,timeDanger:t.timeDanger},`${t.id}-times`),e.jsx(as,{eventId:t.id,cue:t.cue,flag:t.flag,title:t.title,note:t.note,colour:t.colour},`${t.id}-titles`),e.jsxs("div",{className:b.column,children:[e.jsxs(O,{children:["Custom Fields",n&&e.jsx(ge,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(We,{fields:s,handleSubmit:r,entry:t})]}),e.jsxs("div",{className:b.column,children:[e.jsxs(O,{children:["Automations",n&&e.jsx(ge,{search:"settings=automation",children:"Manage Automations"})]}),e.jsx(ms,{triggers:t.triggers,eventId:t.id})]})]})}const gs="_blink_1qqxl_1",ps="_fourtyfive_1qqxl_13",js="_textInput_1qqxl_18",bs="_under_1qqxl_31",Cs="_over_1qqxl_34",ys="_muted_1qqxl_37",vs="_disabled_1qqxl_40",ce={blink:gs,fourtyfive:ps,textInput:js,under:bs,over:Cs,muted:ys,disabled:vs},_t=m.forwardRef(({offset:t,muted:s,disabled:i,children:n,className:r,...o},a)=>{const l=m.useRef(null),c=W([ce.textInput,t&&ce[t],s&&ce.muted,i&&ce.disabled,r]);return m.useImperativeHandle(a,()=>({focusParentElement(){var d,h;(h=(d=l.current)==null?void 0:d.parentElement)==null||h.focus()}})),e.jsx("div",{className:c,tabIndex:i?-1:0,...o,ref:l,children:n})});_t.displayName="TextLikeInput";const V=m.memo(_t);function _s({id:t,name:s,submitHandler:i,time:n,emptyDisplay:r,placeholder:o,disabled:a,align:l="center",className:c}){const d=m.useRef(null),[h,x]=m.useState(""),f=m.useRef(!1),u=m.useCallback(()=>{typeof n!="number"||isNaN(n)?x(r):x(R(n))},[r,n]),j=m.useCallback(()=>{var v;(v=d.current)==null||v.select()},[]),p=m.useCallback(v=>{if(v===""&&n===null)return!1;const E=Ce(v);return E===n?!1:(i(s,E),!0)},[s,i,n]),g=m.useCallback(v=>{p(v)||u()},[p,u]),y=m.useCallback(v=>{var E,H;v.key==="Enter"&&((E=d.current)==null||E.blur()),v.key==="Escape"&&(f.current=!0,(H=d.current)==null||H.blur(),u())},[u]),_=m.useCallback(v=>{if(f.current){f.current=!1;return}g(v.target.value)},[g]);return m.useEffect(()=>{u()},[u]),e.jsx(Y,{id:t,disabled:a,ref:d,"data-testid":`time-input-${s}`,className:W([En.timeInput,c]),placeholder:o,onFocus:j,onChange:v=>x(v.target.value),onBlur:_,onKeyDown:y,value:h,maxLength:8,autoComplete:"off",style:{textAlign:l}})}function Es({duration:t,targetDuration:s,submitHandler:i}){const n=s!==null;return e.jsxs("div",{children:[e.jsx(C,{htmlFor:"targetDuration",children:"Target duration"}),e.jsxs(he,{hasDelay:n&&s!==t,children:[e.jsx(_s,{name:"targetDuration",time:s,submitHandler:i,emptyDisplay:fe,className:n?"":b.inactive}),e.jsx(P,{text:"Lock to target duration",className:W([b.timeAction,n&&b.active]),onClick:()=>i("targetDuration",n?null:t),"data-testid":"lock__duration",render:e.jsx(A,{variant:"subtle-white",className:n?b.active:b.inactive}),children:n?e.jsx(Ne,{}):e.jsx(we,{})})]})]})}function ks({group:t}){const{data:s}=Fe(),{updateEntry:i}=L(),n=m.useCallback((l,c)=>{if(typeof l=="string"&&l.startsWith("custom-")){const d=l.split("custom-")[1];i({id:t.id,custom:{[d]:c}});return}return i(l==="targetDuration"?{id:t.id,targetDuration:c}:{id:t.id,[l]:c})},[t.id,i]),r=window.location.pathname.includes("editor"),o=t.targetDuration===null?null:t.duration-t.targetDuration,a=o!==null?kn(o):null;return e.jsxs("div",{className:b.content,children:[e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Group schedule"}),e.jsxs("div",{className:b.inline,children:[e.jsxs("div",{children:[e.jsx(C,{children:"First event start"}),e.jsx(V,{className:b.textLikeInput,disabled:!0,children:R(t.timeStart,{fallback:Ye})})]}),e.jsxs("div",{children:[e.jsx(C,{children:"Last event end"}),e.jsx(V,{className:b.textLikeInput,disabled:!0,children:R(t.timeEnd,{fallback:Ye})})]}),e.jsxs("div",{children:[e.jsx(C,{htmlFor:"duration",children:"Scheduled duration"}),e.jsx(V,{className:b.textLikeInput,disabled:!0,children:R(t.duration,{fallback:fe})})]})]}),e.jsxs("div",{className:b.inline,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"eventId",children:"Plan offset"}),e.jsxs(V,{offset:a,className:W([b.textLikeInput,o===null&&b.inactive]),disabled:!0,children:[o!==null&&o>0?"+":"",R(o,{fallback:fe})]})]}),e.jsx(Es,{duration:t.duration,targetDuration:t.targetDuration,submitHandler:n})]})]}),e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Group data"}),e.jsxs("div",{children:[e.jsx(C,{children:"Colour"}),e.jsx(Le,{name:"colour",value:t.colour,handleChange:n})]}),e.jsx(J,{field:"title",label:"Title",initialValue:t.title,submitHandler:n}),e.jsx(ve,{field:"note",label:"Note",initialValue:t.note,submitHandler:n})]}),e.jsxs("div",{className:b.column,children:[e.jsxs(O,{children:["Custom Fields",r&&e.jsx(ge,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(We,{fields:s,handleSubmit:n,entry:t})]})]})}function Ss({milestone:t}){const{data:s}=Fe(),{updateEntry:i}=L(),n=m.useCallback((o,a)=>{if(typeof o=="string"&&o.startsWith("custom-")){const l=o.split("custom-")[1];i({id:t.id,custom:{[l]:a}});return}return i({id:t.id,[o]:a})},[t.id,i]),r=window.location.pathname.includes("editor");return e.jsxs("div",{className:b.content,children:[e.jsxs("div",{className:b.column,children:[e.jsx(O,{children:"Milestone data"}),e.jsxs("div",{className:b.splitTwo,children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"entryId",children:"Milestone ID (read only)"}),e.jsx(Y,{id:"entryId","data-testid":"input-textfield",value:t.id,readOnly:!0,fluid:!0})]}),e.jsx(J,{field:"cue",label:"Cue",initialValue:t.cue,submitHandler:n,maxLength:10})]}),e.jsxs("div",{children:[e.jsx(C,{children:"Colour"}),e.jsx(Le,{name:"colour",value:t.colour,handleChange:n})]}),e.jsx(J,{field:"title",label:"Title",initialValue:t.title,submitHandler:n}),e.jsx(ve,{field:"note",label:"Note",initialValue:t.note,submitHandler:n})]}),e.jsxs("div",{className:b.column,children:[e.jsxs(O,{children:["Custom Fields",r&&e.jsx(ge,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(We,{fields:s,handleSubmit:n,entry:t})]})]})}function Ts({entryId:t}){const{data:s}=yn(),i=m.useMemo(()=>s.order.length===0?null:s.entries[t]??null,[t,s.order,s.entries]);return ae(i)?e.jsx("div",{className:b.entryEditor,"data-testid":"editor-container",children:e.jsx(fs,{event:i})}):gt(i)?e.jsx("div",{className:b.inModal,"data-testid":"editor-container",children:e.jsx(Ss,{milestone:i})}):pt(i)?e.jsx("div",{className:b.inModal,"data-testid":"editor-container",children:e.jsx(ks,{group:i})}):null}const Re=be(t=>({selectedEntryId:null,setEditableEntry:s=>t({selectedEntryId:s}),clearSelection:()=>t({selectedEntryId:null})})),Ca=m.memo(Is);function Is(){const t=Re(i=>i.selectedEntryId),s=Re(i=>i.clearSelection);return t===null?null:e.jsx(ft,{isOpen:!0,onClose:s,title:"Edit entry",showCloseButton:!0,bodyElements:e.jsx(Ts,{entryId:t})})}function Ns(t,s){let i;return(...n)=>{i&&clearTimeout(i),i=setTimeout(()=>{i=null,t(...n)},s)}}function ws(t="cuesheet"){const s=m.useMemo(()=>Me(`${t}-table-sizes`),[t]),[i,n]=m.useState(()=>{try{const o=localStorage.getItem(s);return o?JSON.parse(o):{}}catch{return{}}});m.useEffect(()=>{Ns(a=>{localStorage.setItem(s,JSON.stringify(a))},500)(i)},[i,s]);const r=m.useCallback(o=>{n(o)},[]);return{columnSizing:i,setColumnSizing:r}}function Et(t,s="cuesheet"){const i=m.useMemo(()=>Me(`${s}-table-order`),[s]),[n,r]=lt({key:i,defaultValue:t.map(a=>a.id)});m.useEffect(()=>{const a=t.map(l=>l.id);a.some(l=>!n.includes(l))&&r(a)},[n,t,r]);const o=m.useCallback(()=>{r(t.map(a=>a.id))},[t,r]);return{columnOrder:n,saveColumnOrder:r,resetColumnOrder:o}}function Ds(t="cuesheet"){const s=m.useMemo(()=>Me(`${t}-table-hidden`),[t]),[i,n]=lt({key:s,defaultValue:{}});return{columnVisibility:i,setColumnVisibility:n}}function ya({columns:t,tableRoot:s="cuesheet",children:i}){const{columnOrder:n,saveColumnOrder:r}=Et(t,s),o=Bt(Ue(Vt,{activationConstraint:{delay:100,tolerance:50}}),Ue(Kt,{activationConstraint:{delay:100,tolerance:50}})),a=l=>{const{delta:c,active:d,over:h}=l;if(c.y>200||(h==null?void 0:h.id)==null)return;const x=n.indexOf(d.id),f=n.indexOf(h.id);if(f===-1)return;const u=[...n],j=u.splice(x,1);u.splice(f,0,j[0]),r(u)};return e.jsx(qt,{sensors:o,collisionDetection:Ut,onDragEnd:a,children:i})}const kt=m.forwardRef(({initialValue:t,fieldId:s,fieldLabel:i,allowSubmitSameValue:n,handleUpdate:r,handleCancelUpdate:o},a)=>{const l=m.useRef(null),c=m.useCallback(u=>r(u),[r]),{value:d,onChange:h,onBlur:x,onKeyDown:f}=ye(t,c,l,{allowSubmitSameValue:n,allowKeyboardNavigation:!0,submitOnEnter:!0,submitOnCtrlEnter:!0,onCancelUpdate:o});return m.useImperativeHandle(a,()=>({focus(){var u;(u=l.current)==null||u.focus()},select(){var u;(u=l.current)==null||u.select()},focusParentElement(){var u,j;(j=(u=l.current)==null?void 0:u.parentElement)==null||j.focus()}}),[l]),e.jsx(Y,{ref:l,variant:"ghosted",fluid:!0,value:d,onChange:h,onBlur:x,onKeyDown:f,"data-testid":s?`cuesheet-editor-${s}`:void 0,"aria-label":i?`${i} editor`:void 0})});kt.displayName="SingleLineCell";const Ae=m.memo(kt),zs=m.memo(Rs);function Rs({initialValue:t,lockedValue:s,delayed:i,onSubmit:n,children:r}){const[o,a]=m.useState(!1),[l,c]=m.useState(t),d=m.useRef(null),h=m.useRef(null);m.useEffect(()=>{o&&d.current&&(d.current.focus(),d.current.select())},[o]),m.useEffect(()=>{o||c(t)},[t,o]);const x=()=>a(!0),f=()=>{a(!1),setTimeout(()=>{var p;return(p=h.current)==null?void 0:p.focusParentElement()})},u=m.useCallback(p=>{var y,_,v;if(a(!1),p===""){n(p),(y=d.current)==null||y.focusParentElement();return}if(p.startsWith("p")||p.startsWith("+")){n(p),(_=d.current)==null||_.focusParentElement();return}const g=Ce(p);if(g<0||isNaN(g)){c(t),setTimeout(()=>{var E;return(E=h.current)==null?void 0:E.focusParentElement()});return}if(g===t&&s){(v=d.current)==null||v.focusParentElement();return}n(p),c(Number(p)),setTimeout(()=>{var E;return(E=h.current)==null?void 0:E.focusParentElement()})},[t,s,n]),j=R(l);return o?e.jsx(Ae,{ref:d,initialValue:j,allowSubmitSameValue:!s,handleUpdate:u,handleCancelUpdate:f}):e.jsx(V,{onClick:x,onFocus:x,muted:!s,offset:i?"over":void 0,ref:h,children:r})}const Os="_imageInput_1dtk5_17",Ls="_imageCell_1dtk5_24",Ms="_overlay_1dtk5_28",$s="_image_1dtk5_17",de={imageInput:Os,imageCell:Ls,overlay:Ms,image:$s},Fs=m.memo(Ws);function Ws({initialValue:t,readOnly:s,updateValue:i}){const n=o=>{o!==t&&(o!==""&&!o.startsWith("http")||i(o))},r=()=>{t&&window.open(t,"_blank","noopener,noreferrer")};return t?e.jsxs("div",{className:de.imageCell,children:[!s&&e.jsxs("div",{className:de.overlay,children:[e.jsx(F,{onClick:r,children:"Preview"}),e.jsx(F,{variant:"subtle-destructive",onClick:()=>n(""),children:"Delete"})]}),!!t&&e.jsx("img",{loading:"lazy",src:t,className:de.image})]}):e.jsx(Y,{variant:"ghosted",className:de.imageInput,fluid:!0,readOnly:s,disabled:s,placeholder:"Paste image URL",onBlur:o=>n(o.currentTarget.value),onKeyDown:o=>{o.key==="Enter"&&n(o.currentTarget.value)},defaultValue:t})}const As="_flag_yy7ty_17",Hs={flag:As};function Ps(){return e.jsx("div",{className:Hs.flag,children:e.jsx(Gt,{})})}const Bs="_ghostedText_18xqt_17",qs="_multiline_18xqt_24",nt={ghostedText:Bs,multiline:qs};function He({children:t,multiline:s}){return e.jsx("div",{className:`${nt.ghostedText} ${s?nt.multiline:""}`,children:t})}const St=m.memo(Us);function Us({initialValue:t,fieldId:s,fieldLabel:i,handleUpdate:n}){const r=m.useRef(null),o=m.useCallback(h=>n(h),[n]),{value:a,onChange:l,onBlur:c,onKeyDown:d}=ye(t,o,r,{submitOnCtrlEnter:!0,allowKeyboardNavigation:!0});return e.jsx(vt,{inputref:r,variant:"ghosted",fluid:!0,rows:1,value:a,onChange:l,onBlur:c,onKeyDown:d,spellCheck:!1,"data-testid":s?`cuesheet-editor-${s}`:void 0,"aria-label":i?`${i} editor`:void 0})}const Ks="_muted_1u021_17",Vs="_numeric_1u021_22",st={muted:Ks,numeric:Vs};function X({numeric:t,children:s}){return e.jsx("span",{className:W([st.muted,t&&st.numeric]),children:s})}const Tt=m.memo(Gs);function Gs({initialValue:t,lockedValue:s,delayed:i,onSubmit:n,children:r}){const[o,a]=m.useState(!1),[l,c]=m.useState(t),d=m.useRef(null),h=m.useRef(null);m.useEffect(()=>{o&&d.current&&(d.current.focus(),d.current.select())},[o]),m.useEffect(()=>{o||c(t)},[t,o]);const x=()=>a(!0),f=()=>{a(!1),setTimeout(()=>{var p;return(p=h.current)==null?void 0:p.focusParentElement()})},u=m.useCallback(p=>{var y,_,v;if(a(!1),p===""){n(p),(y=d.current)==null||y.focusParentElement();return}if(p.startsWith("p")||p.startsWith("+")){n(p),(_=d.current)==null||_.focusParentElement();return}const g=Ce(p);if(g<0||isNaN(g)){c(t),setTimeout(()=>{var E;return(E=h.current)==null?void 0:E.focusParentElement()});return}if(g===t&&s){(v=d.current)==null||v.focusParentElement();return}n(p),c(Number(p)),setTimeout(()=>{var E;return(E=h.current)==null?void 0:E.focusParentElement()})},[t,s,n]),j=te(l);return o?e.jsx(Ae,{ref:d,initialValue:j,allowSubmitSameValue:!s,handleUpdate:u,handleCancelUpdate:f}):e.jsx(V,{onClick:x,onFocus:x,muted:!s,offset:i?"over":void 0,ref:h,children:r})}function Pe(t){return typeof t.columnDef.header=="string"?t.columnDef.header:t.id}function Js({getValue:t,row:s,table:i,column:n}){var p;if(!i.options.meta)return null;const{showDelayedTimes:r,hideTableSeconds:o}=i.options.meta.options,a=o?{format12:"h:mm a",format24:"HH:mm"}:void 0,l=s.original;if(!ae(l))return e.jsx(X,{numeric:!0,children:te(t(),a)});const{handleUpdateTimer:c}=i.options.meta,d=g=>c(s.original.id,"timeStart",g),h=t(),x=!l.linkStart,f=r?h+l.delay:h,u=te(f,a);return((p=n.columnDef.meta)==null?void 0:p.canWrite)?e.jsxs(Tt,{initialValue:h,onSubmit:d,lockedValue:x,delayed:l.delay!==0,children:[u,e.jsx(je,{delayValue:l.delay,tooltipPrefix:R(h)})]}):e.jsxs(X,{numeric:!0,children:[u,e.jsx(je,{delayValue:l.delay,tooltipPrefix:R(h)})]})}function Xs({getValue:t,row:s,table:i,column:n}){var p;if(!i.options.meta)return null;const{showDelayedTimes:r,hideTableSeconds:o}=i.options.meta.options,a=o?{format12:"h:mm a",format24:"HH:mm"}:void 0,l=s.original;if(!ae(l))return e.jsx(X,{numeric:!0,children:te(t(),a)});const{handleUpdateTimer:c}=i.options.meta,d=g=>c(s.original.id,"timeEnd",g),h=t(),x=l.timeStrategy===K.LockEnd,f=r?h+l.delay:h,u=te(f,a);return((p=n.columnDef.meta)==null?void 0:p.canWrite)?e.jsxs(Tt,{initialValue:h,onSubmit:d,lockedValue:x,delayed:l.delay!==0,children:[u,e.jsx(je,{delayValue:l.delay,tooltipPrefix:R(h)})]}):e.jsxs(X,{numeric:!0,children:[u,e.jsx(je,{delayValue:l.delay,tooltipPrefix:R(h)})]})}function Ys({getValue:t,row:s,table:i,column:n}){var f;if(!i.options.meta)return null;const{hideTableSeconds:r}=i.options.meta.options,o=s.original;if(!ae(o))return e.jsx(X,{numeric:!0,children:Ze(t(),r)});const{handleUpdateTimer:a}=i.options.meta,l=u=>a(s.original.id,"duration",u),c=t(),d=o.timeStrategy===K.LockDuration,h=Ze(c,r);return((f=n.columnDef.meta)==null?void 0:f.canWrite)?e.jsx(zs,{initialValue:c,onSubmit:l,lockedValue:d,children:h}):e.jsx(X,{numeric:!0,children:h})}function Zs({row:t,column:s,table:i}){var a;const n=m.useCallback(l=>{var c;(c=i.options.meta)==null||c.handleUpdate(t.index,s.id,l,!1)},[s.id,t.index,i.options.meta]),r=t.original[s.id];return typeof r!="string"?null:((a=s.columnDef.meta)==null?void 0:a.canWrite)?e.jsx(St,{initialValue:r,fieldId:s.id,fieldLabel:Pe(s),handleUpdate:n}):e.jsx(He,{multiline:!0,children:r})}function Qs({row:t,column:s,table:i}){var l;const n=m.useCallback(c=>{var d;(d=i.options.meta)==null||d.handleUpdate(t.index,s.id,c,!0)},[s.id,t.index,i.options.meta]),r=t.original;if($e(r))return null;const o=(l=s.columnDef.meta)==null?void 0:l.canWrite,a=r.custom[s.id];return e.jsx(Fs,{initialValue:a,updateValue:n,readOnly:!o})}function it({row:t,column:s,table:i}){var a;const n=m.useCallback(l=>{var c;(c=i.options.meta)==null||c.handleUpdate(t.index,s.id,l,!1)},[s.id,t.index,i.options.meta]),r=t.original[s.id];return typeof r!="string"?null:((a=s.columnDef.meta)==null?void 0:a.canWrite)?e.jsx(Ae,{initialValue:r,fieldId:s.id,fieldLabel:Pe(s),handleUpdate:n}):e.jsx(He,{children:r})}function ei({row:t}){const s=t.original;return!ae(s)||!s.flag?null:e.jsx(Ps,{})}function ti({row:t,column:s,table:i}){var l;const n=m.useCallback(c=>{var d;(d=i.options.meta)==null||d.handleUpdate(t.index,s.id,c,!0)},[s.id,t.index,i.options.meta]),r=t.original;if($e(r))return null;const o=r.custom[s.id]??"";return((l=s.columnDef.meta)==null?void 0:l.canWrite)?e.jsx(St,{initialValue:o,fieldId:s.id,fieldLabel:Pe(s),handleUpdate:n}):e.jsx(He,{multiline:!0,children:o})}function va(t,s,i){var f,u,j,p;const n=[],r=s===D.Edit,o=i?((f=i.options)==null?void 0:f.read)==="full":!0,a=i?((u=i.options)==null?void 0:u.write)==="full":!0,l=(j=i==null?void 0:i.options)!=null&&j.write?new Set(i.options.write.split(",")):new Set,c=(p=i==null?void 0:i.options)!=null&&p.read?new Set(i.options.read.split(",")):new Set,d=g=>o||c.has(g),h=g=>r&&(a||l.has(g));d("flag")&&n.push({accessorKey:"flag",id:"flag",header:"Flag",cell:ei,size:45,minSize:45,meta:{canWrite:h("flag")}}),d("cue")&&n.push({accessorKey:"cue",id:"cue",header:"Cue",cell:it,size:75,minSize:40,meta:{canWrite:h("cue")}}),d("timeStart")&&n.push({accessorKey:"timeStart",id:"timeStart",header:"Start",cell:Js,size:75,minSize:75,meta:{canWrite:h("timeStart")}}),d("timeEnd")&&n.push({accessorKey:"timeEnd",id:"timeEnd",header:"End",cell:Xs,size:75,minSize:75,meta:{canWrite:h("timeEnd")}}),d("duration")&&n.push({accessorKey:"duration",id:"duration",header:"Duration",cell:Ys,size:75,minSize:75,meta:{canWrite:h("duration")}}),d("title")&&n.push({accessorKey:"title",id:"title",header:"Title",cell:it,size:250,minSize:75,meta:{canWrite:h("title")}}),d("note")&&n.push({accessorKey:"note",id:"note",header:"Note",cell:Zs,size:250,minSize:75,meta:{canWrite:h("note")}});const x=Object.keys(t);for(let g=0;g<x.length;g++){const y=x[g],_=`custom-${y}`;d(_)&&n.push({accessorKey:y,id:y,header:t[y].label,cell:t[y].type==="text"?ti:Qs,size:250,minSize:75,meta:{colour:t[y].colour,canWrite:h(_)}})}return n}const ni="_emptyContainer_1dp7m_17",si="_emptyCell_1dp7m_21",ii="_empty_1dp7m_17",ai="_text_1dp7m_30",ue={emptyContainer:ni,emptyCell:si,empty:ii,text:ai};function oi({text:t}){return e.jsx("tbody",{className:ue.emptyContainer,children:e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:ue.emptyCell,children:[e.jsx(fn,{className:ue.empty}),t&&e.jsx("span",{className:ue.text,children:t})]})})})}const at={hideTableSeconds:!1,hideIndexColumn:!1,showDelayedTimes:!1,hideDelays:!1},It=be()(Jt(t=>({...at,setOption:(s,i)=>t(n=>({...n,[s]:i})),toggleOption:s=>t(i=>({...i,[s]:!i[s]})),resetOptions:()=>t(at)}),{name:"editor-options"}));var ri=(t=>(t.List="list",t.Table="table",t))(ri||{});const Nt=be(t=>({canChangeMode:!1,canCreateEntries:!1,canEditEntries:!1,canFlag:!1,canShare:!1,setPermissions(s){t({canChangeMode:s.canChangeMode,canFlag:s.canFlag,canCreateEntries:s.canCreateEntries,canEditEntries:s.canEditEntries,canShare:s.canShare})}}));function li(t){return e.jsx(ot,{style:{transform:"rotate(-45deg)"},...t})}function ci(){const{data:t}=gn(),{data:s}=pn(),[i,n]=Xt(),r=i&&t&&s;return e.jsxs(e.Fragment,{children:[e.jsxs(ee,{onClick:n.open,render:e.jsx(F,{}),children:[e.jsx(li,{}),"Share..."]}),e.jsx(ft,{isOpen:i,onClose:n.close,title:"Share cuesheet view",showBackdrop:!0,showCloseButton:!0,bodyElements:r?e.jsx(un,{lockedPath:{value:jn.Cuesheet,label:"Cuesheet"}}):null})]})}const di="_tableSettings_18k3s_17",ui="_sectionTitle_18k3s_29",mi="_option_18k3s_40",hi="_column_18k3s_47",xi="_inline_18k3s_54",fi="_apart_18k3s_60",gi="_group_18k3s_65",pi="_radioButton_18k3s_76",S={tableSettings:di,sectionTitle:ui,option:mi,column:hi,inline:xi,apart:fi,group:gi,radioButton:pi};function ji({columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n}){const r=Nt(h=>h.canShare),o=m.use(bn),a=ie(),[l,c]=Yt({key:o?`${o.alias}${Qe.cuesheetMode}`:Qe.cuesheetMode,defaultValue:o?D.Run:D.Edit}),d=h=>{const x=h.at(0);x&&c(x)};return e.jsxs(ct,{className:S.tableSettings,children:[e.jsx(wt,{optionsStore:a}),e.jsx(Dt,{columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n}),e.jsxs(Zt,{value:[l],onValueChange:d,className:W([S.group,S.apart]),children:[e.jsx(ee,{render:e.jsx(Ke,{}),value:D.Run,className:S.radioButton,children:"Run"}),e.jsx(ee,{render:e.jsx(Ke,{}),value:D.Edit,className:S.radioButton,children:"Edit"})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx(_n,{orientation:"vertical"}),e.jsx(ci,{})]})]})}function wt({optionsStore:t}){const s=t;return e.jsxs(dt,{children:[e.jsx(ut,{render:e.jsx(ee,{render:e.jsxs(F,{variant:"ghosted-white",children:[e.jsx(mt,{})," Settings",e.jsx(ht,{})]})})}),e.jsxs(bt,{align:"start",className:S.inline,children:[e.jsxs("div",{className:S.column,children:[e.jsx(C,{className:S.sectionTitle,children:"Element visibility"}),e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:s.hideTableSeconds,onCheckedChange:i=>s.setOption("hideTableSeconds",i)}),"Hide seconds in table"]}),e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:s.hideIndexColumn,onCheckedChange:i=>s.setOption("hideIndexColumn",i)}),"Hide index column"]})]}),e.jsxs("div",{className:S.column,children:[e.jsx(C,{className:S.sectionTitle,children:"Table Behaviour"}),e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:s.showDelayedTimes,onCheckedChange:i=>s.setOption("showDelayedTimes",i)}),"Show delayed times"]}),e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:s.hideDelays,onCheckedChange:i=>s.setOption("hideDelays",i)}),"Hide delay entries"]})]})]})]})}function Dt({columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n}){return e.jsxs(dt,{children:[e.jsx(ut,{render:e.jsx(ee,{render:e.jsxs(F,{variant:"ghosted-white",children:[e.jsx(Qt,{})," Columns",e.jsx(ht,{})]})})}),e.jsxs(bt,{align:"start",className:S.inline,children:[e.jsxs("div",{className:S.column,children:[e.jsx(C,{className:S.sectionTitle,children:"Column visibility"}),t.map(r=>{const o=r.columnDef.header,a=r.getIsVisible();return e.jsxs(C,{className:S.option,children:[e.jsx(Z,{defaultChecked:a,onCheckedChange:r.toggleVisibility}),o]},`${r.id}-${a}`)})]}),e.jsxs("div",{className:S.column,children:[e.jsx(C,{className:S.sectionTitle,children:"Reset Options"}),e.jsx(F,{size:"small",fluid:!0,onClick:n,children:"Show All"}),e.jsx(F,{size:"small",fluid:!0,onClick:s,children:"Reset Resizing"}),e.jsx(F,{size:"small",fluid:!0,onClick:i,children:"Reset Reordering"})]})]})]})}function bi({columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n}){const r=It();return e.jsxs(ct,{className:S.tableSettings,children:[e.jsx(wt,{optionsStore:r}),e.jsx(Dt,{columns:t,handleResetResizing:s,handleResetReordering:i,handleClearToggles:n})]})}const Ci="_actionColumn_1gx4m_17",yi="_indexColumn_1gx4m_26",vi="_cuesheet_1gx4m_37",_i="_resizer_1gx4m_61",Ei="_tableHeader_1gx4m_77",B={actionColumn:Ci,indexColumn:yi,cuesheet:vi,resizer:_i,tableHeader:Ei};function ki({columnId:t,colSpan:s,injectedStyles:i,children:n,draggable:r}){const{attributes:o,listeners:a,setNodeRef:l,transform:c,transition:d,isDragging:h}=en({id:t}),x={...i,zIndex:h?2:"inherit",transform:tn.Translate.toString(c),transition:d};return e.jsxs("th",{ref:l,style:x,colSpan:s,tabIndex:-1,children:[e.jsx("div",{...o,...a,children:n}),r]})}function Si({colSpan:t,injectedStyles:s,children:i,draggable:n}){return e.jsxs("th",{style:s,colSpan:t,tabIndex:-1,children:[e.jsx("div",{children:i}),n]})}function zt({header:t}){return e.jsx("div",{onDoubleClick:()=>t.column.resetSize(),onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:B.resizer})}function Ti({headerGroup:t,cuesheetMode:s}){const i=ie(n=>n.hideIndexColumn);return e.jsxs("tr",{children:[s===D.Edit&&e.jsx("th",{className:B.actionColumn,tabIndex:-1}),!i&&e.jsx("th",{className:B.indexColumn,tabIndex:-1,children:"#"}),e.jsx(nn,{items:t.headers,strategy:sn,children:t.headers.map(n=>{var l,c;const r=(l=n.column.columnDef.meta)==null?void 0:l.colour,a={opacity:((c=n.column.columnDef.meta)==null?void 0:c.canWrite)?1:.6};if(r){const d=G(r);a.backgroundColor=d.backgroundColor,a.color=d.color}return e.jsx(ki,{columnId:n.column.id,colSpan:n.colSpan,injectedStyles:{width:`calc(var(--header-${n==null?void 0:n.id}-size) * 1px)`,...a},draggable:e.jsx(zt,{header:n}),children:n.isPlaceholder?null:se(n.column.columnDef.header,n.getContext())},n.column.columnDef.id)})},t.id)]},t.id)}function Ii({headerGroup:t,cuesheetMode:s}){const i=ie(n=>n.hideIndexColumn);return e.jsxs("tr",{children:[s===D.Edit&&e.jsx("th",{className:B.actionColumn,tabIndex:-1}),!i&&e.jsx("th",{className:B.indexColumn,tabIndex:-1,children:"#"}),t.headers.map(n=>{var l,c;const r=(l=n.column.columnDef.meta)==null?void 0:l.colour,a={opacity:((c=n.column.columnDef.meta)==null?void 0:c.canWrite)?1:.6};if(r){const d=G(r);a.backgroundColor=d.backgroundColor,a.color=d.color}return e.jsx(Si,{columnId:n.column.id,colSpan:n.colSpan,injectedStyles:{width:`calc(var(--header-${n==null?void 0:n.id}-size) * 1px)`,...a},draggable:e.jsx(zt,{header:n}),children:n.isPlaceholder?null:se(n.column.columnDef.header,n.getContext())},n.column.columnDef.id)})]},t.id)}const Ni="_delayRow_1yrjh_37",wi="_delayRowHidden_1yrjh_55",Te={delayRow:Ni,delayRowHidden:wi};function Di({duration:t,injectedStyles:s,hasCursor:i,...n}){if(ie(a=>a.hideDelays)||t===0)return e.jsx("tr",{className:`${Te.delayRow} ${Te.delayRowHidden}`,"data-testid":"cuesheet-delay-hidden",style:s,...n,children:e.jsx("td",{})});const o=Ct(t,"expanded");return e.jsx("tr",{className:Te.delayRow,"data-testid":"cuesheet-delay",style:s,"data-cursor":i,...n,children:e.jsx("td",{tabIndex:0,children:o})})}const zi=m.memo(Di),_e=be(t=>({isOpen:!1,entryId:null,entryType:null,entryIndex:null,parentId:null,position:{x:0,y:0},flag:null,openMenu:(s,i,n,r,o,a)=>t({isOpen:!0,position:s,entryId:i,entryType:n,entryIndex:r,parentId:o,flag:a}),closeMenu:()=>t({isOpen:!1})})),Ri="_actionColumn_xqld8_17",Oi="_indexColumn_xqld8_26",Li="_eventRow_xqld8_37",Mi="_firstAfterGroup_xqld8_52",$i="_skip_xqld8_55",U={actionColumn:Ri,indexColumn:Oi,eventRow:Li,firstAfterGroup:Mi,skip:$i};function Fi({rowId:t,id:s,eventIndex:i,colour:n,isFirstAfterGroup:r,isLoaded:o,isPast:a,groupColour:l,flag:c,skip:d,parent:h,rowIndex:x,table:f,injectedStyles:u,hasCursor:j,...p}){var oe;const{cuesheetMode:g,hideIndexColumn:y}=((oe=f.options.meta)==null?void 0:oe.options)??{cuesheetMode:D.Edit,hideIndexColumn:!1},_=_e(I=>I.openMenu),{color:v,backgroundColor:E}=G(n),H=De(v),Ee=ze({...H,alpha:H.alpha*.8}),w=m.useMemo(()=>{if(o)return"#087A27";if(n){const I=De(G(n).backgroundColor);if(I!==null)return ze({...I,alpha:I.alpha*.25})}},[n,o]);return e.jsxs("tr",{id:t,className:W([U.eventRow,d&&U.skip,r&&U.firstAfterGroup,h&&U.hasParent]),style:{...u,opacity:`${a?"0.2":"1"}`,"--user-bg":l??"transparent"},"data-cursor":j,"data-testid":"cuesheet-event","data-entry-id":s,...p,children:[g===D.Edit&&e.jsx("td",{className:U.actionColumn,tabIndex:-1,role:"cell",children:e.jsx(A,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:I=>{const q=I.currentTarget.getBoundingClientRect(),ke=8+q.y+q.height/2;_({x:q.x,y:ke},s,ne.Event,x,h,c)},children:e.jsx(Oe,{})})}),!y&&e.jsx("td",{className:U.indexColumn,style:{backgroundColor:E,color:Ee},tabIndex:-1,role:"cell",children:i}),f.getRow(t).getVisibleCells().map(I=>e.jsx("td",{style:{width:`calc(var(--col-${I.column.id}-size) * 1px)`,backgroundColor:w},tabIndex:-1,role:"cell","data-testid":`cuesheet-cell-${I.column.id}`,"data-column-id":I.column.id,children:se(I.column.columnDef.cell,I.getContext())},I.id))]})}const Wi="_actionColumn_1sgq2_17",Ai="_indexColumn_1sgq2_26",Hi="_groupRow_1sgq2_37",Ie={actionColumn:Wi,indexColumn:Ai,groupRow:Hi};function Pi({groupId:t,colour:s,rowId:i,rowIndex:n,table:r,injectedStyles:o,hasCursor:a,...l}){var x;const{cuesheetMode:c,hideIndexColumn:d}=((x=r.options.meta)==null?void 0:x.options)??{cuesheetMode:D.Edit,hideIndexColumn:!1},h=_e(f=>f.openMenu);return e.jsxs("tr",{className:Ie.groupRow,style:{...o,"--user-bg":s},"data-testid":"cuesheet-group","data-cursor":a,...l,children:[c===D.Edit&&e.jsx("td",{className:Ie.actionColumn,tabIndex:-1,role:"cell",children:e.jsx(A,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:f=>{const u=f.currentTarget.getBoundingClientRect(),j=8+u.y+u.height/2;h({x:u.x,y:j},t,ne.Group,n,null,null)},children:e.jsx(Oe,{})})}),!d&&e.jsx("td",{className:Ie.indexColumn,tabIndex:-1,role:"cell"}),r.getRow(i).getVisibleCells().map(f=>e.jsx("td",{tabIndex:-1,style:{width:`calc(var(--col-${f.column.id}-size) * 1px)`},role:"cell",children:se(f.column.columnDef.cell,f.getContext())},f.id))]})}const Bi="_actionColumn_tym0z_17",qi="_indexColumn_tym0z_26",Ui="_milestoneRow_tym0z_37",me={actionColumn:Bi,indexColumn:qi,milestoneRow:Ui};function Ki({entryId:t,isPast:s,parentBgColour:i,parentId:n,colour:r,rowId:o,rowIndex:a,hasCursor:l,table:c,injectedStyles:d,...h}){var p;const{cuesheetMode:x,hideIndexColumn:f}=((p=c.options.meta)==null?void 0:p.options)??{cuesheetMode:D.Edit,hideIndexColumn:!1},u=_e(g=>g.openMenu);let j;if(r){const g=De(G(r).backgroundColor);g!==null&&(j=ze({...g,alpha:g.alpha*.25}))}return e.jsxs("tr",{className:W([me.milestoneRow,!!i&&me.hasParent]),style:{...d,opacity:`${s?"0.2":"1"}`,"--user-bg":i??"transparent"},"data-testid":"cuesheet-milestone","data-cursor":l,...h,children:[x===D.Edit&&e.jsx("td",{className:me.actionColumn,tabIndex:-1,role:"cell",children:e.jsx(A,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:g=>{const y=g.currentTarget.getBoundingClientRect(),_=8+y.y+y.height/2;u({x:y.x,y:_},t,ne.Milestone,a,n,null)},children:e.jsx(Oe,{})})}),!f&&e.jsx("td",{className:me.indexColumn,tabIndex:-1,role:"cell",children:fe}),c.getRow(o).getVisibleCells().map(g=>{const y=g.column.id!=="duration"&&g.column.id!=="timeStart"&&g.column.id!=="timeEnd";return e.jsx("td",{style:{width:`calc(var(--col-${g.column.id}-size) * 1px)`,backgroundColor:j,opacity:y?1:.4},tabIndex:-1,children:y&&se(g.column.columnDef.cell,g.getContext())},g.id)})]})}const Vi=m.memo(Gi);function Gi(){const{isOpen:t,entryId:s,entryIndex:i,parentId:n,flag:r,position:o,closeMenu:a}=_e(),{addEntry:l,clone:c,deleteEntry:d,move:h,updateEntry:x}=L(),f=Re(j=>j.setEditableEntry),u=Nt();return t?e.jsx(mn,{isOpen:!0,onClose:a,items:[{type:"item",label:"Edit...",onClick:()=>f(s),icon:mt,disabled:!u.canEditEntries},{type:"divider"},{type:"item",label:r?"Remove flag":"Add flag",onClick:()=>x({id:s,flag:!r}),icon:Ve,disabled:r===null||!u.canFlag},{type:"divider"},{type:"item",label:"Add event above",onClick:()=>l({type:ne.Event,parent:n},{before:s}),icon:Ge,disabled:!u.canCreateEntries},{type:"item",label:"Add event below",onClick:()=>l({type:ne.Event,parent:n},{after:s}),icon:Ge,disabled:!u.canCreateEntries},{type:"item",label:"Clone event",onClick:()=>c(s),icon:Ve,disabled:!u.canCreateEntries},{type:"divider"},{type:"item",label:"Move up",onClick:()=>h(s,"up"),icon:an,disabled:i<1||!u.canEditEntries},{type:"item",label:"Move down",onClick:()=>h(s,"down"),icon:on,disabled:!u.canEditEntries},{type:"divider"},{type:"item",label:"Delete",onClick:()=>d([s]),icon:rt,disabled:!u.canEditEntries}],position:o}):null}function _a({columns:t,cuesheetMode:s,tableRoot:i="cuesheet"}){const{data:n,status:r}=vn(),{updateEntry:o,updateTimer:a}=L(),l=i==="editor"?It:ie,c=l(k=>k.showDelayedTimes),d=l(k=>k.hideTableSeconds),h=l(k=>k.hideIndexColumn),x=Cn(),f=Xe(k=>k.cursor),u=Xe(k=>k.setScrollHandler),j=m.useRef(null),{listeners:p}=rn(),g=m.useMemo(()=>({handleUpdate:(k,T,z,M=!1)=>{const re=n[k];if(!(!re||re[T]===z)){if(M){o({id:re.id,custom:{[T]:z}});return}o({id:re.id,[T]:z})}},handleUpdateTimer:(k,T,z)=>{a(k,T,z,!0)},options:{showDelayedTimes:c,hideTableSeconds:d,cuesheetMode:s,hideIndexColumn:h}}),[s,n,h,d,c,o,a]),{columnOrder:y,resetColumnOrder:_}=Et(t,i),{columnSizing:v,setColumnSizing:E}=ws(i),{columnVisibility:H,setColumnVisibility:Ee}=Ds(i),w=ln({data:n,columns:t,columnResizeMode:"onChange",state:{columnOrder:y,columnVisibility:H,columnSizing:v},onColumnVisibilityChange:Ee,onColumnSizingChange:E,getCoreRowModel:dn(),meta:g}),oe=m.useCallback(()=>{w.toggleAllColumnsVisible(!0)},[w]),I=m.useCallback(()=>{E({})},[E]);m.useEffect(()=>{if(j.current===null||s!==D.Run||!x)return;const k=n.findIndex(T=>T.id===x);k!==-1&&j.current.scrollToIndex({index:k,behavior:"auto",align:"start",offset:-50})},[s,n,x]),m.useEffect(()=>(u(T=>{if(j.current===null)return;const z=n.findIndex(M=>M.id===T);z!==-1&&j.current.scrollToIndex({index:z,behavior:"auto",align:"start",offset:-50})}),()=>{u(null)}),[n,u]);const q=m.useMemo(()=>{const k=w.getFlatHeaders(),T={};for(let z=0;z<k.length;z++){const M=k[z];M&&(T[`--header-${M.id}-size`]=M.getSize(),T[`--col-${M.column.id}-size`]=M.column.getSize())}return T},[w.getState().columnSizingInfo,w.getState().columnSizing]),ke=w.getAllLeafColumns(),{rows:Be}=w.getRowModel(),Rt=m.useMemo(()=>({columnSizeVars:q,cursor:f,listeners:p,rows:Be,table:w}),[q,f,p,Be,w]),Ot=m.useCallback((k,T)=>T.id,[]),Lt=m.useCallback(()=>w.getHeaderGroups().map(k=>{const T=w.getState().columnSizingInfo.isResizingColumn?Ii:Ti;return e.jsx(T,{cuesheetMode:s,headerGroup:k},k.id)}),[s,w]);if(!n||r==="pending")return e.jsx(Tn,{text:"Loading..."});const Mt=i==="editor"?bi:ji;return e.jsxs(e.Fragment,{children:[e.jsx(Mt,{columns:ke,handleResetResizing:I,handleResetReordering:_,handleClearToggles:oe}),e.jsx(cn,{ref:j,data:n,context:Rt,style:i==="editor"?{paddingLeft:"1rem"}:void 0,computeItemKey:Ot,increaseViewportBy:{top:100,bottom:200},components:Qi,fixedHeaderContent:Lt}),e.jsx(Vi,{})]})}const Ji=m.memo(function(){return e.jsx(oi,{text:"No data in rundown"})}),Xi=m.memo(function({style:s,context:i,...n}){return e.jsx("table",{className:B.cuesheet,id:"cuesheet",style:{...s,...i.columnSizeVars},...i.listeners,...n})}),Yi=m.memo(function({context:s,className:i,...n}){return e.jsx("thead",{className:B.tableHeader,...n})}),Zi=m.memo(function({item:s,style:i,context:n,...r}){const o=r["data-index"],a=n.rows[o];if(!a)return null;const l=a.original.id,c=a.original,d=c.id===n.cursor;return pt(c)?e.jsx(Pi,{groupId:c.id,colour:c.colour,rowId:a.id,rowIndex:a.index,table:n.table,injectedStyles:i,hasCursor:d,...r},l):$e(c)?e.jsx(zi,{duration:c.duration,injectedStyles:i,hasCursor:d,...r},l):gt(c)?e.jsx(Ki,{entryId:c.id,isPast:c.isPast,parentBgColour:c.groupColour,parentId:c.parent,colour:c.colour,rowId:a.id,rowIndex:o,table:n.table,injectedStyles:i,hasCursor:d,...r},l):e.jsx(Fi,{id:c.id,eventIndex:c.eventIndex,colour:c.colour,isFirstAfterGroup:c.isFirstAfterGroup,isLoaded:c.isLoaded,isPast:c.isPast,groupColour:c.groupColour,flag:c.flag,skip:c.skip,parent:c.parent,rowId:a.id,rowIndex:o,table:n.table,injectedStyles:i,hasCursor:d,...r},a.id)}),Qi={EmptyPlaceholder:Ji,Table:Xi,TableHead:Yi,TableRow:Zi};export{ya as C,ba as E,ks as G,Ss as M,ri as R,ts as T,_a as a,Ca as b,fs as c,L as d,ye as e,va as m,b as s,Nt as u};
2
+ //# sourceMappingURL=CuesheetTable-B5LQVh5m.js.map