@getontime/cli
Version:
Time keeping for live events
2 lines • 3.55 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]=`ce8dc6e6-30fe-4e87-b28d-7951fe754826`,e._sentryDebugIdIdentifier=`sentry-dbid-ce8dc6e6-30fe-4e87-b28d-7951fe754826`)}catch{}})();import{t as e}from"./jsx-runtime-BNC90REB.js";import{I as t}from"./useSocket-B9-0Z7zf.js";import{K as n}from"./constants-8b9Q9Bj6.js";import{t as r}from"./errorboundary-BKENFA_Y.js";import{P as i,i as a}from"./index-qU8RbaVt.js";import{n as o}from"./EditorUtils-CCdI8uXK.js";import{r as s,t as c}from"./viewUtils-CulstVIy.js";import"./useAnimatedProgress-DJlteBY2.js";import{t as l}from"./MultiPartProgressBar-B4jgVUIf.js";import{c as u,i as d,l as f,n as p,o as m,r as h,s as g,u as _}from"./timer.utils-DRE1_9vU.js";import{t as v}from"./presentation.utils-Co5R9T_c.js";var y=i(),b=e();function x({viewSettings:e}){let{eventNow:r,message:i,time:a,clock:o,timerTypeNow:y,countToEndNow:x,auxTimer:S}=t(),C=m(i.timer),{showFinished:w,showWarning:T,showDanger:E}=g(y,x,a.phase,!1,``,!1),D=h(a.playback),O=u(y),k=f(a.duration,a.addedTime),A=c(s(!1,y,o,a,y),y,`min`,{removeSeconds:!1,removeLeadingZero:!1}),j=d(i,i.timer.secondarySource===`aux1`?S.aux1:i.timer.secondarySource===`aux2`?S.aux2:i.timer.secondarySource===`aux3`?S.aux3:null,`min`,!1,!0,!1),M=v(e,void 0,T,E),N=p(A,j),P={...M&&{"--timer-colour":M}};return(0,b.jsxs)(`div`,{className:n([`pip-timer`,w&&`pip-timer--finished`]),style:P,children:[(0,b.jsx)(`div`,{className:n([`message-overlay`,C&&`message-overlay--active`]),children:(0,b.jsx)(_,{mode:`multi`,min:12,max:256,className:n([`message`,i.timer.blink&&`blink`]),children:i.timer.text})}),(0,b.jsxs)(`div`,{className:`timer-container`,children:[(0,b.jsx)(`div`,{className:n([`timer`,!D&&`timer--paused`,w&&`timer--finished`]),style:{fontSize:`${N}vw`},"data-phase":a.phase,children:A}),(0,b.jsx)(`div`,{className:n([`secondary`,!j&&`secondary--hidden`]),children:(0,b.jsx)(_,{mode:`multi`,min:12,max:256,children:j})})]}),O&&(0,b.jsx)(l,{className:n([`progress-container`,!D&&`progress-container--paused`]),now:a.current,complete:k,eventId:r?.id,normalColor:e.normalColor,warning:r?.timeWarning,warningColor:e.warningColor,danger:r?.timeDanger,dangerColor:e.dangerColor,hideOvertime:!w})]})}function S(){let{data:e,status:t}=a();return(0,b.jsx)(o,{onClick:t===`success`?async()=>{if(window.documentPictureInPicture.window)return;let t;try{t=await window.documentPictureInPicture.requestWindow()}catch(e){console.error(`Failed to open Picture-in-Picture:`,e);return}[...document.styleSheets].forEach(e=>{try{if(e.href){let n=t.document.createElement(`link`);n.rel=`stylesheet`,n.href=e.href,t.document.head.appendChild(n)}else if(e.cssRules){let n=t.document.createElement(`style`);n.textContent=[...e.cssRules].map(e=>e.cssText).join(``),t.document.head.appendChild(n)}}catch(e){console.warn(`Stylesheet copy blocked:`,e)}});let n=t.document.createElement(`div`);n.setAttribute(`id`,`pip-root`),n.style.height=`100vh`,t.document.body.append(n);let i=(0,y.createRoot)(t.document.getElementById(`pip-root`),{onCaughtError:(e,t)=>console.error(e),onUncaughtError:(e,t)=>console.error(e),onRecoverableError:(e,t)=>console.error(e)});t.addEventListener(`pagehide`,()=>{i.unmount()}),i.render((0,b.jsx)(r,{children:(0,b.jsx)(x,{viewSettings:e})}))}:void 0})}export{S as default};
//# sourceMappingURL=PipHost-CP9svm7c.js.map