@getontime/cli
Version:
Time keeping for live events
2 lines • 6.17 kB
JavaScript
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./constants-legacy-CvecvM28.js","./errorboundary-legacy-CiQMUIM4.js","./index-legacy-NWDCUII5.js","./EditorUtils-legacy-CWdX_BN4.js","./viewUtils-legacy-djI28uVO.js","./useAnimatedProgress-legacy-Dqk_a2jt.js","./MultiPartProgressBar-legacy-8W5o43nz.js","./timer.utils-legacy-CQShK8iX.js","./presentation.utils-legacy-Cz-JncTB.js"],function(e,t){var i,n,r,o,a,s,c,d,l,m,p,u,g,f,h,y,v,x,w,b,j,S;function E({viewSettings:e}){const{eventNow:t,message:i,time:o,clock:a,timerTypeNow:s,countToEndNow:c,auxTimer:b}=n(),j=h(i.timer),{showFinished:E,showWarning:k,showDanger:C}=v(s,c,o.phase,!1,"",!1),I=y(o.playback),N=p(s),P=g(o.duration,o.addedTime),T=l(d(!1,s,a,o,s),s,"min",{removeSeconds:!1,removeLeadingZero:!1}),D=u(i,"aux1"===i.timer.secondarySource?b.aux1:"aux2"===i.timer.secondarySource?b.aux2:"aux3"===i.timer.secondarySource?b.aux3:null,"min",!1,!0,!1),R=w(e,void 0,k,C),U=f(T,D),_={...R&&{"--timer-colour":R}};return(0,S.jsxs)("div",{className:r(["pip-timer",E&&"pip-timer--finished"]),style:_,children:[(0,S.jsx)("div",{className:r(["message-overlay",j&&"message-overlay--active"]),children:(0,S.jsx)(x,{mode:"multi",min:12,max:256,className:r(["message",i.timer.blink&&"blink"]),children:i.timer.text})}),(0,S.jsxs)("div",{className:"timer-container",children:[(0,S.jsx)("div",{className:r(["timer",!I&&"timer--paused",E&&"timer--finished"]),style:{fontSize:`${U}vw`},"data-phase":o.phase,children:T}),(0,S.jsx)("div",{className:r(["secondary",!D&&"secondary--hidden"]),children:(0,S.jsx)(x,{mode:"multi",min:12,max:256,children:D})})]}),N&&(0,S.jsx)(m,{className:r(["progress-container",!I&&"progress-container--paused"]),now:o.current,complete:P,eventId:t?.id,normalColor:e.normalColor,warning:t?.timeWarning,warningColor:e.warningColor,danger:t?.timeDanger,dangerColor:e.dangerColor,hideOvertime:!E})]})}return e("default",function(){const{data:e,status:t}=s();return(0,S.jsx)(c,{onClick:"success"===t?async()=>{if(window.documentPictureInPicture.window)return;let t;try{t=await window.documentPictureInPicture.requestWindow()}catch(r){return void console.error("Failed to open Picture-in-Picture:",r)}[...document.styleSheets].forEach(e=>{try{if(e.href){const i=t.document.createElement("link");i.rel="stylesheet",i.href=e.href,t.document.head.appendChild(i)}else if(e.cssRules){const i=t.document.createElement("style");i.textContent=[...e.cssRules].map(e=>e.cssText).join(""),t.document.head.appendChild(i)}}catch(i){console.warn("Stylesheet copy blocked:",i)}});const i=t.document.createElement("div");i.setAttribute("id","pip-root"),i.style.height="100vh",t.document.body.append(i);const n=(0,j.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",()=>{n.unmount()}),n.render((0,S.jsx)(o,{children:(0,S.jsx)(E,{viewSettings:e})}))}:void 0})}),{setters:[function(e){i=e.t},function(e){n=e.I},function(e){r=e.K},function(e){o=e.t},function(e){a=e.P,s=e.i},function(e){c=e.n},function(e){d=e.r,l=e.t},function(e){},function(e){m=e.t},function(e){p=e.c,u=e.i,g=e.l,f=e.n,h=e.o,y=e.r,v=e.s,x=e.u},function(e){w=e.t}],execute:function(){(b=document.createElement("style")).textContent=".blink{animation:1s step-start infinite blink}@keyframes blink{0%{opacity:1}50%{opacity:.2}}.fourtyfive{transform:rotate(45deg)}.mirror{transform:rotate(180deg)}.pip-timer{box-sizing:border-box;color:rgba(255,255,255,.8);background:#101010;flex-direction:column;gap:min(2vh,16px);width:100%;height:100vh;margin:0;padding:0;font-family:Open Sans,Segoe UI,sans-serif;transition:opacity .5s ease-in-out;display:flex;overflow:hidden}.pip-timer--finished{outline-offset:calc(clamp(4px, 1vw, 16px) * -1);outline:max(4px,min(1vw,16px)) solid #fa5656;transition:all .5s}.pip-timer .timer-container{flex-direction:column;flex:1;justify-content:center;width:100%;display:flex;overflow:hidden}.pip-timer .timer-container .timer{opacity:1;color:var(--timer-colour,#f6f6f6);text-align:center;letter-spacing:.05em;font-family:Open Sans,Segoe UI,sans-serif;font-weight:600;line-height:.9em;transition-property:font-size;transition-duration:.5s}.pip-timer .timer-container .timer--paused{opacity:.6;transition:all .5s}.pip-timer .timer-container .timer--finished{color:var(--timer-overtime-color-override,#fa5656)}.pip-timer .timer-container .timer[data-phase=warning]{color:var(--timer-colour,var(--timer-warning-color-override))}.pip-timer .timer-container .timer[data-phase=danger]{color:var(--timer-colour,var(--timer-danger-color-override))}.pip-timer .timer-container .timer[data-type=none]{opacity:0;transition:all 1s}.pip-timer .secondary{white-space:nowrap;text-align:center;color:rgba(255,255,255,.85);letter-spacing:.5px;border-top:1px solid rgba(255,255,255,.086);height:auto;max-height:100%;margin-top:.125em;padding-top:.125em;padding-bottom:.125em;font-weight:600;line-height:1;transition-property:opacity,height;transition-duration:.5s}.pip-timer .secondary--hidden{opacity:0;height:0}.pip-timer .progress-container{opacity:1;width:100%;margin:0 auto;transition:all .5s}.pip-timer .progress-container--paused{opacity:.6;transition:all .5s}.pip-timer .message-overlay{opacity:0;background:#101010;padding:2vw;transition:opacity .5s;position:fixed;top:0;bottom:0;left:0;right:0}.pip-timer .message-overlay--active{z-index:100;opacity:1}.pip-timer .message{color:rgba(255,255,255,.8);text-align:center;place-content:center;width:100%;height:100%;font-weight:600;display:grid}\n/*$vite$:1*/",document.head.appendChild(b),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"f14ad0099eab1969fdd065b56af5fdd3cf530de6"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a20ad297-ceb7-43a2-b3cc-d51bf65800b1",e._sentryDebugIdIdentifier="sentry-dbid-a20ad297-ceb7-43a2-b3cc-d51bf65800b1")}catch(e){}}(),j=a(),S=i()}}});
//# sourceMappingURL=PipHost-legacy-ByrXHggK.js.map