@getontime/cli
Version:
Time keeping for live events
2 lines • 20.7 kB
JavaScript
(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]=`3367c41d-c5b9-4439-92b0-6590176032f2`,e._sentryDebugIdIdentifier=`sentry-dbid-3367c41d-c5b9-4439-92b0-6590176032f2`)}catch{}})();import{a as e,n as t,t as n}from"./jsx-runtime-BNC90REB.js";import{Ft as r,Kt as i,Pt as a,k as o}from"./useSocket-B9-0Z7zf.js";import{C as s,a as c,n as l,r as u,s as d}from"./Button-CsttsbOH.js";import{t as f}from"./Tooltip-DJ2_sn6r.js";import{y as p}from"./useIsSmallScreen-Db4lRgi0.js";import"./Select-CujoWFOD.js";import{Bt as m,It as h,K as g,Kt as _,Q as v,Yt as y,at as b,en as x,mt as S}from"./constants-8b9Q9Bj6.js";import"./SwatchPicker-C0WK8dMM.js";import{t as C}from"./viewParamsEditor.store-BcLRa99Z.js";import{t as w}from"./useFadeOutOnInactivity-u16Uck_y.js";import{c as T}from"./useRundown-BubT2Cyp.js";import{r as E}from"./Input-D-3bhaHU.js";import{t as D}from"./PresetContext-DZh_OrO5.js";import{t as O}from"./viewOptions-z3iLoQCB.js";import{a as k,s as A}from"./index-qU8RbaVt.js";import"./Info-QUjDr4I8.js";import"./Empty-CSL3pipV.js";import{i as j,n as M,o as N,t as ee}from"./ViewParamsEditor-ZtF4EeBG.js";import{i as P,n as te}from"./viewUtils-CulstVIy.js";import{t as F}from"./useWindowTitle-Dvj2xEXy.js";import{t as ne}from"./useCustomFields-BMD3tm-0.js";import{t as I}from"./viewLoader.utils-BLkafrJE.js";import{a as re,i as L,n as R,r as z,t as B}from"./KeyboardShortcuts-Bd2_HD9N.js";var ie=k(),V=e(t(),1),ae=1.1;function oe(e,t){return W(Math.round(e*ae**t),12,400)}var H=8,U=.5;function W(e,t,n){return Number.isNaN(e)?t:Math.min(Math.max(e,t),n)}function G(e){return W(e,1,40)}function K(e,t){return e/60*t}function q(e){return!Number.isFinite(e)||e<0?0:Math.min(e,100)/1e3}function se(e,t,n,r){let i=e+t*n;return{position:i,atEnd:r>0&&i>=r}}function ce(e,t,n){if(n<=0)return e;let r=t+(e-t)*Math.exp(-H*n);return Math.abs(r-t)<U?t:r}var J=n();function le({isRunning:e,speed:t,canReengageFollow:n,atEnd:r,controller:i,onToggleHelp:a}){let o=w(!0),s=e=>t=>{t.detail>0&&t.currentTarget.blur(),e()};return(0,J.jsxs)(`div`,{className:g([`teleprompter__controls`,!o&&`teleprompter__controls--idle`]),children:[(0,J.jsx)(f,{text:e?`Pause (Space)`:`Play (Space)`,render:(0,J.jsx)(E,{variant:`subtle-white`,size:`large`,onClick:s(i.togglePlay),"data-testid":`teleprompter-play`,"aria-label":e?`Pause`:`Play`}),children:e?(0,J.jsx)(_,{}):(0,J.jsx)(y,{})}),(0,J.jsx)(f,{text:`Slow down (Left arrow)`,render:(0,J.jsx)(E,{variant:`subtle-white`,size:`large`,onClick:s(()=>i.changeSpeed(-1)),"aria-label":`Slow down`}),children:(0,J.jsx)(x,{})}),(0,J.jsxs)(`div`,{className:`teleprompter__speed`,"data-testid":`teleprompter-speed`,children:[t,(0,J.jsx)(`span`,{className:`teleprompter__speed-unit`,children:`lpm`})]}),(0,J.jsx)(f,{text:`Speed up (Right arrow)`,render:(0,J.jsx)(E,{variant:`subtle-white`,size:`large`,onClick:s(()=>i.changeSpeed(1)),"aria-label":`Speed up`}),children:(0,J.jsx)(v,{})}),(0,J.jsx)(f,{text:`Rewind to the top (Home)`,render:(0,J.jsx)(E,{variant:r?`primary`:`subtle-white`,size:`large`,onClick:s(()=>i.rewind()),"aria-label":`Rewind to top`}),children:(0,J.jsx)(b,{})}),(0,J.jsx)(f,{text:n?`Jump back to the loaded event and follow it again (L)`:`Following the loaded event`,render:(0,J.jsx)(E,{variant:n?`primary`:`subtle-white`,size:`large`,disabled:!n,onClick:s(i.reengageFollow),"data-testid":`teleprompter-follow`,"aria-label":`Follow the loaded event`}),children:(0,J.jsx)(m,{})}),(0,J.jsx)(f,{text:`Keyboard shortcuts (?)`,render:(0,J.jsx)(E,{variant:`subtle-white`,size:`large`,onClick:s(a),"aria-label":`Keyboard shortcuts`}),children:(0,J.jsx)(h,{})})]})}function ue({isOpen:e,onClose:t}){return(0,J.jsx)(u,{open:e,onOpenChange:e=>{e||t()},children:(0,J.jsxs)(c,{children:[(0,J.jsx)(s,{className:`teleprompter__help`}),(0,J.jsxs)(d,{className:`teleprompter__help-card`,children:[(0,J.jsxs)(`div`,{className:`teleprompter__help-header`,children:[(0,J.jsx)(l,{className:`teleprompter__help-title`,children:`Prompter shortcuts`}),(0,J.jsx)(E,{variant:`subtle-white`,size:`large`,onClick:t,"aria-label":`Close`,children:(0,J.jsx)(S,{})})]}),(0,J.jsxs)(re,{className:`teleprompter__help-groups`,children:[(0,J.jsxs)(L,{title:`Transport`,children:[(0,J.jsx)(z,{label:`Start / stop scrolling`,children:(0,J.jsx)(B,{keys:[`Space`]})}),(0,J.jsxs)(z,{label:`Slower / faster`,children:[(0,J.jsx)(B,{keys:[`←`]}),(0,J.jsx)(R,{}),(0,J.jsx)(B,{keys:[`→`]})]}),(0,J.jsxs)(z,{label:`Larger speed steps`,children:[(0,J.jsx)(B,{keys:[`Shift`,`←`]}),(0,J.jsx)(R,{}),(0,J.jsx)(B,{keys:[`Shift`,`→`]})]})]}),(0,J.jsxs)(L,{title:`Navigation`,children:[(0,J.jsxs)(z,{label:`Nudge one line`,children:[(0,J.jsx)(B,{keys:[`↑`]}),(0,J.jsx)(R,{}),(0,J.jsx)(B,{keys:[`↓`]})]}),(0,J.jsxs)(z,{label:`Jump a screen`,children:[(0,J.jsx)(B,{keys:[`PgUp`]}),(0,J.jsx)(R,{}),(0,J.jsx)(B,{keys:[`PgDn`]})]}),(0,J.jsxs)(z,{label:`Jump to top / end`,children:[(0,J.jsx)(B,{keys:[`Home`]}),(0,J.jsx)(R,{}),(0,J.jsx)(B,{keys:[`End`]})]}),(0,J.jsx)(z,{label:`Rewind and stop`,children:(0,J.jsx)(B,{keys:[`Esc`]})}),(0,J.jsx)(z,{label:`Follow the loaded event again`,children:(0,J.jsx)(B,{keys:[`L`]})})]}),(0,J.jsxs)(L,{title:`Display`,children:[(0,J.jsxs)(z,{label:`Font size`,children:[(0,J.jsx)(B,{keys:[`+`]}),(0,J.jsx)(R,{}),(0,J.jsx)(B,{keys:[`-`]})]}),(0,J.jsx)(z,{label:`Reset font size`,children:(0,J.jsx)(B,{keys:[`0`]})}),(0,J.jsxs)(z,{label:`Flip horizontally / vertically`,children:[(0,J.jsx)(B,{keys:[`F`]}),(0,J.jsx)(R,{}),(0,J.jsx)(B,{keys:[`Shift`,`F`]})]}),(0,J.jsx)(z,{label:`Show this list`,children:(0,J.jsx)(B,{keys:[`?`]})})]})]})]})]})})}function de(e){"use memo";let t=(0,ie.c)(15),{block:n,registerRef:r}=e,i;t[0]!==n.id||t[1]!==r?(i=e=>r(n.id,e),t[0]=n.id,t[1]=r,t[2]=i):i=t[2];let a=n.isLoaded||void 0,o;t[3]===n.groupTitle?o=t[4]:(o=n.groupTitle&&(0,J.jsx)(`div`,{className:`teleprompter__group`,children:n.groupTitle}),t[3]=n.groupTitle,t[4]=o);let s;t[5]===n.heading?s=t[6]:(s=n.heading&&(0,J.jsx)(`h2`,{className:`teleprompter__heading`,children:n.heading}),t[5]=n.heading,t[6]=s);let c;t[7]===n.text?c=t[8]:(c=(0,J.jsx)(`p`,{className:`teleprompter__body`,children:n.text}),t[7]=n.text,t[8]=c);let l;return t[9]!==i||t[10]!==a||t[11]!==o||t[12]!==s||t[13]!==c?(l=(0,J.jsxs)(`section`,{className:`teleprompter__block`,ref:i,"data-loaded":a,children:[o,s,c]}),t[9]=i,t[10]=a,t[11]=o,t[12]=s,t[13]=c,t[14]=l):l=t[14],l}var Y=[{value:`title`,label:`Title`},{value:`cue`,label:`Cue`},{value:`both`,label:`Cue and title`},{value:`none`,label:`None`}],fe=Y.map(e=>e.value),X={script:`none`,heading:`title`,hideEmpty:!0,showGroups:!0,speed:14,followLoaded:!0,fontSize:52,lineHeight:1.3,textWidth:80,readingLine:!0,readingLinePos:25,flipH:!1,flipV:!1},Z={speed:[1,40],fontSize:[12,400],lineHeight:[1,4],textWidth:[20,100],readingLinePos:[0,100]},pe=e=>{let t=j(e,[{value:`none`,label:`None`},{value:`note`,label:`Note`},{value:`title`,label:`Title`}]);return[{title:M.DataSources,collapsible:!0,options:[{id:`script`,title:`Script`,description:`Select the data source which holds the script to read`,type:`option`,values:t,defaultValue:X.script},{id:`heading`,title:`Segment heading`,description:`What to show above each segment of the script`,type:`option`,values:Y,defaultValue:X.heading}]},{title:M.BehaviourOptions,collapsible:!0,options:[{id:`speed`,title:`Speed`,description:`Scroll speed in lines per minute (1-40). Adjustable live with the arrow keys`,type:`number`,defaultValue:X.speed},{id:`followLoaded`,title:`Follow loaded event`,description:`Scroll to the segment of the loaded event. Scrolling by hand releases the follow`,type:`boolean`,defaultValue:X.followLoaded}]},{title:M.ElementVisibility,collapsible:!0,options:[{id:`hideEmpty`,title:`Hide events without a script`,description:`Prevents showing headings for events which have no script text`,type:`boolean`,defaultValue:X.hideEmpty},{id:`showGroups`,title:`Show group names`,description:`Shows the group name when the script moves into a new group`,type:`boolean`,defaultValue:X.showGroups}]},{title:M.StyleOverride,collapsible:!0,options:[{id:`fontSize`,title:`Font size`,description:`Base font size in pixels. Adjustable live with the + and - keys`,type:`number`,defaultValue:X.fontSize},{id:`lineHeight`,title:`Line height`,description:`Spacing between lines, as a multiple of the font size`,type:`number`,defaultValue:X.lineHeight},{id:`textWidth`,title:`Text width`,description:`Width of the text column as a percentage of the screen. Narrower means less eye movement`,type:`number`,defaultValue:X.textWidth},{id:`readingLine`,title:`Reading line`,description:`Shows a marker beside the line which should be read`,type:`boolean`,defaultValue:X.readingLine},{id:`readingLinePos`,title:`Reading line position`,description:`Position of the reading line as a percentage from the top of the screen`,type:`number`,defaultValue:X.readingLinePos},{id:`flipH`,title:`Flip horizontally`,description:`Mirrors the view horizontally, which is what a beam splitter rig needs. Toggled live with F. Flip Screen in the navigation menu flips both axes at once, which is a rotation rather than a mirror`,type:`boolean`,defaultValue:X.flipH},{id:`flipV`,title:`Flip vertically`,description:`Mirrors the view vertically. Note this also moves the reading line. Toggled live with Shift+F`,type:`boolean`,defaultValue:X.flipV}]}]};function Q(e,[t,n],r){if(e===null||e===``)return r;let i=Number(e);return Number.isFinite(i)?Math.min(Math.max(i,t),n):r}function $(e,t){return e===null?t:P(e)}function me(e,t,n){return t.includes(e)?e:n}function he(e,t){let n=n=>t?.get(n)??e.get(n);return{scriptSource:n(`script`)??X.script,heading:me(n(`heading`),fe,X.heading),hideEmpty:$(n(`hideEmpty`),X.hideEmpty),showGroups:$(n(`showGroups`),X.showGroups),speed:Q(n(`speed`),Z.speed,X.speed),followLoaded:$(n(`followLoaded`),X.followLoaded),fontSize:Q(n(`fontSize`),Z.fontSize,X.fontSize),lineHeight:Q(n(`lineHeight`),Z.lineHeight,X.lineHeight),textWidth:Q(n(`textWidth`),Z.textWidth,X.textWidth),readingLine:$(n(`readingLine`),X.readingLine),readingLinePos:Q(n(`readingLinePos`),Z.readingLinePos,X.readingLinePos),flipH:$(n(`flipH`),X.flipH),flipV:$(n(`flipV`),X.flipV)}}function ge(){let[e]=p(),t=(0,V.use)(D);return(0,V.useMemo)(()=>he(e,t?new URLSearchParams(t.search):void 0),[t,e])}function _e(e,t,n){switch(e){case`cue`:return t;case`title`:return n;case`both`:return[t,n].filter(Boolean).join(` · `);case`none`:return``}}function ve(e,t){return e.startsWith(`custom-`)?t[e.slice(7)]?.type===`text`:!0}function ye(e,t,n,i){let{scriptSource:o,heading:s,hideEmpty:c,showGroups:l}=i;if(o===`none`||!ve(o,n))return[];let u=[],d=null;for(let n of e.flatOrder){let i=e.entries[n];if(!a(i)||i.skip)continue;let f=t[n],p=te(i,o,e.entries)?.trim()??``;if(c&&!p)continue;let m=f?.groupId??null,h=null;if(l&&m&&m!==d){let t=e.entries[m];h=r(t)?t.title:null}d=m,u.push({id:n,heading:_e(s,i.cue,i.title),text:p,groupTitle:h,isLoaded:!!f?.isLoaded})}return u}function be(e,t,n){return{flipH:e!==n,flipV:t!==n}}var xe=400;function Se({speed:e,fontSize:t,flipH:n,flipV:r}){let[,i]=p(),a=!!(0,V.use)(D);(0,V.useEffect)(()=>{if(a)return;let o=setTimeout(()=>{let a={speed:e===X.speed?null:String(e),fontSize:t===X.fontSize?null:String(t),flipH:n===X.flipH?null:String(n),flipV:r===X.flipV?null:String(r)};i(e=>{let t=new URLSearchParams(e);for(let[e,n]of Object.entries(a))n===null?t.delete(e):t.set(e,n);return t},{replace:!0})},xe);return()=>clearTimeout(o)},[n,r,t,a,i,e])}function Ce(e){if(e.ctrlKey||e.metaKey||e.altKey)return null;switch(e.code){case`Space`:return e.repeat?null:{type:`togglePlay`};case`ArrowDown`:return{type:`nudge`,lines:1};case`ArrowUp`:return{type:`nudge`,lines:-1};case`PageDown`:return{type:`page`,direction:1};case`PageUp`:return{type:`page`,direction:-1};case`ArrowRight`:return{type:`speed`,delta:e.shiftKey?5:1};case`ArrowLeft`:return{type:`speed`,delta:e.shiftKey?-5:-1};case`Home`:return{type:`rewind`};case`End`:return{type:`jumpToEnd`};case`Escape`:return{type:`rewindAndPause`}}switch(e.key){case`?`:return{type:`toggleHelp`};case`+`:case`=`:return{type:`fontSize`,steps:1};case`-`:case`_`:return{type:`fontSize`,steps:-1};case`0`:return{type:`resetFontSize`}}let t=e.key.toLowerCase();return t===`f`?{type:`flip`,axis:e.shiftKey?`v`:`h`}:t===`l`?{type:`reengageFollow`}:null}var we=new Set([`INPUT`,`TEXTAREA`,`SELECT`]);function Te(e){let t=(0,V.useRef)(e);(0,V.useEffect)(()=>{t.current=e}),(0,V.useEffect)(()=>{function e(e){let{controller:n,onFlip:r,onFontSize:i,onResetFontSize:a,onToggleHelp:o}=t.current;switch(e.type){case`togglePlay`:return n.togglePlay();case`nudge`:return n.nudge(e.lines);case`page`:return n.page(e.direction);case`speed`:return n.changeSpeed(e.delta);case`rewind`:return n.rewind();case`rewindAndPause`:return n.rewind(!0);case`jumpToEnd`:return n.jumpToEnd();case`reengageFollow`:return n.reengageFollow();case`flip`:return r(e.axis);case`fontSize`:return i(e.steps);case`resetFontSize`:return a();case`toggleHelp`:return o()}}function n(n){let r=n.target;if(r&&(we.has(r.tagName)||r.isContentEditable)||C.getState().isOpen||t.current.isHelpOpen)return;let i=Ce(n);i&&(n.preventDefault(),e(i))}return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[])}function Ee(){let{data:e,rundownMetadata:t,status:n}=T(),{data:r,status:i}=ne();return{data:{rundown:e,rundownMetadata:t,customFields:r},status:I([n,i])}}var De=.85,Oe=2;function ke(e){let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent instanceof HTMLElement?n.offsetParent:null;return t}function Ae({initialSpeed:e,followLoaded:t,selectedEventId:n,readingLinePos:r,blocks:i}){let a=(0,V.useRef)(null),o=(0,V.useRef)(null),s=(0,V.useRef)(new Map),[c,l]=(0,V.useState)(!1),u=(0,V.useCallback)(e=>{a.current=e,l(!!(e&&o.current))},[]),d=(0,V.useCallback)(e=>{o.current=e,l(!!(e&&a.current))},[]),f=(0,V.useRef)(0),p=(0,V.useRef)(0),m=(0,V.useRef)(!1),h=(0,V.useRef)(e),g=(0,V.useRef)(0),_=(0,V.useRef)(0),v=(0,V.useRef)(null),y=(0,V.useRef)(0),[b,x]=(0,V.useState)(!1),[S,C]=(0,V.useState)(e),[w,T]=(0,V.useState)(!1),[E,D]=(0,V.useState)(!1),O=(0,V.useCallback)(e=>{let t=a.current;if(!t)return;Math.abs(t.scrollTop-f.current)>Oe&&(f.current=t.scrollTop,v.current=null);let n=q(e-p.current);p.current=e;let r=f.current;if(y.current!==0&&(r+=y.current,y.current=0,v.current=null),v.current!==null)r=ce(r,v.current,n),r===v.current&&(v.current=null);else if(m.current){let e=K(h.current,g.current),t=se(r,e,n,_.current);r=t.position,t.atEnd&&(m.current=!1,x(!1),D(!0))}let i=W(r,0,_.current);i!==f.current&&(f.current=i,t.scrollTop=i)},[]);(0,V.useEffect)(()=>{p.current=performance.now();let e=requestAnimationFrame(function t(n){O(n),e=requestAnimationFrame(t)});return()=>cancelAnimationFrame(e)},[O]);let k=(0,V.useCallback)(()=>{let e=a.current,t=o.current;if(!e||!t)return;_.current=Math.max(0,e.scrollHeight-e.clientHeight);let n=getComputedStyle(t),r=Number.parseFloat(n.lineHeight);if(Number.isFinite(r)&&r>0)g.current=r;else{let e=Number.parseFloat(n.fontSize);g.current=Number.isFinite(e)?e*1.2:0}},[]);(0,V.useEffect)(()=>{h.current=S},[S]);let[A,j]=(0,V.useState)(e);A!==e&&(j(e),C(e)),(0,V.useEffect)(()=>{k();let e=a.current,t=o.current;if(!e||!t)return;let n=new ResizeObserver(()=>k());return n.observe(e),n.observe(t),()=>n.disconnect()},[k,c]),(0,V.useEffect)(()=>{let e=!1;return document.fonts?.ready.then(()=>{e||k()}),()=>{e=!0}},[k]),(0,V.useEffect)(()=>{let e=()=>{p.current=performance.now()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,V.useEffect)(()=>{if(!t||w||!n)return;let e=a.current,i=s.current.get(n);if(!e||!i)return;let o=e.clientHeight*r/100;v.current=W(ke(i)-ke(e)-o,0,_.current),D(!1)},[n,t,w,r,n!==null&&i.some(e=>e.id===n)]);let M=(0,V.useCallback)(()=>{t&&T(!0)},[t]);return{scrollerRef:u,contentRef:d,registerBlock:(0,V.useCallback)((e,t)=>{t?s.current.set(e,t):s.current.delete(e)},[]),handleUserScroll:M,controller:(0,V.useMemo)(()=>{let e=()=>{_.current>0&&f.current>=_.current||(m.current=!0,x(!0),D(!1))},t=()=>{m.current=!1,x(!1)};return{togglePlay:()=>m.current?t():e(),nudge:e=>{y.current+=e*g.current,D(!1)},page:e=>{let t=a.current;if(!t)return;let n=t.clientHeight*De*e;v.current=W(f.current+n,0,_.current),D(!1)},changeSpeed:e=>C(t=>G(t+e)),rewind:(e=!1)=>{v.current=0,e&&t(),D(!1)},jumpToEnd:()=>{v.current=_.current,_.current>0&&(m.current=!1,x(!1),D(!0))},reengageFollow:()=>T(!1)}},[]),isRunning:b,speed:S,followLocked:w,atEnd:E}}function je(){let{data:e,status:t}=Ee();return F(`Teleprompter`),t===`pending`?(0,J.jsx)(A,{}):t===`error`?(0,J.jsx)(N,{variant:`error`,text:`There was an error fetching data, please refresh the page.`}):(0,J.jsx)(Me,{...e})}function Me(e){"use memo";let t=(0,ie.c)(44),{rundown:n,rundownMetadata:r,customFields:a}=e,s=ge(),c=o(),l=O(Fe),[u,d]=(0,V.useState)(!1),f;t[0]!==s.flipH||t[1]!==s.flipV||t[2]!==s.fontSize?(f={flipH:s.flipH,flipV:s.flipV,fontSize:s.fontSize},t[0]=s.flipH,t[1]=s.flipV,t[2]=s.fontSize,t[3]=f):f=t[3];let p=f,m=`${p.flipH}|${p.flipV}|${p.fontSize}`,[h,_]=(0,V.useState)(p),[v,y]=(0,V.useState)(m);v!==m&&(y(m),_(p));let b;t[4]===a?b=t[5]:(b=pe(a),t[4]=a,t[5]=b);let x=b,S=ye(n,r,a,{scriptSource:s.scriptSource,heading:s.heading,hideEmpty:s.hideEmpty,showGroups:s.showGroups}),{scrollerRef:C,contentRef:w,registerBlock:T,handleUserScroll:E,controller:D,isRunning:k,speed:A,followLocked:j,atEnd:M}=Ae({initialSpeed:s.speed,followLoaded:s.followLoaded,selectedEventId:c,readingLinePos:s.readingLinePos,blocks:S}),P;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>_(t=>{let n=e===`h`?`flipH`:`flipV`;return{...t,[n]:!t[n]}}),t[6]=P):P=t[6];let te=P,F;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>_(t=>({...t,fontSize:oe(t.fontSize,e)})),t[7]=F):F=t[7];let ne=F,I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>_(Pe),t[8]=I):I=t[8];let re=I,L;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>d(Ne),t[9]=L):L=t[9];let R=L,z;t[10]!==h.flipH||t[11]!==h.flipV||t[12]!==h.fontSize||t[13]!==A?(z={speed:A,fontSize:h.fontSize,flipH:h.flipH,flipV:h.flipV},t[10]=h.flipH,t[11]=h.flipV,t[12]=h.fontSize,t[13]=A,t[14]=z):z=t[14],Se(z);let B;t[15]!==D||t[16]!==R||t[17]!==u?(B={controller:D,isHelpOpen:u,onFlip:te,onFontSize:ne,onResetFontSize:re,onToggleHelp:R},t[15]=D,t[16]=R,t[17]=u,t[18]=B):B=t[18],Te(B);let ae=s.scriptSource!==`none`,H,U;if(t[19]!==l||t[20]!==h.flipH||t[21]!==h.flipV||t[22]!==h.fontSize||t[23]!==s.lineHeight||t[24]!==s.readingLinePos||t[25]!==s.textWidth){let e=be(h.flipH,h.flipV,l),n=`${h.fontSize}px`,r=`${s.textWidth}%`,i;t[28]!==s.lineHeight||t[29]!==s.readingLinePos||t[30]!==n||t[31]!==r?(i={"--tp-configured-font-size":n,"--tp-line-height":s.lineHeight,"--tp-text-width":r,"--tp-reading-line":s.readingLinePos},t[28]=s.lineHeight,t[29]=s.readingLinePos,t[30]=n,t[31]=r,t[32]=i):i=t[32],U=i,H=g([`teleprompter`,e.flipH&&`teleprompter--flip-h`,e.flipV&&`teleprompter--flip-v`]),t[19]=l,t[20]=h.flipH,t[21]=h.flipV,t[22]=h.fontSize,t[23]=s.lineHeight,t[24]=s.readingLinePos,t[25]=s.textWidth,t[26]=H,t[27]=U}else H=t[26],U=t[27];let W;t[33]===x?W=t[34]:(W=(0,J.jsx)(ee,{target:i.Teleprompter,viewOptions:x}),t[33]=x,t[34]=W);let G=ae?S.length===0?(0,J.jsx)(N,{text:`There is no script text in the selected field`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`teleprompter__scroller`,"data-testid":`teleprompter-scroller`,ref:C,onWheel:E,onTouchMove:E,onPointerDown:E,children:(0,J.jsx)(`div`,{className:`teleprompter__content`,ref:w,children:S.map(e=>(0,J.jsx)(de,{block:e,registerRef:T},e.id))})}),(0,J.jsx)(`div`,{className:`teleprompter__dim`}),s.readingLine&&(0,J.jsx)(`div`,{className:`teleprompter__reading-line`,children:(0,J.jsx)(`span`,{className:`teleprompter__reading-marker`})}),(0,J.jsx)(le,{isRunning:k,speed:A,canReengageFollow:j&&s.followLoaded,atEnd:M,controller:D,onToggleHelp:R})]}):(0,J.jsx)(N,{text:`Select which field holds the script in the view options`}),K;t[35]!==R||t[36]!==u?(K=(0,J.jsx)(ue,{isOpen:u,onClose:R}),t[35]=R,t[36]=u,t[37]=K):K=t[37];let q;return t[38]!==W||t[39]!==G||t[40]!==K||t[41]!==H||t[42]!==U?(q=(0,J.jsxs)(`div`,{className:H,style:U,"data-testid":`teleprompter-view`,children:[W,G,K]}),t[38]=W,t[39]=G,t[40]=K,t[41]=H,t[42]=U,t[43]=q):q=t[43],q}function Ne(e){return!e}function Pe(e){return{...e,fontSize:X.fontSize}}function Fe(e){return e.mirror}export{je as default};
//# sourceMappingURL=Teleprompter-GNDeUC1r.js.map