@getontime/cli
Version:
Time keeping for live events
4 lines • 67 kB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Timer-DIm2brUR.js","./vendor-DFNUfA2K.js","./vendor-4xP-6xVS.css","./MultiPartProgressBar-BiSyJr2f.js","./getProgress-Dgt_8BYF.js","./MultiPartProgressBar-1_EFIx1M.css","./EmptyPage-dVRQ987V.js","./Empty-BLJKwoJq.js","./Empty-DvR62o5B.css","./EmptyPage-Cgxd2Z6S.css","./TitleCard-Bnxx8KS3.js","./TitleCard-BlCGzVFy.css","./ViewLogo-BhUYUzFU.js","./ViewLogo-Cu9JQggv.css","./ViewParamsEditor-C6i_vUmm.js","./useWindowTitle-Bgl000Se.js","./useWindowTitle-DrFGLRMI.css","./Select-Bp_h4xvR.js","./Select-DdMiS_36.css","./useProjectData-BfKJevmX.js","./useProjectData-Cw1aXCwD.css","./ViewParamsEditor-Bq_-FpWp.css","./viewLoader.utils-CeLIIcNn.js","./viewLoader-Bk5IU6zG.css","./presentation.utils-C6tDFxNi.js","./common.options-CwGs4uxL.js","./validateEvent-d8SZfbc8.js","./playbackstate-DRK4geZP.js","./useCustomFields-C60U2vqf.js","./Timer-DGNfbBKM.css","./Countdown-DP7Joj2L.js","./useRundown-DgZv-crd.js","./useFollowComponent-2C-gde3X.js","./offset-DC4blUxG.js","./FollowButton-DHe0O-J2.js","./FollowButton-Dab8w6zT.css","./Countdown-BunHqgqg.css","./Backstage-CFV0YhNP.js","./Backstage-BlanRQaw.css","./Studio-Cp0DLcHB.js","./Studio-DVDjMRoq.css","./TimelinePage-DdNpQZcV.js","./isNewLatest-Bui5Tm3U.js","./TimelinePage-Rof7fynD.css","./ProjectInfo-DQf4QKCG.js","./ProjectInfo-CTQGba6F.css","./ProtectedEditor-BF76LgsW.js","./ProtectRoute-CmcGN6gV.js","./ProtectRoute-GSFobmAo.css","./DropdownMenu-BV41kjSA.js","./DropdownMenu-ByBDeesm.css","./OverviewWrapper-qXI8MQqb.js","./OverviewWrapper-a18gep4m.css","./useReport-C6WYCwpP.js","./editorSettings-CK-Psf7E.js","./editorSettings-BqHbWs9b.css","./EditorUtils-QotOv0b5.js","./EditorUtils-BXko-IuN.css","./Tooltip-CMnbeNS3.js","./Tooltip-CKb7gU2M.css","./TimeInput-BWc6ixac.js","./parseUserTime-COEUAmmZ.js","./TimeInput-BrVdiuOQ.css","./TimeElements-DystPWQS.js","./TimeElements-UbSD4wx3.css","./Editor.module-DvV2efYs.js","./Editor-B_NlyOLw.css","./ProtectedEditor-BWCKyTjm.css","./ProtectedCuesheet-ClVaU6wv.js","./GroupEditor-Fr9zvH2i.js","./dateConfig-B62K3AL_.js","./GroupEditor-CBhgzn1f.css","./DelayIndicator-BLygKI9P.js","./DelayIndicator-VuYhhwTj.css","./ProtectedCuesheet-DkJchqm1.css","./OperatorExport-DEJRptkl.js","./OperatorExport-QyLn8tmf.css","./EditorFeatureWrapper-C1_-Ls7C.js","./EditorFeatureWrapper-MP8HHRxx.css","./RundownExport-Dz40gwc-.js","./RundownExport-D4xWhbXq.css","./TimerControlExport-BYJGGnXs.js","./TimerControlExport-D8kqHQB0.css","./MessageControlExport-PVFSIYCo.js","./MessageControlExport-DPgqVb-4.css"])))=>i.map(i=>d[i]);
var Bt=Object.defineProperty;var Wt=(e,t,n)=>t in e?Bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ae=(e,t,n)=>Wt(e,typeof t!="symbol"?t+"":t,n);import{c as qt,Q as Vt,a as Ht,u as Kt,i as Qt,b as Gt,d as Jt,r as c,e as E,f as pe,R as Ze,w as Zt,j as o,s as Xt,g as Yt,h as en,k as ge,I as tn,l as nn,m as B,n as on,D as Xe,o as Ye,p as et,q as tt,t as Pe,v as ee,x as nt,y as rn,z as sn,A as an,B as cn,C as ot,E as ln,F as he,G as un,H as dn,J as mn,K as fn,L as pn,M as gn,N as hn,O as le,P as _n,S as vn,T as bn,U as yn,V as xn,W as wn,X as Sn,Y as kn,Z as jn,_ as k,$ as b,a0 as Cn,a1 as En,a2 as In,a3 as Nn,a4 as Rn,a5 as Pn,a6 as Tn}from"./vendor-DFNUfA2K.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb7869ef-a5f1-4ae6-be21-9b473883c036",e._sentryDebugIdIdentifier="sentry-dbid-eb7869ef-a5f1-4ae6-be21-9b473883c036")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();var J=(e=>(e.CountDown="count-down",e.CountUp="count-up",e.Clock="clock",e.None="none",e))(J||{}),j=(e=>(e.Editor="editor",e.Cuesheet="cuesheet",e.Operator="op",e.Timer="timer",e.Backstage="backstage",e.Timeline="timeline",e.StudioClock="studio",e.Countdown="countdown",e.ProjectInfo="info",e))(j||{}),w=(e=>(e.Ping="ping",e.Pong="pong",e.ClientInit="client-init",e.ClientSet="client-set",e.ClientSetPath="client-set-path",e.ClientRename="client-rename",e.ClientRedirect="client-redirect",e.ClientList="client-list",e.Dialog="dialog",e.Log="log",e.RuntimeData="runtime-data",e.Refetch="refetch",e))(w||{}),L=(e=>(e.All="all",e.CustomFields="custom-fields",e.ProjectData="project-data",e.Report="report",e.Rundown="rundown",e.UrlPresets="url-presets",e.ViewSettings="view-settings",e))(L||{}),Z=(e=>(e.Info="INFO",e.Warn="WARN",e.Error="ERROR",e.Severe="SEVERE",e))(Z||{}),g=(e=>(e.Client="CLIENT",e.Playback="PLAYBACK",e.Rx="RX",e.Server="SERVER",e.Tx="TX",e.User="USER",e))(g||{}),rt=(e=>(e.Roll="roll",e.Play="play",e.Pause="pause",e.Stop="stop",e.Armed="armed",e))(rt||{}),te=(e=>(e.Absolute="absolute",e.Relative="relative",e))(te||{}),W=(e=>(e.Start="start",e.Pause="pause",e.Stop="stop",e))(W||{}),ue=(e=>(e.CountUp="count-up",e.CountDown="count-down",e))(ue||{}),st=(e=>(e.None="none",e.Default="default",e.Warning="warning",e.Danger="danger",e.Overtime="overtime",e.Pending="pending",e))(st||{});const Dn={clock:0,timer:{addedTime:0,current:null,duration:null,elapsed:null,expectedFinish:null,phase:st.None,playback:rt.Stop,secondaryTimer:null,startedAt:null},message:{timer:{text:"",visible:!1,blink:!1,blackout:!1,secondarySource:null},secondary:""},rundown:{selectedEventIndex:null,numEvents:0,plannedStart:0,plannedEnd:0,actualStart:null},offset:{absolute:0,relative:0,mode:te.Absolute,expectedFlagStart:null,expectedGroupEnd:null,expectedRundownEnd:null},groupNow:null,eventNow:null,eventNext:null,eventFlag:null,auxtimer1:{current:0,direction:ue.CountUp,duration:0,playback:W.Stop},auxtimer2:{current:0,direction:ue.CountUp,duration:0,playback:W.Stop},auxtimer3:{current:0,direction:ue.CountUp,duration:0,playback:W.Stop},ping:1},$n="4.0.0-alpha.4",pi="https://www.github.com/cpvalente/ontime",gi="https://api.github.com/repos/cpvalente/ontime/releases/latest",hi="https://www.getontime.no",_i="https://discord.com/invite/eje3CSUEXm",vi="https://docs.getontime.no",bi="https://docs.getontime.no/features/custom-fields/",yi="https://github.com/sponsors/cpvalente",xi="https://buymeacoffee.com/cpvalente",wi=$n,On=!0,Ie=window.location.hostname,An=Ie==="localhost"||Ie==="127.0.0.1",Si=!1,Ln=Ie.includes("cloud.getontime.no"),q=Un(),ne=at("http",""),Fn=at("ws","ws");function at(e,t){const n=new URL(window.location.origin);if(e==="ws"){const r=window.location.protocol==="https:";n.protocol=r?"wss":"ws"}n.pathname=q?`${q}/${t}`:t;const s=n.toString();return s.endsWith("/")?s.slice(0,-1):s}function Un(){var n;const t=((n=document.querySelector("base"))==null?void 0:n.getAttribute("href"))??"";return t.endsWith("/")?t.slice(0,-1):t}const Mn=zn(),F=()=>new URLSearchParams(window.location.search).get("n")==="1";function zn(){const e=document.cookie.split("; ").find(t=>t.startsWith("token="));if(e)try{const{scope:t}=JSON.parse(e.split("=")[1]);return t}catch{return"rw"}return"rw"}const Bn=["appinfo"],it=["appSettings"],ki=["appVersion"],ji=["automation"],Le=["customFields"],Wn=["project"],Ci=["projectList"],Ei=["projectRundowns"],Fe=["rundown"],X=["urlpresets"],de=["viewSettings"];const qn=["report"],_e=`${ne}/data`,ct="user",Vn="styles/override.css",Hn=`${ne}/${ct}/${Vn}`,Ii=`${ne}/${ct}/logo`,Y=1e3,V=1e3*60,fe=1e3*60*60,Kn=864e5;function Qn(e,t=J.CountDown){if(e===null)return 0;let n=0;return t===J.CountDown&&(n=Math.ceil(e/Y)),t===J.CountUp&&(n=Math.floor(e/Y)),n===0?0:n}function Gn(e){return Math.floor(e/60)}function Jn(e){return Math.floor(e/3600)}function Ni(e){return e?Math.floor(e%V/Y):0}const Zn=qt("1234567890abcdef",6),lt=()=>Zn();function Xn(e){return String(e).padStart(2,"0")}function ut(e,t){if(e==null)return(t==null?void 0:t.fallback)??"...";const n=e<0,s=Math.abs(Qn(e,t==null?void 0:t.direction)),r=s%60,a=Gn(s)%60,i=Jn(s);return`${n?"-":""}${[i,a,r].map(Xn).join(":")}`}function Ri(e){return e.startsWith("00:0")?e.slice(4):e.startsWith("00:")?e.slice(3):e.startsWith("-00:0")?`-${e.slice(5)}`:e.startsWith("-00:")?`-${e.slice(4)}`:e}function Pi(e){return e.endsWith(":00")?e.slice(0,-3):e}function Ti(e){return e.slice(0,-3)}function Yn(e,t){if(e<0)return;const n=new Date(e),s=n.getUTCHours().toString().padStart(2,"0"),r=n.getUTCHours().toString(),a=n.getUTCMinutes().toString().padStart(2,"0"),i=n.getUTCMinutes().toString(),u=n.getUTCSeconds().toString().padStart(2,"0"),m=n.getUTCSeconds().toString(),_=n.getUTCMilliseconds().toString().padStart(3,"0"),v=(n.getUTCHours()%12||12).toString(),p=v.padStart(2,"0"),I=n.getUTCHours()>=12?"PM":"AM";return eo(t,{HH:s,H:r,hh:p,h:v,mm:a,m:i,ss:u,s:m,S:_,a:I})}function eo(e,t){return Object.keys(t).reduce((n,s)=>{const r=new RegExp(`\\b${s}\\b`,"g");return n.replace(r,t[s])},e)}const T={isOnlyNumbers:/^\d+$/,isIPAddress:/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/,startsWithHttp:/^https?:\/\//,startsWithSlash:/^\//,isAlphanumeric:/^[a-z0-9]+$/i,isAlphanumericWithSpace:/^[a-z0-9_ ]+$/i,isASCII:/^[ -~]+$/,isASCIIorEmpty:/^$|^[ -~]+$/,isNotEmpty:/\S/},to={isOnlyNumbers:e=>T.isOnlyNumbers.test(e),isIPAddress:e=>T.isIPAddress.test(e),startsWithHttp:e=>T.startsWithHttp.test(e),startsWithSlash:e=>T.startsWithSlash.test(e),isAlphanumeric:e=>T.isAlphanumeric.test(e),isAlphanumericWithSpace:e=>T.isAlphanumericWithSpace.test(e),isASCII:e=>T.isASCII.test(e),isASCIIorEmpty:e=>T.isASCIIorEmpty.test(e),isNotEmpty:e=>T.isNotEmpty.test(e)},no=e=>{const t=/^#((?:[a-f\d]{1}){3,4})$/i,n=/^#((?:[a-f\d]{2}){3,4})$/i;return t.test(e)||n.test(e)};function Di(e){return e instanceof Error?e.message:String(e)}function oo(e){const t=e.replace(/[a-zA-Z0-9]/g,n=>/[a-zA-Z]/.test(n)?String.fromCharCode((n<="Z"?90:122)>=(n=n.charCodeAt(0)+13)?n:n-26):String.fromCharCode((n<="4"?57:48)>=(n=n.charCodeAt(0)+5)?n:n-10));return e.startsWith("_")?t.replace("_",""):`_${t}`}function Ue(e){return e.startsWith("_")?oo(e):e}function ro(e,t){const{timeStart:n,dayOffset:s,delay:r}=e,{currentDay:a,totalGap:i,isLinkedToLoaded:u,offset:m,mode:_,actualStart:v,plannedStart:p}=t,I=s-a,ye=Math.max(0,n+r)+I*Kn;let P=0;_===te.Relative&&(P=(v??0)-(p??0));const l=ye+P,oe=l+m;return u?oe:i>m?l:oe-i}function so(e,t,n=.5){const s=n,r=1-s;return{red:Math.round(e.red*s+t.red*r),green:Math.round(e.green*s+t.green*r),blue:Math.round(e.blue*s+t.blue*r),alpha:1}}function dt(e){const t=Math.round(e.alpha*255).toString(16).padStart(2,"0"),n=e.red.toString(16).padStart(2,"0"),s=e.green.toString(16).padStart(2,"0"),r=e.blue.toString(16).padStart(2,"0");return"#"+n+s+r+t}function mt(e){if(e.startsWith("#"))return Me(e);const t=e.toLocaleLowerCase();return t in ze?Me(ze[t]):null}function Me(e){if(!no(e))return null;let t=e.toLocaleLowerCase();t=t.replace(/^#/,"");let n=1;if(t.length===8){const u=t.slice(6,8);n=parseInt(u,16)/255,t=t.slice(0,6)}if(t.length===4){const u=t.slice(3,4).repeat(2);n=parseInt(u,16)/255,t=t.slice(0,3)}t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const s=parseInt(t,16),r=s>>16,a=s>>8&255,i=s&255;return isNaN(r)||isNaN(a)||isNaN(i)||isNaN(n)?null:{red:r,green:a,blue:i,alpha:n}}function ao(e){return(e.red*299+e.green*587+e.blue*114)/1e3>=128}const ze={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd3"},S=new Vt({defaultOptions:{queries:{gcTime:10*V,networkMode:"always",refetchOnWindowFocus:!1,retry:5,retryDelay:e=>e*2500},mutations:{networkMode:Ln?"online":"always"}}}),io=[{url:"timer",label:"Timer"},{url:"backstage",label:"Backstage"},{url:"timeline",label:"Timeline"},{url:"studio",label:"Studio Clock"},{url:"countdown",label:"Countdown"},{url:"info",label:"Project Info"}],ft="h:mm:ss a",pt="HH:mm:ss",gt=(e,t)=>Qt(e,t),H=Ht(()=>({...Dn}),gt),ht=e=>Kt(H,e,gt);function _t(e,t){const n=H.getState();n[e]=t,H.setState({...n})}function co(e){const t=H.getState();H.setState({...t,...e})}const f=e=>()=>ht(e),vt={setIdentify:e=>d("client",e),setRedirect:e=>d("client",e),setClientName:e=>d("client",e)},$i=f(e=>{var t,n;return{playback:e.timer.playback,selectedEventId:((t=e.eventNow)==null?void 0:t.id)??null,nextEventId:((n=e.eventNext)==null?void 0:n.id)??null}}),Oi=f(e=>({blackout:e.message.timer.blackout,blink:e.message.timer.blink,secondarySource:e.message.timer.secondarySource})),Ai=f(e=>({text:e.message.timer.text,visible:e.message.timer.visible})),Li=f(e=>({text:e.message.secondary,visible:e.message.timer.secondarySource==="secondary"})),Fi=f(e=>{var t,n;return{blink:e.message.timer.blink,blackout:e.message.timer.blackout,phase:e.timer.phase,secondarySource:e.message.timer.secondarySource,showTimerMessage:e.message.timer.visible&&!!e.message.timer.text,timerType:((t=e.eventNow)==null?void 0:t.timerType)??null,countToEnd:((n=e.eventNow)==null?void 0:n.countToEnd)??!1}}),Ui={timerText:e=>d("message",{timer:{text:e}}),timerVisible:e=>d("message",{timer:{visible:e}}),secondaryMessage:e=>d("message",{secondary:e}),timerBlink:e=>d("message",{timer:{blink:e}}),timerBlackout:e=>d("message",{timer:{blackout:e}}),timerSecondarySource:e=>d("message",{timer:{secondarySource:e}})},Mi=f(e=>({playback:e.timer.playback,selectedEventIndex:e.rundown.selectedEventIndex,numEvents:e.rundown.numEvents,timerPhase:e.timer.phase})),zi={start:()=>d("start",void 0),pause:()=>d("pause",void 0),roll:()=>d("roll",void 0),startNext:()=>d("start","next"),previous:()=>{d("load","previous")},next:()=>{d("load","next")},stop:()=>{d("stop",void 0)},reload:()=>{d("reload",void 0)},addTime:e=>{d("addtime",e)}},Bi=f(e=>({aux1:e.auxtimer1.current,aux2:e.auxtimer2.current,aux3:e.auxtimer3.current})),Wi=e=>f(t=>e===1?t.auxtimer1.current:e===2?t.auxtimer2.current:t.auxtimer3.current)(),qi=e=>f(t=>e===1?{playback:t.auxtimer1.playback,direction:t.auxtimer1.direction}:e===2?{playback:t.auxtimer2.playback,direction:t.auxtimer2.direction}:{playback:t.auxtimer3.playback,direction:t.auxtimer3.direction})(),Vi={start:e=>d("auxtimer",{[e]:W.Start}),pause:e=>d("auxtimer",{[e]:W.Pause}),stop:e=>d("auxtimer",{[e]:W.Stop}),setDirection:(e,t)=>d("auxtimer",{[e]:{direction:t}}),setDuration:(e,t)=>d("auxtimer",{[e]:{duration:t}})},Hi=f(e=>{var t;return{selectedEventId:((t=e.eventNow)==null?void 0:t.id)??null}}),Ki=f(e=>{var t;return{currentGroupId:((t=e.groupNow)==null?void 0:t.id)??null}}),Qi={loadEvent:e=>d("load",{id:e}),startEvent:e=>d("start",{id:e}),start:()=>d("start",void 0),pause:()=>d("pause",void 0)},Gi=f(e=>({...e.timer})),Ji=f(e=>({clock:e.clock})),Zi=f(e=>{var t;return{id:((t=e.eventFlag)==null?void 0:t.id)??null,expectedStart:e.offset.expectedFlagStart}}),Xi=f(e=>{var t,n;return{current:e.timer.current,duration:e.timer.duration,timeWarning:((t=e.eventNow)==null?void 0:t.timeWarning)??null,timeDanger:((n=e.eventNow)==null?void 0:n.timeDanger)??null}}),Yi=f(e=>({plannedStart:e.rundown.plannedStart,actualStart:e.rundown.actualStart,plannedEnd:e.rundown.plannedEnd,expectedEnd:e.offset.expectedRundownEnd})),ec=f(e=>({playback:e.timer.playback,clock:e.clock,numEvents:e.rundown.numEvents,selectedEventIndex:e.rundown.selectedEventIndex,offset:e.offset.mode===te.Absolute?e.offset.absolute:e.offset.relative,groupExpectedEnd:e.offset.expectedGroupEnd})),tc=f(e=>({clock:e.clock,offset:e.offset.absolute})),lo=f(e=>{var t;return{offset:e.offset.mode===te.Absolute?e.offset.absolute:e.offset.relative,mode:e.offset.mode,currentDay:((t=e.eventNow)==null?void 0:t.dayOffset)??0,actualStart:e.rundown.actualStart,plannedStart:e.rundown.plannedStart,clock:e.clock}}),nc=f(e=>{var t;return{currentDay:((t=e.eventNow)==null?void 0:t.dayOffset)??0}}),oc=f(e=>({offset:e.offset.absolute})),rc=f(e=>({ping:e.ping})),uo=f(e=>({isOnline:e.ping>0})),sc=f(e=>({offsetMode:e.offset.mode})),ac=e=>d("offsetmode",e),ic=()=>ht(t=>({playback:t.timer.playback})),cc=f(e=>{var t,n;return{eventNext:e.eventNext,eventNow:e.eventNow,message:e.message,time:e.timer,clock:e.clock,timerTypeNow:((t=e.eventNow)==null?void 0:t.timerType)??J.CountDown,countToEndNow:((n=e.eventNow)==null?void 0:n.countToEnd)??!1,auxTimer:{aux1:e.auxtimer1.current,aux2:e.auxtimer2.current,aux3:e.auxtimer3.current}}}),lc=f(e=>({playback:e.timer.playback,current:e.timer.current,clock:e.clock})),uc=f(e=>{var t;return{eventNext:e.eventNext,eventNow:e.eventNow,rundown:e.rundown,selectedEventId:((t=e.eventNow)==null?void 0:t.id)??null,time:e.timer}}),dc=f(e=>({clock:e.clock,playback:e.timer.playback})),mc=f(e=>({eventNext:e.eventNext,eventNow:e.eventNow,message:e.message,time:e.timer,offset:e.offset,rundown:e.rundown})),fc=f(e=>({clock:e.clock,offset:e.offset.absolute}));function bt(){const e=new Date;let t=e.getHours()*fe;return t+=e.getMinutes()*V,t+=e.getSeconds()*Y,t+=e.getMilliseconds(),t}function mo(){return new URL(document.location.href).searchParams.get("timeformat")}function fo(){const e=S.getQueryData(it);return(e==null?void 0:e.timeFormat)??"24"}function pc(e,t=ft,n=pt){return e==="12"?t:n}function po(e,t){const n=mo();return n||(fo()==="12"?e:t)}const gc=(e,t,n=po)=>{if(e===null)return"...";const s=n((t==null?void 0:t.format12)??ft,(t==null?void 0:t.format24)??pt),r=Yn(Math.abs(e),s);return`${e<0?"-":""}${r}`};function hc(e,t=!0){if(e<=0)return"0h 0m";const n=Math.floor(e/fe),s=Math.floor(e%fe/V);let r="";if(n>0&&(r+=`${n}h`),s>0&&(r+=`${s}m`),!t){const a=Math.ceil(e%V/Y);a>0&&(r+=`${a}s`)}return r}function _c(e,t){const{offset:n,currentDay:s,mode:r,actualStart:a,plannedStart:i,clock:u}=lo();return e===null?0:ro({...e},{...t,currentDay:s,offset:n,mode:r,actualStart:a,plannedStart:i})-u}const Te=Gt(()=>({logs:[]})),go=()=>Jt(Te),yt=e=>Te.setState(t=>({logs:[e,...t.logs]})),ho=()=>Te.setState({logs:[]});function vc(){const e=c.useCallback((r,a)=>{const i={id:lt(),origin:g.Client,time:ut(bt()),level:a,text:r};d(w.Log,i)},[]),t=c.useCallback(r=>{e(r,Z.Info)},[e]),n=c.useCallback(r=>{e(r,Z.Warn)},[e]),s=c.useCallback(r=>{e(r,Z.Error)},[e]);return{emitInfo:t,emitWarning:n,emitError:s}}function _o(e){var t,n;if(E.isAxiosError(e)){const s=((t=e.response)==null?void 0:t.statusText)??"";let r=((n=e.response)==null?void 0:n.data)??"";return typeof r=="object"&&("message"in r?r=JSON.stringify(r.message):r=JSON.stringify(r)),`${s}: ${r}`}else return e instanceof Error?e.message:typeof e!="string"?JSON.stringify(e):e}function bc(e){return e instanceof Error?e.message:typeof e!="string"?JSON.stringify(e):e}function yc(e,t){const n=`${e}: ${_o(t)}`;yt({id:lt(),origin:"SERVER",time:ut(bt()),level:Z.Error,text:n})}async function Be(){await S.invalidateQueries()}function xc(e,t){return new Blob([e],{type:t})}function wc(e,t){const n=URL.createObjectURL(e),s=document.createElement("a");s.setAttribute("href",n),s.setAttribute("download",t),document.body.appendChild(s),s.click(),URL.revokeObjectURL(n)}function vo(e,t){const n=localStorage.getItem(e);return n?n==="true":(localStorage.setItem(e,String(t)),t)}function bo(e){return q?`${q}-${e}`:e}const xt=bo("client-name");function yo(e){localStorage.setItem(xt,e)}const y=pe(e=>({name:localStorage.getItem(xt)??void 0,setName:t=>e(()=>(yo(t),{name:t})),id:"",setId:t=>e({id:t}),redirect:"",setRedirect:t=>e({redirect:t}),clients:{},setClients:t=>e({clients:t})}));function xo(){return y.getState().name}function We(e){y.getState().setName(e)}function wo(e){y.getState().setId(e)}function qe(){return y.getState().id}function So(e){y.getState().setRedirect(e)}function ko(e){return y.getState().setClients(e)}const jo=pe(e=>({showDialog:null,clearDialog:()=>e({showDialog:null}),setDialog:t=>e({showDialog:t})}));function wt(e){jo.getState().setDialog(e)}let N=null,Ve=null;const Co=1e3;let St=!1,me=0;const kt=()=>{N=new WebSocket(Fn);const e=xo();N.onopen=()=>{clearTimeout(Ve),St=!0,me=0,d(w.ClientSet,{type:"ontime",origin:window.location.origin,path:window.location.pathname+window.location.search,name:e}),Be(),He(!0)},N.onclose=()=>{console.warn("WebSocket disconnected"),Ve=setTimeout(()=>{me>2&&He(!1),console.warn("WebSocket: attempting reconnect"),N&&N.readyState===WebSocket.CLOSED&&(me+=1,kt())},Co)},N.onerror=t=>{console.error("WebSocket error:",t)},N.onmessage=async t=>{try{const n=JSON.parse(t.data),{tag:s,payload:r}=n;if(!s)return;switch(s){case w.Pong:{const a=(new Date().getTime()-new Date(r).getTime())*.5;_t("ping",a);break}case w.ClientInit:{wo(r.clientId),e||We(r.clientName);break}case w.ClientRename:{const a=qe();r.target===a&&We(r.name);break}case w.ClientRedirect:{const a=qe();r.target===a&&So(r.path);break}case w.ClientList:{ko(r);break}case w.Dialog:{r.dialog==="welcome"&&wt("welcome");break}case w.Log:{yt(r);break}case w.RuntimeData:{co(r);break}case w.Refetch:{const{target:a,revision:i}=r;switch(a){case L.All:Be();break;case L.CustomFields:S.invalidateQueries({queryKey:Le});break;case L.ProjectData:S.invalidateQueries({queryKey:Wn});break;case L.Report:S.invalidateQueries({queryKey:qn});break;case L.Rundown:if(i===S.getQueryData(Fe).revision)break;S.invalidateQueries({queryKey:Fe}),S.invalidateQueries({queryKey:Le});break;case L.UrlPresets:S.invalidateQueries({queryKey:X});break;case L.ViewSettings:S.invalidateQueries({queryKey:de});break;default:break}break}default:break}}catch{}}};function d(e,t){N&&N.readyState===WebSocket.OPEN&&N.send(JSON.stringify({tag:e,payload:t}))}function He(e){_t("ping",e?1:-1)}const Eo="_errorContainer_1w7pu_17",Io="_error_1w7pu_17",No="_report_1w7pu_29",re={errorContainer:Eo,error:Io,report:No};class Ke extends Ze.Component{constructor(n){super(n);Ae(this,"reportContent","");this.state={error:null,errorInfo:null}}static getDerivedStateFromError(n){return{errorMessage:n.toString()}}componentDidCatch(n,s){this.setState({error:n,errorInfo:s}),this.reportContent=`${n} ${s.componentStack}`;const r=H.getState();r.ping<0||Zt(a=>{a.setExtras({error:n,store:r,hasSocket:{hasConnected:St,reconnectAttempts:me}});const i=Yt(n);this.setState({eventId:i,info:s})})}render(){return this.state.errorMessage?o.jsx("div",{className:re.errorContainer,"data-testid":"error-container",children:o.jsxs("div",{children:[o.jsx("p",{className:re.error,children:":/"}),o.jsx("p",{children:"Something went wrong"}),o.jsx("div",{role:"button",className:re.report,onClick:()=>Xt({eventId:this.state.eventId}),children:"Report error"}),o.jsx("div",{role:"button",className:re.report,onClick:()=>{var n;((n=window==null?void 0:window.process)==null?void 0:n.type)==="renderer"?window.ipcRenderer.send("reload"):window.location.reload()},children:"Reload interface"})]})}):this.props.children}}const Ro="_overlay_ujow7_17",Po="_name_ujow7_35",To="_message_ujow7_43",xe={overlay:Ro,name:Po,message:To};function Do(){var r;const e=y(a=>a.clients),t=y(a=>a.id);if(!((r=e[t])==null?void 0:r.identify))return null;const s=document.getElementById("identify-portal");return s?en.createPortal(o.jsx($o,{}),s):null}function $o(){var u;const e=y(m=>m.clients),t=y(m=>m.id),n=y(m=>m.name),s=c.useRef(null),{setIdentify:r}=vt,a=(u=e[t])==null?void 0:u.identify,i=c.useCallback(()=>{s.current&&clearTimeout(s.current),r({target:t,identify:!1})},[t,r]);return c.useEffect(()=>(a&&(s.current=setTimeout(i,V)),()=>{s.current&&clearTimeout(s.current)}),[a,t,r,i]),o.jsxs("div",{className:xe.overlay,"data-testid":"identify-overlay",onClick:i,children:[o.jsx("div",{className:xe.name,children:n}),o.jsx("div",{className:xe.message,children:"Click to close"})]})}const De=12e4,Sc={cuesheetMode:"cuesheet-mode",editorMode:"editor-mode"};var Oo=(e=>(e.Run="run",e.Edit="edit",e))(Oo||{});const $e=`${_e}/settings`;async function Ao(){return(await E.get($e)).data}async function kc(e){return E.post($e,e)}async function jc(e){E.post(`${$e}/welcomedialog`,{show:e})}const Lo={version:"4.0.0",serverPort:4001,editorKey:null,operatorKey:null,timeFormat:"24",language:"en"};function jt(){const{data:e,status:t,isFetching:n,isError:s,refetch:r}=ge({queryKey:it,queryFn:Ao,placeholderData:(a,i)=>a,retry:5,retryDelay:a=>a*2500,refetchInterval:De,networkMode:"always",select:a=>{const i={...a};return a.editorKey&&(i.editorKey=Ue(a.editorKey)),a.operatorKey&&(i.operatorKey=Ue(a.operatorKey)),i}});return{data:e??Lo,status:t,isFetching:n,isError:s,refetch:r}}const Fo=c.createContext({editorAuth:!1,operatorAuth:!1,validate:()=>!1}),se={editor:"ontime-editor-entry",operator:"ontime-operator-entry"},Uo=({children:e})=>{const{status:t,data:n}=jt(),[s,r]=c.useState(!0),[a,i]=c.useState(!0);c.useEffect(()=>{if(t==="pending")return;const m=sessionStorage.getItem(se.editor);m&&m===n.editorKey?r(!0):r(n.editorKey==null||n.editorKey==="");const _=sessionStorage.getItem(se.operator);_&&_===n.operatorKey?i(!0):i(n.operatorKey==null||n.operatorKey==="")},[n,t]);const u=c.useCallback((m,_)=>{function v(p,I){return I==null||I===""||p===I}if(_==="editor"){const p=v(m,n.editorKey);return p&&sessionStorage.setItem(se.editor,m),r(p),p}else if(_==="operator"){const p=v(m,n.operatorKey);return p&&sessionStorage.setItem(se.operator,m),i(p),p}return!1},[n]);return o.jsx(Fo.Provider,{value:{editorAuth:s,operatorAuth:a,validate:u},children:e})},Mo={"common.expected_finish":"Erwartetes Ende","common.minutes":"min","common.now":"Jetzt","common.next":"Nächste","common.scheduled_start":"Geplanter beginn","common.scheduled_end":"Geplantes ende","common.expected_start":"Erwartetes beginn","common.expected_end":"Erwartetes ende","common.stage_timer":"Bühnen-Timer","common.started_at":"Gestartet am","common.time_now":"Aktuelle Zeit","common.no_data":"Keine Daten","countdown.ended":"Veranstaltung endete um","countdown.running":"Veranstaltung läuft","countdown.select_event":"Wählen Sie eine Veranstaltung aus, um sie zu verfolgen","countdown.to_start":"Zeit bis zum Start","countdown.waiting":"Warten auf den Veranstaltungsbeginn","countdown.overtime":"überfällig","timeline.live":"live","timeline.done":"Beendet","timeline.due":"fällig","timeline.followedby":"Gefolgt von","project.title":"Titel","project.description":"Beschreibung","project.info":"Projektinfo","project.url":"Projekt-URL"},Ct={"common.expected_finish":"Expected Finish","common.minutes":"min","common.now":"Now","common.next":"Next","common.scheduled_start":"Scheduled start","common.scheduled_end":"Scheduled end","common.expected_start":"Expected start","common.expected_end":"Expected end","common.stage_timer":"Stage Timer","common.started_at":"Started At","common.time_now":"Time now","common.no_data":"No data","countdown.ended":"Event ended at","countdown.running":"Event running","countdown.select_event":"Select an event to follow","countdown.to_start":"Time to start","countdown.waiting":"Waiting for event start","countdown.overtime":"in overtime","timeline.live":"live","timeline.done":"done","timeline.due":"due","timeline.followedby":"Followed by","project.title":"Title","project.description":"Description","project.info":"Project Info","project.url":"Project URL"},zo={"common.expected_finish":"Finalización esperada","common.minutes":"min","common.now":"Ahora","common.next":"Siguiente","common.scheduled_start":"Inicio programado","common.scheduled_end":"Fin programado","common.expected_start":"Inicio previsto","common.expected_end":"Fin previsto","common.stage_timer":"Temporizador de presentador","common.started_at":"Iniciado en","common.time_now":"Ahora","common.no_data":"Sin datos","countdown.ended":"Evento finalizado a las","countdown.running":"Evento en curso","countdown.select_event":"Seleccionar un evento para seguir","countdown.to_start":"Tiempo para comenzar","countdown.waiting":"Esperando el inicio del evento","countdown.overtime":"en tiempo extra","timeline.live":"live","timeline.done":"Terminado","timeline.due":"pendiente","timeline.followedby":"Seguido por","project.title":"Título","project.description":"Descripción","project.info":"Información del proyecto","project.url":"URL del proyecto"},Bo={"common.expected_finish":"Fin estimée à","common.minutes":"min","common.now":"Maintenant","common.next":"A suivre","common.scheduled_start":"Début prévu","common.scheduled_end":"Fin prévue","common.expected_start":"Début projeté","common.expected_end":"Fin projetée","common.stage_timer":"Minuteur de scène","common.started_at":"Commencé à","common.time_now":"Heure","common.no_data":"Aucune donnée","countdown.ended":"Évènement terminé à","countdown.running":"Évènement en cours","countdown.select_event":"Sélectionnez un évènement à suivre","countdown.to_start":"Évènement commence dans","countdown.waiting":"En attente du début de l’évènement","countdown.overtime":"en dépassement","timeline.live":"live","timeline.done":"Terminé","timeline.due":"dû","timeline.followedby":"Suivi de","project.title":"Titre","project.description":"Description","project.info":"Informations du projet","project.url":"URL du projet"},Wo={"common.expected_finish":"Fine Prevista","common.minutes":"min","common.now":"Adesso","common.next":"Prossimo","common.scheduled_start":"Inizio programmato","common.scheduled_end":"Fine programmata","common.expected_start":"Inizio previsto","common.expected_end":"Fine prevista","common.stage_timer":"Orologio Palco","common.started_at":"Iniziato Alle","common.time_now":"Ora attuale","common.no_data":"Nessun dato disponibile","countdown.ended":"Evento finito alle","countdown.running":"Evento in corso","countdown.select_event":"Seleziona un evento da seguire","countdown.to_start":"Tempo alla partenza","countdown.waiting":"In attesa dell'inizio dell'evento","countdown.overtime":"in ritardo","timeline.live":"live","timeline.done":"Terminato","timeline.due":"previsto","timeline.followedby":"Seguito da","project.title":"Titolo","project.description":"Descrizione","project.info":"Informazioni sul progetto","project.url":"URL del progetto"},qo={"common.expected_finish":"Término esperado","common.minutes":"min","common.now":"Agora","common.next":"Próximo","common.scheduled_start":"Início programado","common.scheduled_end":"Fim programado","common.expected_start":"Início previsto","common.expected_end":"Fim previsto","common.stage_timer":"Temporizador do presentador","common.started_at":"Iniciado em","common.time_now":"Hora atual","common.no_data":"Sem dados","countdown.ended":"Evento encerrado às","countdown.running":"Evento em andamento","countdown.select_event":"Selecione um evento para acompanhar","countdown.to_start":"Tempo para iniciar","countdown.waiting":"Aguardando o início do evento","countdown.overtime":"em tempo extra","timeline.live":"live","timeline.done":"Concluído","timeline.due":"Pendente","timeline.followedby":"Seguido por","project.title":"Título","project.description":"Descrição","project.info":"Informações do projeto","project.url":"URL do projeto"},we={en:Ct,es:zo,fr:Bo,it:Wo,de:Mo,pt:qo},Et=c.createContext({getLocalizedString:()=>""}),Vo=({children:e})=>{const{data:t}=jt(),s={getLocalizedString:c.useCallback((r,a=(t==null?void 0:t.language)||"en")=>a in we&&r in we[a]?we[a][r]:Ct[r],[t==null?void 0:t.language])};return o.jsx(Et.Provider,{value:s,children:e})},Cc=()=>{const{getLocalizedString:e}=c.useContext(Et);return{getLocalizedString:e}},Ho=pe(e=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e(t=>({isOpen:!t.isOpen}))}));function Ko(e,t){let n;return(...s)=>{n||(n=setTimeout(()=>{n=null,e(...s)},t))}}const Qo=3e3,It=(e=!1)=>{const[t,n]=c.useState(e);return c.useEffect(()=>{let s=null;const a=Ko(()=>{n(!0),s&&clearTimeout(s),s=setTimeout(()=>n(!1),Qo)},1e3);return document.addEventListener("mousemove",a),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("keydown",a),s&&clearTimeout(s)}},[]),t},Go={red:26,green:26,blue:26},Ec=e=>{if(!e)return{backgroundColor:"#1a1a1a",color:"#fffffa"};const t=mt(e);if(!t)return{backgroundColor:"#1a1a1a",color:"#fffffa"};const n=so(Go,t,1-t.alpha),s=ao(n)?"black":"#fffffa";return{backgroundColor:dt(n),color:s}},x=e=>e.filter(Boolean).join(" "),Ic="–",Nc="––:––:––",Rc="––:––";function Pc(e,t){const n=mt(e);return n?(n.alpha=t,dt(n)):e}const Jo="_blink_bz8cs_1",Zo="_fourtyfive_bz8cs_13",Xo="_mirror_bz8cs_17",Yo="_subtle_bz8cs_21",er="_primary_bz8cs_51",tr="_destructive_bz8cs_66",nr="_ghosted_bz8cs_92",or="_baseIconButton_bz8cs_140",rr="_small_bz8cs_157",sr="_medium_bz8cs_162",ar="_large_bz8cs_167",ir="_xlarge_bz8cs_172",Se={blink:Jo,fourtyfive:Zo,mirror:Xo,subtle:Yo,"subtle-white":"_subtle-white_bz8cs_35",primary:er,destructive:tr,"subtle-destructive":"_subtle-destructive_bz8cs_79",ghosted:nr,"ghosted-white":"_ghosted-white_bz8cs_108","ghosted-destructive":"_ghosted-destructive_bz8cs_124",baseIconButton:or,small:rr,medium:sr,large:ar,xlarge:ir},K=c.forwardRef(({className:e,children:t,variant:n="subtle",size:s="medium",...r},a)=>o.jsx("button",{ref:a,className:x([Se.baseIconButton,Se[n],Se[s],e]),type:"button",...r,children:t}));K.displayName="IconButton";const cr="_fadeable_1nsno_17",lr="_hidden_1nsno_22",ur="_buttonContainer_1nsno_27",ke={fadeable:cr,hidden:lr,buttonContainer:ur};function dr({toggleMenu:e,toggleSettings:t}){const n=It(!0);return o.jsxs("div",{id:"fadeable-navigation",className:x([ke.fadeable,ke.buttonContainer,!n&&ke.hidden]),children:[e&&o.jsx(K,{variant:"subtle-white",size:"xlarge",onClick:e,"aria-label":"toggle menu","data-testid":"navigation__toggle-menu",children:o.jsx(tn,{})}),t&&o.jsx(K,{variant:"subtle-white",size:"xlarge",onClick:t,"aria-label":"toggle settings","data-testid":"navigation__toggle-settings",children:o.jsx(nn,{})})]})}const mr="_fadeable_1yt6p_17",fr="_hidden_1yt6p_22",pr="_lockIcon_1yt6p_27",je={fadeable:mr,hidden:fr,lockIcon:pr};function gr(){const e=It();return o.jsx("div",{className:x([je.fadeable,je.lockIcon,!e&&je.hidden]),children:o.jsx(B,{})})}const hr=pe()(e=>({mirror:vo("view-mirror",!1),toggleMirror:t=>e(n=>{const s=typeof t>"u"?!n.mirror:t;return localStorage.setItem("view-mirror",String(s)),{mirror:s}})})),_r="_blink_1erat_1",vr="_fourtyfive_1erat_13",br="_mirror_1erat_17",yr="_subtle_1erat_21",xr="_primary_1erat_51",wr="_destructive_1erat_66",Sr="_ghosted_1erat_92",kr="_baseButton_1erat_140",jr="_loading_1erat_161",Cr="_content_1erat_164",Er="_loadingOverlay_1erat_174",Ir="_spinner_1erat_180",Nr="_spin_1erat_180",Rr="_small_1erat_190",Pr="_medium_1erat_195",Tr="_large_1erat_200",Dr="_xlarge_1erat_205",$r="_fluid_1erat_210",O={blink:_r,fourtyfive:vr,mirror:br,subtle:yr,"subtle-white":"_subtle-white_1erat_35",primary:xr,destructive:wr,"subtle-destructive":"_subtle-destructive_1erat_79",ghosted:Sr,"ghosted-white":"_ghosted-white_1erat_108","ghosted-destructive":"_ghosted-destructive_1erat_124",baseButton:kr,loading:jr,content:Cr,loadingOverlay:Er,spinner:Ir,spin:Nr,small:Rr,medium:Pr,large:Tr,xlarge:Dr,fluid:$r},C=c.forwardRef(({className:e,children:t,variant:n="subtle",size:s="medium",fluid:r,loading:a,...i},u)=>o.jsxs("button",{ref:u,className:x([O.baseButton,O[n],O[s],r&&O.fluid,a&&O.loading,e]),type:"button",disabled:a||i.disabled,...i,children:[o.jsx("span",{className:O.content,children:t}),a&&o.jsx("div",{className:O.loadingOverlay,children:o.jsx(on,{className:O.spinner})})]}));C.displayName="Button";const Or="_dialog_fu4d0_17",Ar="_backdrop_fu4d0_32",Lr="_title_fu4d0_42",Fr="_body_fu4d0_51",Ur="_footer_fu4d0_59",Q={dialog:Or,backdrop:Ar,title:Lr,body:Fr,footer:Ur};function Mr({isOpen:e,title:t,showCloseButton:n,showBackdrop:s,bodyElements:r,footerElements:a,onClose:i}){return o.jsx(Xe,{open:e,onOpenChange:u=>{u||i()},children:o.jsxs(Ye,{children:[s&&o.jsx(et,{className:Q.backdrop}),o.jsxs(tt,{className:Q.dialog,children:[o.jsxs("div",{className:Q.title,children:[t,n&&o.jsx(K,{variant:"subtle-white",onClick:i,children:o.jsx(Pe,{})})]}),o.jsx("div",{className:Q.body,children:r}),o.jsx("div",{className:Q.footer,children:a})]})]})})}const zr="_blink_1kix8_1",Br="_fourtyfive_1kix8_13",Wr="_input_1kix8_17",qr="_subtle_1kix8_47",Vr="_ghosted_1kix8_51",Hr="_medium_1kix8_56",Kr="_large_1kix8_60",Qr="_fluid_1kix8_64",ae={blink:zr,fourtyfive:Br,input:Wr,subtle:qr,ghosted:Vr,medium:Hr,large:Kr,fluid:Qr},Gr=c.forwardRef(function({className:t,variant:n="subtle",height:s="medium",fluid:r,...a},i){return o.jsx("input",{ref:i,type:"text",autoCorrect:"off",autoComplete:"off",spellCheck:"false",className:x([ae.input,ae[n],ae[s],r&&ae.fluid,t]),...a})});function Jr({id:e,name:t="",isOpen:n,onClose:s}){const[r,a]=c.useState(t),{setClientName:i}=vt,u=()=>{r!==t&&r!==""&&i({target:e,rename:r}),s()},m=r!==t&&r!=="";return o.jsx(Mr,{isOpen:n,title:`Rename Client: ${t}`,showCloseButton:!0,onClose:s,bodyElements:o.jsx(Gr,{height:"large",placeholder:"New name",value:r,onChange:_=>a(_.target.value)}),footerElements:o.jsxs(o.Fragment,{children:[o.jsx(C,{variant:"subtle",size:"large",onClick:s,children:"Cancel"}),o.jsx(C,{variant:"primary",size:"large",onClick:u,disabled:!m,children:"Submit"})]})})}var Je;const Ne=((Je=window.process)==null?void 0:Je.type)==="renderer",z=Ne?window.require("electron").ipcRenderer:null;function Nt(){const e=c.useCallback((t,n)=>{Ne&&z&&z.send(t,n)},[]);return{isElectron:Ne,sendToElectron:e}}function Tc(){const e=ee(),{isElectron:t}=Nt();c.useEffect(()=>(t&&(z.on("request-editor-location",(n,s)=>{e(s,{relative:"route"})}),z.on("dialog",(n,s)=>{s==="welcome"&&wt("welcome")})),()=>{z==null||z.removeAllListeners()}),[t,e])}function Rt(e){var t;((t=window.process)==null?void 0:t.type)==="renderer"?window.ipcRenderer.send("send-to-link",e):window.open(e)}function Zr(e,t,n=ne,s=q){t==null||t.preventDefault();const r=new URL(n);r.pathname=s?`${s}/${e}`:e,Rt(r.toString())}function Xr(e,t,n=ne,s=q){const r=new URL(n);return r.hostname=e,t&&(r.pathname=s?`${s}/${t}`:t),r.toString()}function Yr(e){return e.key==="Enter"}function es(e){return e.key==="Escape"}function Dc(e,t){es(e)&&(e.preventDefault(),e.stopPropagation(),t==null||t())}const ts="_link_pmy0j_17",ns="_current_pmy0j_41",Qe={link:ts,current:ns};function $({active:e,className:t,children:n,onClick:s}){return o.jsx("div",{className:x([Qe.link,e&&Qe.current,t]),tabIndex:0,role:"button",onClick:s,onKeyDown:r=>{Yr(r)&&s()},children:n})}const os="_linkIcon_1wpyp_17",rs={linkIcon:os};function Ce({current:e,to:t,children:n}){const{isElectron:s}=Nt(),r=ee();return s?o.jsxs($,{active:e,onClick:()=>Zr(t),children:[n,o.jsx(nt,{className:rs.linkIcon})]}):o.jsx($,{active:e,onClick:()=>r(`/${t}`),children:n})}function ss(){const{width:e}=rn(),t=sn();return c.useMemo(()=>(t==="ios"||t==="android")&&e<1300,[e,t])}function as(){const e=ee();return ss()?o.jsxs(o.Fragment,{children:[o.jsxs($,{active:location.pathname==="/timercontrol",onClick:()=>e("/timercontrol"),children:[o.jsx(B,{}),"Timer Controls"]}),o.jsxs($,{active:location.pathname==="/messagecontrol",onClick:()=>e("/messagecontrol"),children:[o.jsx(B,{}),"Message Controls"]}),o.jsxs($,{active:location.pathname==="/rundown",onClick:()=>e("/rundown"),children:[o.jsx(B,{}),"Rundown"]})]}):o.jsxs($,{active:location.pathname==="/editor",onClick:()=>e("/editor"),children:[o.jsx(B,{}),"Editor"]})}const Pt=`${_e}/session`;async function is(){return(await E.get(`${Pt}/info`)).data}async function $c(e){return(await E.post(`${Pt}/url`,e)).data.url}const cs={networkInterfaces:[],version:"4.0.0",serverPort:4001,publicDir:""};function ls(){const{data:e,status:t,isError:n,refetch:s,isFetching:r}=ge({queryKey:Bn,queryFn:is,placeholderData:(a,i)=>a,retry:5,retryDelay:a=>a*2500,refetchInterval:De,networkMode:"always"});return{data:e??cs,status:t,isError:n,refetch:s,isFetching:r}}async function us(e){setTimeout(async()=>{var t;return await((t=navigator.clipboard)==null?void 0:t.writeText(e))})}const ds="_blink_35xx6_1",ms="_fourtyfive_35xx6_13",fs="_copytag_35xx6_17",ps="_action_35xx6_22",gs="_label_35xx6_27",hs="_small_35xx6_38",_s="_medium_35xx6_43",vs="_large_35xx6_48",bs="_copy_35xx6_17",G={blink:ds,fourtyfive:ms,copytag:fs,action:ps,label:gs,small:hs,medium:_s,large:vs,copy:bs};function ys({copyValue:e,disabled:t,size:n="medium",children:s,onClick:r}){const[a,i]=c.useState(!1),u=c.useRef(null),m=()=>{us(e),i(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>i(!1),2e3)};return o.jsxs("div",{className:G.copytag,children:[r!==void 0?o.jsx(C,{className:G.action,size:n,onClick:r,disabled:t,children:s}):o.jsx("div",{className:x([G.label,G[n]]),children:s}),o.jsx(K,{className:G.copy,variant:"primary",size:n,onClick:m,disabled:t,children:a?o.jsx(an,{}):o.jsx(cn,{})})]})}const xs="_header_elv9y_17",ws="_interfaces_elv9y_23",Ss="_interfaceCopy_elv9y_30",ks="_goIcon_elv9y_35",ie={header:xs,interfaces:ws,interfaceCopy:Ss,goIcon:ks};function js({currentLocation:e}){var n;const{data:t}=ls();return t.networkInterfaces.length<2?null:o.jsxs(o.Fragment,{children:[o.jsx("div",{className:ie.header,children:"Accessible on external networks"}),o.jsx("div",{className:ie.interfaces,children:(n=t==null?void 0:t.networkInterfaces)==null?void 0:n.map(s=>{if(s.name==="localhost")return null;const r=Xr(s.address,e);return o.jsx(ys,{copyValue:r,onClick:()=>Rt(r),size:"small",children:o.jsxs("span",{className:ie.interfaceCopy,children:[s.address," ",o.jsx(nt,{className:ie.goIcon})]})},s.name)})})]})}const Cs="_separator_1f3q6_17",Es="_backdrop_1f3q6_21",Is="_drawer_1f3q6_31",Ns="_header_1f3q6_60",Rs="_body_1f3q6_70",Ps="_note_1f3q6_75",U={separator:Cs,backdrop:Es,drawer:Is,header:Ns,body:Rs,note:Ps},Ts=c.memo(Ds);function Ds({isOpen:e,onClose:t}){const n=y(p=>p.id),s=y(p=>p.name),[r,a]=ot(!1),{fullscreen:i,toggle:u}=ln(),{mirror:m,toggleMirror:_}=hr(),v=he();return o.jsx(Xe,{open:e,onOpenChange:p=>{p||t()},children:o.jsxs(Ye,{children:[o.jsx(et,{className:U.backdrop}),o.jsx(Jr,{id:n,name:s,isOpen:r,onClose:a.close}),o.jsxs(tt,{className:U.drawer,children:[o.jsxs("div",{className:U.header,children:[o.jsx(un,{children:"Ontime"}),o.jsx(K,{variant:"subtle-white",size:"large",onClick:t,children:o.jsx(Pe,{})})]}),o.jsxs("div",{className:U.body,children:[o.jsxs($,{active:i,onClick:u,children:["Toggle Fullscreen",i?o.jsx(dn,{}):o.jsx(mn,{})]}),o.jsxs($,{active:m,onClick:()=>_(),children:["Flip Screen",o.jsx(fn,{}),m&&o.jsx("span",{className:U.note,children:"Active"})]}),o.jsx($,{onClick:a.open,children:"Rename Client"}),o.jsx("hr",{className:U.separator}),o.jsx(as,{}),o.jsxs(Ce,{to:"cuesheet",current:v.pathname==="/cuesheet",children:[o.jsx(B,{}),"Cuesheet"]}),o.jsxs(Ce,{to:"op",current:v.pathname==="/op",children:[o.jsx(B,{}),"Operator"]}),o.jsx("hr",{className:U.separator}),io.map(p=>o.jsx(Ce,{to:p.url,current:v.pathname===`/${p.url}`,children:p.label},p.url))]}),An&&o.jsx("div",{children:o.jsx(js,{currentLocation:v.pathname})})]})]})})}const D=c.memo($s);function $s({isNavigationLocked:e,suppressSettings:t}){const[n,s]=ot(),{open:r}=Ho();return pn([["Space",()=>{e||s.toggle()},{preventDefault:!0}],["mod + ,",()=>{t||r()},{preventDefault:!0}]]),e&&t?o.jsx(gr,{}):o.jsxs(o.Fragment,{children:[o.jsx(dr,{toggleMenu:e?void 0:s.toggle,toggleSettings:t?void 0:r}),!e&&o.jsx(Ts,{isOpen:n,onClose:s.close})]})}const Os=c.createContext(void 0),As=()=>{const e=ee(),{pathname:t,search:n}=he(),{redirect:s,setRedirect:r}=y(gn(i=>({redirect:i.redirect,setRedirect:i.setRedirect}))),a=uo();c.useEffect(()=>{a&&d(w.ClientSetPath,t+n)},[t,n,a]),c.useEffect(()=>{s!==""&&(r(""),s!==t+n&&e(s,{replace:!0}))},[e,t,s,n,r])},ve=`${_e}/url-presets`;async function Ls(){return(await E.get(ve)).data}async function Fs(e){return(await E.post(ve,e)).data}async function Us(e,t){return(await E.put(`${ve}/${e}`,t)).data}async function Ms(e){return(await E.delete(`${ve}/${e}`)).data}function Oe({skip:e=!1}={}){const{data:t,status:n,isError:s,refetch:r}=ge({queryKey:X,queryFn:Ls,placeholderData:(a,i)=>a,refetchInterval:De,enabled:!e});return{data:t??[],status:n,isError:s,refetch:r}}function Oc(e){const{data:t}=Oe();return{viewPresets:c.useMemo(()=>t.filter(s=>s.target===e),[t,e])}}function Ac(){const e=hn(),t=le({mutationFn:Fs,onSuccess:r=>{e.setQueryData(X,r)}}),n=le({mutationFn:({alias:r,data:a})=>Us(r,a),onSuccess:r=>{e.setQueryData(X,r)}}),s=le({mutationFn:Ms,onSuccess:r=>{e.setQueryData(X,r)}});return{addPreset:t.mutateAsync,updatePreset:(r,a)=>n.mutateAsync({alias:r,data:a}),deletePreset:s.mutateAsync,isMutating:t.isPending||n.isPending||s.isPending,isMutationError:t.isError||n.isError||s.isError}}function zs(e,t){if(Vs(e))return null;const n=`${e.pathname}${e.search}`.substring(1),s=Tt(e),r=new URLSearchParams(e.search).get("token"),a=e.search.includes("n=1");for(const i of t)if(i.enabled&&(i.alias===s||i.target===s)){const u=Bs(i.target,i.search,i.alias,a,r);return Ws(n,u)?null:u}return null}function Tt(e){const n=e.pathname.split("?")[0].split("/").filter(Boolean);return n[0]==="preset"&&n.length>1?n[1]:n[n.length-1]||""}function Bs(e,t,n,s,r){const a=_n(`${e}?${t}`),i=new URLSearchParams(a.search);return i.set("alias",n),s&&i.set("n","1"),r&&i.set("token",r),`${a.pathname}?${i}`.substring(1)}function Ws(e,t){const n=new URL(e,document.location.origin),s=new URL(t,document.location.origin);return n.pathname.startsWith("/preset/")||s.pathname.startsWith("/preset/")?n.pathname===s.pathname:n.pathname!==s.pathname?!1:(n.searchParams.delete("token"),n.searchParams.delete("n"),s.searchParams.delete("token"),s.searchParams.delete("n"),n.searchParams.toString()===s.searchParams.toString())}function Lc(e,t){let n=t;to.startsWithHttp(t.toLowerCase())||(n=`http://${n}`);const s=new URL(n),r=Tt(s);if(!qs(r))throw new Error(`Invalid target view: ${r}`);return{alias:e,target:r,search:s.searchParams.toString(),enabled:!0}}function qs(e){return e!==j.Editor&&Object.values(j).includes(e)}function Vs(e){return e.pathname.split("/").filter(Boolean)[0]==="preset"}const Hs="_blink_9yv90_1",Ks="_fourtyfive_9yv90_13",Qs="_header_9yv90_17",Gs="_subheader_9yv90_24",Js="_title_9yv90_33",Zs="_section_9yv90_43",Xs="_indent_9yv90_44",Ys="_paragraph_9yv90_63",ea="_card_9yv90_67",ta="_highlight_9yv90_75",na="_blockquote_9yv90_81",oa="_error_9yv90_87",ra="_pad_9yv90_93",sa="_table_9yv90_99",aa="_listGroup_9yv90_131",ia="_listItem_9yv90_138",ca="_fieldTitle_9yv90_146",la="_fieldDescription_9yv90_151",ua="_fieldError_9yv90_156",da="_divider_9yv90_161",ma="_overlay_9yv90_167",fa="_loader_9yv90_178",pa="_animloader_9yv90_1",ga="_empty_9yv90_188",ha="_inlineElements_9yv90_201",_a="_inner_9yv90_205",va="_component_9yv90_208",ba="_start_9yv90_211",ya="_end_9yv90_214",xa="_apart_9yv90_217",h={blink:Hs,fourtyfive:Ks,header:Qs,subheader:Gs,title:Js,section:Zs,indent:Xs,paragraph:Ys,card:ea,highlight:ta,blockquote:na,error:oa,pad:ra,table:sa,listGroup:aa,listItem:ia,fieldTitle:ca,fieldDescription:la,fieldError:ua,divider:da,overlay:ma,loader:fa,animloader:pa,empty:ga,inlineElements:ha,inner:_a,component:va,start:ba,end:ya,apart:xa};function Fc({children:e}){return o.jsx("h2",{className:h.header,children:e})}function Uc({children:e}){return o.jsx("h3",{className:h.subheader,children:e})}function Mc({children:e}){return o.jsx("h4",{className:h.title,children:e})}function zc({as:e,className:t,children:n,...s}){const r=e??"div";return o.jsx(r,{className:x([h.section,t]),...s,children:n})}function Bc({as:e,className:t,children:n,...s}){const r=e??"div";return o.jsx(r,{className:x([h.indent,t]),...s,children:n})}function Wc({children:e}){return o.jsx("p",{className:h.paragraph,children:e})}function qc({children:e,className:t,...n}){return o.jsx("div",{className:x([h.card,t]),...n,children:e})}function Vc({className:e,children:t}){return o.jsx("div",{className:h.pad,children:o.jsx("table",{className:x([h.table,e]),children:t})})}function Hc({label:e,handleClick:t}){return o.jsx("tr",{className:h.empty,children:o.jsxs("td",{colSpan:99,children:[o.jsx("div",{children:e??"No data yet"}),t&&o.jsxs(C,{onClick:t,disabled:!t,variant:"primary",children:["New ",o.jsx(vn,{})]})]})})}function Kc({className:e,children:t}){return o.jsx("ul",{className:x([h.listGroup,e]),children:t})}function Qc({children:e}){return o.jsx("li",{className:h.listItem,children:e})}function Gc({title:e,description:t,error:n}){return o.jsxs("div",{className:h.fieldTitle,children:[e,n&&o.jsx(Sa,{children:n}),!n&&t&&o.jsx(wa,{children:t})]})}function wa({children:e}){return o.jsx("div",{className:h.fieldDescription,children:e})}function Jc({children:e}){return o.jsx("code",{className:h.highlight,children:e})}function Sa({children:e,className:t}){return o.jsx("div",{className:x([h.fieldError,t]),children:e})}function Zc(){return o.jsx("hr",{className:h.divider})}function Xc({isLoading:e}){return e?o.jsx("div",{className:h.overlay,children:o.jsx("div",{className:h.loader})}):null}function ka({children:e,as:t,relation:n="component",align:s="start",className:r}){const a=t??"div";return o.jsx(a,{className:x([h.inlineElements,h[n],h[s],r]),children:e})}const ja="_blink_hxuk5_1",Ca="_fourtyfive_hxuk5_13",Ea="_log_hxuk5_17",Ia="_apart_hxuk5_27",Na="_logEntry_hxuk5_31",Ra="_INFO_hxuk5_34",Pa="_WARN_hxuk5_37",Ta="_ERROR_hxuk5_40",Da="_time_hxuk5_46",$a="_origin_hxuk5_49",Oa="_msg_hxuk5_52",Aa="_buttonBar_hxuk5_56",A={blink:ja,fourtyfive:Ca,log:Ea,apart:Ia,logEntry:Na,INFO:Ra,WARN:Pa,ERROR:Ta,time:Da,origin:$a,msg:Oa,buttonBar:Aa};function La(){const{logs:e}=go(),[t,n]=c.useState(!0),[s,r]=c.useState(!0),[a,i]=c.useState(!0),[u,m]=c.useState(!0),[_,v]=c.useState(!0),[p,I]=c.useState(!0),R=[];p&&R.push(g.User),t&&R.push(g.Client),s&&R.push(g.Server),a&&R.push(g.Rx),u&&R.push(g.Tx),_&&R.push(g.Playback);const ye=e.filter(l=>R.some(oe=>l.origin===oe)),P=c.useCallback(l=>{l===g.User?I(!0):I(!1),l===g.Client?n(!0):n(!1),l===g.Server?r(!0):r(!1),l===g.Rx?i(!0):i(!1),l===g.Tx?m(!0):m(!1),l===g.Playback?v(!0):v(!1)},[]);return o.jsxs(o.Fragment,{children:[o.jsxs(ka,{className:A.buttonBar,children:[o.jsx(C,{variant:p?"primary":"subtle",size:"small",onClick:()=>I(l=>!l),onAuxClick:()=>P(g.User),onContextMenu:l=>l.preventDefault(),children:g.User}),o.jsx(C,{variant:t?"primary":"subtle",size:"small",onClick:()=>n(l=>!l),onAuxClick:()=>P(g.Client),onContextMenu:l=>l.preventDefault(),children:g.Client}),o.jsx(C,{variant:s?"primary":"subtle",size:"small",onClick:()=>r(l=>!l),onAuxClick:()=>P(g.Server),onContextMenu:l=>l.preventDefault(),children:g.Server}),o.jsx(C,{variant:_?"primary":"subtle",size:"small",onClick:()=>v(l=>!l),onAuxClick:()=>P(g.Playback),onContextMenu:l=>l.preventDefault(),children:g.Playback}),o.jsx(C,{variant:a?"primary":"subtle",size:"small",onClick:()=>i(l=>!l),onAuxClick:()=>P(g.Rx),onContextMenu:l=>l.preventDefault(),children:g.Rx}),o.jsx(C,{variant:u?"primary":"subtle",size:"small",onClick:()=>m(l=>!l),onAuxClick:()=>P(g.Tx),onContextMenu:l=>l.preventDefault(),children:g.Tx}),o.jsxs(C,{variant:"subtle-destructive",size:"small",onClick:ho,className:A.apart,children:[o.jsx(Pe,{})," Clear"]})]}),o.jsx("ul",{className:A.log,children:ye.map(l=>o.jsxs("li",{className:`${A.logEntry} ${A[l.level]} `,children:[o.jsx("span",{className:A.time,children:l.time}),o.jsx("span",{className:A.origin,children:l.origin}),o.jsx("span",{className:A.msg,children:l.text})]},l.id))})]})}const Fa="_loader_vno17_21",Ua="_ellipsis_vno17_28",Ge={loader:Fa,ellipsis:Ua};function be(){return o.jsx("div",{className:Ge.loader,children:o.jsxs("div",{className:Ge.ellipsis,children:[o.jsx("div",{}),o.jsx("div",{}),o.jsx("div",{}),o.jsx("div",{})]})})}const Ma=e=>c.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:275,height:275,fill:"none",viewBox:"0 0 275 275",...e},c.createElement("path",{fill:"#4D4D4D",d:"M49.83 133.919c0-18.343 3.531-34.692 10.595-49.048 7.064-14.355 17.204-25.464 30.42-33.325 13.33-7.861 28.768-11.792 46.313-11.792 24.952 0 45.288 7.633 61.011 22.9 15.837 15.267 24.666 36.003 26.489 62.207l.342 12.647c0 28.369-7.918 51.155-23.755 68.359-15.836 17.09-37.085 25.635-63.745 25.635-26.66 0-47.965-8.545-63.916-25.635-15.836-17.09-23.755-40.332-23.755-69.726v-2.222zm49.389 3.589c0 17.545 3.304 30.989 9.912 40.332 6.608 9.228 16.064 13.843 28.369 13.843 11.963 0 21.305-4.558 28.028-13.672 6.722-9.229 10.083-23.926 10.083-44.092 0-17.204-3.361-30.534-10.083-39.99-6.723-9.457-16.179-14.185-28.37-14.185-12.076 0-21.419 4.728-28.027 14.185-6.608 9.342-9.912 23.869-9.912 43.579z"}),c.createElement("mask",{id:"a",width:177,height:193,x:49,y:39,maskUnits:"userSpaceOnUse"},c.createElement("path",{fill:"#fff",d:"M49.83 133.919c0-18.343 3.531-34.692 10.595-49.048 7.064-14.355 17.204-25.464 30.42-33.325 13.33-7.861 28.768-11.792 46.313-11.792 24.952 0 45.288 7.633 61.011 22.9 15.837 15.267 24.666 36.003 26.489 62.207l.342 12.647c0 28.369-7.918 51.155-23.755 68.359-15.836 17.09-37.085 25.635-63.745 25.635-26.66 0-47.965-8.545-63.916-25.635-15.836-17.09-23.755-40.332-23.755-69.726v-2.222zm49.389 3.589c0 17.545 3.304 30.989 9.912 40.332 6.608 9.228 16.064 13.843 28.369 13.843 11.963 0 21.305-4.558 28.028-13.672 6.722-9.229 10.083-23.926 10.083-44.092 0-17.204-3.361-30.534-10.083-39.99-6.723-9.457-16.179-14.185-28.37-14.185-12.076 0-21.419 4.728-28.027 14.185-6.608 9.342-9.912 23.869-9.912 43.579z"})),c.createElement("g",{mask:"url(#a)"},c.createElement("path",{fill:"url(#paint0_linear)",d:"M19.07 95.347c15.556-6.524 14.288-34.989 22.08-30.11 9.74 6.099 0-23.084 13.549-16.56 21.714 10.455-10.977 18.645 12.296 32.007 23.274 13.362 117.508 24.346 150.898 90.045 12.812 25.21 19.341 32.653 21.836 34.543 1.508-.13 1.78 1.349 0 0-.38.033-.838.168-1.362.476-5.516 3.245-106.876 85.867-148.54 34.124C48.162 188.129 2.25 140.221 14.31 127.463c9.648-10.205 1.393-25.103 4.76-32.116z"}),c.createElement("path",{fill:"url(#paint1_linear)",d:"M42.153 69.754c-7.791-4.88-.412 13.939-24.087 22.582-3.366 7.013 4.63 19.904-5.018 30.109-12.06 12.757 37.623 69.197 79.288 120.94 41.664 51.743 123.453-24.356 128.969-27.6 5.515-3.245 14.092 10.618-10.114-37.154-33.382-65.882-126.481-75.197-149.59-98.582-20.018-20.26 33.92-42.547 10.662-37.896-30.11 6.022-20.37 33.7-30.11 27.6z"})),c.createElement("defs",null,c.createElement("linearGradient",{id:"paint0_linear",x1:93.96,x2:67.62,y1:-33.993,y2:351.251,gradientUnits:"userSpaceOnUse"},c.createElement("stop",null),c.createElement("stop",{offset:1,stopColor:"#414141",stopOpacity:0})),c.createElement("linearGradient",{id:"paint1_linear",x1:88.433,x2:62.092,y1:-37.321,y2:347.924,gradientUnits:"userSpaceOnUse"},c.createElement("stop",{stopColor:"#FF005C",stopOpacity:.74}),c.createElement("stop",{offset:0}),c.createElement("stop",{offset:1,stopColor:"#242424",stopOpacity:0})))),za="_notFound_1e3hx_21",Ba={notFound:za};function Re(){return o.jsxs("div",{className:Ba.notFound,children:[o.jsx(Ma,{}),o.jsx("h1",{children:"Not found"}),o.jsxs("div",{children:["The page you are after was not found.",o.jsx("br",{}),"It may have moved or your URL may be incorrect.",o.jsx("br",{}),"Double check the URL and try again."]})]})}const Ee="ontime-override",Wa=e=>{const[t,n]=c.useState(!1);return c.useEffect(()=>{if(!e){s();return}if(document.getElementById(Ee)){n(!0);return}n(!1),r(e).then(i=>{if(!i){console.error("Error loading stylesheet: no data");return}return a(i)}).catch(i=>{console.error(`Error loading stylesheet: ${i}`)}).finally(()=>{setTimeout(()=>n(!0),0)});function s(){var i;(i=document.getElementById(Ee))==null||i.remove(),n(!0)}async function r(i){const u=await fetch(i);if(u.ok)return u.text()}async function a(i){const u=document.createElement("style");u.setAttribute("id",Ee),u.innerHTML=i,document.head.append(u)}},[e]),{shouldRender:t}},Dt=`${_e}/view-settings`;async function qa(){return(await E.get(Dt)).data}async function Va(e){return(await E.post(Dt,e)).data}const Ha={dangerColor:"#ff7300",normalColor:"#ffffffcc",overrideStyles:!1,warningColor:"#ffa528"};function Ka(){const{data:e,status:t}=ge({queryKey:de,queryFn:qa,placeholderData:(s,r)=>s,staleTime:fe}),{mutateAsync:n}=le({mutationFn:Va,onMutate:()=>{S.cancelQueries({queryKey:de})},onSuccess:s=>{S.setQueryData(de,s)}});return{data:e??Ha,status:t,mutateAsync:n}}function M({children:e}){const{data:t}=Ka(),{shouldRender:n}=Wa(t.overrideStyles?Hn:void 0);return n?o.jsx(o.Fragment,{children:e}):o.jsx(be,{})}const Qa="4.0.0-alpha.4",Ga=["top.GLOBALS","originalCreateNotification","canvas.contentDocument","MyApp_RemoveAllHighlights","http://tt.epicplay.com","Can't find variable: ZiteReader","jigsaw is not defined","ComboSearch is not defined","http://loading.retry.widdit.com/","atomicFindClose","fb_xd_fragment","bmi_SafeAddOnload","EBCallBackMessageReceived","conduitPage"],Ja="https://5e4d2c4b57ab409cb98d4c08b2014755@o4504288369836032.ingest.sentry.io/4504288371343360",Za=()=>(bn({dsn:Ja,integrations:[yn({useEffect:Ze.useEffect,useLocation:he,useNavigationType:kn,createRoutesFromChildren:Sn,matchRoutes:wn})],tracesSampleRate:.3,release:Qa,enabled:!0,ignoreErrors:[...Ga,/Unable to preload CSS/i,/dynamically imported module/i,/Failed to fetch dynamically imported module/i,/Loading chunk \d+ failed/i,/Loading CSS chunk \d+ failed/i,/ChunkLoadError/i,/Loading module .+ failed/i,/Cannot read propert.* of undefined/i,/Cannot read propert.* of null/i,/Network request failed/i,/Failed to fetch/i,/NetworkError/i,/The operation couldn't be completed/i],denyUrls:[/extensions\//i,/^chrome:\/\//i,/^chrome-extension:\/\//i],beforeSend(e){var n,s,r;const t=(r=(s=(n=e.exception)==null?void 0:n.values)==null?void 0:s[0])==null?void 0:r.value;return t&&(t.includes("Cannot read property")||t.includes("Cannot read properties")||t.includes("Network request failed")||t.includes("Failed to fetch"))?null:e}}),xn(jn)),$t=c.lazy(()=>k(()=>import("./Timer-DIm2brUR.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]),import.meta.url)),Ot=c.lazy(()=>k(()=>import("./Countdown-DP7Joj2L.js"),__vite__mapDeps([30,1,2,31,19,20,7,8,6,9,12,13,14,15,16,17,18,21,22,23,25,32,33,34,35,28,36]),import.meta.url)),At=c.lazy(()=>k(()=>import("./Backstage-CFV0YhNP.js"),__vite__mapDeps([37,1,2,4,7,8,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,31,33,25,28,38]),import.meta.url)),Lt=c.lazy(()=>k(()=>import("./Studio-Cp0DLcHB.js"),__vite__mapDeps([39,1,2,6,7,8,9,12,13,14,15,16,17,18,19,20,21,25,22,23,33,24,40]),import.meta.url)),Ft=c.lazy(()=>k(()=>import("./TimelinePage-DdNpQZcV.js"),__vite__mapDeps([41,1,2,6,7,8,9,12,13,14,15,16,17,18,19,20,21,22,23,31,25,42,4,43]),import.meta.url)),Ut=c.lazy(()=>k(()=>import("./ProjectInfo-DQf4QKCG.js"),__vite__mapDeps([44,1,2,6,7,8,9,12,13,14,15,16,17,18,19,20,21,45]),import.meta.url)),Xa=c.lazy(()=>k(()=>import("./ProtectedEditor-BF76LgsW.js"),__vite__mapDeps([46,1,2,47,48,15,16,49,19,20,50,51,17,18,28,52,31,53,54,26,55,56,57,58,59,60,61,62,63,33,27,64,65,66,67]),import.meta.url)),Mt=c.lazy(()=>k(()=>import("./ProtectedCuesheet-ClVaU6wv.js"),__vite__mapDeps([68,1,2,47,48,15,16,63,58,59,31,19,20,33,27,64,51,17,18,28,52,49,50,69,56,57,60,61,62,70,26,42,54,55,71,3,4,5,6,7,8,9,72,73,32,74]),import.meta.url)),zt=c.lazy(()=>k(()=>import("./OperatorExport-DEJRptkl.js"),__vite__mapDeps([75,1,2,47,48,31,19,20,6,7,8,9,14,15,16,17,18,21,32,28,54,26,55,70,42,61,34,35,72,58,59,73,63,33,27,64,3,4,5,25,76]),import.meta.url)),ce=c.lazy(()=>k(()=>import("./EditorFeatureWrapper-C1_-Ls7C.js"),__vite__mapDeps([77,1,2,47,48,78]),import.meta.url)),Ya=c.lazy(()=>k(()=>import("./RundownExport-Dz40gwc-.js").then(e=>e.R),__vite__mapDeps([79,1,2,56,57,47,48,31,19,20,69,60,61,62,70,26,42,54,55,28,17,18,58,59,49,50,33,71,7,8,32,80]),import.meta.url)),ei=c.lazy(()=>k(()=>import("./TimerControlExport-BYJGGnXs.js"),__vite__mapDeps([81,1,2,56,57,47,48,60,61,62,58,59,53,65,66,82]),import.meta.url)),ti=c.lazy(()=>k(()=>import("./MessageControlExport-PVFSIYCo.js"),__vite__mapDeps([83,1,2,56,57,47,48,17,18,58,59,65,66,84]),import.meta.url)),ni=Za();function oi(){return As(),o.jsx(c.Suspense,{fallback:o.jsx(be,{}),children:o.jsxs(ni,{children:[o.jsx(b,{path:"/",element:o.jsx(Cn,{to:"/timer"})}),o.jsx(b,{path:"timer",element:o.jsxs(M,{children:[o.jsx(D,{isNavigationLocked:F()}),o.jsx($t,{})]})}),o.jsx(b,{path:"countdown",element:o.jsxs(M,{children:[o.jsx(D,{isNavigationLocked:F()}),o.jsx(Ot,{})]})}),o.jsx(b,{path:"backstage",element:o.jsxs(M,{children:[o.jsx(D,{isNavigationLocked:F()}),o.jsx(At,{})]})}),o.jsx(b,{path:"studio",element:o.jsxs(M,{children:[o.jsx(D,{isNavigationLocked:F()}),o.jsx(Lt,{})]})}),o.jsx(b,{path:"timeline",element:o.jsxs(M,{children:[o.jsx(D,{isNavigationLocked:F()}),o.jsx(Ft,{})]})}),o.jsx(b,{path:"info",element:o.jsxs(M,{children:[o.jsx(D,{suppressSettings:!0,isNavigationLocked:F()}),o.jsx(Ut,{})]})}),o.jsx(b,{path:"editor",element:o.jsx(Xa,{})}),o.jsx(b,{path:"cuesheet",element:o.jsx(Mt,{})}),o.jsx(b,{path:"op",element:o.jsx(M,{children:o.jsx(zt,{})})}),o.jsx(b,{path:"rundown",element:o.jsx(ce,{children:o.jsx(Ya,{})})}),o.jsx(b,{path:"timercontrol",element:o.jsx(ce,{children:o.jsx(ei,{})})}),o.jsx(b,{path:"messagecontrol",element:o.jsx(ce,{children:o.jsx(ti,{})})}),o.jsx(b,{path:"log",element:o.jsx(ce,{children:o.jsx(La,{})})}),o.jsx(b,{path:"preset/:alias",element:o.jsx(si,{})}),o.jsx(b,{path:"*",element:o.jsx(ai,{})})]})})}const ri={[j.Cuesheet]:Mt,[j.Operator]:zt,[j.Timer]:$t,[j.Backstage]:At,[j.Timeline]:Ft,[j.StudioClock]:Lt,[j.Countdown]:Ot,[j.ProjectInfo]:Ut};function si(){const{data:e,status:t}=Oe(),{alias:n}=En(),s=c.useMemo(()=>{if(!(t==="pending"||!n))return e.find(i=>i.alias===n&&i.enabled)},[e,t,n]);if(t==="pending")return o.jsx(be,{});const r=Mn==="rw";if(!s)return o.jsxs(o.Fragment,{children:[o.jsx(D,{isNavigationLocked:!r,suppressSettings:!0}),o.jsx(Re,{})]});const a=ri[s.target];return o.jsxs(Os,{value:s,children:[s.target!==j.Cuesheet&&o.jsx(D,{isNavigationLocked:F(),suppressSettings:!0}),a?o.jsx(a,{}):o.jsx(Re,{})]})}function ai(){const{data:e,status:t}=Oe(),n=ee(),s=he(),r=c.useMemo(()=>t==="pending"?null:zs(s,e),[e,s,t]);return c.useEffect(()=>{r&&n(`/${r}`,{replace:!0})},[r,n]),t==="pending"?o.jsx(be,{}):o.jsxs(o.Fragment,{children:[o.jsx(D,{isNavigationLocked:F(),suppressSettings:!0}),o.jsx(Re,{})]})}kt();function ii(){return o.jsx(In,{client:S,children:o.jsx(Uo,{children:o.jsx(Nn,{children:o.jsxs(Rn,{basename:q,children:[o.jsxs("div",{className:"App",children:[o.jsx(Ke,{children:o.jsxs(Vo,{children:[o.jsx(Do,{}),o.jsx(oi,{})]})}),o.jsx(Pn,{initialIsOpen:!1})]}),o.jsx(Ke,{children:o.jsx("div",{id:"identify-portal"})})]})})})})}const ci=document.getElementById("root"),li=Tn.createRoot(ci);li.render(o.jsx(c.StrictMode,{children:o.jsx(ii,{})}));export{qc as $,dc as A,C as B,mc as C,Bi as D,hc as E,ft as F,Pc as G,Gi as H,tc as I,fc as J,Ii as K,be as L,fe as M,Rt as N,j as O,Os as P,gi as Q,$n as R,An as S,J as T,ki as U,Wc as V,wi as W,Sa as X,Ln as Y,Fc as Z,zc as _,st as a,bo as a$,Uc as a0,hi as a1,yi as a2,xi as a3,vi as a4,pi as a5,_i as a6,ka as a7,Zc as a8,Dc as a9,Ec as aA,Di as aB,bi as aC,De as aD,Ei as aE,Mr as aF,io as aG,vt as aH,y as aI,Jr as aJ,La as aK,Si as aL,rc as aM,d as aN,w as aO,Be as aP,Ci as aQ,Wn as aR,kc as aS,Nt as aT,Jc as aU,Yr as aV,jc as aW,jo as aX,Tc as aY,Ts as aZ,Xi as a_,Xc as aa,Mc as ab,Kc as ac,Qc as ad,Gc as ae,Gr as af,_o as ag,Bc as ah,K as ai,Vc as aj,Hc as ak,ls as al,Xr as am,ys as an,xc as ao,wc as ap,Ac as aq,wa as ar,Lc as as,bc as at,Oe as au,Zr as av,_e as aw,Fe as ax,Le as ay,to as az,rt as b,Oo as b0,Ma as b1,mt as b2,dt as b3,Ki as b4,Sc as b5,Mn as b6,F as b7,ne as b8,lt as b9,qi as bA,W as bB,ue as bC,Vi as bD,Wi as bE,Mi as bF,Fi as bG,Oi as bH,Ui as bI,Ai as bJ,Li as bK,Fo as bL,Qi as bM,Pi as bN,vc as bO,qn as bP,$c as ba,us as bb,uo as bc,Ti as bd,_c as be,V as bf,Y as bg,D as bh,Oc as bi,Nc as bj,Ho as bk,Yi as bl,ec as bm,Zi as bn,S as bo,sc as bp,te as bq,ac as br,$i as bs,ss as bt,Ke as bu,ji as bv,yc as bw,Yn as bx,vo as by,zi as bz,Ka as c,jt as d,cc as e,Cc as f,gc as g,pc as h,x as i,Kn as j,pt as k,ic as l,Hi as m,It as n,oc as o,nc as p,lc as q,Ji as r,Ic as s,Ko as t,hr as u,uc as v,ut as w,Ri as x,Rc as y,Ni as z};
//# sourceMappingURL=index-BNit4nUw.js.map