UNPKG

@getontime/cli

Version:

Time keeping for live events

3 lines 8.29 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./PipHost-CP9svm7c.js","./constants-8b9Q9Bj6.js","./jsx-runtime-BNC90REB.js","./index-qU8RbaVt.js","./Button-CsttsbOH.js","./useSocket-B9-0Z7zf.js","./Button-DiI6nd38.css","./useIsSmallScreen-Db4lRgi0.js","./useMutation-BQgDt5L8.js","./assets-DU19UGw8.js","./NavigationMenu-6SsQpfey.js","./Input-D-3bhaHU.js","./Input-C9TDHweP.css","./Tooltip-DJ2_sn6r.js","./Tooltip-C0bTEpWY.css","./PresetContext-DZh_OrO5.js","./viewOptions-z3iLoQCB.js","./NavigationMenu-DPX7dRN-.css","./useSettings-CeUw01Bu.js","./viewParamsEditor.store-BcLRa99Z.js","./useFadeOutOnInactivity-u16Uck_y.js","./throttle-W86nehU0.js","./use-hotkeys-B1NTwV1d.js","./exports-BUXB5LA6.js","./index-CHpQBF7q.css","./EditorUtils-CCdI8uXK.js","./tb-CLik_SnZ.js","./EditorUtils-BIAiI5ZG.css","./timer.utils-DRE1_9vU.js","./viewUtils-CulstVIy.js","./playbackstate-C3qVH4fY.js","./MultiPartProgressBar-B4jgVUIf.js","./useAnimatedProgress-DJlteBY2.js","./MultiPartProgressBar-BjCZ48k8.css","./presentation.utils-Co5R9T_c.js","./errorboundary-BKENFA_Y.js","./PipHost-DvIIU6Jz.css"])))=>i.map(i=>d[i]); (function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`f14ad0099eab1969fdd065b56af5fdd3cf530de6`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`dc58a407-1aae-423a-b4f9-f6c9c53e8939`,e._sentryDebugIdIdentifier=`sentry-dbid-dc58a407-1aae-423a-b4f9-f6c9c53e8939`)}catch{}})();import{a as e,n as t,t as n}from"./jsx-runtime-BNC90REB.js";import{L as r,P as i,Rt as a,i as o,m as s,qt as c,v as l}from"./useSocket-B9-0Z7zf.js";import{t as u}from"./Button-CsttsbOH.js";import{t as d}from"./Tooltip-DJ2_sn6r.js";import{A as f,c as p}from"./useIsSmallScreen-Db4lRgi0.js";import{t as m}from"./Select-CujoWFOD.js";import{At as h,J as g,K as _,at as v,j as y,kt as b,rt as x,st as S,un as C}from"./constants-8b9Q9Bj6.js";import{l as w}from"./NavigationMenu-6SsQpfey.js";import"./viewParamsEditor.store-BcLRa99Z.js";import"./useFadeOutOnInactivity-u16Uck_y.js";import"./useSettings-CeUw01Bu.js";import{r as T,t as E}from"./Input-D-3bhaHU.js";import"./PresetContext-DZh_OrO5.js";import"./viewOptions-z3iLoQCB.js";import{i as D,j as O,r as k}from"./index-qU8RbaVt.js";import{t as A}from"./ProtectRoute-BH4thnew.js";import{a as j,o as M,r as N,t as P}from"./EditorUtils-CCdI8uXK.js";var F=e(t(),1),I={blink:`_blink_fnxow_1`,fourtyfive:`_fourtyfive_fnxow_13`,inputItems:`_inputItems_fnxow_17`,label:`_label_fnxow_24`,active:`_active_fnxow_28`},L=n();function R(e){let{label:t,placeholder:n,text:r,visible:i,changeHandler:a,children:o}=e,[s,c]=(0,F.useState)(r),l=(0,F.useRef)(null),u=(0,F.useRef)(0);return(0,F.useEffect)(()=>{l.current&&l.current!==document.activeElement&&(l.current.selectionStart=u.current,l.current.selectionEnd=u.current)},[r]),(0,F.useEffect)(()=>{l.current!==document.activeElement&&c(r)},[r]),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:_([I.label,i??I.active]),htmlFor:t,children:t}),(0,L.jsxs)(`div`,{className:I.inputItems,children:[(0,L.jsx)(E,{id:t,ref:l,value:s,onChange:e=>{u.current=e.target.selectionStart??0,c(e.target.value),a(e.target.value)},placeholder:n}),o]})]})}var z=`documentPictureInPicture`in window,B=(0,F.lazy)(()=>f(()=>import(`./PipHost-CP9svm7c.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url)),V=(0,F.memo)(H);function H(){return z?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(B,{})}):null}var U={blink:`_blink_8qr2e_1`,fourtyfive:`_fourtyfive_8qr2e_13`,preview:`_preview_8qr2e_17`,mainContent:`_mainContent_8qr2e_25`,secondaryContent:`_secondaryContent_8qr2e_41`,blackout:`_blackout_8qr2e_45`,eventStatus:`_eventStatus_8qr2e_49`,statusIcon:`_statusIcon_8qr2e_58`},W={aux1:`Aux 1`,aux2:`Aux 2`,aux3:`Aux 3`,secondary:`Secondary message`};function G(){let{blink:e,blackout:t,countToEnd:n,phase:r,secondarySource:i,showTimerMessage:o,timerType:s}=l(),{data:u}=D(),f=o?`Message`:s===c.None?g:r===a.Pending?`Standby to start`:r===a.Overtime?`Timer Overtime`:s===c.Clock?`Clock`:n?`Count to End`:`Timer`,m=o||!i?null:W[i],h=r===a.Warning?u.warningColor??`#ffa528`:r===a.Danger?u.dangerColor??`#ff7300`:u.normalColor??`#FFFC`,y=f==`Timer`,b=_([e&&U.blink,t&&U.blackout]);return(0,L.jsxs)(`div`,{className:U.preview,children:[(0,L.jsx)(N,{onExtractClick:e=>w(`timer`,e),pipElement:(0,L.jsx)(V,{})}),(0,L.jsxs)(`div`,{className:b,children:[(0,L.jsx)(`div`,{className:U.mainContent,"data-phase":y&&r,style:y?{"--override-colour":h}:{},children:f}),m!==null&&(0,L.jsx)(`div`,{className:U.secondaryContent,children:m})]}),(0,L.jsxs)(`div`,{className:U.eventStatus,children:[(0,L.jsx)(d,{text:`Time type: Count down`,render:(0,L.jsx)(`span`,{}),className:U.statusIcon,"data-active":s===c.CountDown,children:(0,L.jsx)(x,{})}),(0,L.jsx)(d,{text:`Time type: Count up`,render:(0,L.jsx)(`span`,{}),className:U.statusIcon,"data-active":s===c.CountUp,children:(0,L.jsx)(v,{})}),(0,L.jsx)(d,{text:`Time type: Clock`,render:(0,L.jsx)(`span`,{}),className:U.statusIcon,"data-active":s===c.Clock,children:(0,L.jsx)(C,{})}),(0,L.jsx)(d,{text:`Time type: None`,render:(0,L.jsx)(`span`,{}),className:U.statusIcon,"data-active":s===c.None,children:(0,L.jsx)(S,{})}),(0,L.jsx)(d,{text:n?`Count to end`:`Count duration`,render:(0,L.jsx)(`span`,{}),className:U.statusIcon,"data-active":n,children:(0,L.jsx)(p,{})})]})]})}var K={blink:`_blink_ytrng_1`,fourtyfive:`_fourtyfive_ytrng_13`,previewContainer:`_previewContainer_ytrng_17`,options:`_options_ytrng_23`};function q(){let{blackout:e,blink:t}=r();return(0,L.jsxs)(`div`,{className:K.previewContainer,children:[(0,L.jsx)(G,{}),(0,L.jsxs)(`div`,{className:K.options,children:[(0,L.jsx)(J,{}),(0,L.jsx)(M,{orientation:`horizontal`}),(0,L.jsx)(u,{variant:t?`primary`:`subtle`,fluid:!0,onClick:()=>o.timerBlink(!t),"data-testid":`toggle timer blink`,children:`Blink`}),(0,L.jsx)(u,{variant:e?`primary`:`subtle`,fluid:!0,onClick:()=>o.timerBlackout(!e),"data-testid":`toggle timer blackout`,children:`Blackout screen`})]})]})}function J(){let{secondarySource:e}=r(),[t,n]=(0,F.useState)(`aux1`);return(0,F.useEffect)(()=>{e!==null&&n(e)},[e]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(m,{value:t,options:[{value:`aux1`,label:`Aux 1`},{value:`aux2`,label:`Aux 2`},{value:`aux3`,label:`Aux 3`},{value:`secondary`,label:`Secondary message`}],onValueChange:t=>{t!==null&&(e!==null&&o.timerSecondarySource(t),n(t))}}),(0,L.jsx)(u,{variant:e===null?`subtle`:`primary`,fluid:!0,onClick:()=>{e===t?o.timerSecondarySource(null):o.timerSecondarySource(t)},"data-testid":`toggle secondary`,children:`Show secondary`})]})}function Y(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(q,{}),(0,L.jsx)(X,{}),(0,L.jsx)(Z,{})]})}function X(){let{text:e,visible:t}=i();return(0,L.jsx)(R,{label:`Timer Message`,placeholder:`Message shown fullscreen in stage timer`,text:e,visible:t,changeHandler:e=>o.timerText(e),children:(0,L.jsx)(T,{"aria-label":`Toggle timer message visibility`,onClick:()=>o.timerVisible(!t),variant:t?`primary`:`subtle`,children:t?(0,L.jsx)(b,{}):(0,L.jsx)(h,{})})})}function Z(){let{text:e,visible:t}=s(),n=()=>{t?o.timerSecondarySource(null):o.timerSecondarySource(`secondary`)};return(0,L.jsx)(R,{label:`Secondary Message`,placeholder:`Message shown as secondary text in stage timer`,text:e,visible:t,changeHandler:e=>o.secondaryMessage(e),children:(0,L.jsx)(T,{"aria-label":`Toggle secondary message visibility`,onClick:n,variant:t?`primary`:`subtle`,children:t?(0,L.jsx)(b,{}):(0,L.jsx)(h,{})})})}var Q={blink:`_blink_9ahya_1`,fourtyfive:`_fourtyfive_9ahya_13`,growPanel:`_growPanel_9ahya_17`,contentLayout:`_contentLayout_9ahya_21`},$=(0,F.memo)(ee);function ee(){let e=window.location.pathname.includes(`/messagecontrol`);return(0,L.jsx)(A,{permission:`editor`,children:(0,L.jsxs)(j,{className:Q.growPanel,"data-testid":`panel-messages-control`,children:[!e&&(0,L.jsx)(P,{onClick:e=>w(`messagecontrol`,e)}),e&&(0,L.jsx)(O,{suppressSettings:!0,isNavigationLocked:y()}),(0,L.jsx)(`div`,{className:Q.contentLayout,children:(0,L.jsx)(k,{children:(0,L.jsx)(Y,{})})})]})})}export{$ as default}; //# sourceMappingURL=MessageControlExport-D2ZmM_Yg.js.map