@getontime/cli
Version:
Time keeping for live events
2 lines • 258 kB
JavaScript
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./Button-legacy-DpgzgT04.js","./Tooltip-legacy-DEkL5laM.js","./useIsSmallScreen-legacy-DavgXfPB.js","./Select-legacy-DHLEukf3.js","./constants-legacy-CvecvM28.js","./useMutation-legacy-CHaWRMnS.js","./SwatchPicker-legacy-DpR2sNl5.js","./NavigationMenu-legacy-AAR54e_T.js","./use-local-storage-legacy-Xbm6tq51.js","./GenerateLinkFormExport-legacy-BXqi2OlY.js","./use-hotkeys-legacy-D0havt6H.js","./TimerDisplay-legacy-CDx7PTJp.js","./parseUserTime-legacy-BAw2X6qu.js","./Tag-legacy-Dmwjqz-6.js","./useSettings-legacy-CmEM1qbK.js","./useRundown-legacy-zes2lKPp.js","./Input-legacy-CNt711cd.js","./PresetContext-legacy-DMyxIOHO.js","./viewOptions-legacy-C48HYPwV.js","./errorboundary-legacy-CiQMUIM4.js","./assets-legacy-CsCyioqi.js","./index-legacy-NWDCUII5.js","./ProtectRoute-legacy-DKYjVKxt.js","./Info-legacy-6yM0-oGU.js","./Modal-legacy-CjFHV5U2.js","./tb-legacy-C5yyMA4Y.js","./EditorUtils-legacy-CWdX_BN4.js","./AppLink-legacy-CNq__WK8.js","./useReport-legacy-DgBTP5JA.js","./useWindowTitle-legacy-2YHQ5qMQ.js","./editorSettings-legacy-Bzf9rUwb.js","./TimeElements-legacy-WdUHx7La.js","./useAutoTickingClock-legacy-CkfIpBWe.js","./SuperscriptPeriod-legacy-NlsBX--E.js","./useCustomFields-legacy-B9FQxHWS.js","./QrCode-legacy-CyNmwHds.js","./useProjectData-legacy-BeF8hAuC.js","./useCuesheetRundownSelection-legacy-BPYx6P_A.js"],function(e,t){var n,i,r,s,a,o,l,c,d,u,h,m,p,f,_,g,x,y,j,b,v,w,k,C,S,N,E,I,R,T,P,O,A,q,L,D,F,B,V,M,z,$,U,H,W,G,K,Y,J,Q,Z,X,ee,te,ne,ie,re,se,ae,oe,le,ce,de,ue,he,me,pe,fe,_e,ge,xe,ye,je,be,ve,we,ke,Ce,Se,Ne,Ee,Ie,Re,Te,Pe,Oe,Ae,qe,Le,De,Fe,Be,Ve,Me,ze,$e,Ue,He,We,Ge,Ke,Ye,Je,Qe,Ze,Xe,et,tt,nt,it,rt,st,at,ot,lt,ct,dt,ut,ht,mt,pt,ft,_t,gt,xt,yt,jt,bt,vt,wt,kt,Ct,St,Nt,Et,It,Rt,Tt,Pt,Ot,At,qt,Lt,Dt,Ft,Bt,Vt,Mt,zt,$t,Ut,Ht,Wt,Gt,Kt,Yt,Jt,Qt,Zt,Xt,en,tn,nn,rn,sn,an,on,ln,cn,dn,un,hn,mn,pn,fn,_n,gn,xn,yn,jn,bn,vn,wn,kn,Cn,Sn,Nn,En,In,Rn,Tn,Pn,On,An,qn,Ln,Dn,Fn,Bn,Vn,Mn,zn,$n,Un,Hn,Wn,Gn,Kn,Yn,Jn,Qn,Zn,Xn,ei,ti,ni,ii,ri,si,ai,oi,li,ci,di,ui,hi,mi,pi,fi,_i,gi,xi,yi,ji,bi,vi,wi,ki,Ci,Si,Ni,Ei,Ii,Ri,Ti,Pi,Oi,Ai,qi,Li,Di,Fi,Bi,Vi,Mi,zi,$i,Ui,Hi,Wi,Gi,Ki,Yi,Ji,Qi,Zi,Xi,er,tr,nr,ir,rr,sr,ar,or,lr,cr,dr,ur,hr,mr,pr,fr,_r,gr,xr,yr,jr,br,vr,wr,kr,Cr,Sr,Nr,Er,Ir,Rr,Tr,Pr,Or,Ar,qr,Lr,Dr,Fr,Br,Vr,Mr,zr,$r,Ur,Hr,Wr,Gr,Kr,Yr,Jr,Qr,Zr,Xr,es,ts,ns,is,rs,ss,as,os,ls,cs,ds,us,hs,ms,ps,fs,_s,gs,xs,ys,js,bs,vs,ws,ks,Cs,Ss,Ns,Es,Is,Rs,Ts,Ps,Os,As,qs,Ls,Ds,Fs,Bs,Vs,Ms,zs,$s,Us,Hs,Ws,Gs,Ks,Ys,Js,Qs,Zs,Xs,ea,ta,na,ia,ra,sa,aa,oa,la,ca,da,ua,ha,ma,pa,fa,_a,ga,xa,ya,ja,ba,va,wa,ka,Ca,Sa,Na,Ea,Ia,Ra,Ta,Pa,Oa,Aa,qa,La,Da,Fa,Ba,Va,Ma,za,$a,Ua,Ha,Wa,Ga,Ka,Ya,Ja,Qa,Za,Xa,eo,to,no,io,ro,so,ao,oo,lo,co,uo,ho,mo,po,fo,_o,go,xo,yo,jo,bo,vo,wo,ko,Co,So,No,Eo,Io,Ro,To,Po,Oo,Ao,qo,Lo,Do,Fo,Bo,Vo,Mo,zo,$o,Uo,Ho,Wo,Go,Ko,Yo,Jo,Qo,Zo,Xo,el,tl,nl,il,rl,sl,al,ol,ll,cl,dl,ul,hl,ml,pl,fl,_l;function gl(e){return e.trim().replaceAll(" ","_")}function xl({onClose:e,children:t}){return(0,ws.jsxs)("div",{className:vs.contentWrapper,children:[(0,ws.jsx)("div",{className:vs.corner,children:(0,ws.jsxs)(qe,{size:"large",onClick:e,children:["Close settings ",(0,ws.jsx)(Sn,{})]})}),(0,ws.jsx)("div",{className:vs.content,children:t})]})}function yl(){const{data:e,status:t,isFetching:n,isError:i,refetch:r}=Ln({queryKey:jn,queryFn:({signal:e})=>async function(e){const t=await sn.get(Fn,{signal:e?.signal});return{url:t.data.html_url,version:t.data.tag_name}}({signal:e}),placeholderData:(e,t)=>e,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,staleTime:k,enabled:Yt}),s=e?.version&&!e.version.includes("4.13.0-beta.1");return{data:e?{...e,hasUpdates:s}:ks,placeholder:ks,status:t,isFetching:n,isError:i,refetch:r}}function jl(e){return e.trim().toLowerCase()}function bl(e,t){const n=jl(t);return!!n&&(!!jl(e.label).includes(n)||Boolean(e.keywords?.some(e=>e.includes(n))))}function vl({query:e,onQueryChange:t,onSubmit:n}){const i=(0,js.useRef)(null),r=e.trim().length>0;return(0,ws.jsxs)("div",{className:Ss.search,children:[(0,ws.jsx)(on,{className:Ss.icon}),(0,ws.jsx)(Zi,{ref:i,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{if("Escape"===e.key&&r)return e.stopPropagation(),void t("");"Enter"===e.key&&n()},placeholder:"Search settings",className:Ss.input,fluid:!0}),r&&(0,ws.jsx)(Qi,{variant:"ghosted-white",size:"small","aria-label":"Clear search",className:Ss.clear,onClick:()=>{t(""),i.current?.focus()},children:(0,ws.jsx)(Sn,{})})]})}function wl({selectedPanel:e,location:t}){const{options:n}=function(){const{data:e}=yl();return{options:(0,js.useMemo)(()=>Cs.map(t=>"about"===t.id&&e.hasUpdates?Object.assign({},t,{highlight:"New version available"}):t),[e])}}(),{setLocation:i}=Ai(),[r,s]=(0,js.useState)(""),a=function(e,t){const n=jl(t);return n?e.reduce((e,t)=>{if(bl(t,n))return e.push(t),e;if(t.secondary){const i=t.secondary.filter(e=>bl(e,n));i.length&&e.push({...t,secondary:i})}return e},[]):[...e]}(n,r);return(0,ws.jsxs)("div",{className:Ns.container,children:[(0,ws.jsx)(vl,{query:r,onQueryChange:s,onSubmit:()=>{const e=function(e,t){const n=e[0];return n?bl(n,t.trim().toLowerCase())?n.id:n.secondary?.[0]?.id??null:null}(a,r);e&&(i(e),s(""))}}),0===a.length?(0,ws.jsx)(jr,{title:"No settings match",description:`Nothing found for "${r.trim()}"`}):(0,ws.jsx)("ul",{className:Ns.tabs,children:a.map(n=>{const i=e===n.id;return n.highlight?(0,ws.jsx)(Ue,{text:n.highlight,render:(0,ws.jsx)("span",{}),children:(0,ws.jsx)(kl,{panel:n,location:t,isSelected:i})},n.id):(0,ws.jsx)(kl,{panel:n,location:t,isSelected:i},n.id)})})]})}function kl({panel:e,isSelected:t,location:n}){const{setLocation:i}=Ai(),r=Boolean(t&&e.secondary?.some(e=>e.id.split("__")[1]===n));return(0,ws.jsxs)(js.Fragment,{children:[(0,ws.jsx)("li",{onClick:()=>i(e.id),onKeyDown:t=>{ii(t)&&i(e.id)},className:zt([Ns.primary,t&&!r&&Ns.active,r&&Ns.groupActive,e.highlight&&Ns.highlight]),tabIndex:0,role:"button",children:e.label},e.id),e.secondary?.map((e,r)=>{const s=e.id.split("__")[1];return(0,ws.jsx)("li",{onClick:()=>i(e.id),onKeyDown:t=>{ii(t)&&i(e.id)},className:zt([Ns.secondary,t&&n===s?Ns.active:null]),tabIndex:0,role:"button",children:e.label},e.id+r)})]},e.id)}function Cl(e){return gn({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16.72 7.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1 0 1.06l-3.75 3.75a.75.75 0 1 1-1.06-1.06l2.47-2.47H3a.75.75 0 0 1 0-1.5h16.19l-2.47-2.47a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"},child:[]}]})(e)}function Sl({href:e,inline:t,className:n,children:i}){return(0,ws.jsxs)("a",{href:"#!",target:"_blank",rel:"noreferrer",className:zt([Es.link,t&&Es.inline,n]),onClick:t=>{t.preventDefault(),Yn(e)},children:[i,(0,ws.jsx)(Cl,{className:Es.icon})]})}function Nl(){const{data:e,isError:t}=yl();return t?(0,ws.jsx)(dr,{children:(0,ws.jsx)(_r,{title:`Ontime ${Xt}`,description:"",error:"Could not fetch version information"})}):e.hasUpdates?(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)("span",{className:Is.updateIndicator,"aria-hidden":"true"}),`Ontime ${Xt}`]}),description:Vt?`Version ${e.version} is available. Restart your stage to update.`:`Version ${e.version} is available.`}),!Vt&&(0,ws.jsx)(Sl,{href:"https://www.getontime.no",children:"Download the latest version from Ontime's page"})]}):(0,ws.jsx)(dr,{children:(0,ws.jsx)(_r,{title:`Ontime ${Xt}`,description:"You are using the latest version."})})}function El(){return Vt?null:(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{className:Rs.card,children:[(0,ws.jsx)("span",{className:Rs.eyebrow,children:"Ontime Cloud"}),(0,ws.jsx)("h3",{className:Rs.title,children:"Run Ontime online with zero setup"}),(0,ws.jsxs)("p",{className:Rs.description,children:[(0,ws.jsx)("span",{children:"Ontime Cloud lets you run and share Ontime online with your team. Subscriptions support continued development while Ontime remains fully open-source and self-hostable."}),(0,ws.jsx)("span",{className:Rs.portability,children:"Project files work locally and in Cloud, so your shows can move freely."})]}),(0,ws.jsxs)("ul",{className:Rs.benefits,children:[(0,ws.jsxs)("li",{children:[(0,ws.jsx)(qn,{}),"Start in minutes, with no setup or maintenance"]}),(0,ws.jsxs)("li",{children:[(0,ws.jsx)(qn,{}),"Coordinate multi-track rundowns with Overview views"]}),(0,ws.jsxs)("li",{children:[(0,ws.jsx)(qn,{}),"Manage every instance from one dashboard"]}),(0,ws.jsxs)("li",{children:[(0,ws.jsx)(qn,{}),"Share secure read-only views with collaborators"]})]}),(0,ws.jsx)("div",{className:Rs.actions,children:(0,ws.jsx)(Sl,{href:tn,children:"Learn more about Ontime Cloud"})})]})})}function Il({href:e,title:t,description:n}){return(0,ws.jsx)(dr,{interactive:!0,children:(0,ws.jsxs)(Sl,{href:e,className:Ts.link,children:[(0,ws.jsx)(_r,{title:t,description:n}),(0,ws.jsx)("span",{className:Ts.action,children:"Open"})]})})}function Rl(){return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(hr,{children:"About Ontime"}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Ontime"}),(0,ws.jsx)(br,{}),(0,ws.jsx)(Rr,{children:"Free, open-source software for managing rundowns and event timers."}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsx)(Il,{href:tn,title:"www.getontime.no",description:"App site and downloads"}),(0,ws.jsx)(Il,{href:Ht,title:"GitHub Sponsors",description:"Support development through GitHub"}),(0,ws.jsx)(Il,{href:Dt,title:"Buy Me a Coffee",description:"Make a one-time contribution"})]})]})}),(0,ws.jsx)(El,{}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Current version"}),(0,ws.jsx)(br,{}),(0,ws.jsx)(Cr,{children:(0,ws.jsx)(Nl,{})})]})}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Helpful links"}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsx)(Il,{href:At,title:"Read the docs",description:"Setup guides and feature documentation"}),(0,ws.jsx)(Il,{href:Wt,title:"GitHub",description:"Report issues or contribute to Ontime"}),(0,ws.jsx)(Il,{href:en,title:"YouTube",description:"Watch tutorials and feature walkthroughs"}),(0,ws.jsx)(Il,{href:wn,title:"Discord",description:"Get help and share suggestions"}),(0,ws.jsx)(Il,{href:Mn,title:"Reddit",description:"Join the Ontime community discussion"})]})]})})]})}function Tl(e,t){const n=(0,js.useRef)(null);return(0,js.useEffect)(()=>{t&&n.current&&t===e&&n.current.scrollIntoView({behavior:"smooth",block:"center"})},[t,e]),n}function Pl({enabledAutomations:e,enabledOscIn:t,oscPortIn:n,automationState:i,oscInputState:r,isLoading:s}){const{handleSubmit:a,reset:o,register:l,setError:c,watch:d,setValue:u,formState:{errors:h,isSubmitting:p,isDirty:f,isValid:_}}=Er({mode:"onChange",defaultValues:{enabledAutomations:e,enabledOscIn:t,oscPortIn:n},resetOptions:{keepDirtyValues:!1}}),g=()=>{o({enabledAutomations:e,enabledOscIn:t,oscPortIn:n})},x=!p&&f&&_,y=d("enabledAutomations"),j=d("enabledOscIn");return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(rr,{isLoading:Boolean(s)}),(0,ws.jsxs)(ar,{children:["Automation settings",(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(qe,{variant:"ghosted",onClick:g,disabled:!x,children:"Revert to saved"}),(0,ws.jsx)(qe,{variant:"primary",type:"submit",form:"automation-settings-form",disabled:!x,loading:p,children:"Save"})]})]}),h?.root&&(0,ws.jsx)(gr,{children:h.root.message}),(0,ws.jsx)(br,{}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(Rr,{children:[(0,ws.jsx)("span",{children:"Control Ontime and share its data with external systems in your workflow."}),(0,ws.jsx)("span",{children:"- Automations allow Ontime to send its data on lifecycle triggers."}),(0,ws.jsx)("span",{children:"- OSC Input tells Ontime to listen to messages on the specific port."}),(0,ws.jsx)(Sl,{href:Ps,children:"See the docs"})]})}),(0,ws.jsxs)(ur,{as:"form",id:"automation-settings-form",onSubmit:a(async e=>{try{await ji(e),o(e)}catch(t){c("root",{message:m(t)})}}),onKeyDown:e=>Gn(e,g),children:[(0,ws.jsx)(yr,{children:"Automation"}),(0,ws.jsx)(Cr,{children:(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)("span",{children:"Enable automations"}),!1===i&&(0,ws.jsx)(Di,{variant:"warning",children:"OFF"})]}),description:!1===i?"Automations are OFF. Triggers stay configured, but Ontime will not send messages.":"Allow Ontime to send messages on lifecycle triggers",descriptionTone:!1===i?"warning":"default",error:h.enabledAutomations?.message}),(0,ws.jsx)($n,{size:"large",checked:y,onCheckedChange:e=>u("enabledAutomations",e,{shouldDirty:!0,shouldValidate:!0})})]})}),(0,ws.jsx)(yr,{children:"OSC Input"}),(0,ws.jsxs)(Cr,{children:[Vt&&(0,ws.jsx)(Rr,{children:"For security reasons OSC integrations are not available in the cloud service."}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)("span",{children:"OSC input"}),!1===r&&(0,ws.jsx)(Di,{variant:"warning",children:"OFF"})]}),description:!1===r?"OSC input is OFF. Ontime will not listen for incoming OSC control messages.":"Allow control of Ontime through OSC",descriptionTone:!1===r?"warning":"default",error:h.enabledOscIn?.message}),(0,ws.jsx)($n,{size:"large",checked:j,onCheckedChange:e=>u("enabledOscIn",e,{shouldDirty:!0,shouldValidate:!0})})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Listen on port",description:"Port for incoming OSC. Default: 8888",error:h.oscPortIn?.message}),(0,ws.jsx)(Zi,{id:"oscPortIn",placeholder:"8888",maxLength:5,style:{textAlign:"right",width:"5rem"},type:"number",fluid:!0,...l("oscPortIn",{required:{value:!0,message:"Required field"},max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"},pattern:{value:_i,message:"Value should be numeric"}})})]})]})]})]})})}function Ol(e){return Object.hasOwn(e,"id")}function Al(e,t,n,i,r,s,a,o,l,c=2){const d=Ce(n.current,{event:e,orientation:i,loopFocus:r,rtl:s,cols:c,disabledIndices:a,minIndex:o,maxIndex:l,prevIndex:t>l?o:t,stopEvent:!0});return ie(n.current,d)?void 0:d}function ql(){const e=js.useContext(Ls);if(!e)throw new Error(de(22));return e}function Ll(){const e=js.useContext(Ds);if(!e)throw new Error(de(23));return e}function Dl(){const e=js.useContext(Fs);if(!e)throw new Error(de(24));return e}function Fl(e){return Array.isArray(e)?e.map(e=>Fl(e)).join(","):null==e?"":String(e)}function Bl(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Fl(e.locale)}|${JSON.stringify(t)}`,i=zs.get(n);if(i)return i;const r=new Intl.Collator(e.locale,t),s={contains(e,t,n){if(!t)return!0;const i=It(e,n);for(let s=0;s<=i.length-t.length;s+=1)if(0===r.compare(i.slice(s,s+t.length),t))return!0;return!1},startsWith(e,t,n){if(!t)return!0;const i=It(e,n);return 0===r.compare(i.slice(0,t.length),t)},endsWith(e,t,n){if(!t)return!0;const i=It(e,n),s=t.length;return i.length>=s&&0===r.compare(i.slice(i.length-s),t)}};return zs.set(n,s),s}function Vl(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:i=null,selectedValue:r,onSelectedValueChange:s,defaultInputValue:a,inputValue:o,open:l,defaultOpen:c=!1,selectionMode:d="none",onItemHighlighted:u,name:h,form:m,disabled:p=!1,readOnly:f=!1,required:_=!1,inputRef:g,grid:x=!1,items:y,filteredItems:j,filter:b,openOnInputClick:v=!0,autoHighlight:w=!1,keepHighlight:k=!1,highlightItemOnHover:C=!0,loopFocus:S=!0,itemToStringLabel:N,itemToStringValue:E,isItemEqualToValue:I=mt,virtualized:R=!1,inline:T=!1,fillInputOnItemPress:P=!0,modal:O=!1,limit:A=-1,autoComplete:q="list",formAutoComplete:L,locale:D,submitOnItemClick:F=!1}=e,{clearErrors:B}=bt(),{setDirty:V,validityData:M,setFilled:z,name:$,disabled:U,setTouched:H,setFocused:W,validationMode:G,validation:K}=vt(),J=Ge(),X=at({id:t}),ie=$s({locale:D}),[re,le]=js.useState(!1),[ce,de]=js.useState(null),me=js.useRef([]),ge=js.useRef([]),je=js.useRef(null),be=js.useRef(null),ve=js.useRef(null),we=js.useRef(null),Ce=js.useRef(null),Se=js.useRef(!0),Ne=js.useRef(!1),Re=js.useRef(null),qe=js.useRef(null),Le=js.useRef(null),De=js.useRef(Hs),Fe=js.useRef(null),Me=js.useRef([]),ze=js.useRef([]),Ue=U||p,He=$??h,Ke="multiple"===d,Ye="single"===d,Je=void 0!==o||void 0!==a,Qe=void 0!==y,Ze=void 0!==j;let Xe;Xe="always"===w?"always":!!w&&"input-change";const[et,tt]=ut({controlled:r,default:Ke?i??te:i,name:"Combobox",state:"selectedValue"}),nt=js.useMemo(()=>null===b?()=>!0:void 0!==b?b:Ye&&!re?function(e,t,n){return(i,r)=>{if(null==i)return!1;if(!r)return!0;const s=It(i,t),a=null!=n?It(n,t):"";return!(!a||!e.contains(a,r)||a.length!==r.length)||e.contains(s,r)}}(ie,N,et):function(e,t){return(n,i)=>{if(null==n)return!1;const r=It(n,t);return e.contains(r,i)}}(ie,N),[b,Ye,et,re,ie,N]),it=ke(()=>Je?a??"":Ye?It(et,N):"").current,[st,lt]=ut({controlled:o,default:it,name:"Combobox",state:"inputValue"}),[ct,xt]=ut({controlled:l,default:c,name:"Combobox",state:"open"}),yt=gt(y),jt=ce??(""===st?"":String(st).trim()),wt=Ye?It(et,N):"",kt=Ye&&!re&&""!==jt&&""!==wt&&wt.length===jt.length&&ie.contains(wt,jt),St=kt?"":jt,Nt=Qe&&Ze&&kt,Et=js.useMemo(()=>y?yt?y.flatMap(e=>e.items):y:te,[y,yt]),Ot=js.useMemo(()=>{if(j&&!Nt)return j;if(!y)return te;if(yt){const e=y,t=[];let n=0;for(const i of e){if(A>-1&&n>=A)break;const e=""===St?i.items:i.items.filter(e=>nt(e,St,N));if(0===e.length)continue;const r=A>-1?A-n:1/0,s=e.slice(0,r);if(s.length>0){const e={...i,items:s};t.push(e),n+=s.length}}return t}if(""===St)return A>-1?Et.slice(0,A):Et;const e=[];for(const t of Et){if(A>-1&&e.length>=A)break;nt(t,St,N)&&e.push(t)}return e},[j,Nt,y,yt,St,A,nt,N,Et]),At=js.useMemo(()=>yt?Ot.flatMap(e=>e.items):Ot,[Ot,yt]),qt=ke(()=>new Y({id:X,labelId:void 0,selectedValue:et,open:ct,filter:nt,query:jt,items:y,selectionMode:d,listRef:me,labelsRef:ge,popupRef:je,emptyRef:Ce,inputRef:be,startDismissRef:ve,endDismissRef:we,keyboardActiveRef:Se,chipsContainerRef:Re,clearRef:qe,valuesRef:Me,allValuesRef:ze,selectionEventRef:Le,name:He,form:m,disabled:Ue,readOnly:f,required:_,grid:x,isGrouped:yt,virtualized:R,openOnInputClick:v,itemToStringLabel:N,isItemEqualToValue:I,modal:O,autoHighlight:Xe,submitOnItemClick:F,hasInputValue:Je,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:T,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},itemProps:ne,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:"none"===d,onOpenChangeComplete:n||ae,setOpen:ae,setInputValue:ae,setSelectedValue:ae,setIndices:ae,onItemHighlighted:ae,handleSelection:ae,forceMount:ae,requestSubmit:ae})).current,Lt="none"===d?st:et,Dt=js.useMemo(()=>"none"===d?Lt:Array.isArray(et)?et.map(e=>Pt(e,E)):Pt(et,E),[Lt,E,d,et]),Ft=Te(u),Bt=Te(n),Vt=xe(qt,Ms.activeIndex),Mt=xe(qt,Ms.selectedIndex),zt=xe(qt,Ms.positionerElement),$t=xe(qt,Ms.listElement),Ut=xe(qt,Ms.triggerElement),Ht=xe(qt,Ms.inputElement),Wt=xe(qt,Ms.inputGroupElement),Gt=xe(qt,Ms.inline),Kt=xe(qt,Ms.inputInsidePopup),Yt=xe(qt,Ms.inputOwnsFormValue),Jt=Ae(Ut),{mounted:Qt,setMounted:Zt,transitionStatus:Xt}=he(ct),{openMethod:en,triggerProps:tn}=ot(ct),nn=Te(()=>Dt);dt(Kt?Jt:be,X,Lt,nn,!Ue,h);const rn=Te(()=>{y?ge.current=At.map(e=>It(e,N)):qt.set("forceMounted",!0)}),sn=js.useRef(et);Q(()=>{et!==sn.current&&rn()},[rn,et]);const an=Te(e=>{qt.update(e);const t=e.type||"none";if(void 0!==e.activeIndex)if(null===e.activeIndex)De.current!==Hs&&(De.current=Hs,Ft(void 0,ye(t,void 0,{index:-1})));else{const n=Me.current[e.activeIndex];De.current={value:n,index:e.activeIndex},Ft(n,ye(t,void 0,{index:e.activeIndex}))}}),on=Te((t,n)=>{if(Ne.current=n.reason===pe,e.onInputValueChange?.(t,n),!n.isCanceled){if("input-change"===n.reason){const e=n.event,i=e.inputType;if("compositionend"===e.type||null!=i&&""!==i&&"insertReplacementText"!==i){const e=""!==t.trim();e&&le(!0),Fe.current={hasQuery:e},e&&Xe&&null==qt.state.activeIndex&&qt.set("activeIndex",0)}}lt(t)}}),ln=Te((t,n)=>{if(ct!==t&&("escape-key"===n.reason&&Qe&&0===At.length&&!qt.state.emptyRef.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&Ke&&Kt&&!Gt&&null!==ce&&(le(!1),de(null),""!==st&&on("",_e(pe,n.event))),!t&&re&&(Ye?(Gt||de(jt),""===jt&&le(!1)):Ke&&(Gt||de(jt),Kt&&an({activeIndex:null}),Kt&&!Gt||on("",_e(pe,n.event)))),xt(t),!t&&Kt&&("focus-out"===n.reason||"outside-press"===n.reason)&&(H(!0),W(!1),"onBlur"===G)))){const e="none"===d?st:et;K.commit(e)}}),cn=Te((e,t)=>{s?.(e,t),t.isCanceled||(tt(e),("none"===d&&je.current&&P||Ye&&!qt.state.inputInsidePopup)&&on(It(e,N),_e(t.reason,t.event)),Ye&&null!=e&&"input-change"!==t.reason&&re&&!Gt&&de(jt))}),dn=Te((e,t)=>{let n=t;if(void 0===n){if(null===Vt)return;n=Me.current[Vt]}const i=ue(e),r=Le.current??e;Le.current=null;const s=_e(oe,r),a=i?.closest("a")?.getAttribute("href");if(a)a.startsWith("#")&&ln(!1,s);else if(Ke){const e=Array.isArray(et)?et:[];if(cn(pt(e,n,qt.state.isItemEqualToValue)?Rt(e,n,qt.state.isItemEqualToValue):[...e,n],s),s.isCanceled)return;if(!be.current||""===be.current.value.trim())return;qt.state.inputInsidePopup?on("",_e(pe,s.event)):ln(!1,s)}else{if(cn(n,s),s.isCanceled)return;ln(!1,s)}}),un=Te(()=>{if(!qt.state.submitOnItemClick)return;const e=K.inputRef.current?.form??qt.state.inputElement?.form;e&&"function"==typeof e.requestSubmit&&e.requestSubmit()}),hn=Te(()=>{if(Zt(!1),Bt?.(!1),le(!1),de(null),an("none"===d?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ke&&be.current&&""!==be.current.value&&!Ne.current&&on("",_e(pe)),Ye)if(qt.state.inputInsidePopup)be.current&&""!==be.current.value&&on("",_e(pe));else{const e=It(et,N);be.current&&be.current.value!==e&&on(e,_e(""===e?pe:Be))}}),mn=js.useMemo(()=>Gt&&zt?{current:zt.closest('[role="dialog"]')}:je,[Gt,zt]);ee({enabled:!e.actionsRef,open:ct,ref:mn,onComplete(){ct||hn()}}),js.useImperativeHandle(e.actionsRef,()=>({unmount:hn}),[hn]),Q(function(){if(ct||"none"===d)return;const e=y?Et:ze.current;if(Ke){const t=Array.isArray(et)?et:[],n=t[t.length-1],i=rt(e,n,I);an({selectedIndex:-1===i?null:i})}else{const t=rt(e,et,I);an({selectedIndex:-1===t?null:t})}},[ct,et,y,d,Et,Ke,I,an]),Q(()=>{y&&(Me.current=At,me.current.length=At.length)},[y,At]),Q(()=>{const e=Fe.current;if(e&&(e.hasQuery?Xe&&qt.set("activeIndex",0):"always"===Xe&&qt.set("activeIndex",0),Fe.current=null),!ct&&!Gt)return;const t=Qe||Ze?At:Me.current,n=qt.state.activeIndex;if(null==n)return"always"===Xe&&t.length>0?void qt.set("activeIndex",0):void(De.current!==Hs&&(De.current=Hs,qt.state.onItemHighlighted(void 0,ye(Be,void 0,{index:-1}))));if(n>=t.length)return De.current!==Hs&&(De.current=Hs,qt.state.onItemHighlighted(void 0,ye(Be,void 0,{index:-1}))),void qt.set("activeIndex",null);const i=t[n],r=De.current.value,s=r!==Us&&Tt(i,r,qt.state.isItemEqualToValue);De.current.index===n&&s||(De.current={value:i,index:n},qt.state.onItemHighlighted(i,ye(Be,void 0,{index:n})))},[Vt,Xe,Ze,Qe,At,Gt,ct,qt]),Q(()=>{z("none"!==d?Ke?Array.isArray(et)&&et.length>0:null!=et:""!==String(st))},[z,d,st,et,Ke]),js.useEffect(()=>{Qe&&Xe&&0===At.length&&an({activeIndex:null})},[Qe,Xe,At.length,an]),ht(jt,()=>{ct&&""!==jt&&jt!==String(it)&&le(!0)}),ht(et,()=>{if("none"!==d&&(B(He),V(function(e){const t=M.initialValue;return Array.isArray(e)&&Array.isArray(t)?!Ct(e,t,(e,t)=>Tt(e,t,I)):e!==t}(et)),K.change(et),Ye&&!Je&&!Kt)){const e=It(et,N);st!==e&&on(e,_e(Be))}}),ht(st,()=>{"none"===d&&(B(He),V(st!==M.initialValue),K.change(st))}),ht(y,()=>{if(!Ye||Je||Kt||re)return;const e=It(et,N);st!==e&&on(e,_e(Be))});const pn=We({open:!!Gt||ct,onOpenChange:ln,elements:{reference:Kt?Ut:Ht,floating:zt}});let fn,_n;Gt||(fn=x?"grid":"listbox",_n=ct?"true":"false");const gn=js.useMemo(()=>{const e=null==Ht||"INPUT"===Ht?.tagName,t=e?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return(e||ct)&&(t.role="combobox",t["aria-expanded"]=_n,t["aria-haspopup"]=fn,t["aria-controls"]=ct?$t?.id:void 0,t["aria-autocomplete"]=q),{reference:t,floating:{role:"presentation"}}},[Ht,ct,_n,fn,$t?.id,q]),xn=_t(pn,{enabled:!f&&!Ue&&v,event:"mousedown-only",toggle:!1,touchOpenDelay:Kt?0:100,reason:Ve}),yn=Oe(pn,{enabled:!f&&!Ue&&!Gt,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:!!Gt||void 0,outsidePress(e){const t=ue(e);return!(Z(Ut,t)||Z(qe.current,t)||Z(Re.current,t)||Z(Wt,t))}}),jn=ft(pn,{enabled:!f&&!Ue,id:X,listRef:me,activeIndex:Vt,selectedIndex:Mt,virtual:!0,loopFocus:S,allowEscape:S&&!Xe,focusItemOnOpen:!(re||"none"===d&&!Xe)&&"auto",focusItemOnHover:C,resetOnPointerLeave:!k,orientation:x?"horizontal":void 0,rtl:"rtl"===J,disabledIndices:te,grid:x?Al:void 0,onNavigate(e,t){(t||ct)&&"ending"!==Xt&&an(t?{activeIndex:e,type:Se.current?"keyboard":"pointer"}:{activeIndex:e})}}),bn=js.useMemo(()=>$e(jn.reference,{onKeyDown(e){!x||null!=qt.state.activeIndex||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.preventBaseUIHandler()}},yn.reference,xn.reference,gn.reference),[jn.reference,yn.reference,xn.reference,gn.reference,x,qt]),vn=js.useMemo(()=>$e(se,jn.floating,yn.floating,gn.floating),[jn.floating,yn.floating,gn.floating]),wn=js.useMemo(()=>{const e=jn.item;return e?{...e,onFocus:void 0}:ne},[jn.item]);Ie(()=>{qt.update({inline:T,popupProps:vn,inputProps:bn,triggerProps:tn,itemProps:wn,setOpen:ln,setInputValue:on,setSelectedValue:cn,setIndices:an,onItemHighlighted:Ft,handleSelection:dn,forceMount:rn,requestSubmit:un})}),Q(()=>{qt.update({id:X,selectedValue:et,open:ct,mounted:Qt,transitionStatus:Xt,items:y,inline:T,popupProps:vn,inputProps:bn,triggerProps:tn,openMethod:en,itemProps:wn,selectionMode:d,name:He,form:m,disabled:Ue,readOnly:f,required:_,grid:x,isGrouped:yt,virtualized:R,onOpenChangeComplete:Bt,openOnInputClick:v,itemToStringLabel:N,modal:O,autoHighlight:Xe,isItemEqualToValue:I,submitOnItemClick:F,hasInputValue:Je,requestSubmit:un,inputOwnsFormValue:"none"===d&&(T||!qt.state.inputInsidePopup)})},[qt,X,et,ct,Qt,Xt,y,vn,bn,wn,en,tn,d,He,Ue,f,_,K,x,yt,R,Bt,v,N,O,I,F,Je,T,un,Xe,m]);const kn=fe(g,K.inputRef),Cn=js.useMemo(()=>({query:jt,hasItems:Qe,filteredItems:Ot,flatFilteredItems:At}),[jt,Qe,Ot,At]),Sn=js.useMemo(()=>Array.isArray(Lt)?"":Pt(Lt,E),[Lt,E]),Nn=Ke&&Array.isArray(et)&&et.length>0,En=Ke||"none"===d&&Yt?void 0:He,In=js.useMemo(()=>Ke&&Array.isArray(et)&&He?et.map(e=>{const t=Pt(e,E);return(0,ws.jsx)("input",{type:"hidden",form:m,name:He,value:t,disabled:Ue},t)}):null,[Ke,et,m,He,E,Ue]),Rn=(0,ws.jsxs)(js.Fragment,{children:[e.children,(0,ws.jsx)("input",{...K.getValidationProps(Ue,{onFocus(){Kt?Ut?.focus():(be.current||Ut)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ue||f)return;const t=e.currentTarget.value,n=t.toLowerCase(),i=_e(Be,e.nativeEvent),r=()=>Me.current.findIndex(e=>Pt(e,E).toLowerCase()===n||It(e,N).toLowerCase()===n);Ye&&(rn(),y&&-1===r()&&qt.set("forceMounted",!0)),queueMicrotask(function(){if(Ke)return;if("none"===d)return void on(t,i);let e=r();-1===e&&(e=Me.current.findIndex((e,t)=>{const i=ge.current[t];return null!=i&&i.toLowerCase()===n}));const s=-1===e?void 0:Me.current[e];null!=s&&cn?.(s,i)})}}),id:X&&null==En?`${X}-hidden-input`:void 0,form:m,name:En,autoComplete:L,disabled:Ue,required:_&&!Nn,readOnly:f,value:Sn,ref:kn,style:En?Pe:Ee,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),In]});return(0,ws.jsx)(Ls.Provider,{value:qt,children:(0,ws.jsx)(Ds.Provider,{value:pn,children:(0,ws.jsx)(Bs.Provider,{value:Qe,children:(0,ws.jsx)(Fs.Provider,{value:Cn,children:(0,ws.jsx)(Vs.Provider,{value:st,children:Rn})})})})})}function Ml(e){const{openOnInputClick:t=!1,value:n,defaultValue:i,onValueChange:r,mode:s="list",itemToStringValue:a,...o}=e,l="inline"===s||"both"===s,c="inline"===s||"none"===s,d=void 0!==n,[u,h]=js.useState(i??""),[m,p]=js.useState("");let f;js.useEffect(()=>{d&&p("")},[n,d]),f=l&&""!==m?m:d?n??"":u;const _=$s(),g=js.useMemo(()=>void 0!==o.filter?o.filter:_.contains,[o.filter,_]),x=String(d?n:u).trim(),y=js.useMemo(()=>"both"!==s?c?null:g:null===g?null:(e,t,n)=>g(e,x,n),[g,s,x,c]);return(0,ws.jsx)(Vl,{...o,itemToStringLabel:a,openOnInputClick:t,selectionMode:"none",fillInputOnItemPress:!0,filter:y,autoComplete:s,inputValue:f,defaultInputValue:i,onInputValueChange:function(e,t){p(""),d||h(e),r?.(e,t)},onItemHighlighted:function(t,n){e.onItemHighlighted?.(t,n),"pointer"!==n.reason&&p(l?null==t?"":It(t,a):"")}})}function zl(e){const t=js.useContext(Ks);if(void 0===t&&!e)throw new Error(de(21));return t}function $l(e){const{children:t}=e,{filteredItems:n}=Dl(),i=js.useContext(Qs),r=i?i.items:n;return r?(0,ws.jsx)(js.Fragment,{children:r.map(t)}):null}function Ul(){const e=le(),t=js.useRef(null);return js.useEffect(()=>{if(ze)return;const n=t.current;if(null==n)return;const i=function(e){const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);let n=null;for(;t.nextNode();){const e=t.currentNode;""!==e.nodeValue&&(n=e)}return n}(n);if(null==i)return;const r=i.nodeValue??"",s=`${r}${Xs}`;return i.nodeValue=s,e.start(200,()=>{i.nodeValue===s&&(i.nodeValue=r)}),()=>{e.clear(),i.nodeValue===s&&(i.nodeValue=r)}},[t,e]),t}function Hl(e){const{componentProps:t,forwardedRef:n,virtualized:i,indexFromFilter:r}=e,{render:s,className:a,style:o,value:l=null,index:c,disabled:d=!1,nativeButton:u=!1,...h}=t,m=js.useRef(!1),p=js.useRef(null),f=Nt({index:c,textRef:p,indexGuessBehavior:St.GuessFromOrder}),_=ql(),g=js.useContext(aa),x=js.useContext(Bs),y=xe(_,Ms.open),j=xe(_,Ms.selectionMode),b=xe(_,Ms.readOnly),v=xe(_,Ms.isItemEqualToValue),w="none"!==j,k=c??(i?r??-1:f.index),C=-1!==f.index,S=xe(_,Ms.id),N=xe(_,Ms.isActive,k),E=xe(_,Ms.isSelected,l),I=xe(_,Ms.itemProps),R=js.useRef(null),T=null!=S&&C?`${S}-${k}`:void 0,P=E&&w;Q(()=>{if(!C||!i&&null==c)return;const e=_.state.listRef.current;return e[k]=R.current,()=>{delete e[k]}},[C,i,k,c,_]),Q(()=>{if(!C||x)return;const e=_.state.valuesRef.current;return e[k]=l,"none"!==j&&_.state.allValuesRef.current.push(l),()=>{delete e[k]}},[C,x,k,l,_,j]),Q(()=>{if(!y)return void(m.current=!1);if(!C||x)return;const e=_.state.selectedValue;Tt(l,Array.isArray(e)?e[e.length-1]:e,v)&&_.set("selectedIndex",k)},[C,x,y,_,k,l,v]);const{getButtonProps:O,buttonRef:A}=Ot({disabled:d,focusableWhenDisabled:!0,native:u,composite:!0}),q={disabled:d,selected:P,highlighted:N};function L(e){function t(){_.state.handleSelection(e,l)}_.state.submitOnItemClick?(oa.flushSync(t),_.state.requestSubmit()):t()}const D={id:T,role:g?"gridcell":"option","aria-selected":w?P:void 0,tabIndex:void 0,onPointerDownCapture(e){m.current=!0,e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){d||b||L(e.nativeEvent)},onMouseUp(e){const t=m.current;m.current=!1,d||b||0!==e.button||t||!N||L(e.nativeEvent)}},F=me("div",t,{ref:[A,n,f.ref,R],state:q,props:[I,D,h,O]}),B=js.useMemo(()=>({selected:P,textRef:p}),[P,p]);return(0,ws.jsx)(sa.Provider,{value:B,children:F})}function Wl(e){const{componentProps:t,forwardedRef:n}=e,i=xe(ql(),Ms.isItemEqualToValue),{flatFilteredItems:r}=Dl();return(0,ws.jsx)(Hl,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:rt(r,t.value??null,i)})}function Gl(e,t=e.length){const n=e.slice(0,t),i=n.lastIndexOf("{{");if(-1===i)return null;if(n.lastIndexOf("}}")>i)return null;const r=e.indexOf("}}",i),s=e.indexOf("{{",t);return{end:-1!==r&&(-1===s||r<s)?r+2:t,start:i,template:e.slice(i,t)}}function Kl(e,t=e.length){return Gl(e,t)?.template??""}function Yl(e,t){return e?.selectionStart??t.length}function Jl(e,t,n,i){const[r,s]=(0,js.useState)(!1),[a,o]=(0,js.useState)(e.length),l=Kl(e,a),c=(0,js.useMemo)(()=>l?t.filter(e=>e.startsWith(l)):[],[l,t]),d=(0,js.useCallback)((e,t)=>{o(t),s(Boolean(Kl(e,t)))},[]),u=(0,js.useCallback)(()=>{d(e,Yl(n.current,e))},[n,d,e]);return{handleValueChange:(0,js.useCallback)((t,r)=>{if("item-press"===r.reason){r.cancel();const l=function(e,t,n=e.length){const i=Gl(e,n);if(!i){const n=e+function(e,t){if(e===t)return"";if(e.endsWith("{{")&&t.startsWith("{{"))return t.substring(2);if(e.endsWith("{")&&t.startsWith("{{"))return t.substring(1);for(let n=0;n<t.length;n++){const i=t.substring(0,n+1);if(e.endsWith(i))return t.substring(n+1)}return""}(e,t);return{value:n,cursorIndex:n.length}}return{value:`${e.slice(0,i.start)}${t}${e.slice(i.end)}`,cursorIndex:i.start+t.length}}(e,t,a);return d(l.value,l.cursorIndex),i(l.value),s=n.current,o=l.cursorIndex,void requestAnimationFrame(()=>{s?.focus(),s?.setSelectionRange(o,o)})}var s,o;d(t,Yl(n.current,t)),i(t)},[a,n,i,d,e]),open:r&&c.length>0,setCursorForValue:d,setShowSuggestions:s,suggestions:c,updateCursor:u}}function Ql({className:e,disabled:t,fluid:n,height:i="medium",onChange:r,readOnly:s,ref:a,value:o,variant:l="subtle",...c}){const{data:d}=Xr(),u=(0,js.useRef)(null),[h,m]=(0,js.useState)(o||""),[p,f]=(0,js.useState)(!1),_=(0,js.useMemo)(()=>{return e=d,[...da,...ua,...ha,...Object.entries(e).map(([e])=>`{{eventNow.custom.${e}}}`),...ma,...Object.entries(e).map(([e])=>`{{eventNext.custom.${e}}}`),...pa,...Object.entries(e).map(([e])=>`{{groupNow.custom.${e}}}`),...fa(1),...fa(2),...fa(3)];var e},[d]),g=(0,js.useCallback)(e=>{m(e),function(e,t,n){n?.({target:{name:e,value:t},currentTarget:{name:e,value:t}})}(c.name,e,r)},[r,c.name]),x=Jl(h,_,u,g),{setCursorForValue:y}=x;(0,js.useEffect)(()=>{const e=o||"";m(e),y(e,e.length)},[y,o]);const j=(0,js.useCallback)(e=>{u.current=e,function(e,t){"function"==typeof e?e(t):e&&(e.current=t)}(a,e)},[a]);return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(Zl,{autocomplete:x,value:h,children:(0,ws.jsxs)("div",{className:zt([_a.inputShell,n&&_a.fluid]),children:[(0,ws.jsx)(Js,{ref:j,className:zt([Ji.input,Ji[l],Ji[i],n&&Ji.fluid,_a.input,e]),...c,disabled:t,onClick:x.updateCursor,onFocus:x.updateCursor,onKeyUp:x.updateCursor,onSelect:x.updateCursor,readOnly:s}),(0,ws.jsx)(Qi,{"aria-label":"Expand template editor",className:_a.expandButton,disabled:t||s,onClick:()=>{x.setShowSuggestions(!1),f(!0)},size:"small",title:"Expand template editor",variant:"ghosted-white",children:(0,ws.jsx)(Kt,{})})]})}),(0,ws.jsx)(Xl,{autocompleteList:_,isOpen:p,onClose:()=>{f(!1)},onSave:e=>{g(e),x.setCursorForValue(e,e.length),f(!1)},value:h})]})}function Zl({autocomplete:e,children:t,value:n}){return(0,ws.jsxs)(Ml,{items:e.suggestions,autoHighlight:!0,highlightItemOnHover:!0,mode:"none",open:e.open,value:n,onOpenChange:e.setShowSuggestions,onValueChange:e.handleValueChange,children:[t,(0,ws.jsx)(ec,{})]})}function Xl({autocompleteList:e,isOpen:t,onClose:n,onSave:i,value:r}){const s=(0,js.useRef)(null),[a,o]=(0,js.useState)(r),l=Jl(a,e,s,o),{setShowSuggestions:c}=l;(0,js.useEffect)(()=>{t&&(o(r),c(!1))},[t,c,r]);const d=()=>{c(!1),n()};return(0,ws.jsx)(Tr,{isOpen:t,onClose:d,showBackdrop:!0,showCloseButton:!0,title:"Edit template",bodyElements:(0,ws.jsx)(Zl,{autocomplete:l,value:a,children:(0,ws.jsx)(Js,{autoFocus:!0,className:_a.expandedEditor,onClick:l.updateCursor,onFocus:l.updateCursor,onKeyUp:l.updateCursor,onSelect:l.updateCursor,render:(0,ws.jsx)(Mr,{ref:s,fluid:!0,resize:"none",rows:8})})}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsxs)("span",{className:_a.footerHint,children:["Start a template with ","{{"," to see autocomplete."]}),(0,ws.jsx)(qe,{onClick:d,children:"Cancel"}),(0,ws.jsx)(qe,{onClick:()=>{c(!1),i(a)},variant:"primary",children:"Save"})]})})}function ec(){return(0,ws.jsx)(ta,{children:(0,ws.jsx)(na,{side:"bottom",align:"start",className:_a.positioner,children:(0,ws.jsx)(ra,{className:_a.popup,children:(0,ws.jsx)(Zs,{className:_a.list,children:(0,ws.jsx)($l,{children:e=>(0,ws.jsx)(la,{value:e,className:_a.item,children:e},e)})})})})})}function tc({index:e,register:t,setValue:n,rowErrors:i,value:r,children:s,watch:a}){const[o,l]=(0,js.useState)(r);return(0,ws.jsxs)("div",{className:ga.actionSection,children:[(0,ws.jsxs)("label",{children:["Action",(0,ws.jsx)(Et,{onValueChange:t=>{null!==t&&(t=>{n(`outputs.${e}.action`,t,{shouldDirty:!0}),l(t)})(t)},value:a(`outputs.${e}.action`),options:[{value:"aux1-pause",label:"Aux 1: pause"},{value:"aux2-pause",label:"Aux 2: pause"},{value:"aux3-pause",label:"Aux 3: pause"},{value:"aux1-start",label:"Aux 1: start"},{value:"aux2-start",label:"Aux 2: start"},{value:"aux3-start",label:"Aux 3: start"},{value:"aux1-stop",label:"Aux 1: stop"},{value:"aux2-stop",label:"Aux 2: stop"},{value:"aux3-stop",label:"Aux 3: stop"},{value:"aux1-set",label:"Aux 1: set"},{value:"aux2-set",label:"Aux 2: set"},{value:"aux3-set",label:"Aux 3: set"},{value:"playback-start",label:"Playback: start"},{value:"playback-stop",label:"Playback: stop"},{value:"playback-pause",label:"Playback: pause"},{value:"playback-roll",label:"Playback: roll"},{value:"message-set",label:"Primary Message"},{value:"message-secondary",label:"Secondary Message"}]}),(0,ws.jsx)(gr,{children:i?.action?.message})]}),o.startsWith("aux")&&o.endsWith("set")&&(0,ws.jsxs)("label",{children:["New time",(0,ws.jsx)(Zi,{...t(`outputs.${e}.time`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"eg: 10m5s"}),(0,ws.jsx)(gr,{children:i?.time?.message})]}),"message-set"===o&&(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsxs)("label",{children:["Text (leave empty for no change)",(0,ws.jsx)(Ql,{...t(`outputs.${e}.text`),value:a(`outputs.${e}.text`)??"",fluid:!0,placeholder:"eg: Timer is finished"}),(0,ws.jsx)(gr,{children:i?.text?.message})]}),(0,ws.jsxs)("label",{children:["Visibility",(0,ws.jsx)(Et,{onValueChange:t=>{n(`outputs.${e}.visible`,null===t?void 0:t,{shouldDirty:!0})},value:a(`outputs.${e}.visible`),options:[{value:null,label:"Untouched"},{value:!0,label:"Show"},{value:!1,label:"Hide"}]}),(0,ws.jsx)(gr,{children:i?.visible?.message})]})]}),"message-secondary"===o&&(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsxs)("label",{children:["Text (leave empty for no change)",(0,ws.jsx)(Ql,{...t(`outputs.${e}.text`),value:a(`outputs.${e}.text`)??"",fluid:!0,placeholder:"eg: Next up: keynote"}),(0,ws.jsx)(gr,{children:i?.text?.message})]}),(0,ws.jsxs)("label",{children:["Timer secondary source",(0,ws.jsx)(Et,{onValueChange:t=>{null!==t&&n(`outputs.${e}.secondarySource`,"no-change"!==t?"null"!==t?t:null:void 0,{shouldDirty:!0})},value:a(`outputs.${e}.secondarySource`)??"no-change",options:[{value:"no-change",label:"No change"},{value:"aux1",label:"Auxiliary timer 1"},{value:"aux2",label:"Auxiliary timer 2"},{value:"aux3",label:"Auxiliary timer 3"},{value:"secondary",label:"Secondary"},{value:"null",label:"None"}]}),(0,ws.jsx)(gr,{children:i?.secondarySource?.message})]})]}),(0,ws.jsx)("div",{className:ga.test,children:s})]})}function nc({automation:e,onClose:t}){const n=Ol(e),{data:i}=Xr(),{refetch:r}=li(),s=(0,js.useMemo)(()=>{return e=i,[...As,...Object.entries(e).map(([e,{label:t}])=>({value:`eventNow.custom.${e}`,label:`Custom: ${t}`})),...qs,...Object.entries(e).map(([e,{label:t}])=>({value:`eventNext.custom.${e}`,label:`Next custom: ${t}`}))];var e},[i]),{control:a,handleSubmit:o,getValues:l,register:c,setError:d,setFocus:u,setValue:h,watch:p,formState:{errors:f,isSubmitting:_,isDirty:g,isValid:y}}=Er({mode:"onChange",defaultValues:{title:e?.title??"",filterRule:e?.filterRule??"all",filters:e?.filters??[],outputs:e?.outputs??[]},resetOptions:{keepDirtyValues:!0}}),{fields:j,append:b,remove:v}=Ir({name:"filters",control:a}),{fields:w,append:k,remove:C}=Ir({name:"outputs",control:a});(0,js.useEffect)(()=>{u("title")},[u]);const S=!_&&g&&y;return(0,ws.jsx)(Tr,{isOpen:!0,onClose:t,showBackdrop:!0,showCloseButton:!0,title:n?"Edit automation":"Create automation",bodyElements:(0,ws.jsxs)("form",{id:ya,onSubmit:o(async n=>{Ol(e)?await async function(e,n){try{await mi(e,n),t()}catch(i){d("root",{message:m(i)})}}(e.id,{id:e.id,...n}):await async function(e){try{await Ni(e),t()}catch(n){d("root",{message:m(n)})}}(n),r()}),className:ga.outerColumn,children:[(0,ws.jsxs)("div",{className:ga.innerColumn,children:[(0,ws.jsx)("h3",{children:"Automation options"}),(0,ws.jsxs)("div",{className:ga.titleSection,children:[(0,ws.jsxs)("label",{children:["Title",(0,ws.jsx)(Zi,{...c("title",{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"Load preset"})]}),(0,ws.jsx)(gr,{children:f.title?.message})]})]}),(0,ws.jsxs)("div",{className:ga.innerColumn,children:[(0,ws.jsx)("h3",{children:"Filters (optional)"}),(0,ws.jsxs)("div",{className:ga.ruleSection,children:[(0,ws.jsxs)("label",{children:["Trigger outputs if",(0,ws.jsx)(wi,{orientation:"horizontal",value:p("filterRule"),onValueChange:e=>h("filterRule",e,{shouldDirty:!0}),items:[{value:"all",label:"All filters pass"},{value:"any",label:"Any filter passes"}]})]}),j.map((e,t)=>{const n=`filters.${t}.field.${e.id}`;return(0,ws.jsxs)("div",{className:ga.filterSection,children:[(0,ws.jsxs)("label",{children:["Runtime data source",(0,ws.jsx)(Et,{value:p(`filters.${t}.field`)||null,onValueChange:e=>{null!==e&&h(`filters.${t}.field`,e,{shouldDirty:!0})},options:s.map(({value:e,label:t})=>({value:e,label:t,disabled:null===e})),"aria-label":"Event field"}),(0,ws.jsx)(gr,{children:f.filters?.[t]?.field?.message})]}),(0,ws.jsxs)("label",{children:["Matching condition",(0,ws.jsx)(Et,{value:p(`filters.${t}.operator`),onValueChange:e=>{null!==e&&h(`filters.${t}.operator`,e,{shouldDirty:!0})},options:[{value:"equals",label:"equals"},{value:"not_equals",label:"not equals"},{value:"contains",label:"contains"}],"aria-label":"Operator"}),(0,ws.jsx)(gr,{children:f.filters?.[t]?.operator?.message})]}),(0,ws.jsxs)("label",{children:["Value to match",(0,ws.jsx)(Zi,{...c(`filters.${t}.value`),fluid:!0,placeholder:"<empty / no value>"})]}),(0,ws.jsxs)("div",{children:[(0,ws.jsx)("span",{children:" "}),(0,ws.jsx)("div",{children:(0,ws.jsx)(Qi,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>v(t),children:(0,ws.jsx)(mn,{})})})]})]},n)}),(0,ws.jsx)("div",{children:(0,ws.jsxs)(qe,{onClick:()=>{b({field:"",operator:"equals",value:""})},children:["Add filter ",(0,ws.jsx)(Jt,{})]})})]})]}),(0,ws.jsxs)("div",{className:ga.innerColumn,children:[(0,ws.jsx)("h3",{children:"Outputs"}),(0,ws.jsxs)(Rr,{children:["Automation outputs can be used to send data from Ontime to external software ",(0,ws.jsx)("br",{}),"or to change properties of Ontime itself. ",(0,ws.jsx)("br",{})," ",(0,ws.jsx)("br",{}),"Use Ontime runtime data in these fields with template strings. Type ","{{"," to see autocomplete, or"," ",(0,ws.jsx)(Sl,{href:xa,children:"read the docs"})]}),w.map((e,t)=>{if(D(e)){const n=f.outputs?.[t];return(0,ws.jsxs)("div",{className:ga.outputCard,children:[(0,ws.jsx)(Di,{children:"OSC"}),(0,ws.jsxs)("div",{className:ga.oscSection,children:[(0,ws.jsxs)("label",{children:["Target IP",(0,ws.jsx)(Zi,{...c(`outputs.${t}.targetIP`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"127.0.0.1"}),(0,ws.jsx)(gr,{children:n?.targetIP?.message})]}),(0,ws.jsxs)("label",{children:["Target Port",(0,ws.jsx)(Zi,{...c(`outputs.${t}.targetPort`,{required:{value:!0,message:"Required field"},setValueAs:e=>""===e?0:Number(e),max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"}}),fluid:!0,type:"number",maxLength:5,placeholder:"8000"}),(0,ws.jsx)(gr,{children:n?.targetPort?.message})]}),(0,ws.jsxs)("label",{children:["Address",(0,ws.jsx)(Ql,{...c(`outputs.${t}.address`),value:e.address,fluid:!0,placeholder:"/cue/start"}),(0,ws.jsx)(gr,{children:n?.address?.message})]}),(0,ws.jsxs)("label",{children:["Arguments",(0,ws.jsx)(Ql,{...c(`outputs.${t}.args`),value:e.args,fluid:!0,placeholder:"1"}),(0,ws.jsx)(gr,{children:n?.args?.message})]}),(0,ws.jsxs)("div",{children:[(0,ws.jsx)("span",{children:" "}),(0,ws.jsxs)(mr,{relation:"inner",children:[(0,ws.jsx)(qe,{variant:"ghosted-white",onClick:()=>(async e=>{try{const t=l(`outputs.${e}`);if(!t.targetIP||!t.targetPort||!t.address)return;await yi({type:"osc",targetIP:t.targetIP,targetPort:t.targetPort,address:t.address,args:t.args})}catch(t){}})(t),children:"Test"}),(0,ws.jsx)(Qi,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>C(t),children:(0,ws.jsx)(mn,{})})]})]})]})]},e.id)}if(B(e)){const n=f.outputs?.[t];return(0,ws.jsxs)("div",{className:ga.outputCard,children:[(0,ws.jsx)(Di,{children:"HTTP"}),(0,ws.jsxs)("div",{className:ga.httpSection,children:[(0,ws.jsxs)("label",{children:["Target URL",(0,ws.jsx)(Ql,{...c(`outputs.${t}.url`,{required:{value:!0,message:"Required field"},pattern:{value:Si,message:"HTTP messages should target http:// or https://"}}),value:e.url,fluid:!0,placeholder:"http://127.0.0.1/start/1"}),(0,ws.jsx)(gr,{children:n?.url?.message})]}),(0,ws.jsxs)("div",{children:[(0,ws.jsx)("span",{children:" "}),(0,ws.jsxs)(mr,{relation:"inner",children:[(0,ws.jsx)(qe,{variant:"ghosted-white",onClick:()=>(async e=>{try{const t=l(`outputs.${e}`);if(!t.url)return;await yi({type:"http",url:t.url})}catch(t){}})(t),children:"Test"}),(0,ws.jsx)(Qi,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>C(t),children:(0,ws.jsx)(mn,{})})]})]})]})]},e.id)}if(x(e)){const n=f.outputs?.[t];return(0,ws.jsxs)("div",{className:ga.outputCard,children:[(0,ws.jsx)(Di,{children:"Ontime action"}),(0,ws.jsxs)(tc,{value:e.action,index:t,register:c,rowErrors:n,setValue:h,watch:p,children:[(0,ws.jsx)("span",{children:" "}),(0,ws.jsxs)(mr,{relation:"inner",children:[(0,ws.jsx)(qe,{variant:"ghosted-white",onClick:()=>(async e=>{try{await yi({...l(`outputs.${e}`),type:"ontime"})}catch(t){}})(t),children:"Test"}),(0,ws.jsx)(Qi,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>C(t),children:(0,ws.jsx)(mn,{})})]})]})]},e.id)}return null}),(0,ws.jsxs)(mr,{relation:"inner",children:[(0,ws.jsxs)(qe,{onClick:()=>{k({type:"osc",targetIP:"",targetPort:void 0,address:"",args:""})},children:["OSC ",(0,ws.jsx)(Jt,{})]}),(0,ws.jsxs)(qe,{onClick:()=>{k({type:"http",url:""})},children:["HTTP ",(0,ws.jsx)(Jt,{})]}),(0,ws.jsxs)(qe,{onClick:()=>{k({type:"ontime",action:"aux1-start"})},children:["Ontime action ",(0,ws.jsx)(Jt,{})]})]})]})]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[f?.root&&(0,ws.jsx)(gr,{children:f.root.message}),(0,ws.jsx)(qe,{onClick:t,children:"Cancel"}),(0,ws.jsx)(qe,{variant:"primary",type:"submit",form:ya,disabled:!S,loading:_,children:"Save"})]})})}function ic({automations:e,enabledAutomations:t,isLoading:n}){const{refetch:i}=li(),[r,s]=(0,js.useState)(null),[a,o]=(0,js.useState)(null),l=Object.keys(e);return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[null!==r&&(0,ws.jsx)(nc,{automation:r,onClose:()=>s(null)}),(0,ws.jsxs)(ar,{children:["Manage automations",(0,ws.jsxs)(qe,{onClick:()=>s(ja),children:["New ",(0,ws.jsx)(Jt,{})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(ur,{children:[!1===t&&(0,ws.jsx)(Rr,{children:"Automations are disabled. You can still manage automation definitions here, but they will not run until enabled."}),(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{style:{width:"45%"},children:"Title"}),(0,ws.jsx)("th",{style:{width:"15%"},children:"Trigger rule"}),(0,ws.jsx)("th",{style:{width:"15%"},children:"Filters"}),(0,ws.jsx)("th",{style:{width:"15%"},children:"Outputs"}),(0,ws.jsx)("th",{})]})}),(0,ws.jsxs)("tbody",{children:[!n&&0===l.length&&(0,ws.jsx)(cr,{title:"No automations yet",description:"An automation sends OSC or HTTP messages, or runs an Ontime action, whenever a trigger fires.",action:(0,ws.jsxs)(qe,{variant:"primary",onClick:()=>s(ja),children:["Create automation ",(0,ws.jsx)(Jt,{})]})}),l.map(t=>Object.hasOwn(e,t)?(0,ws.jsx)(js.Fragment,{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("td",{children:e[t].title}),(0,ws.jsx)("td",{children:(0,ws.jsx)(Di,{children:e[t].filterRule})}),(0,ws.jsx)("td",{children:e[t].filters.length}),(0,ws.jsx)("td",{children:e[t].outputs.length}),(0,ws.jsxs)(mr,{align:"end",relation:"inner",as:"td",children:[(0,ws.jsx)(Qi,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>s(e[t]),children:(0,ws.jsx)(Rn,{})}),(0,ws.jsx)(Qi,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>(async e=>{try{o(null),await di(e)}catch(t){o(m(t))}finally{i()}})(t),children:(0,ws.jsx)(mn,{})})]})]})},t):null),a&&(0,ws.jsx)("tr",{children:(0,ws.jsx)("td",{colSpan:5,children:(0,ws.jsx)(gr,{children:a})})})]})]})]})]})})}function rc({automations:e,trigger:t,onCancel:n,postSubmit:i}){const{handleSubmit:r,register:s,setFocus:a,setError:o,watch:l,setValue:c,formState:{errors:d,isSubmitting:u,isValid:h,isDirty:p}}=Er({defaultValues:{title:t?.title,trigger:t?.trigger??Os[0].value,automationId:t?.automationId??e?.[Object.keys(e)[0]]?.id},resetOptions:{keepDirtyValues:!0}});(0,js.useEffect)(()=>{a("title")},[a]);const f=Object.keys(e).map(t=>({value:t,label:e[t].title})),_=p&&h;return(0,ws.jsx)(Tr,{isOpen:!0,onClose:n,showBackdrop:!0,showCloseButton:!0,size:"compact",title:t?"Edit trigger":"Create trigger",bodyElements:(0,ws.jsxs)("form",{id:ba,onSubmit:r(async e=>{if(t)try{await oi(t.id,{id:t.id,...e}),i()}catch(n){o("root",{message:`Failed to save changes to trigger ${m(n)}`})}else try{await pi(e),i()}catch(n){o("root",{message:`Failed to save trigger ${m(n)}`})}}),children:[(0,ws.jsxs)("label",{children:["Title",(0,ws.jsx)(Zi,{...s("title",{required:{value:!0,message:"Required field"}}),fluid:!0,defaultValue:t?.title}),(0,ws.jsx)(gr,{children:d.title?.message})]}),(0,ws.jsxs)("label",{children:["Lifecycle trigger",(0,ws.jsx)(Et,{value:l("trigger"),onValueChange:e=>{null!==e&&c("trigger",e,{shouldDirty:!0})},options:Os.map(e=>({value:e.value,label:e.label})),"aria-label":"Lifecycle trigger"}),(0,ws.jsx)(gr,{children:d.trigger?.message})]}),(0,ws.jsxs)("label",{children:["Automation title",(0,ws.jsx)(Et,{value:l("automationId"),onValueChange:e=>{null!==e&&c("automationId",e,{shouldDirty:!0})},options:f,"aria-label":"Automation title"}),(0,ws.jsx)(gr,{children:d.automationId?.message})]})]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[d.root&&(0,ws.jsx)(gr,{children:d.root.message}),(0,ws.jsx)(qe,{disabled:u,onClick:n,children:"Cancel"}),(0,ws.jsx)(qe,{type:"submit",form:ba,variant:"primary",disabled:!_,loading:u,children:"Save"})]})})}function sc(e){const{automations:t,trigger:n,duplicate:i,handleEdit:r,handleDelete:s}=e;return(0,ws.jsxs)("tr",{"data-warn":i,children:[(0,ws.jsxs)(mr,{as:"td",relation:"inner",children:[i&&(0,ws.jsx)(yn,{color:"#FFBC56"}),n.title]}),(0,ws.jsx)("td",{children:(0,ws.jsx)(Di,{children:Os.find(e=>e.value===n.trigger)?.label})}),(0,ws.jsx)("td",{children:(0,ws.jsx)(Di,{children:t?.[n.automationId]?.title})}),(0,ws.jsxs)(mr,{align:"end",relation:"inner",as:"td",children:[(0,ws.jsx)(Qi,{variant:"ghosted-white","aria-label":"Edit entry",onClick:r,children:(0,ws.jsx)(Rn,{})}),(0,ws.jsx)(Qi,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:s,children:(0,ws.jsx)(mn,{})})]})]})}function ac({triggers:e,automations:t,enabledAutomations:n,isLoading:i}){const[r,s]=(0,js.useState)({isOpen:!1,trigger:void 0}),{refetch:a}=li(),[o,l]=(0,js.useState)(null),c=()=>s({isOpen:!0}),d=()=>s({isOpen:!1,trigger:void 0}),u=(0,js.useMemo)(()=>function(e){const t={},n=[];for(let i=0;i<e.length;i++){const r=e[i];Object.hasOwn(t,r.trigger)||(t[r.trigger]=[]),t[r.trigger].includes(r.automationId)?n.push(i):t[r.trigger].push(r.automationId)}return n.length>0?n:void 0}(e),[e]),h=Object.keys(t).length>0;return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[r.isOpen&&(0,ws.jsx)(rc,{automations:t,trigger:r.trigger??null,onCancel:d,postSubmit:()=>{d(),a()}}),(0,ws.jsxs)(ar,{children:["Manage triggers",(0,ws.jsxs)(qe,{disabled:!h,onClick:c,children:["New ",(0,ws.jsx)(Jt,{})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(ur,{children:[!1===n&&(0,ws.jsx)(Rr,{children:"Automations are disabled. You can still manage triggers here, but they will not run until enabled."}),u&&(0,ws.jsx)(gr,{children:"You have created multiple links between the same trigger and automation which can cause performance issues."}),(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{style:{width:"35%"},children:"Title"}),(0,ws.jsx)("th",{style:{width:"25%"},children:"Lifecycle trigger"}),(0,ws.jsx)("th",{style:{width:"25%"},children:"Automation"}),(0,ws.jsx)("th",{})]})}),(0,ws.jsxs)("tbody",{children:[!i&&0===e.length&&(0,ws.jsx)(cr,{title:"No triggers yet",description:h?"Triggers run an automation at a given point of the timer lifecycle, like when an event starts or finishes.":"Create an automation first, then add a trigger to decide when it should run.",action:h&&(0,ws.jsxs)(qe,{variant:"primary",onClick:c,children:["Create trigger ",(0,ws.jsx)(Jt,{})]})}),e.map((e,n)=>(0,ws.jsx)(js.Fragment,{children:(0,ws.jsx)(sc,{automations:t,trigger:e,duplicate:u?.includes(n),handleEdit:()=>(e=>s({isOpen:!0,trigger:e}))(e),handleDelete:()=>(async e=>{try{l(null),await ci(e)}catch(t){l(m(t))}finally{a()}})(e.id)})},e.id)),o&&(0,ws.jsx)("tr",{children:(0,ws.jsx)("td",{colSpan:5,children:(0,ws.jsx)(gr,{children:o})})})]})]})]})]})})}function oc({location:e}){const{data:t,status:n}=li(),i=Tl("settings",e),r=Tl("triggers",e),s=Tl("automations",e),a="pending"===n,o=a?void 0:t.enabledAutomations,l=a?void 0:t.enabledOscIn;return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(hr,{children:"Automation"}),(0,ws.jsx)("div",{ref:i,children:(0,ws.jsx)(Pl,{enabledAutomations:t.enabledAutomations,enabledOscIn:t.enabledOscIn,oscPortIn:t.oscPortIn,automationState:o,oscInputState:l,isLoading:a})}),(0,ws.jsx)("div",{ref:s,children:(0,ws.jsx)(ic,{automations:t.automations,enabledAutomations:o,isLoading:a})}),(0,ws.jsx)("div",{ref:r,children:(0,ws.jsx)(ac,{triggers:t.triggers,automations:t.automations,enabledAutomations:o,isLoading:a})})]})}function lc(){const{data:e}=Zn();return(0,ws.jsx)(mr,{wrap:"wrap",children:e.networkInterfaces.map(e=>{if("localhost"===e.name&&!Yt)return null;const t=Kn(e.address);return(0,ws.jsxs)(ti,{copyValue:t,onClick:()=>(e=>Yn(e))(t),children:[`${e.name} - ${e.address}`," ",(0,ws.jsx)(ln,{className:va.goIcon})]},e.name)})})}function cc(){Na=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)ka[t]=e[t],Ca[e.charCodeAt(t)]=t;Ca["-".charCodeAt(0)]=62,Ca["_".charCodeAt(0)]=63}function dc(e){return ka[e>>18&63]+ka[e>>12&63]+ka[e>>6&63]+ka[63&e]}function uc(e,t,n){for(var i,r=[],s=t;s<n;s+=3)i=(e[s]<<16)+(e[s+1]<<8)+e[s+2],r.push(dc(i));return r.join("")}function hc(e){var t;Na||cc();for(var n=e.length,i=n%3,r="",s=[],a=16383,o=0,l=n-i;o<l;o+=a)s.push(uc(e,o,o+a>l?l:o+a));return 1===i?(t=e[n-1],r+=ka[t>>2],r+=ka[t<<4&63],r+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],r+=ka[t>>10],r+=ka[t>>4&63],r+=ka[t<<2&63],r+="="),s.push(r),s.join("")}function mc(e,t,n,i,r){var s,a,o=8*r-i-1,l=(1<<o)-1,c=l>>1,d=-7,u=n?r-1:0,h=n?-1:1,m=e[t+u];for(u+=h,s=m&(1<<-d)-1,m>>=-d,d+=o;d>0;s=256*s+e[t+u],u+=h,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=i;d>0;a=256*a+e[t+u],u+=h,d-=8);if(0===s)s=1-c;else{if(s===l)return a?NaN:1/0*(m?-1:1);a+=Math.pow(2,i),s-=c}return(m?-1:1)*a*Math.pow(2,s-i)}function pc(e,t,n,i,r,s){var a,o,l,c=8*s-r-1,d=(1<<c)-1,u=d>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:s-1,p=i?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+u>=1?h/l:h*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=d?(o=0,a=d):a+u>=1?(o=(t*l-1)*Math.pow(2,r),a+=u):(o=t*Math.pow(2,u-1)*Math.pow(2,r),a=0));r>=8;e[n+m]=255&o,m+=p,o/=256,r-=8);for(a=a<<r|o,c+=r;c>0;e[n+m]=255&a,m+=p,a/=256,c-=8);e[n+m-p]|=128*f}function fc(){return gc.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _c(e,t){if(fc()<t)throw new RangeError("Invalid typed array length");return gc.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=gc.prototype:(null===e&&(e=new gc(t)),e.length=t),e}function gc(e,t,n){if(!(gc.TYPED_ARRAY_SUPPORT||this instanceof gc))return new gc(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return jc(this,e)}return xc(this,e,t,n)}function xc(e,t,n,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i),gc.TYPED_ARRAY_SUPPORT?(e=t).__proto__=gc.prototype:e=bc(e,t),e}(e,t,n,i):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!gc.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|kc(t,n),r=(e=_c(e,i)).write(t,n);return r!==i&&(e=e.slice(0,r)),e}(e,t,n):function(e,t){if(wc(t)){var n=0|vc(t.length);return 0===(e=_c(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?_c(e,0):bc(e,t);if("Buffer"===t.type&&Ia(t.data))return bc(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function yc(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function jc(e,t){if(yc(t),e=_c(e,t<0?0:0|vc(t)),!gc.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function bc(e,t){var n=t.length<0?0:0|vc(t.length);e=_c(e,n);for(var i=0;i<n;i+=1)e[i]=255&t[i];return e}function vc(e){if(e>=fc())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+fc().toString(16)+" bytes");return 0|e}function wc(e){return!(null==e||!e._isBuffer)}function kc(e,t){if(wc(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Yc(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Jc(e).length;default:if(i)return Yc(e).length;t=(""+t).toLowerCase(),i=!0}}function Cc(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Bc(this,t,n);case"utf8":case"utf-8":return Lc(this,t,n);case"ascii":return Dc(this,t,n);case"latin1":case"binary":return Fc(this,t,n);case"base64":return qc(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vc(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function Sc(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function Nc(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=gc.from(t,i)),wc(t))return 0===t.length?-1:Ec(e,t,n,i,r);if("number"==typeof t)return t&=255,gc.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Ec(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function Ec(e,t,n,i,r){var s,a=1,o=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,o/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var d=-1;for(s=n;s<o;s++)if(c(e,s)===c(t,-1===d?0:s-d)){if(-1===d&&(d=s),s-d+1===l)return d*a}else-1!==d&&(s-=s-d),d=-1}else for(n+l>o&&(n=o-l),s=n;s>=0;s--){for(var u=!0,h=0;h<l;h++)if(c(e,s+h)!==c(t,h)){u=!1;break}if(u)return s}return-1}function Ic(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var a=0;a<i;++a){var o=parseInt(t.substr(2*a,2),16);if(isNaN(o))return a;e[n+a]=o}return a}function Rc(e,t,n,i){return Qc(Yc(t,e.length-n),e,n,i)}function Tc(e,t,n,i){return Qc(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function Pc(e,t,n,i){return Tc(e,t,n,i)}function Oc(e,t,n,i){return Qc(Jc(t),e,n,i)}function Ac(e,t,n,i){return Qc(function(e,t){for(var n,i,r,s=[],a=0;a<e.length&&!((t-=2)<0);++a)i=(n=e.charCodeAt(a))>>8,r=n%256,s.push(r),s.push(i);return s}(t,e.length-n),e,n,i)}function qc(e,t,n){return 0===t&&n===e.length?hc(e):hc(e.slice(t,n))}function Lc(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var s,a,o,l,c=e[r],d=null,u=c>239?4:c>223?3:c>191?2:1;if(r+u<=n)switch(u){case 1:c<128&&(d=c);break;case 2:128==(192&(s=e[r+1]))&&(l=(31&c)<<6|63&s)>127&&(d=l);break;case 3:s=e[r+1],a=e[r+2],128==(192&s)&&128==(192&a)&&(l=(15&c)<<12|(63&s)<<6|63&a)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:s=e[r+1],a=e[r+2],o=e[r+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(l=(15&c)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(d=l)}null===d?(d=65533,u=1):d>65535&&(d-=65536,i.push(d>>>10&1023|55296),d=56320|1023&d),i.push(d),r+=u}return function(e){var t=e.length;if(t<=Ra)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=Ra));return n}(i)}function Dc(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function Fc(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function Bc(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var r="",s=t;s<n;++s)r+=Kc(e[s]);return r}function Vc(e,t,n){for(var i=e.slice(t,n),r="",s=0;s<i.length;s+=2)r+=String.fromCharCode(i[s]+256*i[s+1]);return r}function Mc(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function zc(e,t,n,i,r,s){if(!wc(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function $c(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,s=Math.min(e.length-n,2);r<s;++r)e[n+r]=(t&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function Uc(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,s=Math.min(e.length-n,4);r<s;++r)e[n+r]=t>>>8*(i?r:3-r)&255}function Hc(e,t,n,i,r,s){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Wc(e,t,n,i,r){return r||Hc(e,0,n,4),pc(e,t,n,i,23,4),n+4}function Gc(e,t,n,i,r){return r||Hc(e,0,n,8),pc(e,t,n,i,52,8),n+8}function Kc(e){return e<16?"0"+e.toString(16):e.toString(16)}function Yc(e,t){var n;t=t||1/0;for(var i=e.length,r=null,s=[],a=0;a<i;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function Jc(e){return function(e){var t,n,i,r,s,a;Na||cc();var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[o-2]?2:"="===e[o-1]?1:0,a=new Sa(3*o/4-s),i=s>0?o-4:o;var l=0;for(t=0,n=0;t<i;t+=4,n+=3)r=Ca[e.charCodeAt(t)]<<18|Ca[e.charCodeAt(t+1)]<<12|Ca[e.charCodeAt(t+2)]<<6|Ca[e.charCodeAt(t+3)],a[l++]=r>>16&255,a[l++]=r>>8&255,a[l++]=255&r;return 2===s?(r=Ca[e.charCodeAt(t)]<<2|Ca[e.charCodeAt(t+1)]>>4,a[l++]=255&r):1===s&&(r=Ca[e.charCodeAt(t)]<<10|Ca[e.charCodeAt(t+1)]<<4|Ca[e.charCodeAt(t+2)]>>2,a[l++]=r>>8&255,a[l++]=255&r),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Ta,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Qc(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function Zc(e){return null!=e&&(!!e._isBuffer||Xc(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Xc(e.slice(0,0))}(e))}function Xc(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function ed(e){const t=[];t.push(Za);for(const n of e)t.push([String(n.index),n.title,n.cue,s(n.scheduledStart),s(n.actualStart),s(n.scheduledEnd),s(n.actualEnd)]);return Qa(t)}function td(){const{data:e}=Fr(),{data:t}=Ui(),n=(0,js.useMemo)(()=>function(e,t,n){if(0===Object.keys(e).length)return[];if(0===n.length)return[];const i=[];let r=1;for(let s=0;s<n.length;s++){const a=n[s],o=t[a];o&&b(o)&&(a in e||i.push({id:a,index:r,title:o.title,cue:o.cue,scheduledStart:o.timeStart,actualEnd:null,scheduledEnd:o.timeEnd,actualStart:null}),a in e&&i.push({id:a,index:r,title:o.title,cue:o.cue,scheduledStart:o.timeStart,actualEnd:e[a].endedAt,scheduledEnd:o.timeEnd,actualStart:e[a].startedAt}),r++)}return i}(e,t.entries,t.flatOrder),[e,t.entries,t.flatOrder]);return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Report"}),(0,ws.jsx)(br,{}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(yr,{children:["Manage report",(0,ws.jsxs)(mr,{children:[(0,ws.jsxs)(qe,{onClick:()=>(e=>{e&&u(N(ed(e),"text/csv;charset=utf-8;"),"ontime-report.csv")})(n),disabled:0===n.length,children:[(0,ws.jsx)(fn,{}),"Export CSV"]}),(0,ws.jsxs)(qe,{variant:"subtle-destructive",onClick:async()=>await Dr(),disabled:0===n.length,children:[(0,ws.jsx)(fn,{}),"Clear All"]})]})]})}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{children:"#"}),(0,ws.jsx)("th",{children:"Cue"}),(0,ws.jsx)("th",{children:"Title"}),(0,ws.jsx)("th",{children:"Scheduled Start"}),(0,ws.jsx)("th",{children:"Actual Start"}),(0,ws.jsx)("th",{children:"Scheduled End"}),(0,ws.jsx)("th",{children:"Actual End"})]})}),(0,ws.jsxs)("tbody",{children:[0===n.length&&(0,ws.jsx)(cr,{title:"No report data yet",description:"Reports are generated as you run through the show, comparing scheduled times against what actually happened."}),n.map(e=>{const t=null===e.actualStart?null:e.actualStart<=e.scheduledStart?"under":"over",n=null===e.actualEnd?null:e.actualEnd<=e.scheduledEnd?"under":"over";return(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{children:e.index}),(0,ws.jsx)("th",{children:e.cue}),(0,ws.jsx)("th",{children:e.title}),(0,ws.jsx)("th",{className:zt([t&&Xa[t]]),children:s(e.scheduledStart)}),(0,ws.jsx)("th",{className:zt([t&&Xa[t]]),children:s(e.actualStart)}),(0,ws.jsx)("th",{className:zt([n&&Xa[n]]),children:s(e.scheduledEnd)}),(0,ws.jsx)("th",{className:zt([n&&Xa[n]]),children:s(e.actualEnd)})]},e.id)})]})]})})]})})}function nd({urlPreset:e,onClose:t}){const{addPreset:n,updatePreset:i,isMutating:r}=et(),{handleSubmit:s,register:a,setFocus:o,setError:l,clearErrors:c,setValue:d,getValues:u,watch:h,formState:{errors:p,isSubmitting:f,isValid:g,isDirty:x}}=Er({defaultValues:e??io,mode:"onChange",resetOptions:{keepDirtyValues:!0}}),y=(0,js.useRef)(null),j=(0,js.useRef)({read:e?.options?.read??"full",write:e?.options?.write??"full"}),[b,v]=(0,js.useState)(j.current);(0,js.useEffect)(()=>{j.current={read:e?.options?.read??"full",write:e?.options?.write??"full"},v(j.current)},[]);const w=e&&e.target===_.Cuesheet,k=h("target")===_.Cuesheet,C=k&&(b.read!==j.current.read||b.write!==j.current.write),S=k&&"-"===b.read;return(0,js.useEffect)(()=>{o("alias")},[o]),(0,ws.jsx)(Tr,{isOpen:!0,onClose:t,showBackdrop:!0,showCloseButton:!0,size:"compact",title:e?"Edit URL preset":"Create URL preset",bodyElements:(0,ws.jsxs)("form",{id:no,onSubmit:s(async r=>{try{const s=r.target===_.Cuesheet?{...r,target:_.Cuesheet,options:b}:r;e?await i(e.alias,s):await n(s),t()}catch(s){l("root",{message:m(s)})}}),className:eo.column,children:[(0,ws.jsx)("input",{hidden:!0,name:"enabled",value:"true"}),(0,ws.jsx)("div",{children:"1. Enter URL and let Ontime generate the preset options"}),(0,ws.jsxs)(mr,{children:[(0,ws.jsxs)("div",{children:[(0,ws.jsx)(fr,{children:"Alias"}),(0,ws.jsx)(Zi,{...a("alias",{required:"Alias is required",pattern:{value:bi,message:"Field can only contain URL safe characters (a-z, 0-9, _ and -)"}})})]}),(0,ws.jsxs)("div",{className:eo.expand,children:[(0,ws.jsx)(fr,{children:"Generate options (paste URL to generate options)"}),(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(Zi,{placeholder:"Paste URL",fluid:!0,ref:y,disabled:w}),(0,ws.jsx)(qe,{onClick:()=>{c();try{const e=ir(u("alias"),y.current?.value.trim()??"");d("target",e.target,{shouldDirty:!0,shouldValidate:!0}),d("search",e.search,{shouldDirty:!0,shouldValidate:!0})}catch(e){return void l("root",{message:I(e)})}},disabled:w,children:"Generate"})]})]})]}),p.alias?.message&&(0,ws.jsx)(gr,{children:p.alias.message}),!w&&(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsxs)("div",{children:["–"," or ","–"]}),(0,ws.jsx)("div",{children:"2. Choose a view and its parameters"}),(0,ws.jsxs)("div",{children:[(0,ws.jsx)(fr,{children:"Target"}),(0,ws.jsx)(Et,{options:to,...a("target",{required:"Target is required"}),value:h("target"),onValueChange:e=>{null!==e&&d("target",e,{shouldDirty:!0})}})]}),(0,ws.jsxs)("div",{children:[(0,ws.jsx)(fr,{children:"Parameters"}),(0,ws.jsx)(Mr,{fluid:!0,rows:3,...a("search",{validate:e=>{try{return new URLSearchParams(e),!0}catch(t){return I(t)||"Invalid URL parameters"}}})}),(0,ws.jsx)(gr,{children:p.search?.message})]})]}),k&&(0,ws.jsxs)("div",{children:[(0,ws.jsx)(fr,{children:"Permissions"}),(0,ws.jsx)(vi,{initialRead:j.current.read,initialWrite:j.current.write,onChange:v})]})]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(gr,{children:p.root?.message}),(0,ws.jsx)(qe,{onClick:t,children:"Cancel"}),(0,ws.jsx)(qe,{variant:"primary",type:"submit",form:no,disabled:!g||!x&&!C||S,loading:f||r,children:"Save"})]})})}function id(){const[e,t]=(0,js.useState)({isOpen:!1,preset:void 0}),[n,i]=(0,js.useState)(null),{data:r,status:s}=nt(),{updatePreset:a,deletePreset:o,isMutating:l}=et(),c=()=>t({isOpen:!0}),d=async e=>{i(null);try{await a(e.alias,e)}catch(t){i(m(t))}};return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[e.isOpen&&(0,ws.jsx)(nd,{urlPreset:e.preset,onClose:()=>t({isOpen:!1,preset:void 0})}),(0,ws.jsxs)(ar,{children:["URL presets",(0,ws.jsxs)(qe,{onClick:c,children:["New ",(0,ws.jsx)(Jt,{})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(Rr,{children:["URL presets are user pre-defined aliases to Ontime URLs.",(0,ws.jsx)("br",{}),"This URL can contain full configuration including parameters, or simply route to a specific view.",(0,ws.jsx)("br",{}),(0,ws.jsx)("br",{}),"The easiest way to get started is to copy an URL from your browser and paste it into the form.",(0,ws.jsx)(Sl,{href:ro,children:"See the docs"})]})}),(0,ws.jsxs)(ur,{children:[(0,ws.jsx)(rr,{isLoading:"pending"===s}),n&&(0,ws.jsx)(gr,{children:n}),(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{children:"Enabled"}),(0,ws.jsx)("th",{children:"Show in nav"}),(0,ws.jsx)("th",{children:"Target view"}),(0,ws.jsx)("th",{children:"Alias"}),(0,ws.jsx)("th",{})]})}),(0,ws.jsxs)("tbody",{children:[0===r.length&&(0,ws.jsx)(cr,{title:"No URL presets yet",description:"A preset gives one of your views a short, memorable address, with all of its options baked in.",action:(0,ws.jsxs)(qe,{variant:"primary",onClick:c,children:["Create preset ",(0,ws.jsx)(Jt,{})]})}),r.map((e,n)=>{const i=e.target===_.Cuesheet;return(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("td",{children:(0,ws.jsx)($n,{checked:e.enabled,onCheckedChange:t=>d({...e,enabled:t}),disabled:l,"aria-label":"Toggle preset enabled"})}),(0,ws.jsx)("td",{children:(0,ws.jsx)($n,{checked:e.displayInNav,onCheckedChange:t=>d({...e,displayInNav:t}),disabled:l||i})}),(0,ws.jsx)("td",{children:(0,ws.jsx)(Di,{children:e.target})}),(0,ws.jsx)("td",{style:{width:"100%"},children:e.alias}),(0,ws.jsxs)(mr,{relation:"inner",as:"td",children:[(0,ws.jsx)(Qi,{variant:"ghosted-white",onClick:t=>Xn(e.alias,t),disabled:l,children:(0,ws.jsx)(nn,{})}),(0,ws.jsx)(Qi,{onClick:()=>(e=>t({isOpen:!0,preset:e}))(e),variant:"ghosted-white","aria-label":"Edit entry","data-testid":`field__edit_${n}`,disabled:l,children:(0,ws.jsx)(Rn,{})}),(0,ws.jsx)(Qi,{onClick:()=>o(e.alias),variant:"ghosted-destructive","aria-label":"Delete entry","data-testid":`field__delete_${n}`,disabled:l,children:(0,ws.jsx)(mn,{})})]})]},e.alias)})]})]})]})]})})}function rd({location:e}){const t=Tl("presets",e),n=Tl("link",e),i=Tl("report",e);return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(hr,{children:"Sharing and reporting"}),(0,ws.jsx)("div",{ref:t,children:(0,ws.jsx)(id,{})}),(0,ws.jsx)("div",{ref:n,children:(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Share Ontime Link"}),!Vt&&(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(kr,{children:"Ontime is streaming on the following network interfaces"}),(0,ws.jsx)(lc,{})]}),(0,ws.jsx)(br,{}),(0,ws.jsx)(Ci,{})]})})}),(0,ws.jsx)("div",{ref:i,children:(0,ws.jsx)(td,{})})]})}function sd(e){const{colour:t,label:n,fieldKey:i,type:r,onEdit:s,onDelete:a}=e;return(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("td",{children:(0,ws.jsx)(hi,{color:t})}),(0,ws.jsx)("td",{children:(0,ws.jsx)(Di,{children:r})}),(0,ws.jsx)("td",{className:so.halfWidth,children:n}),(0,ws.jsx)("td",{className:so.fullWidth,children:(0,ws.jsx)(ti,{size:"small",copyValue:i,children:i})}),(0,ws.jsxs)(mr,{relation:"inner",as:"td",children:[(0,ws.jsx)(Qi,{variant:"ghosted-white","aria-label":"Edit entry",onClick:s,children:(0,ws.jsx)(Rn,{})}),(0,ws.jsx)(Qi,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>a(i),children:(0,ws.jsx)(mn,{})})]})]})}function ad({onSubmit:e,onCancel:t,initialColour:n,initialLabel:i,initialKey:r,initialType:s}){const{data:a}=Xr(),[o,l]=(0,js.useState)(n||""),{handleSubmit:c,register:d,setFocus:u,setError:h,setValue:p,getValues:f,watch:_,formState:{errors:g,isSubmitting:x,isValid:y,isDirty:j}}=Er({defaultValues:{type:s??"text",label:i||"",colour:n||""},resetOptions:{keepDirtyValues:!0}});(0,js.useEffect)(()=>{u("label")},[u]);const b=f("colour"),v=j&&y,w=void 0!==r;return(0,ws.jsx)(Tr,{isOpen:!0,onClose:t,showBackdrop:!0,showCloseButton:!0,size:"compact",title:w?"Edit custom field":"Create custom field",bodyElements:(0,ws.jsxs)("form",{id:ao,onSubmit:c(async t=>{const{type:n,label:i,colour:r}=t,s={type:n,colour:r,label:i};try{await e(s)}catch(a){h("root",{type:"custom",message:m(a)})}}),className:so.formColumn,children:[(0,ws.jsxs)(Rr,{children:["Please note that images can quickly deteriorate your app's performance.",(0,ws.jsx)("br",{}),"Prefer using small, and compressed images."]}),(0,ws.jsxs)("div",{children:[(0,ws.jsx)(fr,{children:"Type"}),(0,ws.jsx)(wi,{orientation:"horizontal",disabled:w,onValueChange:e=>p("type",e,{shouldDirty:!0}),value:_("type"),items:[{value:"text",label:"Text"},{value:"image",label:"Image"}]})]}),(0,ws.jsxs)("div",{className:so.twoCols,children:[(0,ws.jsxs)("label",{children:[(0,ws.jsx)(fr,{children:"Label (only alphanumeric characters are allowed)"}),g.label&&(0,ws.jsx)(gr,{children:g.label.message}),(0,ws.jsx)(Zi,{...d("label",{required:{value:!0,message:"Required field"},onChange:()=>p("key",gl(f("label"))??"N/A"),validate:e=>0===e.trim().length?"Required field":or.isAlphanumericWithSpace(e)?!(!w&&Object.hasOwn(a,gl(e)??""))||"Custom fields must be unique":"Only alphanumeric characters and space are allowed"}),fluid:!0})]}),(0,ws.jsxs)("label",{children:[(0,ws.jsx)(fr,{children:"Key (use in Integrations and API)"}),(0,ws.jsx)(Zi,{...d("key"),variant:"ghosted",readOnly:!0,fluid:!0})]})]}),(0,ws.jsxs)("label",{children:[(0,ws.jsx)(fr,{children:"Colour"}),(0,ws.jsx)(ui,{name:"colour",value:b,handleChange:(e,t)=>(e=>{l(e),p("colour",e,{shouldDirty:!0})})(t)})]})]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[g.root&&(0,ws.jsx)(gr,{children:g.root.message}),(0,ws.jsx)(qe,{variant:"ghosted",onClick:t,children:"Cancel"}),(0,ws.jsx)(qe,{type:"submit",form:ao,variant:"primary",disabled:!v,loading:x,children:"Save"})]})})}function od(){const{data:e,refetch:t}=Xr(),[n,i]=(0,js.useState)({isOpen:!1,field:void 0}),r=()=>i({isOpen:!0}),s=()=>i({isOpen:!1,field:void 0}),a=async e=>{try{await Qr(e),t()}catch(n){}},o=Object.entries(e);return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[n.isOpen&&(0,ws.jsx)(ad,{onSubmit:async e=>{const i=n.field;i?await Zr(i.key,e):await Jr(e),t(),s()},onCancel:s,initialColour:n.field?.colour,initialLabel:n.field?.label,initialKey:n.field?.key,initialType:n.field?.type}),(0,ws.jsxs)(ar,{children:["Custom fields",(0,ws.jsxs)(qe,{onClick:r,children:["New ",(0,ws.jsx)(Jt,{})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(Rr,{children:[(0,ws.jsx)("span",{children:"Custom fields allow for additional information to be added to an event."}),(0,ws.jsxs)("span",{children:["To use custom fields as a data source in an"," ",(0,ws.jsx)(Lr,{search:"settings=automation__automations",children:"Automation"}),", please note the generated key."]}),(0,ws.jsx)(Sl,{href:Gt,children:"See the docs"})]})}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{children:"Colour"}),(0,ws.jsx)("th",{children:"Type"}),(0,ws.jsx)("th",{children:"Name"}),(0,ws.jsx)("th",{children:"Key (used in Automations)"}),(0,ws.jsx)("th",{})]})}),(0,ws.jsxs)("tbody",{children:[0===o.length&&(0,ws.jsx)(cr,{title:"No custom fields yet",description:"Custom fields add your own columns to the rundown, and can be shown in views or used in automations.",action:(0,ws.jsxs)(qe,{variant:"primary",onClick:r,children:["Create custom field ",(0,ws.jsx)(Jt,{})]})}),o.map(([e,{colour:t,label:n,type:r}])=>(0,ws.jsx)(sd,{fieldKey:e,colour:t,label:n,type:r,onEdit:()=>i({isOpen:!0,field:{key:e,colour:t,label:n,type:r}}),onDelete:a},e))]})]})})]})})}function ld({onSubmit:e,onCancel:t,initialTitle:n}){const{handleSubmit:i,register:r,setFocus:s,setError:a,formState:{errors:o,isSubmitting:l,isValid:c,isDirty:d}}=Er({defaultValues:{title:n},mode:"onChange"});(0,js.useEffect)(()=>{s("title")},[s]);const u=d&&c;return(0,ws.jsxs)(Sr,{as:"form",onSubmit:i(async t=>{try{await e(t.title)}catch(n){a("root",{type:"custom",message:m(n)})}}),onKeyDown:e=>Gn(e,t),children:[(0,ws.jsxs)("label",{children:[(0,ws.jsx)(fr,{children:"Rundown title"}),(0,ws.jsx)(Zi,{...r("title",{required:{value:!0,message:"Title is required"},validate:e=>0===e.trim().length?"Title cannot be empty":!1!==or.isAlphanumericWithSpace(e)||"Title can only contain alphanumeric characters, spaces and underscores"}),maxLength:64,fluid:!0}),o.title&&(0,ws.jsx)(gr,{children:o.title.message})]}),o.root&&(0,ws.jsx)(gr,{children:o.root.message}),(0,ws.jsxs)(mr,{relation:"inner",align:"end",children:[(0,ws.jsx)(qe,{variant:"ghosted",onClick:t,children:"Cancel"}),(0,ws.jsx)(qe,{type:"submit",variant:"primary",disabled:!u,loading:l,children:"Save"})]})]})}function cd({onClose:e}){const{create:t}=Ki(),{handleSubmit:n,register:i,setFocus:r,setError:s,formState:{errors:a,isSubmitting:o}}=Er({defaultValues:{title:""}});return(0,js.useEffect)(()=>{r("title")},[r]),(0,ws.jsx)(Tr,{isOpen:!0,onClose:e,showBackdrop:!0,showCloseButton:!0,size:"small",title:"Create rundown",bodyElements:(0,ws.jsx)("form",{id:lo,onSubmit:n(async n=>{try{await t(n.title||"untitled"),e()}catch(i){s("root",{message:`Failed to create rundown. ${i}`})}}),children:(0,ws.jsxs)("label",{children:[(0,ws.jsx)(fr,{children:"Rundown title"}),(0,ws.jsx)(Zi,{...i("title"),fluid:!0,placeholder:"Your rundown name",maxLength:64})]})}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[a.root&&(0,ws.jsx)(gr,{children:a.root.message}),(0,ws.jsx)(qe,{variant:"ghosted",disabled:o,onClick:e,children:"Cancel"}),(0,ws.jsx)(qe,{type:"submit",form:lo,variant:"primary",disabled:o,children:"Create rundown"})]})})}function dd(){const{data:e}=Yi(),{duplicate:t,remove:n,load:i,rename:r}=Ki(),[s,a]=si(),[o,l]=si(),[c,d]=si(),[h,p]=(0,js.useState)(""),[f,_]=(0,js.useState)(null),[g,x]=(0,js.useState)(null),y=async(e,t)=>{await async function(e,t,n){try{u((await sn.get(`${oo}/${e}/export`,{signal:n?.signal,timeout:n?.timeout??lr.longTimeout,responseType:"blob"})).data,`${t??"Ontime_rundown"}.xlsx`)}catch(i){console.error("Error downloading file:",i)}}(e,t)},j=fs();return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsxs)(ar,{children:["Manage project rundowns",(0,ws.jsx)(mr,{children:(0,ws.jsxs)(qe,{onClick:()=>{x(null),d.open()},children:["New ",(0,ws.jsx)(Jt,{})]})})]}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(ur,{children:[c&&(0,ws.jsx)(cd,{onClose:d.close}),g&&(0,ws.jsx)(gr,{children:g}),(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{children:"# Entries"}),(0,ws.jsx)("th",{style:{width:"100%"},children:"Title"}),(0,ws.jsx)("th",{})]})}),(0,ws.jsx)("tbody",{children:e?.rundowns?.map(({id:n,numEntries:i,title:s})=>{const o=e.loaded===n;return f===n?(0,ws.jsx)("tr",{children:(0,ws.jsx)("td",{colSpan:3,children:(0,ws.jsx)(ld,{onCancel:()=>_(null),onSubmit:e=>(async(e,t)=>{try{await r([e,t]),_(null)}catch(n){x(`Failed to rename rundown. ${m(n)}`)}})(n,e),initialTitle:s})})},n):(0,ws.jsxs)("tr",{className:zt([o&&so.current]),children:[(0,ws.jsx)("td",{children:i}),(0,ws.jsxs)("td",{children:[s," ",o&&(0,ws.jsx)(Di,{variant:"active",children:"Loaded"})]}),(0,ws.jsx)("td",{children:(0,ws.jsx)(xi,{render:(0,ws.jsx)(Qi,{variant:"ghosted-white","data-testId":"rundown_menu"}),items:[{type:"item",icon:Mt,label:"Rename",onClick:()=>(e=>{x(null),_(e)})(n)},{type:"item",icon:Lt,label:"Load",onClick:()=>(e=>{x(null),p(e),l.open()})(n),disabled:o},{type:"item",icon:Zt,label:"Download .xlsx",onClick:()=>y(n,s)},{type:"item",icon:Bn,label:"Duplicate",onClick:()=>(async e=>{x(null),_(null),p("");try{await t(e)}catch(n){x(`Failed to duplicate rundown. ${m(n)}`)}})(n)},{type:"item",icon:Pr,label:"Edit in cuesheet",onClick:()=>j(n)},{type:"divider"},{type:"destructive",icon:mn,label:"Delete",onClick:()=>(e=>{x(null),p(e),a.open()})(n),disabled:o}],children:(0,ws.jsx)(Bt,{})})})]},n)})})]})]})]})}),(0,ws.jsx)(Jn,{isOpen:s,onClose:a.close,title:"Delete rundown",showBackdrop:!0,showCloseButton:!0,bodyElements:(0,ws.jsxs)(ws.Fragment,{children:["You will lose all data in your rundown. ",(0,ws.jsx)("br",{})," Are you sure?"]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(qe,{size:"large",onClick:a.close,children:"Cancel"}),(0,ws.jsx)(qe,{variant:"destructive",size:"large",onClick:async()=>{try{await n(h)}catch(e){x(`Failed to delete rundown. ${m(e)}`)}finally{a.close()}},children:"Delete rundown"})]})}),(0,ws.jsx)(Jn,{isOpen:o,onClose:l.close,title:"Load rundown",showBackdrop:!0,showCloseButton:!0,bodyElements:(0,ws.jsxs)(ws.Fragment,{children:["The current playback will be stopped. ",(0,ws.jsx)("br",{})," Are you sure?"]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(qe,{size:"large",onClick:l.close,children:"Cancel"}),(0,ws.jsx)(qe,{variant:"primary",size:"large",onClick:async()=>{try{await i(h)}catch(e){x(`Failed to load rundown. ${m(e)}`)}finally{l.close()}},children:"Load rundown"})]})})]})}function ud(){const{defaultDuration:e,linkPrevious:t,defaultTimeStrategy:n,defaultWarnTime:i,defaultDangerTime:r,defaultTimerType:s,defaultEndAction:a,inheritGroupColour:o,setDefaultDuration:l,setLinkPrevious:c,setTimeStrategy:d,setWarnTime:u,setDangerTime:h,setDefaultTimerType:m,setDefaultEndAction:f,setInheritGroupColour:_}=Vr(e=>e),g=Pi(e),x=Pi(i),y=Pi(r);return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Rundown defaults"}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(ur,{children:[(0,ws.jsx)(yr,{children:"Default settings for new events"}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Link previous",description:"Whether the start time of new events should be linked to the previous event end time"}),(0,ws.jsx)($n,{size:"large",checked:t,onCheckedChange:c})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Inherit group colour",description:"Whether new events and milestones inherit the colour of their parent group"}),(0,ws.jsx)($n,{size:"large",checked:o,onCheckedChange:_})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Timer strategy",description:"Which time should be maintained when event schedule is recalculated"}),(0,ws.jsx)(Et,{value:n,onValueChange:e=>{null!==e&&d(e)},options:[{value:p.LockDuration,label:"Duration"},{value:p.LockEnd,label:"End Time"}]})]})]}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Default duration",description:"Default duration for new events"}),(0,ws.jsx)(qr,{name:"defaultDuration",submitHandler:(e,t)=>l(t),time:g,placeholder:zr.duration})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Timer type",description:"Default type of timer for new events"}),(0,ws.jsx)(Et,{value:s,onValueChange:e=>{null!==e&&m(e)},options:[{value:$.CountDown,label:"Count down"},{value:$.CountUp,label:"Count up"},{value:$.Clock,label:"Clock"},{value:$.None,label:"None"}]})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"End Action",description:"Default end action for new events"}),(0,ws.jsx)(Et,{value:a,onValueChange:e=>{null!==e&&f(e)},options:[{value:E.None,label:"None"},{value:E.LoadNext,label:"Load next"},{value:E.PlayNext,label:"Play next"}]})]})]}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Warning time",description:"Default threshold for warning time in an event"}),(0,ws.jsx)(qr,{name:"warnTime",submitHandler:(e,t)=>u(t),time:x,placeholder:zr.warnTime})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Danger time",description:"Default threshold for danger time in an event"}),(0,ws.jsx)(qr,{name:"dangerTime",submitHandler:(e,t)=>h(t),time:y,placeholder:zr.dangerTime})]})]})]})]})})}function hd(e){if(!function(e){return e?.name.endsWith(".json")}(e))throw new Error("Unknown file type");if(0===e.size)throw new Error("File is empty");if(e.size>2e6)throw new Error("File size limit (2MB) exceeded")}function md(){return localStorage.getItem(yo)??""}function pd(e){const{onCancel:t,onSheetLoaded:n,closedByUser:i}=e,[r,s]=(0,js.useState)(null),[a,o]=(0,js.useState)(md),[l,c]=(0,js.useState)("not_authenticated"),[d,u]=(0,js.useState)(null),[h,p]=(0,js.useState)(""),[f,_]=(0,js.useState)(""),[g,x]=(0,js.useState)(""),[y,j]=(0,js.useState)(""),b=(0,js.useRef)(null),v=(0,js.useRef)(null),w=(0,js.useRef)(null),k=(0,js.useCallback)(()=>{null!==b.current&&(window.clearTimeout(b.current),b.current=null)},[]),C=(0,js.useCallback)(()=>{null!==v.current&&(window.clearTimeout(v.current),v.current=null)},[]),S=(0,js.useCallback)(()=>{null!==w.current&&(window.removeEventListener("focus",w.current),w.current=null)},[]),N=(0,js.useCallback)(async e=>{const t=await _o(e);!function(e){localStorage.setItem(yo,e)}(e),n(e,t),j("")},[n]),E=(0,js.useCallback)(async(e=0)=>{if(k(),!i)try{const n=await uo();if(c(n.authenticated),o(n.sheetId),"pending"===n.authenticated)return e<10?void(b.current=window.setTimeout(()=>{E(e+1)},2e3)):(u(null),void _(""));if("authenticated"===n.authenticated&&n.sheetId){_("load-sheet");try{await N(n.sheetId)}catch(t){j(m(t))}}u(null),_("")}catch(t){x(m(t)),u(null),_("")}},[k,N,i]);(0,js.useEffect)(()=>(x(""),E(),()=>{S(),k(),C()}),[C,S,k,E]);const I=Boolean(r)&&Boolean(a),R=Boolean(a),T=Boolean(d)&&Boolean(h),P=Boolean(f),O="authenticated"===l,A="pending"===l,q=O?"Connected":A?"Waiting for confirmation":"Not connected",L=O?jo.statusReady:A?jo.statusPending:jo.statusIdle,D=O?"default":"warning",F=O?"Load a spreadsheet by its Google Sheet ID.":T?"Finish the device verification in your browser, then return here.":"Upload your client secret and enter the sheet ID you want to access.";return(0,ws.jsxs)(ur,{className:jo.setupShell,children:[(0,ws.jsxs)(yr,{children:["Sync with Google Sheet (experimental)",O?(0,ws.jsx)(qe,{onClick:async()=>{_("cancel");try{c((await mo()).authenticated),o(""),u(null),p(""),x(""),j("")}catch(e){x(m(e))}finally{_("")}},loading:"cancel"===f,children:"Revoke Authentication"}):(0,ws.jsx)(qe,{onClick:()=>{t()},children:"Go Back"})]}),(0,ws.jsxs)("div",{className:jo.setupIntro,children:[(0,ws.jsxs)("div",{className:jo.setupIntroText,children:[(0,ws.jsx)("p",{className:jo.setupLead,children:q}),(0,ws.jsx)("p",{className:jo.setupBody,children:F})]}),(0,ws.jsx)(Di,{className:L,variant:D,children:q})]}),!O&&(0,ws.jsxs)(Cr,{className:jo.setupBlock,children:[(0,ws.jsx)(fr,{children:"Upload Client Secret provided by Google"}),(0,ws.jsx)(gr,{children:g}),(0,ws.jsx)(Zi,{fluid:!0,type:"file",onChange:e=>{e.target.files?.length&&s(e.target.files[0])},accept:".json",disabled:P||T}),(0,ws.jsx)("div",{className:jo.setupHint,children:"Use the OAuth client JSON downloaded from your Google Cloud project."})]}),O&&g&&(0,ws.jsx)(Cr,{className:jo.setupBlock,children:(0,ws.jsx)(gr,{children:g})}),(0,ws.jsxs)(Cr,{className:jo.setupBlock,children:[(0,ws.jsx)(fr,{children:"Enter ID of sheet to synchronize"}),(0,ws.jsx)(gr,{children:y}),(0,ws.jsx)(Zi,{fluid:!0,value:a,placeholder:"Sheet ID or Google Sheets URL",onChange:e=>{j(""),o(function(e){const t=e.trim(),n=t.match(xo);return n?n[1]:t.split(/[?#]/)[0]}(e.target.value))},disabled:P||T}),(0,ws.jsx)("div",{className:jo.setupHint,children:"Paste a Google Sheets URL or the sheet ID from the URL bar."})]}),O?(0,ws.jsxs)(Cr,{className:jo.setupBlock,children:[(0,ws.jsx)(fr,{children:"Load the current spreadsheet configuration"}),(0,ws.jsx)(mr,{wrap:"wrap",className:jo.setupActions,children:(0,ws.jsxs)(qe,{onClick:async()=>{if(a){_("load-sheet"),j("");try{await N(a)}catch(e){j(m(e))}finally{_("")}}},disabled:!R||P,loading:"load-sheet"===f,children:[(0,ws.jsx)(xn,{}),"Load sheet"]})})]}):T?(0,ws.jsxs)(Cr,{className:jo.setupBlock,children:[(0,ws.jsx)(fr,{children:"Copy the device code, then authenticate with Google"}),(0,ws.jsxs)(mr,{wrap:"wrap",className:jo.setupActions,children:[A&&(0,ws.jsx)("span",{children:"Authenticating..."}),(0,ws.jsx)(ti,{copyValue:d??"",children:d}),(0,ws.jsxs)(qe,{onClick:()=>{function e(){C(),S(),E()}_("authenticate"),x(""),S(),k(),C(),Yn(h),v.current=window.setTimeout(()=>{document.hasFocus()&&_("")},1500),w.current=e,window.addEventListener("focus",e,{once:!0})},disabled:P,loading:"authenticate"===f,children:[(0,ws.jsx)(Pn,{}),"Authenticate"]})]}),(0,ws.jsx)("div",{className:jo.setupHint,children:"Copy the code, then open the browser prompt to complete the flow."})]}):(0,ws.jsxs)(Cr,{className:jo.setupBlock,children:[(0,ws.jsx)(fr,{children:"Generate a Google device code"}),(0,ws.jsx)(mr,{wrap:"wrap",className:jo.setupActions,children:(0,ws.jsxs)(qe,{onClick:async()=>{if(r&&a){_("connect"),x(""),j("");try{const e=await ho(r,a);p(e.verification_url),u(e.user_code)}catch(e){x(m(e))}finally{_("")}}},disabled:!I||P,loading:"connect"===f,children:[(0,ws.jsx)(Cn,{}),"Connect"]})})]})]})}function fd({preview:e,mode:t,disabled:n,loading:i,onApply:r}){const s=l(),a=F(),o=a?e?.rundown.entries[a]:void 0,c=!(void 0!==o&&b(o)&&g(o)),d=s!==S.Stop&&("new"===t||c),[u,h]=(0,js.useState)(!1);return(0,js.useEffect)(()=>{h(!1)},[t,e]),(0,ws.jsx)(qe,{variant:"primary",onClick:()=>{!d||u?r():h(!0)},disabled:n,loading:i,children:d&&u?"Confirm — stop playback & apply import":"Apply import"})}function _d(e){return e?.trim().toLowerCase()??""}function gd(){return{worksheet:"event schedule",builtIn:bo.map(e=>({header:e.defaultHeader,enabled:e.defaultHeader.trim().length>0})),custom:[]}}function xd(e){const t=bo.findIndex(e=>"id"===e.importKey),n=e.builtIn[t];return Boolean(n?.enabled&&n.header.trim())}function yd(e){return e.replace(/[^a-z0-9 ]+/gi," ").replace(/\s+/g," ").trim()}function jd(e){return e.map(({importName:e})=>{const t=e.trim();if(!t)return{importName:"",ontimeName:""};const n=yd(t);return n?{importName:t,ontimeName:n}:{importName:t,ontimeName:""}})}function bd(e){const t=jd(e.custom).reduce((e,{ontimeName:t,importName:n})=>(t&&n&&(e[t]=n),e),{}),n={worksheet:e.worksheet,custom:t};for(let i=0;i<bo.length;i++)n[bo[i].importKey]=e.builtIn[i].enabled?e.builtIn[i].header:"";return n}function vd(e){return W(`import-map:${e}`)}function wd(e){const t=vd(e);try{const e=localStorage.getItem(t);if(!e)return{values:gd(),isPersisted:!1};const n=JSON.parse(e);return function(e){if("object"!=typeof e||null===e)return!1;const t=e;return"string"==typeof t.worksheet&&Array.isArray(t.builtIn)&&t.builtIn.length===bo.length&&Array.isArray(t.custom)}(n)?{values:n,isPersisted:!0}:(localStorage.removeItem(t),{values:gd(),isPersisted:!1})}catch{return localStorage.removeItem(t),{values:gd(),isPersisted:!1}}}function kd(e){return W(`import-mode:${e}`)}function Cd(e){const t=localStorage.getItem(kd(e));return"new"===t||"merge"===t||"override"===t?t:vo}function Sd(e){return e?"Yes":""}function Nd(e,t,n){const i=n.get(e);return i&&"custom"in t?t.custom?.[i]??"":function(e,t){const n=wo.get(e);if(!n)return"";switch(n){case"flag":return b(t)?Sd(t.flag):"";case"timeStart":return"timeStart"in t?R(t.timeStart):"";case"linkStart":return b(t)?Sd(t.linkStart):"";case"timeEnd":return b(t)?R(t.timeEnd):"";case"duration":return b(t)?R(t.duration):"";case"cue":return b(t)||h(t)?t.cue:"";case"title":return"title"in t?t.title:"";case"countToEnd":return b(t)?Sd(t.countToEnd):"";case"skip":return b(t)?Sd(t.skip):"";case"note":return"note"in t?t.note??"":"";case"colour":return"colour"in t?t.colour??"":"";case"endAction":return b(t)?t.endAction:"";case"timerType":return b(t)?t.timerType:"";case"timeWarning":return b(t)?R(t.timeWarning):"";case"timeDanger":return b(t)?R(t.timeDanger):"";case"id":return t.id;default:return""}}(e,t)}function Ed(e,t){return t.includes("\n")?ko.multilineCell:So.has(e)?ko.numericCell:void 0}function Id({preview:e,columnLabels:t,canRefresh:n,isLoadingMetadata:i,isRefreshing:r,needsPreviewRefresh:s,onRefresh:a,worksheetHeaders:o}){const l=(0,js.useMemo)(()=>e?new Map(Object.entries(e.customFields).map(([e,t])=>[t.label,e])):new Map,[e]),c=(0,js.useMemo)(()=>function(e){return[...e].sort((e,t)=>{const n=Co.indexOf(e),i=Co.indexOf(t);return(-1===n?Co.length:n)-(-1===i?Co.length:i)})}(t),[t]),u=(0,js.useMemo)(()=>e?Wi(e.rundown,null):null,[e]);if(!e){let e="Preview not generated",t="Select the fields you want to import, then click Preview import.";return i?(e="Loading worksheet",t="Loading worksheet metadata..."):0===o.length?(e="No headers found",t="No column headers detected in this worksheet. Try a different worksheet or ensure the first row contains column headers."):s&&(e="Preview needs updating",t="Your column mapping changed. Preview the import again to update this table."),(0,ws.jsx)(jr,{title:e,description:t,action:s&&(0,ws.jsx)(qe,{variant:"primary",onClick:a,disabled:!n,loading:r,children:"Refresh preview"})})}return(0,ws.jsxs)("table",{className:ko.table,children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{className:ko.rowNumber,children:"#"}),(0,ws.jsx)("th",{className:ko.rowType,children:"Type"}),c.map((e,t)=>(0,ws.jsx)("th",{children:e},`${e}-${t}`))]})}),(0,ws.jsx)("tbody",{children:e.rundown.flatOrder.map(t=>{const n=e.rundown.entries[t],i=b(n),r=u?.[t],{rowClassName:s,entryColour:a,entryType:o}=function(e,t){if(d(e))return{rowClassName:ko.groupRow,entryColour:e.colour,entryType:"Group"};const n=t??No;return h(e)?{rowClassName:ko.milestoneRow,entryColour:n,entryType:"Milestone"}:j(e)?{rowClassName:ko.eventRow,entryColour:n,entryType:"Delay"}:{rowClassName:ko.eventRow,entryColour:n,entryType:"Event"}}(n,r?.groupColour);return(0,ws.jsxs)("tr",{className:s,style:{"--entry-colour":a},children:[(0,ws.jsx)("td",{className:ko.rowNumber,children:i?r?.eventIndex:""}),(0,ws.jsx)("td",{className:ko.rowType,children:(0,ws.jsx)(Di,{children:o})}),c.map((e,i)=>{const r=Nd(e,n,l);return(0,ws.jsx)("td",{className:Ed(e,r),"data-empty":""===r,title:r||void 0,children:r},`${t}-${i}`)})]},t)})})]})}function Rd({className:e,disabled:t,emptyLabel:n,fluid:i,height:r="medium",inputRef:s,onValueChange:a,options:o,openOnFocus:l=!1,trailingElement:c,value:d,variant:u="subtle",...h}){const m=(0,js.useRef)(null),[p,f]=(0,js.useState)(!1),{onFocus:_,...g}=h;return(0,js.useEffect)(()=>{if(!p)return;const e=function(e){let t=e?.parentElement??null;for(;t;){const{overflowY:e}=window.getComputedStyle(t);if("auto"===e||"scroll"===e||"overlay"===e)return t;t=t.parentElement}return window}(m.current),t=()=>f(!1);return e.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[p]),(0,ws.jsxs)(Ml,{items:o,autoHighlight:!0,highlightItemOnHover:!0,disabled:t,open:p,value:d,onOpenChange:f,onValueChange:a,children:[(0,ws.jsx)(Js,{ref:e=>{m.current=e,s&&("function"!=typeof s?s.current=e:s(e))},onFocus:e=>{_?.(e),l&&f(!0)},className:zt([Ji.input,Ji[u],Ji[r],i&&Ji.fluid,e]),...g}),(0,ws.jsx)(ta,{children:(0,ws.jsx)(na,{side:"bottom",align:"start",className:Eo.positioner,children:(0,ws.jsx)(ra,{className:Eo.popup,"data-hide-empty":n?void 0:"",children:(0,ws.jsxs)(Zs,{className:Eo.list,children:[(0,ws.jsx)($l,{children:e=>(0,ws.jsxs)(la,{value:e,className:Eo.item,children:[(0,ws.jsx)("span",{className:Eo.itemLabel,children:e}),c?.(e)]},e)}),n&&(0,ws.jsx)(ca,{className:Eo.empty,children:n})]})})})})]})}function Td({header:e,value:t,onValueChange:n,warning:i,options:r,assigned:s,disabled:a=!1}){const o=i?function(e){switch(e.kind){case"duplicate":return"Column mapped more than once";case"missing":return"Column not in current headers, check preview";case"invalid-name":return"Column cannot be converted into an Ontime field name";case"name-collision":return"Column name resolves to a duplicate Ontime field";default:return""}}(i):void 0;return(0,ws.jsxs)("div",{className:Io.mappingField,children:[e,o&&(0,ws.jsx)("span",{className:Io.mappingFieldWarning,children:o}),(0,ws.jsx)(Rd,{className:zt([Io.columnInput,i&&Io.columnInputWarn]),maxLength:50,options:r,openOnFocus:!0,trailingElement:e=>s.has(e)?(0,ws.jsx)(Cn,{}):null,placeholder:"Spreadsheet column",disabled:a,title:o,value:t,onValueChange:n})]})}function Pd({values:e,setValue:t,warnings:n,sampleHeaders:i,assignedHeaders:r,fields:s,addCustomField:a,removeCustomField:o,isBusy:l}){const c=(0,js.useRef)(null),d=jd(e.custom);return(0,ws.jsxs)("section",{className:Io.mappingPane,children:[(0,ws.jsxs)(mr,{align:"apart",className:Io.mappingPaneHeader,children:[(0,ws.jsx)("span",{className:Io.mappingPaneTitle,children:"Column mapping"}),(0,ws.jsx)(mr,{relation:"inner",className:Io.mappingPaneActions,children:(0,ws.jsxs)(qe,{className:Io.addColumnTrigger,onClick:()=>{a(),requestAnimationFrame(()=>c.current?.scrollTo({top:c.current.scrollHeight,behavior:"smooth"}))},disabled:l,children:[(0,ws.jsx)(Jt,{}),"Add"]})})]}),(0,ws.jsxs)("div",{ref:c,className:Io.mappingList,children:[bo.map((s,a)=>(0,ws.jsx)(Td,{header:(0,ws.jsxs)("label",{className:Io.mappingFieldTitle,children:[(0,ws.jsx)(Un,{checked:!1!==e.builtIn[a]?.enabled,onCheckedChange:e=>t(`builtIn.${a}.enabled`,!0===e,{shouldDirty:!0,shouldValidate:!0})}),(0,ws.jsx)("span",{className:Io.mappingFieldLabel,children:s.label})]}),value:e.builtIn[a]?.header??"",onValueChange:e=>t(`builtIn.${a}.header`,e,{shouldDirty:!0,shouldValidate:!0}),warning:!1!==e.builtIn[a]?.enabled?n[`builtIn.${a}.header`]:void 0,options:i,assigned:r,disabled:!1===e.builtIn[a]?.enabled},s.importKey)),s.map((s,a)=>(0,ws.jsx)(Td,{header:(0,ws.jsxs)("div",{className:Io.mappingFieldHeader,children:[(0,ws.jsx)("span",{className:Io.mappingFieldLabel,children:d[a]?.ontimeName||e.custom[a]?.importName||`Custom ${a+1}`}),(0,ws.jsx)(Qi,{variant:"ghosted-destructive","aria-label":`Delete custom column ${d[a]?.ontimeName||e.custom[a]?.importName||`Custom ${a+1}`}`,onClick:()=>o(a),children:(0,ws.jsx)(mn,{})})]}),value:e.custom[a]?.importName??"",onValueChange:e=>{t(`custom.${a}.importName`,e,{shouldDirty:!0,shouldValidate:!0}),t(`custom.${a}.ontimeName`,"",{shouldDirty:!0,shouldValidate:!0})},warning:n[`custom.${a}.importName`],options:i,assigned:r},s.id))]})]})}function Od(e,t){switch(t.type){case"startPreview":return{...e,loading:"preview",error:""};case"startApply":return{...e,loading:"apply",error:""};case"startExport":return{...e,loading:"export",error:""};case"previewSuccess":return{loading:"",error:"",preview:t.preview,needsPreviewRefresh:!1};case"applySuccess":case"exportSuccess":return{...e,loading:""};case"clearPreview":return{...e,error:t.error??"",preview:null,needsPreviewRefresh:t.needsRefresh??!1};case"failure":return"preview"===e.loading?{loading:"",error:t.error,preview:null,needsPreviewRefresh:!1}:{...e,loading:"",error:t.error};case"reset":return Ro;default:return e}}function Ad({sourceKey:e,defaultRundownName:t,worksheetNames:n,initialMetadata:i,loadMetadata:r,previewImport:s,onApply:a,onExport:o}){const{initialFormValues:l,skipAutoPreview:c}=(0,js.useMemo)(()=>{const{values:t,isPersisted:r}=wd(e),s=function(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}(n,t.worksheet,i?.worksheet??""),a=t.worksheet!==s;return{initialFormValues:{...t,worksheet:s},skipAutoPreview:r&&a}},[i?.worksheet,e,n]),{control:u,handleSubmit:p,getValues:f,reset:_,setValue:g,watch:x,formState:{isValid:y}}=Er({mode:"onChange",defaultValues:l}),{fields:j,append:b,remove:w}=Ir({control:u,name:"custom"}),k=x(),C=dn();(0,js.useEffect)(()=>{C.removeQueries({queryKey:["worksheet-metadata",e]}),i&&C.setQueryData(["worksheet-metadata",e,i.worksheet],i)},[i,e,C]);const S=Ln({queryKey:["worksheet-metadata",e,k.worksheet],queryFn:()=>r(k.worksheet),enabled:Boolean(k.worksheet)&&n.includes(k.worksheet),staleTime:1/0}),N=S.data?.headers??To,E=S.isLoading,I=S.error?m(S.error):"",{sampleHeaders:T,assignedHeaders:O}=function(e,t){const n=new Set,i=[];for(const s of t){const e=_d(s);e&&!n.has(e)&&(n.add(e),i.push(s.trim()))}const r=new Set;for(const s of e.builtIn){if(!s.enabled)continue;const e=_d(s.header);e&&r.add(e)}for(const{importName:s}of e.custom){const e=_d(s);e&&r.add(e)}return{sampleHeaders:i,assignedHeaders:new Set(i.filter(e=>r.has(_d(e))))}}(k,N),A=function(e){const t=[];for(let i=0;i<e.builtIn.length;i++)e.builtIn[i].enabled&&t.push(bo[i].label);const n=[];for(const{ontimeName:i}of jd(e.custom))i&&n.push(i);return[...t,...n]}(k),[q,L]=(0,js.useReducer)(Od,Ro),[D,F]=(0,js.useState)(()=>Cd(e)),[B,V]=(0,js.useState)(t),M=function(e,t){const n=new Set(t.map(_d).filter(Boolean)),i=new Set(bo.map(e=>e.label.toLowerCase())),r=new Set,s=new Set,a={};for(let o=0;o<e.builtIn.length;o++){const t=e.builtIn[o];if(!t.enabled)continue;const i=_d(t.header);if(!i)continue;const s=`builtIn.${o}.header`;r.has(i)?a[s]={kind:"duplicate"}:n.size>0&&!n.has(i)&&(a[s]={kind:"missing"}),r.add(i)}return e.custom.forEach(({importName:e},t)=>{const o=_d(e);if(!o)return;const l=`custom.${t}.importName`,c=yd(e);if(r.has(o))a[l]={kind:"duplicate"};else if(c)if(n.size>0&&!n.has(o))a[l]={kind:"missing"};else{const e=c.toLowerCase();(i.has(e)||s.has(e))&&(a[l]={kind:"name-collision"})}else a[l]={kind:"invalid-name"};r.add(o),c&&s.add(c.toLowerCase())}),a}(k,N),z=Object.values(M).filter(Boolean).length,$=(0,js.useRef)(null),U=(0,js.useRef)(!1);(0,js.useEffect)(()=>{U.current=!1,_(l),L({type:"reset"})},[l,_]),(0,js.useEffect)(()=>{F(Cd(e)),V(t)},[e,t]),(0,js.useEffect)(()=>{0!==n.length&&(n.includes(k.worksheet)||g("worksheet",n[0],{shouldDirty:!0,shouldValidate:!0}))},[g,k.worksheet,n]),(0,js.useEffect)(()=>{$.current=q.preview},[q.preview]),(0,js.useEffect)(()=>{const e=x(()=>{$.current&&($.current=null,L({type:"clearPreview",needsRefresh:!0}))});return()=>e.unsubscribe()},[x]);const H=(0,js.useRef)(0),W=(0,js.useCallback)(async e=>{const t=bd(e),n=++H.current;try{L({type:"startPreview"});const e=await s(t);if(H.current!==n)return;L({type:"previewSuccess",preview:e})}catch(i){if(H.current!==n)return;L({type:"failure",error:m(i)})}},[s]);(0,js.useEffect)(()=>{U.current||c||y&&0!==N.length&&(U.current=!0,p(W)())},[c,y,N,p,W]);const G=(0,js.useCallback)(async()=>{if(q.preview)try{L({type:"startApply"});const t=function(e){const t=[];for(const[n,i]of Object.entries(e))"worksheet"!==n&&"custom"!==n&&"id"!==n&&"string"==typeof i&&""!==i.trim()&&t.push(n);return{event:t,custom:Object.keys(e.custom)}}(bd(f()));await a(q.preview,D,B,t),function(e,t){localStorage.setItem(vd(e),JSON.stringify(t))}(e,f()),function(e,t){localStorage.setItem(kd(e),t)}(e,D),L({type:"applySuccess"})}catch(t){L({type:"failure",error:m(t)})}},[f,D,B,a,e,q.preview]),K=(0,js.useCallback)(async e=>{if(o)try{L({type:"startExport"}),await o(bd(e)),L({type:"exportSuccess"})}catch(t){L({type:"failure",error:m(t)})}},[o]),Y=Boolean(q.loading),J=y&&!E&&!Y&&n.length>0,Q=I||q.error;return{values:k,setValue:g,fields:j,addCustomField:(0,js.useCallback)(()=>{b({importName:"",ontimeName:""})},[b]),removeCustomField:w,sampleHeaders:T,assignedHeaders:O,warnings:M,columnLabels:A,worksheetHeaders:N,state:q,toolbarStatus:(()=>{if(!q.preview)return{entries:"–",groups:"–",milestones:"–",start:"–",end:"–",duration:"–",warnings:z};const{entries:e,flatOrder:t}=q.preview.rundown,{start:n,end:i,duration:r}=q.preview.summary;let s=0,a=0;for(const o of t){const t=e[o];d(t)?s++:h(t)&&a++}return{entries:t.length,groups:s,milestones:a,start:P(R(n)),end:P(R(i)),duration:v(r),warnings:z}})(),isLoadingMetadata:E,isBusy:Y,canPreview:J,displayError:Q,importMode:D,setImportMode:F,newRundownTitle:B,setNewRundownTitle:V,handlePreviewSubmit:p(W),handleExportSubmit:p(K),handleApply:G}}function qd({sourceKey:e,defaultRundownName:t,worksheetNames:n,initialMetadata:i,loadMetadata:r,previewImport:s,onApply:a,onCancel:o,onExport:l}){const{values:c,setValue:d,fields:u,addCustomField:h,removeCustomField:m,sampleHeaders:p,assignedHeaders:f,warnings:_,columnLabels:g,worksheetHeaders:x,state:y,toolbarStatus:j,isLoadingMetadata:b,isBusy:v,canPreview:w,displayError:k,importMode:C,setImportMode:S,newRundownTitle:N,setNewRundownTitle:E,handlePreviewSubmit:I,handleExportSubmit:R,handleApply:T}=Ad({sourceKey:e,defaultRundownName:t,worksheetNames:n,initialMetadata:i,loadMetadata:r,previewImport:s,onApply:a,onExport:l}),P=Po.find(e=>e.value===C)??Po[0],O=(0,js.useMemo)(()=>Po.map(e=>({type:"item",label:e.label,description:e.description,icon:C===e.value?Cn:void 0,onClick:()=>S(e.value)})),[C,S]);return(0,ws.jsxs)(ur,{as:"form",id:"spreadsheet-import-workspace",className:Io.editor,onSubmit:I,children:[(0,ws.jsxs)(mr,{align:"apart",wrap:"wrap",className:Io.editorToolbar,children:[(0,ws.jsxs)("label",{className:Io.worksheetControl,children:[(0,ws.jsx)("span",{className:Io.worksheetLabel,children:"Worksheet"}),(0,ws.jsx)(Et,{options:n.map(e=>({value:e,label:e})),value:c.worksheet,onValueChange:e=>d("worksheet",e??"",{shouldDirty:!0,shouldValidate:!0})})]}),j&&(0,ws.jsxs)(fr,{children:["–"===j.entries?"No import preview yet":`${j.entries} entries · ${j.groups} groups · ${j.milestones} milestones · ${j.start}–${j.end} · ${j.duration}`,j.warnings>0&&(0,ws.jsxs)("span",{className:Io.toolbarWarning,children:[" · ",j.warnings," warnings"]})]})]}),(0,ws.jsxs)("div",{className:Io.editorBody,children:[(0,ws.jsx)(Pd,{values:c,setValue:d,warnings:_,sampleHeaders:p,assignedHeaders:f,fields:u,addCustomField:h,removeCustomField:m,isBusy:v}),(0,ws.jsxs)("section",{className:Io.previewPane,children:[(0,ws.jsx)("div",{className:Io.previewPaneHeader,children:(0,ws.jsx)("div",{className:Io.previewPaneHeading,children:(0,ws.jsx)("span",{className:Io.previewPaneTitle,children:"Import preview"})})}),(0,ws.jsx)("div",{className:Io.tableShell,children:(0,ws.jsx)(Id,{preview:y.preview,columnLabels:g,canRefresh:w,isLoadingMetadata:b,isRefreshing:"preview"===y.loading,needsPreviewRefresh:y.needsPreviewRefresh,onRefresh:I,worksheetHeaders:x})})]})]}),k&&(0,ws.jsx)(gr,{children:k}),"merge"===C&&!xd(c)&&(0,ws.jsxs)(fr,{tone:"warning",children:[(0,ws.jsx)(yn,{})," No ID column mapped — merge matches entries by ID, so it will behave like Replace. Export your rundown to a spreadsheet first to keep its IDs."]}),(0,ws.jsxs)(mr,{align:"apart",wrap:"wrap",className:Io.editorFooter,children:[(0,ws.jsxs)(mr,{wrap:"wrap",children:[(0,ws.jsxs)("label",{className:Io.worksheetControl,children:[(0,ws.jsx)("span",{className:Io.worksheetLabel,children:"Import mode"}),(0,ws.jsxs)(xi,{render:(0,ws.jsx)(qe,{className:Io.importModeTrigger,variant:"subtle-white"}),items:O,children:[P.label,(0,ws.jsx)(_n,{})]})]}),"new"===C&&(0,ws.jsxs)("label",{className:Io.worksheetControl,children:[(0,ws.jsx)("span",{className:Io.worksheetLabel,children:"New rundown name"}),(0,ws.jsx)(Zi,{value:N,onChange:e=>E(e.target.value),placeholder:y.preview?.rundown.title||"Imported rundown","aria-label":"New rundown name"})]})]}),(0,ws.jsxs)(mr,{wrap:"wrap",children:[(0,ws.jsx)(qe,{onClick:o,disabled:v,children:"Cancel"}),l&&(0,ws.jsxs)(qe,{onClick:R,disabled:!w,loading:"export"===y.loading,children:[(0,ws.jsx)(In,{}),"Export"]}),(0,ws.jsxs)(qe,{variant:y.preview?void 0:"primary",onClick:I,disabled:!w,loading:"preview"===y.loading,children:[(0,ws.jsx)(kn,{}),"Preview import"]}),(0,ws.jsx)(fd,{preview:y.preview,mode:C,disabled:!y.preview||v,loading:"apply"===y.loading,onApply:T})]})]})]})}function Ld(){const[e,t]=(0,js.useState)("none"),[n,i]=(0,js.useState)(""),[r,s]=(0,js.useState)("none"),[a,o]=(0,js.useState)(null),[l,c]=(0,js.useState)(""),{data:d}=Ui(),{applyImport:u}={applyImport:(0,js.useCallback)(async e=>{await Gi(e)},[])},h=Je(),m=(0,js.useRef)(null),p=()=>{t("none"),s("none"),o(null),i(""),c("")},f=()=>{a&&"gsheet"===a.kind?(o({...a,closedByUser:!0}),i("")):p()},_=e=>{t("finished"),s("none"),o(null),i(""),c(e)},g=(0,js.useCallback)(e=>{if(!a)throw new Error("No spreadsheet source loaded");return"excel"===a.kind?async function(e,t){return(await sn.post(`${oo}/metadata`,{worksheet:e},{signal:t?.signal,timeout:t?.timeout??lr.longTimeout})).data}(e):fo(a.sheetId,e)},[a]),x=(0,js.useCallback)(e=>{if(!a)throw new Error("No spreadsheet source loaded");return"excel"===a.kind?async function(e,t){return(await sn.post(`${oo}/preview`,{options:e},{signal:t?.signal,timeout:t?.timeout??lr.longTimeout})).data}(e):po(a.sheetId,e)},[a]),y=(0,js.useCallback)(e=>{if(!a||"gsheet"!==a.kind)throw new Error("Google Sheet source not available");return go(a.sheetId,e)},[a]),j=(0,js.useCallback)((e,t)=>{o({kind:"gsheet",sheetId:e,worksheetNames:t.worksheets,initialWorksheetMetadata:t.metadata,title:t.title??"",closedByUser:!1})},[]),b=a?.closedByUser??!1,v="gsheet"===e,w="none"===e,k="finished"===e,C=null!==a&&!b,S=a?"excel"===a.kind?"Import spreadsheet":a.title?`Sync: ${a.title}`:"Synchronize with Google Sheet":"",N=a?"excel"===a.kind?"excel":`gsheet:${a.sheetId}`:null,E=a?"excel"===a.kind?function(e){const t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}(a.fileName):a.title:"";return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Synchronize your rundown with an external source"}),n&&(0,ws.jsx)(gr,{children:n}),w&&(0,ws.jsxs)("div",{className:jo.introStack,children:[(0,ws.jsxs)(Rr,{children:[(0,ws.jsx)(Rr.Title,{children:"Choose between a quick file import or a live Google Sheet connection."}),(0,ws.jsx)(Rr.Body,{children:"Google Sheets sync needs a client secret and a one-time device authentication before you can load a sheet by ID."}),(0,ws.jsx)(Rr.Footer,{children:(0,ws.jsx)(Sl,{href:Oo,children:"Read setup guide"})})]}),(0,ws.jsx)("input",{ref:m,style:{display:"none"},type:"file",onChange:async e=>{const r=e.target.files?.[0];if(!r)return o(null),void s("none");try{s("loading"),i(""),function(e){if(!function(e){return e?.name.endsWith(".xlsx")}(e))throw new Error("Unknown file type");if(0===e.size)throw new Error("File is empty");if(e.size>1e7)throw new Error("File size limit (10MB) exceeded")}(r);const e=await async function(e,t){const n=new FormData;return n.append("excel",e),(await sn.post(`${oo}/upload`,n,{signal:t?.signal,timeout:t?.timeout??lr.longTimeout,headers:{"Content-Type":"multipart/form-data"}})).data}(r);o({kind:"excel",fileName:r.name,worksheetNames:e.worksheets,initialWorksheetMetadata:e.metadata,closedByUser:!1}),t("excel"),s("done")}catch(n){i(`Error uploading file: ${Mi(n)}`),o(null),s("none")}},accept:".xlsx","data-testid":"file-input"}),(0,ws.jsxs)("div",{className:jo.sourceGrid,children:[(0,ws.jsxs)("section",{className:jo.sourceCard,children:[(0,ws.jsx)("div",{className:jo.sourceHeader,children:(0,ws.jsx)("h4",{className:jo.sourceTitle,children:"Import spreadsheet"})}),(0,ws.jsx)("p",{className:jo.sourceDescription,children:"Bring in a one-off spreadsheet, review the mapping, and apply the data to the current rundown."}),(0,ws.jsx)("div",{className:jo.sourceMeta,children:"Accepts `.xlsx` files"}),(0,ws.jsxs)(qe,{variant:"primary",size:"large",fluid:!0,onClick:()=>{m.current?.click()},loading:"loading"===r,children:[(0,ws.jsx)(Lt,{}),"Import from spreadsheet"]})]}),(0,ws.jsxs)("section",{className:jo.sourceCard,children:[(0,ws.jsx)("div",{className:jo.sourceHeader,children:(0,ws.jsx)("h4",{className:jo.sourceTitle,children:"Synchronize with Google"})}),(0,ws.jsx)("p",{className:jo.sourceDescription,children:"Connect a Google account once, then load any sheet by ID and keep the import flow inside Ontime."}),(0,ws.jsx)("div",{className:jo.sourceMeta,children:"Requires Google OAuth client credentials"}),(0,ws.jsxs)(qe,{variant:"primary",size:"large",fluid:!0,onClick:()=>{i(""),o(null),t("gsheet")},disabled:"none"!==r,children:[(0,ws.jsx)(an,{}),"Synchronize with Google"]})]})]})]}),k&&(0,ws.jsxs)("div",{className:jo.finishSection,children:[(0,ws.jsx)("span",{className:jo.finishBadge,children:"Import complete"}),(0,ws.jsxs)("div",{className:jo.finishTitle,children:["Spreadsheet data applied to ",l||"your rundown","."]}),(0,ws.jsx)("div",{className:jo.finishDescription,children:"Review the imported rundown in the editor or start another import."}),(0,ws.jsxs)("div",{className:jo.finishActions,children:[(0,ws.jsx)(qe,{variant:"primary",onClick:()=>h("/editor"),children:"Open editor"}),(0,ws.jsx)(qe,{variant:"subtle-white",onClick:p,children:"Import another"})]})]}),v&&(0,ws.jsx)(pd,{onCancel:()=>{p()},onSheetLoaded:j,closedByUser:b}),(0,ws.jsx)(Tr,{isOpen:C,title:S,showBackdrop:!0,showCloseButton:!0,size:"wide",onClose:f,bodyElements:(0,ws.jsx)(qd,{sourceKey:N??"spreadsheet",defaultRundownName:E,worksheetNames:a?.worksheetNames??[],initialMetadata:a?.initialWorksheetMetadata??null,loadMetadata:g,previewImport:x,onApply:async(e,t,n,i)=>{if("new"===t){const t=n.trim()||e.rundown.title;return await u({mode:"new",rundown:{...e.rundown,title:t},customFields:e.customFields}),void _(t)}if(!d)throw new Error("No current rundown loaded");await u({mode:t,targetRundownId:d.id,rundown:e.rundown,customFields:e.customFields,providedFields:i}),_(d.title)},onCancel:f,onExport:"gsheet"===a?.kind?y:void 0})})]})})}function Dd({location:e}){const t=Tl("defaults",e),n=Tl("custom",e),i=Tl("rundowns",e),r=Tl("sheets",e);return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(hr,{children:"Project data"}),(0,ws.jsx)("div",{ref:t,children:(0,ws.jsx)(ud,{})}),(0,ws.jsx)("div",{ref:n,children:(0,ws.jsx)(od,{})}),(0,ws.jsx)("div",{ref:i,children:(0,ws.jsx)(dd,{})}),(0,ws.jsx)("div",{ref:r,children:(0,ws.jsx)(Ld,{})})]})}function Fd({id:e,isOpen:t,name:n,currentPath:i,origin:r,onClose:s}){const{data:a}=nt(),[o,l]=(0,js.useState)(i),[c,d]=(0,js.useState)("/"),{setRedirect:u}=V,h=t=>{"/"!==t&&t!==i&&(t.startsWith("preset-")?u({target:e,redirect:t.slice(7)}):u({target:e,redirect:t}),s())},m=a.filter(e=>e.enabled),p=`${window.location.origin}${Ft}/?settings=sharing__presets`,f=[...z.map(e=>({value:`/${e.url}`,label:e.label})),...m.map(e=>({value:`preset-${e.alias}`,label:`URL Preset: ${e.alias}`}))];return(0,ws.jsx)(Jn,{isOpen:t,onClose:s,showCloseButton:!0,showBackdrop:!0,title:`Redirect: ${n}`,bodyElements:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsxs)(Rr,{children:[(0,ws.jsx)(Rr.Body,{children:"Remotely redirect the client to a different URL. Choose a custom path or select a URL Preset."}),(0,ws.jsx)(Rr.Footer,{children:(0,ws.jsx)(Sl,{href:p,children:"Manage URL Presets"})})]}),(0,ws.jsxs)("section",{className:Ao.section,children:[(0,ws.jsxs)("div",{className:Ao.sectionHeader,children:[(0,ws.jsx)("span",{className:Ao.label,children:"Enter custom path"}),(0,ws.jsx)("span",{className:Ao.description,children:"Type the path the client should open."})]}),(0,ws.jsxs)("div",{className:Ao.inlineEntry,children:[(0,ws.jsxs)("label",{className:Ao.textEntry,children:[(0,ws.jsx)("span",{className:Ao.origin,children:r}),(0,ws.jsx)(Zi,{placeholder:"eg. /timer",fluid:!0,value:o,onChange:e=>l(e.target.value)})]}),(0,ws.jsxs)(qe,{variant:"primary","aria-label":"Redirect to custom path",disabled:o===i||""===o,className:Ao.redirect,onClick:()=>h(o),children:["Redirect",(0,ws.jsx)(bn,{})]})]})]}),(0,ws.jsx)("div",{className:Ao.separator,role:"separator",children:(0,ws.jsx)("span",{children:"Or"})}),(0,ws.jsxs)("section",{className:Ao.section,children:[(0,ws.jsxs)("div",{className:Ao.sectionHeader,children:[(0,ws.jsx)("span",{className:Ao.label,children:"Select view or URL Preset"}),(0,ws.jsx)("span",{className:Ao.description,children:"Choose from the available destinations."})]}),(0,ws.jsxs)("div",{className:Ao.inlineEntry,children:[(0,ws.jsxs)("label",{className:Ao.textEntry,children:[(0,ws.jsx)("span",{className:Ao.origin,children:r}),(0,ws.jsx)(Et,{fluid:!0,options:f,defaultValue:f[0].value,onValueChange:e=>{null!==e&&d(e)},disabled:0===m.length})]}),(0,ws.jsxs)(qe,{variant:"primary","aria-label":"Redirect to preset",className:Ao.redirect,disabled:0===m.length||"/"===c,onClick:()=>h(c),children:["Redirect ",(0,ws.jsx)(bn,{})]})]})]})]})})}function Bd(){const e=A(e=>e.id),t=A(e=>e.clients),[n,i]=si(),[r,s]=si(),{setIdentify:a}=V,[o,l]=(0,js.useState)(""),c=Object.entries(t).filter(([e,{type:t}])=>"ontime"===t),d=Object.entries(t).filter(([e,{type:t}])=>"ontime"!==t),u=t[o];return(0,ws.jsxs)(ws.Fragment,{children:[n&&void 0!==u&&(0,ws.jsx)(Fd,{id:o,name:u.name,origin:u.origin,currentPath:u.path,isOpen:n,onClose:i.close}),r&&(0,ws.jsx)(Qn,{id:o,name:u?.name,isOpen:r,onClose:s.close}),(0,ws.jsxs)(ur,{children:[(0,ws.jsxs)(yr,{children:["Ontime Clients (",c.length,")"]}),(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("td",{style:{width:"20%"},children:"Client Name"}),(0,ws.jsx)("td",{children:"Path"}),(0,ws.jsx)("td",{className:qo.actionsHeader})]})}),(0,ws.jsxs)("tbody",{children:[0===c.length&&(0,ws.jsx)(cr,{title:"No Ontime clients connected",description:"Editor, cuesheet and operator windows appear here as they connect."}),c.map(([t,n])=>{const{identify:r,name:o,path:c}=n,d=e===t;return(0,ws.jsxs)("tr",{className:zt([d&&qo.current]),children:[(0,ws.jsxs)(mr,{relation:"inner",as:"td",children:[d&&(0,ws.jsx)(Di,{variant:"active",children:"SELF"}),o]}),(0,ws.jsx)("td",{className:qo.copiable,children:c}),(0,ws.jsx)("td",{className:qo.actionsCell,children:(0,ws.jsxs)(mr,{relation:"inner",align:"end",className:qo.actionsGroup,children:[(0,ws.jsx)(qe,{size:"small",className:`${r?qo.blink:""}`,disabled:d,variant:r?"primary":"subtle","data-testid":d?"":"not-self-identify",onClick:()=>{a({target:t,identify:!r})},children:"Identify"}),(0,ws.jsx)(qe,{size:"small","data-testid":d?"":"not-self-rename",onClick:()=>(e=>{l(e),s.open()})(t),children:"Rename"}),(0,ws.jsx)(qe,{size:"small",disabled:d,"data-testid":d?"":"not-self-redirect",onClick:()=>(e=>{l(e),i.open()})(t),children:"Redirect"})]})})]},t)})]})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(ur,{children:[(0,ws.jsxs)(yr,{children:["Other Clients (",d.length,")"]}),(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("td",{className:qo.halfWidthNoWrap,children:"Client Name"}),(0,ws.jsx)("td",{className:qo.halfWidthNoWrap,children:"Client type"})]})}),(0,ws.jsxs)("tbody",{children:[0===d.length&&(0,ws.jsx)(cr,{title:"No other clients connected",description:"Views and integrations connected to this server are listed here."}),d.map(([e,t])=>{const{name:n,type:i}=t;return(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("td",{children:n}),(0,ws.jsx)("td",{children:i})]},e)})]})]})]})]})}function Vd(){return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Manage clients"}),(0,ws.jsx)(br,{}),(0,ws.jsx)(Bd,{})]})})}function Md(){return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsxs)(ar,{children:["Event log",(0,ws.jsxs)(qe,{onClick:e=>{Xn("log",e)},children:["Extract ",(0,ws.jsx)(ln,{className:Lo.iconRotate})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsx)(vr,{})]})})}function zd({location:e}){const t=Tl("clients",e),n=Tl("log",e);return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(hr,{children:"Network"}),!1,(0,ws.jsx)("div",{ref:n,children:(0,ws.jsx)(Md,{})}),(0,ws.jsx)("div",{ref:t,children:(0,ws.jsx)(Vd,{})})]})}function $d({isOpen:e,onClose:t}){const{defaultWarnTime:n,defaultDangerTime:i,setDangerTime:r,setWarnTime:s}=Vr(),{handleSubmit:a,register:o,formState:{errors:l,isSubmitting:c,isValid:d},watch:u,setError:h,setValue:p}=Er({defaultValues:Do,values:Do,resetOptions:{keepDirtyValues:!0}}),_=Pi(n),g=Pi(i);return(0,ws.jsx)(Tr,{isOpen:e,onClose:t,showBackdrop:!0,showCloseButton:!0,title:"Create new project...",bodyElements:(0,ws.jsxs)("form",{onSubmit:a(async e=>{try{""===e.project.title&&(e.project.title="untitled"),await os(e),await f(),t()}catch(n){h("root",{message:m(n)})}}),id:"quick-start",children:[(0,ws.jsxs)(Cr,{children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Project title",description:"Shown as the title in some views"}),(0,ws.jsx)(Zi,{maxLength:150,placeholder:"Project title",fluid:!0,...o("project.title")})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Time format",description:"Default time format to show in views 12 / 24 hours",error:l.settings?.timeFormat?.message}),(0,ws.jsx)(Et,{value:u("settings.timeFormat"),onValueChange:e=>{null!==e&&p("settings.timeFormat",e,{shouldDirty:!0})},defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Views language",description:"Language to be displayed in views",error:l.settings?.language?.message}),(0,ws.jsx)(Et,{value:u("settings.language"),onValueChange:e=>{null!==e&&p("settings.language",e,{shouldDirty:!0})},defaultValue:"en",options:[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"es",label:"Spanish"}]})]})]}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Warning time",description:"Default threshold for warning time in an event"}),(0,ws.jsx)(qr,{name:"warnTime",submitHandler:(e,t)=>s(t),time:_,placeholder:zr.warnTime})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Danger time",description:"Default threshold for danger time in an event"}),(0,ws.jsx)(qr,{name:"dangerTime",submitHandler:(e,t)=>r(t),time:g,placeholder:zr.dangerTime})]})]})]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[l?.root&&(0,ws.jsx)(gr,{children:l.root.message}),(0,ws.jsx)(qe,{variant:"ghosted",onClick:t,disabled:!1,children:"Cancel"}),(0,ws.jsx)(qe,{variant:"primary",type:"submit",form:"quick-start",disabled:!d,loading:c,children:"Create project"})]})})}function Ud({action:e,filename:t,onSubmit:n,onCancel:i}){const{handleSubmit:r,register:s,formState:{isSubmitting:a,isDirty:o,isValid:l},setFocus:c}=Er({defaultValues:{filename:t},values:{filename:t},resetOptions:{keepDirtyValues:!0}});return(0,js.useEffect)(()=>{c("filename")},[c]),(0,ws.jsxs)("form",{onSubmit:r(n),onKeyDown:e=>Gn(e,i),className:Fo.form,children:[(0,ws.jsx)(Zi,{className:Fo.formInput,id:"filename",placeholder:"Enter new name",...s("filename",{required:!0})}),(0,ws.jsxs)(mr,{relation:"inner",children:[(0,ws.jsx)(qe,{onClick:i,variant:"ghosted",disabled:a,children:"Cancel"}),(0,ws.jsx)(qe,{variant:"primary",disabled:!o||!l||a,type:"submit",className:Fo.saveButton,children:e})]})]})}function Hd({onClose:e,fileName:t}){const[n,i]=(0,js.useState)(null),r=dn(),{handleSubmit:s,watch:o,setValue:l,formState:{isSubmitting:c,isValid:d,isDirty:u}}=Er({defaultValues:{project:!1,rundowns:!1,viewSettings:!1,urlPresets:!1,automation:!1},resetOptions:{keepDirtyValues:!0}});return(0,ws.jsx)(Tr,{isOpen:!0,onClose:e,showBackdrop:!0,showCloseButton:!0,size:"compact",title:"Partial project merge",bodyElements:(0,ws.jsx)("form",{id:Bo,onSubmit:s(async s=>{if(Object.values(s).every(e=>!e))i("At least one option must be selected");else try{i(null);const{data:n}=await ss(t);if(!n.settings.version.startsWith("4."))return void i("The project you are attempting to merge is from an older version and it need to be migrated first");await as(await async function(e,t){const n={};for(const i in t)a(i,e)&&t[i]&&("rundowns"===i&&(n.customFields=e.customFields),Object.assign(n,{[i]:e[i]}));return n}(n,s)),await r.invalidateQueries({queryKey:hn}),e()}catch(n){i(m(n))}}),children:(0,ws.jsxs)(ur,{className:Fo.mergeBody,children:[(0,ws.jsxs)("div",{className:Fo.mergeIntro,children:[(0,ws.jsxs)(fr,{children:["Select the sections from ",(0,ws.jsx)("span",{className:Fo.sourceFile,children:`"${t}"`})," that you want to merge into the current project."]}),(0,ws.jsx)("div",{className:Fo.mergeSummary,children:"Only the enabled sections are copied. Existing data stays intact."})]}),(0,ws.jsxs)(Rr,{type:"warning",className:Fo.mergeWarningInfo,children:[(0,ws.jsx)(Rr.Title,{children:"Back up before merging"}),(0,ws.jsx)(Rr.Body,{children:"This action can overwrite project data. Create a duplicate project first if you want a recovery point."})]}),(0,ws.jsxs)(Cr,{className:Fo.optionList,children:[(0,ws.jsx)(dr,{children:(0,ws.jsxs)("label",{className:Fo.optionRow,children:[(0,ws.jsxs)("div",{className:Fo.optionCopy,children:[(0,ws.jsx)("span",{className:Fo.optionTitle,children:"Project data"}),(0,ws.jsx)("span",{className:Fo.optionBody,children:"Core project metadata and settings."})]}),(0,ws.jsx)($n,{size:"large",checked:o("project"),onCheckedChange:e=>l("project",e,{shouldDirty:!0})})]})}),(0,ws.jsx)(dr,{children:(0,ws.jsxs)("label",{className:Fo.optionRow,children:[(0,ws.jsxs)("div",{className:Fo.optionCopy,children:[(0,ws.jsx)("span",{className:Fo.optionTitle,children:"Rundown + Custom Fields"}),(0,ws.jsx)("span",{className:Fo.optionBody,children:"Copies all rundowns and any associated custom fields."})]}),(0,ws.jsx)($n,{size:"large",checked:o("rundowns"),onCheckedChange:e=>l("rundowns",e,{shouldDirty:!0})})]})}),(0,ws.jsx)(dr,{children:(0,ws.jsxs)("label",{className:Fo.optionRow,children:[(0,ws.jsxs)("div",{className:Fo.optionCopy,children:[(0,ws.jsx)("span",{className:Fo.optionTitle,children:"View Settings"}),(0,ws.jsx)("span",{className:Fo.optionBody,children:"View configuration, and display preferences."})]}),(0,ws.jsx)($n,{size:"large",checked:o("viewSettings"),onCheckedChange:e=>l("viewSettings",e,{shouldDirty:!0})})]})}),(0,ws.jsx)(dr,{children:(0,ws.jsxs)("label",{className:Fo.optionRow,children:[(0,ws.jsxs)("div",{className:Fo.optionCopy,children:[(0,ws.jsx)("span",{className:Fo.optionTitle,children:"URL Presets"}),(0,ws.jsx)("span",{className:Fo.optionBody,children:"Saved links and preset launch parameters."})]}),(0,ws.jsx)($n,{size:"large",checked:o("urlPresets"),onCheckedChange:e=>l("urlPresets",e,{shouldDirty:!0})})]})}),(0,ws.jsx)(dr,{children:(0,ws.jsxs)("label",{className:Fo.optionRow,children:[(0,ws.jsxs)("div",{className:Fo.optionCopy,children:[(0,ws.jsx)("span",{className:Fo.optionTitle,children:"Automation Settings"}),(0,ws.jsx)("span",{className:Fo.optionBody,children:"Triggers and automation configuration."})]}),(0,ws.jsx)($n,{size:"large",checked:o("automation"),onCheckedChange:e=>l("automation",e,{shouldDirty:!0})})]})})]})]})}),footerElements:(0,ws.jsxs)("div",{className:Fo.footerContent,children:[n&&(0,ws.jsx)(gr,{children:n}),(0,ws.jsxs)("div",{className:Fo.footerActions,children:[(0,ws.jsx)(qe,{onClick:e,variant:"ghosted",disabled:c,children:"Cancel"}),(0,ws.jsx)(qe,{type:"submit",form:Bo,disabled:!d||!u,loading:c,variant:"primary",children:"Merge"})]})]})})}function Wd({current:e,updatedAt:t,editingFilename:n,editingMode:i,filename:r,onRefetch:s,onSubmit:a,onToggleEditMode:o}){const[l,c]=(0,js.useState)(null),[d,u]=(0,js.useState)(!1),[h,p]=(0,js.useState)(!1),_=e=>async t=>{u(!0),c(null);try{if(!t.filename)return void c("Filename cannot be blank");await("rename"===e?ps:_s)(r,t.filename),await s(),a()}catch(n){c(m(n))}finally{u(!1)}},g=(e,t)=>{c(null),o(e,t)},x=()=>{g(null,null)},y=r===n,j=("rename"===i||"duplicate"===i)&&r===n,b="merge"===i&&y,v=zt([e&&!y&&Fo.current,y&&Fo.isEditing]);return(0,ws.jsxs)(ws.Fragment,{children:[l&&(0,ws.jsx)("tr",{children:(0,ws.jsx)("td",{colSpan:99,children:(0,ws.jsx)(gr,{children:l})})},"filename-error"),(0,ws.jsx)("tr",{className:v,children:j?(0,ws.jsx)("td",{colSpan:99,children:(0,ws.jsx)(Ud,{action:i,filename:r,onSubmit:_("duplicate"===i?"duplicate":"rename"),onCancel:x})}):(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)("td",{className:Fo.containCell,children:r}),(0,ws.jsx)("td",{children:e?(0,ws.jsx)(Di,{variant:"active",children:"Loaded"}):new Date(t).toLocaleString()}),(0,ws.jsx)("td",{children:(0,ws.jsx)(Gd,{current:e,filename:r,onChangeEditMode:g,onDelete:()=>p(!0),onLoad:async e=>{u(!0),c(null);try{await gs(e),await s(),await f()}catch(t){c(m(t))}finally{u(!1)}},isDisabled:d||b,onMerge:e=>g("merge",e)})})]})},r),b&&(0,ws.jsx)(Hd,{onClose:x,fileName:r}),(0,ws.jsx)(Jn,{isOpen:h,onClose:()=>p(!1),title:"Delete project",showBackdrop:!0,showCloseButton:!0,bodyElements:"You will permanently remove this project file. Are you sure?",footerElements:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(qe,{size:"large",onClick:()=>p(!1),children:"Cancel"}),(0,ws.jsx)(qe,{variant:"destructive",size:"large",onClick:async()=>{await(async e=>{u(!0),c(null);try{await rs(e),await s()}catch(t){c(m(t))}finally{u(!1)}})(r),p(!1)},loading:d,children:"Delete project"})]})})]})}function Gd(e){const{current:t,filename:n,isDisabled:i,onChangeEditMode:r,onDelete:s,onLoad:a,onMerge:o}=e;return(0,ws.jsx)(xi,{render:(0,ws.jsx)(Qi,{variant:"ghosted-white"}),disabled:i,items:[{type:"item",icon:Lt,label:"Load",onClick:()=>a(n),disabled:t},{type:"item",icon:Lt,label:"Partial Load",onClick:()=>o(n),disabled:t},{type:"item",icon:Mt,label:"Rename",onClick:()=>{r("rename",n)}},{type:"item",icon:Vn,label:"Duplicate",onClick:()=>{r("duplicate",n)}},{type:"item",icon:Zt,label:"Download",onClick:async()=>{await ms(n)}},{type:"divider"},{type:"item",icon:mn,label:"Delete",onClick:s,disabled:t}],children:(0,ws.jsx)(Bt,{})})}function Kd(){const[e,t]=(0,js.useState)(null),[n,i]=(0,js.useState)(null),[r,s]=(0,js.useState)("modified-desc"),{data:a,refetch:o,status:l}=ds(r),c=(e,r)=>{t(t=>t===e&&r===n?null:e),i(r)},d=()=>{t(null),i(null)},u=async()=>{await o()},h=e=>{s(t=>`${e}-${t===`${e}-asc`?"desc":"asc"}`)};if("pending"===l)return(0,ws.jsx)("div",{className:Fo.loaderBox,children:(0,ws.jsx)(rr,{isLoading:!0})});const m=a.reorderedProjectFiles.length;return(0,ws.jsxs)(ws.Fragment,{children:[m>20&&(0,ws.jsxs)(Rr,{className:Fo.warningInfo,type:"warning",children:["You have ",m," projects. Consider deleting unused projects to improve performance."]}),(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{className:Fo.containCell,onClick:()=>h("alphabetical"),children:(0,ws.jsxs)("span",{className:Fo.sortableHeader,children:["File Name",(0,ws.jsx)(Yd,{sortMode:r,type:"alphabetical"})]})}),(0,ws.jsx)("th",{onClick:()=>h("modified"),children:(0,ws.jsxs)("span",{className:Fo.sortableHeader,children:["Last Used",(0,ws.jsx)(Yd,{sortMode:r,type:"modified"})]})}),(0,ws.jsx)("th",{})]})}),(0,ws.jsxs)("tbody",{children:[0===m&&(0,ws.jsx)(cr,{title:"No projects yet",description:"Projects are the show files Ontime saves your rundown and settings into. Create one to get started."}),a.reorderedProjectFiles.map(t=>(0,ws.jsx)(Wd,{filename:t.filename,updatedAt:t.updatedAt,onToggleEditMode:c,onSubmit:d,onRefetch:u,editingFilename:n,editingMode:e,current:t.filename===a.lastLoadedProject},t.filename))]})]})]})}function Yd({sortMode:e,type:t}){const n=`${t}-`;return e===`${n}asc`?(0,ws.jsx)(Tn,{}):e===`${n}desc`?(0,ws.jsx)(ln,{}):null}function Jd(){const{setLocation:e}=Ai(),[t,n]=(0,js.useState)(""),[i,r]=(0,js.useState)(null),s=(0,js.useRef)(null);return(0,ws.jsxs)(ur,{children:[(0,ws.jsx)("input",{ref:s,style:{display:"none"},type:"file",onChange:async e=>{const i=e.target?.files?.[0];if(i){r("import");try{hd(i),await hs(i)}catch(t){n(`Error uploading file: ${m(t)}`)}finally{await f()}r(null)}},accept:".json","data-testid":"file-input"}),(0,ws.jsxs)(pr,{children:[(0,ws.jsxs)(ar,{children:["Manage projects",(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(qe,{onClick:()=>{s.current?.click()},disabled:Boolean(i),loading:"import"===i,children:"Import"}),(0,ws.jsxs)(qe,{onClick:()=>e("project__create"),disabled:Boolean(i),children:["New ",(0,ws.jsx)(Jt,{})]})]})]}),t&&(0,ws.jsx)(gr,{children:t}),(0,ws.jsx)(br,{}),(0,ws.jsx)(Kd,{})]})]})}function Qd({location:e,setLocation:t}){const n=Tl("list",e);return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(hr,{children:"Project"}),(0,ws.jsx)($d,{isOpen:"create"===e,onClose:()=>{t("project")}}),(0,ws.jsx)("div",{ref:n,children:(0,ws.jsx)(Jd,{})})]})}function Zd(){const{data:e,status:t,refetch:n}=Ln({queryKey:An,queryFn:({signal:e})=>async function(e){return(await sn.get(Vo,{signal:e?.signal,timeout:e?.timeout??lr.shortTimeout})).data}({signal:e}),placeholderData:(e,t)=>e,refetchInterval:tt});return{data:e??Mo,status:t,refetch:n}}function Xd(e){const t=new URL(Ut),n=e?`external/${encodeURIComponent(e)}/`:"external/";return t.pathname=Ft?`${Ft}/${n}`:`/${n}`,t.toString()}function eu({onComplete:e,onClose:t}){const[n,i]=(0,js.useState)(""),[r,s]=(0,js.useState)(null),[a,o]=(0,js.useState)(!1),[l,c]=(0,js.useState)(!1),[d,u]=(0,js.useState)(!1),[h,p]=(0,js.useState)(null),f=(0,js.useRef)(null),_=(0,js.useMemo)(()=>n.trim().toLowerCase(),[n]),g=Xd(_),x=(0,js.useMemo)(()=>function(e){return e?$o.test(e)?null:"Use lowercase letters, numbers, and dashes only.":"Name is required."}(_),[_]),y=(0,js.useMemo)(()=>{return(e=r)?"index.html"!==e.name.toLowerCase()?"Only index.html uploads are supported.":0===e.size?"Uploaded file is empty.":e.size>Uo?`File size limit (${Ho}) exceeded.`:null:"index.html is required.";var e},[r]),j=Boolean(_&&r)&&!x&&!y&&!d;return(0,ws.jsx)(Tr,{isOpen:!0,onClose:t,showBackdrop:!0,showCloseButton:!0,size:"compact",title:"Upload custom view",bodyElements:(0,ws.jsxs)("form",{id:Go,onSubmit:async t=>{if(t.preventDefault(),r&&!x&&!y)try{u(!0),p(null),await async function(e,t,n){const i=new FormData;return i.append("indexHtml",t),(await sn.post(`${Vo}/${encodeURIComponent(e)}/upload`,i,{signal:n?.signal,timeout:n?.timeout??lr.longTimeout,headers:{"Content-Type":"multipart/form-data"}})).data}(_,r),e()}catch(n){p(m(n))}finally{u(!1)}},className:Wo.uploadForm,children:[(0,ws.jsx)("input",{ref:f,style:{display:"none"},type:"file",onChange:e=>{s(e.target.files?.[0]??null),c(!0),p(null)},accept:".html,text/html"}),(0,ws.jsxs)("div",{className:Wo.step,children:[(0,ws.jsx)("div",{className:Wo.stepTitle,children:"1. Choose a name"}),(0,ws.jsx)(fr,{children:"Name"}),(0,ws.jsx)(Zi,{value:n,onChange:e=>{i(e.target.value),o(!0)},placeholder:"my-view","aria-label":"Custom view name",autoCapitalize:"off",autoComplete:"off",fluid:!0}),(0,ws.jsxs)(fr,{children:["Use lowercase letters, numbers, and dashes. Example: ",(0,ws.jsx)(wr,{children:"my-view"})]}),(0,ws.jsxs)(fr,{children:["Preview URL: ",(0,ws.jsx)(wr,{children:g})]}),a&&x&&(0,ws.jsx)(gr,{children:x})]}),(0,ws.jsxs)("div",{className:Wo.step,children:[(0,ws.jsx)("div",{className:Wo.stepTitle,children:"2. Select index.html"}),(0,ws.jsx)(fr,{children:"Upload file"}),(0,ws.jsxs)(mr,{wrap:"wrap",className:Wo.filePicker,children:[(0,ws.jsx)(qe,{onClick:()=>f.current?.click(),children:r?"Replace index.html":"Choose index.html"}),(0,ws.jsx)("span",{className:Wo.fileName,children:r?`${r.name} (${Math.ceil(r.size/1024)} KB)`:"No file selected"})]}),(0,ws.jsxs)(fr,{children:["Accepted: index.html only, maximum ",Ho,"."]}),l&&y&&(0,ws.jsx)(gr,{children:y})]})]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[h&&(0,ws.jsx)(gr,{children:h}),(0,ws.jsx)(qe,{onClick:t,children:"Cancel"}),(0,ws.jsxs)(qe,{variant:"primary",type:"submit",form:Go,loading:d,disabled:!j,children:["Upload view ",(0,ws.jsx)(Dn,{})]})]})})}function tu({slug:e,index:t,onDelete:n,onError:i}){return(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("td",{children:e}),(0,ws.jsx)("td",{className:Wo.urlCell,children:Xd(e)}),(0,ws.jsx)("td",{className:Wo.actionsCell,children:(0,ws.jsxs)(mr,{relation:"inner",align:"end",className:Wo.actionsGroup,children:[(0,ws.jsx)(Qi,{variant:"ghosted-white",onClick:()=>{Xn(`external/${encodeURIComponent(e)}/`)},"aria-label":"Preview custom view","data-testid":`custom-view__preview_${t}`,children:(0,ws.jsx)(nn,{})}),(0,ws.jsx)(Qi,{variant:"ghosted-white",onClick:async()=>{try{await async function(e,t){u((await sn.get(`${Vo}/${encodeURIComponent(e)}/download`,{signal:t?.signal,timeout:t?.timeout??lr.longTimeout,responseType:"blob"})).data,`${e}-index.html`)}(e)}catch(t){i(m(t))}},"aria-label":"Download custom view","data-testid":`custom-view__download_${t}`,children:(0,ws.jsx)(Lt,{})}),(0,ws.jsx)(Qi,{variant:"ghosted-destructive",onClick:()=>n(e),"aria-label":"Delete custom view","data-testid":`custom-view__delete_${t}`,children:(0,ws.jsx)(mn,{})})]})})]})}function nu({views:e,onOpenUpload:t,onMutate:n,onError:i}){const[r,s]=(0,js.useState)(null),[a,o]=(0,js.useState)(!1),l=e=>{s(e)};return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsxs)(sr,{children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{children:"Name"}),(0,ws.jsx)("th",{children:"URL"}),(0,ws.jsx)("th",{className:Wo.actionsHeader})]})}),(0,ws.jsxs)("tbody",{children:[0===e.length&&(0,ws.jsx)(cr,{title:"No custom views yet",description:"Upload a self-contained index.html to serve your own view alongside the built-in ones.",action:(0,ws.jsxs)(qe,{variant:"primary",onClick:t,children:["Upload view ",(0,ws.jsx)(Dn,{})]})}),e.map((e,t)=>(0,ws.jsx)(tu,{slug:e.slug,index:t,onDelete:l,onError:i},e.slug))]})]}),(0,ws.jsx)(Jn,{isOpen:null!==r,onClose:()=>s(null),title:"Delete custom view",showBackdrop:!0,showCloseButton:!0,bodyElements:"You will permanently delete this file. Are you sure?",footerElements:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(qe,{size:"large",onClick:()=>s(null),children:"Cancel"}),(0,ws.jsx)(qe,{variant:"destructive",size:"large",onClick:async()=>{if(r)try{o(!0),await async function(e,t){await sn.delete(`${Vo}/${encodeURIComponent(e)}`,{signal:t?.signal,timeout:t?.timeout??lr.longTimeout})}(r),n()}catch(e){i(m(e))}finally{o(!1),s(null)}},loading:a,children:"Delete custom view"})]})})]})}function iu(){const{data:e,refetch:t,status:n}=Zd(),[i,r]=(0,js.useState)(!1),[s,a]=(0,js.useState)(null),o=e.views.some(e=>"demo"===e.slug);return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[i&&(0,ws.jsx)(eu,{onComplete:async()=>{r(!1),await t()},onClose:()=>r(!1)}),(0,ws.jsxs)(ar,{children:["Custom views",(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(qe,{variant:"ghosted",onClick:async()=>{try{a(null),await async function(e){return(await sn.post(`${Vo}/restore-demo`,null,{signal:e?.signal,timeout:e?.timeout??lr.longTimeout})).data}(),await t()}catch(e){a(m(e))}},disabled:o,children:"Restore demo"}),(0,ws.jsxs)(qe,{onClick:()=>r(!0),children:["New ",(0,ws.jsx)(Jt,{})]})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(Rr,{children:[(0,ws.jsxs)("span",{children:["Upload one ",(0,ws.jsx)("strong",{children:"index.html"})," per view to ",(0,ws.jsx)("strong",{children:"/external/<name>/"}),"."]}),"External imports are not allowed, include all assets inside the html file.",(0,ws.jsx)(Sl,{href:zo,children:"See the docs"})]})}),(0,ws.jsxs)(ur,{children:[(0,ws.jsx)(rr,{isLoading:"pending"===n}),s&&(0,ws.jsx)(gr,{children:s}),(0,ws.jsx)(nu,{views:e.views,onOpenUpload:()=>r(!0),onMutate:()=>t(),onError:a})]})]})})}function ru({register:e,formName:t,disabled:n}){const[i,r]=(0,js.useState)(!1);return(0,ws.jsxs)("div",{className:Ko.container,children:[(0,ws.jsx)(Zi,{type:i?"text":"password",maxLength:4,...e(t,{pattern:{value:ki,message:"Only alphanumeric characters are allowed"}}),placeholder:"-",disabled:n}),(0,ws.jsx)(Qi,{onMouseDown:()=>r(!0),onMouseUp:()=>r(!1),variant:"ghosted","aria-label":"Show pin code",children:(0,ws.jsx)(vn,{})})]})}function su(){const{data:e,status:t,refetch:n}=$i(),{handleSubmit:i,register:r,reset:s,setError:a,watch:o,setValue:l,formState:{isSubmitting:c,isDirty:d,isValid:u,errors:h}}=Er({mode:"onChange",defaultValues:e,resetOptions:{keepDirtyValues:!0}}),[p,f]=si();(0,js.useEffect)(()=>{e&&s(e)},[e,s]);const _="pending"===t,g=c||!d||!u,x=()=>{s(e)},y="pending"===t;return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(Yo,{isOpen:p,onClose:f.close}),(0,ws.jsx)(ur,{as:"form",onSubmit:i(async e=>{try{await Bi(e)}catch(t){a("root",{message:m(t)})}finally{await n()}}),onKeyDown:e=>Gn(e,x),id:"app-settings",children:(0,ws.jsxs)(pr,{children:[(0,ws.jsxs)(ar,{children:["General settings",(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(qe,{disabled:!d||c,variant:"ghosted",onClick:x,children:"Revert to saved"}),(0,ws.jsx)(qe,{type:"submit",form:"app-settings",name:"general-settings-submit",loading:c,disabled:g,variant:"primary",children:"Save"})]})]}),"",(0,ws.jsx)(br,{}),(0,ws.jsxs)(ur,{children:[(0,ws.jsx)(Rr,{children:"Changes to the views language does not affect the editor view"}),(0,ws.jsx)(rr,{isLoading:y}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Editor pin code",description:"Protect the editor view with a pin code",error:h.editorKey?.message}),(0,ws.jsx)(ru,{register:r,formName:"editorKey",disabled:_})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Operator pin code",description:"Protect the operator and cuesheet views with a pin code",error:h.operatorKey?.message}),(0,ws.jsx)(ru,{register:r,formName:"operatorKey",disabled:_})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Time format",description:"Default time format to show in views 12 / 24 hours",error:h.timeFormat?.message}),(0,ws.jsx)(Et,{value:o("timeFormat"),onValueChange:e=>{null!==e&&l("timeFormat",e,{shouldDirty:!0})},defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Views language",description:"Language to be displayed in views",error:h.language?.message}),(0,ws.jsx)(Et,{value:o("language"),onValueChange:e=>{null!==e&&l("language",e,{shouldDirty:!0})},disabled:_,defaultValue:"en",options:[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"es",label:"Spanish"},{value:"custom",label:"Custom"}]}),(0,ws.jsx)(qe,{onClick:f.open,children:"Edit custom translation"})]})]})]})]})})]})}function au(){const[e,t]=(0,js.useState)("");(0,js.useEffect)(()=>{Wn({baseUrl:Ut,path:"mcp",authenticate:!0,lockConfig:!1,lockNav:!1}).then(t).catch(()=>{t("")})},[]);const n=e?JSON.stringify({mcpServers:{ontime:{url:e}}},null,2):"";return(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"MCP Server"}),(0,ws.jsx)(kr,{children:"Connect any MCP-compatible AI agent to Ontime using the endpoint below."}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Endpoint URL",description:"Add this URL to your MCP client settings"}),e&&(0,ws.jsx)(ti,{copyValue:e,children:e})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Client configuration snippet",description:'Paste this into your AI agent settings under "mcpServers"'}),e&&(0,ws.jsx)(ti,{copyValue:n,children:n})]})]})]})})}function ou(){const{data:e,status:t}=ns(),{updateProjectData:n}=es(),[i,r]=(0,js.useState)(null),{handleSubmit:s,register:a,reset:o,formState:{isSubmitting:l,isValid:c,isDirty:d,errors:u},setError:h,clearErrors:p,watch:f,control:_,setValue:g}=Er({defaultValues:e,resetOptions:{keepDirtyValues:!0},mode:"onChange"}),{fields:x,append:y,remove:j}=Ir({control:_,name:"custom"});(0,js.useEffect)(()=>{e&&o(e)},[e,o]),(0,js.useEffect)(()=>()=>{i&&URL.revokeObjectURL(i.previewUrl)},[i]);const{ref:b,...v}=a("logo"),w=(0,js.useRef)(null),k=()=>{w.current?.click()},C=()=>{r(null),o(e)},S="pending"===t,N=f("logo");return(0,ws.jsx)(ur,{as:"form",onSubmit:s(async e=>{try{p();const t=await(async()=>{if(!i)return null;if(i.uploadedFilename)return i.uploadedFilename;const e=(await ts(i.file)).data.logoFilename;return r(t=>t?.file===i.file?{...t,uploadedFilename:e}:t),e})()??e.logo;await n({...e,logo:t}),r(null)}catch(t){h("root",{message:m(t)})}}),onKeyDown:e=>Gn(e,C),children:(0,ws.jsxs)(pr,{children:[(0,ws.jsxs)(ar,{children:["Project data",(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(qe,{onClick:C,disabled:l||!d,children:"Revert to saved"}),(0,ws.jsx)(qe,{variant:"primary",type:"submit",disabled:!d&&!i||!c,loading:l,children:"Save"})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(ur,{children:[(0,ws.jsx)(rr,{isLoading:S}),(0,ws.jsxs)("label",{children:["Project title",(0,ws.jsx)(Zi,{fluid:!0,maxLength:50,placeholder:"Project title is shown in production views",...a("title")})]}),(0,ws.jsx)(ur,{style:{marginTop:0},children:(0,ws.jsxs)("label",{children:["Project logo",(0,ws.jsx)("input",{type:"file",style:{display:"none"},accept:"image/*",...v,ref:e=>{b(e),w.current=e},onChange:e=>{const t=e.target.files?.[0];if(p("logo"),t)try{!function(e){if(0===e.size)throw new Error("File is empty");if(e.size>15e5)throw new Error("File size limit (1.5MB) exceeded")}(t),r({file:t,previewUrl:URL.createObjectURL(t)})}catch(n){h("logo",{message:m(n)})}finally{e.target.value=""}}}),(0,ws.jsxs)(pr,{className:Jo.uploadLogoCard,children:[N||i?(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)("img",{src:i?i.previewUrl:`${qt}/${N}`}),(0,ws.jsxs)("div",{className:Jo.logoActions,children:[(0,ws.jsxs)(qe,{disabled:l,onClick:k,type:"button",children:[(0,ws.jsx)(Lt,{}),"Replace logo"]}),(0,ws.jsxs)(qe,{variant:"subtle-destructive",disabled:l||!N&&!i,onClick:e=>{e.preventDefault(),e.stopPropagation(),r(null),g("logo",null,{shouldDirty:!0})},type:"button",children:[(0,ws.jsx)(mn,{}),"Delete"]})]})]}):(0,ws.jsxs)(qe,{disabled:l,onClick:k,type:"button",children:[(0,ws.jsx)(Lt,{}),"Upload logo"]}),u?.logo?.message&&(0,ws.jsx)(gr,{children:u.logo.message})]})]})}),(0,ws.jsxs)("label",{children:["Project description",(0,ws.jsx)(Zi,{fluid:!0,maxLength:100,placeholder:"Euro Love, Malmö 2024",...a("description")})]}),(0,ws.jsxs)("label",{children:["Project info",(0,ws.jsx)(Mr,{fluid:!0,maxLength:150,placeholder:"Wi-Fi password: 1234",resize:"vertical",...a("info")})]}),(0,ws.jsxs)("label",{children:["Project QR code URL",(0,ws.jsx)(Zi,{fluid:!0,placeholder:At,...a("url")})]}),(0,ws.jsxs)(ur,{style:{marginTop:0},children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Custom data",description:""}),(0,ws.jsxs)(qe,{onClick:()=>{y({title:"",value:"",url:""})},children:["Add ",(0,ws.jsx)(Jt,{})]})]}),x.length>0&&x.map((e,t)=>{const n=u.custom?.[t];return(0,ws.jsxs)("div",{className:Jo.customDataItem,children:[(0,ws.jsxs)("div",{className:Jo.titleRow,children:[(0,ws.jsxs)("label",{className:Jo.title,children:["Title",(0,ws.jsx)(Zi,{fluid:!0,defaultValue:e.title,placeholder:"Title of your custom data",...a(`custom.${t}.title`,{required:{value:!0,message:"Field cannot be empty"}})})]}),(0,ws.jsxs)(qe,{variant:"subtle-destructive",onClick:()=>j(t),children:[(0,ws.jsx)(mn,{}),"Delete"]})]}),n?.title?.message&&(0,ws.jsx)(gr,{children:n.title.message}),(0,ws.jsxs)("label",{children:["Text",(0,ws.jsx)(Mr,{fluid:!0,rows:3,resize:"vertical",defaultValue:e.value,placeholder:"Text of your custom data",...a(`custom.${t}.value`,{required:{value:!0,message:"Field cannot be empty"}})}),n?.value?.message&&(0,ws.jsx)(gr,{children:n.value.message})]}),(0,ws.jsxs)("label",{children:["Image URL (optional)",(0,ws.jsxs)("div",{className:Jo.customImage,children:[(0,ws.jsx)(Zi,{fluid:!0,defaultValue:e.url,placeholder:"Paste image URL (optional)",...a(`custom.${t}.url`)}),(0,ws.jsx)("div",{className:Jo.imageContainer,children:f(`custom.${t}.url`)&&(0,ws.jsx)("img",{src:f(`custom.${t}.url`),alt:"",loading:"lazy",className:"info__image"})})]})]})]},e.id)})]})]})]})})}function lu(){const{data:e,status:t,isError:n,refetch:i,mutateAsync:r}=function(){const{data:e,status:t,isError:n,refetch:i}=Ln({queryKey:Nn,queryFn:({signal:e})=>Vi({signal:e}),placeholderData:e=>e,refetchInterval:tt}),{mutateAsync:r}=zn({mutationFn:async e=>(await zi(e)).data,onMutate:()=>{T.cancelQueries({queryKey:Nn})},onSuccess:e=>{T.setQueryData(Nn,e)}});return{data:e??Qo,status:t,isError:n,refetch:i,mutateAsync:r}}(),{handleSubmit:s,register:a,reset:o,setError:l,clearErrors:c,formState:{isSubmitting:d,isDirty:u,isValid:h,errors:p}}=Er({mode:"onChange",defaultValues:{serverPort:4001}});(0,js.useEffect)(()=>{o({serverPort:e.port})},[e.pendingRestart,e.port,o]);const f=async()=>{c("root");const t=await i();t.isError?l("root",{message:"Failed to load server port"}):o({serverPort:t.data?.port??e.port})},_=n?"Failed to load server port":p.root?.message;return(0,ws.jsx)(ur,{as:"form",onSubmit:s(async e=>{if(e.serverPort<1024||e.serverPort>65535)l("serverPort",{message:"Port must be within range 1024 - 65535"});else try{c("root"),await r(e.serverPort)}catch(t){l("root",{message:m(t)})}}),onKeyDown:e=>Gn(e,f),id:"server-port-settings",children:(0,ws.jsxs)(pr,{children:[(0,ws.jsxs)(ar,{children:["Server port",(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(qe,{disabled:!u||d,variant:"ghosted",onClick:f,children:"Revert to saved"}),(0,ws.jsx)(qe,{type:"submit",form:"server-port-settings",name:"server-port-settings-submit",loading:d,disabled:!u||!h||d,variant:"primary",children:"Save"})]})]}),_&&(0,ws.jsx)(gr,{children:_}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(ur,{children:[(0,ws.jsx)(rr,{isLoading:"pending"===t}),e.pendingRestart&&(0,ws.jsx)(Rr,{type:"warning",children:"A port change is pending and will happen on the next restart."}),(0,ws.jsx)(Cr,{children:(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Ontime server port",description:"Port ontime server listens in. Defaults to 4001 (needs app restart)",error:p.serverPort?.message}),(0,ws.jsx)(Zi,{id:"serverPort",type:"number",maxLength:5,style:{width:"75px"},...a("serverPort",{required:{value:!0,message:"Required field"},max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"},pattern:{value:_i,message:"Value should be numeric"}})})]})})]})]})})}function cu({isOpen:e,onClose:t}){const[n,i]=(0,js.useState)(""),[r,s]=(0,js.useState)(""),[a,o]=(0,js.useState)(!1),[l,c]=(0,js.useState)(!1),[d,u]=(0,js.useState)(!1),[h,m]=(0,js.useState)(null),p=n.trim()!==r.trim();return(0,js.useEffect)(()=>{let t=!1;return async function(){if(e)try{m(null),o(!0);const e=await nr();if(t)return;i(e),s(e)}catch(n){if(t)return;i(""),s(""),m("Failed to load CSS from server")}finally{t||o(!1)}}(),()=>{t=!0}},[e]),(0,ws.jsx)(Tr,{title:"Edit CSS override",size:"wide",isOpen:e,onClose:t,showCloseButton:!0,showBackdrop:!0,bodyElements:(0,ws.jsxs)("div",{className:Zo.editorBody,children:[(0,ws.jsx)(js.Suspense,{fallback:(0,ws.jsx)(rr,{isLoading:!0}),children:(0,ws.jsx)(Xo,{value:r,onChange:s})}),(0,ws.jsx)(rr,{isLoading:a})]}),footerElements:(0,ws.jsxs)("div",{className:Zo.column,children:[(0,ws.jsx)(Rr,{children:"Invalid CSS will be refused by the browser"}),h&&(0,ws.jsx)(gr,{className:Zo.right,children:`Error: ${h}`}),(0,ws.jsxs)(mr,{align:"apart",className:Zo.editorActions,children:[(0,ws.jsx)(qe,{variant:"ghosted",onClick:async()=>{try{u(!0),s(await er())}catch(e){}finally{u(!1)}},disabled:l||d,children:"Reset to example"}),(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(qe,{variant:"ghosted",onClick:()=>s(""),children:"Clear"}),(0,ws.jsx)(qe,{onClick:t,children:"Cancel"}),(0,ws.jsx)(qe,{variant:"primary",onClick:async()=>{try{c(!0),await tr(r),i(r)}catch(e){}finally{c(!1)}},disabled:l||d||!p,loading:l,children:"Save changes"})]})]})]})})}function du(){const{data:e,status:t,mutateAsync:n}=xr(),[i,r]=si(),{control:s,handleSubmit:a,setError:o,reset:l,setValue:c,watch:d,formState:{isSubmitting:u,isDirty:h,errors:p}}=Er({defaultValues:e,resetOptions:{keepDirtyValues:!0}});(0,js.useEffect)(()=>{e&&l(e)},[e,l]);const f=()=>{l(e)},_=d("overrideStyles");return s?(0,ws.jsx)(ur,{as:"form",onSubmit:a(async e=>{try{n(e)}catch(t){o("root",{message:m(t)})}}),onKeyDown:e=>Gn(e,f),id:"view-settings",children:(0,ws.jsxs)(pr,{children:[(0,ws.jsxs)(ar,{children:["View settings",(0,ws.jsxs)(mr,{children:[(0,ws.jsx)(qe,{disabled:!h,variant:"ghosted",onClick:f,children:"Revert to saved"}),(0,ws.jsx)(qe,{type:"submit",loading:u,disabled:!h,variant:"primary",children:"Save"})]})]}),(0,ws.jsx)(br,{}),(0,ws.jsxs)(Rr,{children:["You can customise the styles applied to Ontime views by providing overriding CSS rules.",(0,ws.jsx)("br",{}),(0,ws.jsx)(Sl,{href:el,children:"See the docs"})]}),(0,ws.jsxs)(ur,{children:[(0,ws.jsx)(rr,{isLoading:"pending"===t}),(0,ws.jsx)(gr,{children:p.root?.message}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsx)(cu,{isOpen:i,onClose:r.close}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)("span",{children:"Override CSS styles"}),_&&(0,ws.jsx)(Di,{variant:"warning",children:"ON"})]}),description:_?"CSS override is ON. Ontime views will use the custom override stylesheet.":"Enables overriding view styles with custom stylesheet",descriptionTone:_?"warning":"default"}),(0,ws.jsx)($n,{size:"large",checked:_,onCheckedChange:e=>c("overrideStyles",e,{shouldDirty:!0})}),(0,ws.jsx)(qe,{onClick:r.open,disabled:u,children:"Edit CSS override"})]})]}),(0,ws.jsxs)(Cr,{children:[(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Timer colour",description:"Default colour of a running timer"}),(0,ws.jsx)(Hn,{name:"normalColor",control:s})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Warning colour",description:"Colour of a running timer in warning mode"}),(0,ws.jsx)(Hn,{name:"warningColor",control:s})]}),(0,ws.jsxs)(dr,{children:[(0,ws.jsx)(_r,{title:"Danger colour",description:"Colour of a running timer in danger mode"}),(0,ws.jsx)(Hn,{name:"dangerColor",control:s})]})]})]})]})}):null}function uu({location:e}){const t=Tl("data",e),n=Tl("general",e),i=Tl("view",e),r=Tl("custom-views",e),s=Tl("mcp",e),a=Tl("port",e);return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(hr,{children:"Settings"}),(0,ws.jsx)("div",{ref:t,children:(0,ws.jsx)(ou,{})}),(0,ws.jsx)("div",{ref:n,children:(0,ws.jsx)(su,{})}),(0,ws.jsx)("div",{ref:i,children:(0,ws.jsx)(du,{})}),(0,ws.jsx)("div",{ref:r,children:(0,ws.jsx)(iu,{})}),(0,ws.jsx)("div",{ref:s,children:(0,ws.jsx)(au,{})}),(0,ws.jsx)("div",{ref:a,children:(0,ws.jsx)(lu,{})})]})}function hu(){const{isElectron:e,sendToElectron:t}=ni(),[n,i]=si(),r=(0,js.useRef)(null),s=e||Yt;return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(hr,{children:"Shutdown Ontime"}),(0,ws.jsx)(ur,{children:(0,ws.jsxs)(pr,{children:[(0,ws.jsx)(ar,{children:"Shutdown"}),(0,ws.jsx)(br,{}),Vt?(0,ws.jsx)(Rr,{type:"warning",children:"For security reasons, shutting down the server must be done from the Ontime Cloud dashboard."}):(0,ws.jsx)(_r,{title:"Stop the Ontime server",description:"The runtime state will be lost, but your project is kept for next time."}),!Vt&&(0,ws.jsxs)(ur,{children:[(0,ws.jsx)(qe,{variant:"destructive",onClick:i.open,disabled:!s,children:"Shutdown ontime"}),!s&&(0,ws.jsx)(fr,{children:"Only available from the machine running Ontime."})]})]})}),(0,ws.jsx)(Jn,{isOpen:n,title:"Shutdown Ontime",showCloseButton:!0,onClose:i.close,bodyElements:(0,ws.jsxs)(kr,{children:["This will shutdown the Ontime server. ",(0,ws.jsx)("br",{})," Are you sure?"]}),footerElements:(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(qe,{ref:r,onClick:i.close,variant:"ghosted-white",children:"Cancel"}),(0,ws.jsx)(qe,{variant:"destructive",onClick:()=>{t("shutdown","now"),i.close()},disabled:!s,children:"Shutdown"})]})})]})}function mu(){const{close:e,panel:t,location:n,setLocation:i}=Ai();return bs(e,"Escape"),(0,ws.jsx)("div",{className:tl.container,children:(0,ws.jsxs)(Xi,{children:[(0,ws.jsx)(wl,{selectedPanel:t,location:n}),(0,ws.jsxs)(xl,{onClose:e,children:["settings"===t&&(0,ws.jsx)(uu,{location:n}),"project"===t&&(0,ws.jsx)(Qd,{location:n,setLocation:i}),"manage"===t&&(0,ws.jsx)(Dd,{location:n}),"automation"===t&&(0,ws.jsx)(oc,{location:n}),"sharing"===t&&(0,ws.jsx)(rd,{location:n}),"network"===t&&(0,ws.jsx)(zd,{location:n}),"about"===t&&(0,ws.jsx)(Rl,{}),"shutdown"===t&&(0,ws.jsx)(hu,{})]})]})})}function pu({children:e}){const{layoutMode:t}=qi();return(0,ws.jsxs)(cs,{navElements:e,children:[t===Oi.PLANNING&&(0,ws.jsx)(fu,{}),t===Oi.TRACKING&&(0,ws.jsx)(_u,{}),t===Oi.CONTROL&&(0,ws.jsx)(gu,{})]})}function fu(){return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsxs)("div",{className:ls.inline,children:[(0,ws.jsx)(xs,{}),(0,ws.jsx)(Wr,{shouldFormat:!0}),(0,ws.jsx)(Ur,{})]}),(0,ws.jsx)(Yr,{shouldFormat:!0})]})}function _u(){return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsxs)("div",{className:ls.inline,children:[(0,ws.jsx)(Kr,{shouldFormat:!0}),(0,ws.jsx)($r,{}),(0,ws.jsx)(Gr,{})]}),(0,ws.jsx)(Hr,{}),(0,ws.jsx)(Yr,{shouldFormat:!0})]})}function gu(){return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)(xs,{}),(0,ws.jsxs)("div",{className:ls.inline,children:[(0,ws.jsx)(Kr,{shouldFormat:!0}),(0,ws.jsx)($r,{}),(0,ws.jsx)(Gr,{})]}),(0,ws.jsx)(Hr,{}),(0,ws.jsx)(Yr,{shouldFormat:!0})]})}function xu(){const e=y(),{playback:t,numEvents:n,selectedEventIndex:i}=G(),{playback:r,direction:s}=U(1),a=O(1),[l]=ai({key:"add-time",defaultValue:3e5}),{disableGo:c,disableNext:d,disableAddTime:u,isPlaying:h,goAction:m,goLabel:p}=Ii({playback:t,numEvents:n,selectedEventIndex:i,timerPhase:e.phase}),f=u||0===l,_=e=>{f||("add"===e?M.addTime(l):M.addTime(-1*l))};Ei([["Space",()=>!c&&m(),{preventDefault:!0}],["N",()=>!d&&M.next(),{preventDefault:!0}],["Escape",()=>t!==S.Stop&&M.stop(),{preventDefault:!0}]]);const g=e.phase===w.Pending,x=e.phase===w.Overtime,j=g?e.secondaryTimer:e.current,b=v(l);return(0,ws.jsxs)("div",{className:il.container,children:[(0,ws.jsxs)("div",{className:il.itemGroup,children:[(0,ws.jsxs)(Ri,{onClick:m,disabled:c,theme:S.Play,active:h,className:il.goButton,children:[(0,ws.jsx)("span",{className:il.goLabel,children:p}),(0,ws.jsx)("span",{className:il.shortcutHint,children:"[space]"})]}),(0,ws.jsxs)(Ri,{onClick:M.next,disabled:d,className:il.iconButtonWithLabel,aspect:"square",children:[(0,ws.jsx)(Qt,{}),(0,ws.jsx)("span",{className:il.shortcutHint,children:"[n]"})]}),(0,ws.jsxs)(Ri,{onClick:M.stop,disabled:t===S.Stop,className:il.iconButtonWithLabel,aspect:"square",children:[(0,ws.jsx)(un,{}),(0,ws.jsx)("span",{className:il.shortcutHint,children:"[esc]"})]}),(0,ws.jsxs)("div",{className:il.addSection,children:[(0,ws.jsx)("div",{className:il.separator}),(0,ws.jsxs)(Ri,{onClick:()=>_("remove"),disabled:f,className:il.iconButtonWithLabel,aspect:"square",children:[(0,ws.jsx)(pn,{}),b]}),(0,ws.jsxs)(Ri,{onClick:()=>_("add"),disabled:f,className:il.iconButtonWithLabel,aspect:"square",children:[(0,ws.jsx)(Jt,{}),b]})]})]}),(0,ws.jsxs)("div",{className:il.timerSection,children:[(0,ws.jsx)("span",{className:il.negativeIndicator,"data-active":x,children:"–"}),(0,ws.jsx)(Ti,{time:j,phase:e.phase})]}),(0,ws.jsxs)("div",{className:il.auxSection,children:[(0,ws.jsx)(Ri,{onClick:()=>{r===o.Start?H.pause(1):H.start(1)},className:il.iconButton,theme:S.Play,aspect:"square",children:r===o.Start?(0,ws.jsx)($t,{}):(0,ws.jsx)(rn,{})}),(0,ws.jsx)(Ri,{onClick:()=>{H.stop(1)},disabled:r===o.Stop,className:il.iconButton,theme:S.Stop,aspect:"square",children:(0,ws.jsx)(un,{})}),r!==o.Stop?(0,ws.jsx)("div",{className:il.auxTimeDisplay,children:R(a)}):(0,ws.jsx)(qr,{name:"aux1-tracking",submitHandler:(e,t)=>{const n=Pi(t);H.setDuration(1,n)},time:a,className:il.auxTimeInput}),(0,ws.jsx)(Ri,{onClick:()=>{const e=s===K.CountDown?K.CountUp:K.CountDown;H.setDirection(1,e)},disabled:r!==o.Stop,className:il.iconButton,aspect:"square",children:s===K.CountDown?(0,ws.jsx)(Tn,{}):(0,ws.jsx)(ln,{})})]})]})}function yu(){return(0,ws.jsx)("div",{className:sl.container,children:(0,ws.jsx)("div",{className:sl.emptyState,children:(0,ws.jsxs)("div",{className:sl.emptyMessage,children:[(0,ws.jsx)("h3",{className:sl.emptyTitle,children:"No events yet"}),(0,ws.jsx)("p",{className:sl.emptyBody,children:"Add events in the rundown to populate this list."})]})})})}function ju({entry:e,currentEventIndex:t,upcomingChipLimit:n,isRunning:i,mode:r,isGroupEnd:s,onSelect:a}){const o=(0,js.useCallback)(()=>{a({id:e.id,index:e.eventIndex-1,parent:e.parent??void 0})},[a,e.id,e.eventIndex,e.parent]),l=t>0&&e.eventIndex>t&&e.eventIndex<=t+2,c=r===Qe.Run&&e.isPast,d=e.isLoaded?r===Qe.Run?"running":"selected":c?"past":l?"next":"default",u=i&&!e.isLoaded&&!e.isPast&&!e.skip,h=u&&e.eventIndex<=n;return(0,ws.jsxs)("li",{"data-state":d,"data-skipped":e.skip||void 0,"data-group-end":s||void 0,className:al.item,onClick:o,children:[(0,ws.jsx)("div",{className:al.colourBar,style:{backgroundColor:e.groupColour||"transparent"}}),(0,ws.jsx)("span",{className:al.title,children:e.title||"Untitled"}),u&&(0,ws.jsx)(ll,{timeStart:e.timeStart,delay:e.delay,dayOffset:e.dayOffset,totalGap:e.totalGap,isLinkedToLoaded:e.isLinkedToLoaded,isLoaded:e.isLoaded,showOnHover:!h})]})}function bu({timeStart:e,delay:t,dayOffset:n,totalGap:i,isLinkedToLoaded:r,isLoaded:s,showOnHover:a}){const o=L({timeStart:e,delay:t,dayOffset:n},{totalGap:i,isLinkedToLoaded:r}),l=!s&&o<1e3;let d="LIVE";s||(d=l?"DUE":v(Math.abs(o),o>2*c));const u=s?"live":l?"due":"pending";return(0,ws.jsx)(Ue,{text:"Expected time until start",className:al.chipSlot,"data-hover-only":a||void 0,children:(0,ws.jsx)("span",{"data-chip-status":u,className:al.chipText,children:d})})}function vu({mode:e}){const{data:t}=Ui(),n=F(),i=fi(e=>e.cursor),r=(0,js.useMemo)(()=>e===Qe.Run?n:i,[e,n,i]),s=(0,js.useMemo)(()=>Hi(t,r).filter(b),[t,r]);return 0===s.length?(0,ws.jsx)(yu,{}):(0,ws.jsx)(wu,{mode:e,eventData:s,selectedEventId:n,resolvedFollowEventId:r,rundownId:t.id})}function wu({mode:e,eventData:t,selectedEventId:n,resolvedFollowEventId:i,rundownId:r}){const s=(0,js.useRef)(null),a=(0,js.useRef)(null),o=Li(r),l=(0,js.useMemo)(()=>function(e){const t=e.findIndex(e=>e.isLoaded),n=-1!==t?e[t]:null,i=n?.eventIndex??0;return{index:t,id:n?.id??null,eventIndex:i,upcomingChipLimit:i>0?i+rl:rl}}(t),[t]),c=(0,js.useMemo)(()=>i?t.findIndex(e=>e.id===i):-1,[t,i]),d=(0,js.useCallback)(e=>{o(e)},[o]);(0,js.useEffect)(()=>{if(!s.current)return;const t=-1!==c?c:l.index;-1!==t&&(e===Qe.Edit&&t<=3||s.current.scrollToIndex({index:t,align:"start",behavior:"smooth",offset:-50}))},[l.index,c,e]);const u=(0,js.useCallback)((i,r)=>{const s=t[i+1],a=Boolean(r.parent)&&r.parent!==(s?.parent??null);return(0,ws.jsx)(ol,{entry:r,currentEventIndex:l.eventIndex,upcomingChipLimit:l.upcomingChipLimit,isRunning:e===Qe.Run&&null!==n,mode:e,onSelect:d,isGroupEnd:a},r.id)},[t,l.eventIndex,l.upcomingChipLimit,e,n,d]);return(0,ws.jsx)(is,{className:cl.container,ref:a,children:(0,ws.jsx)(gi,{ref:s,data:t,computeItemKey:(e,t)=>t.id,itemContent:u,increaseViewportBy:{top:200,bottom:200},customScrollParent:a.current??void 0,components:{List:ku,Footer:Cu}})})}function ku({children:e,...t}){return(0,ws.jsx)("ul",{...t,className:cl.list,children:e})}function Cu(){return(0,ws.jsx)("div",{className:cl.bottomSpacer})}function Su(){const{layoutMode:e}=qi();return e===Oi.CONTROL?(0,ws.jsxs)("div",{id:"panels",className:dl.panelContainer,children:[(0,ws.jsxs)("div",{className:dl.left,children:[(0,ws.jsx)(hl,{}),(0,ws.jsx)(ml,{})]}),(0,ws.jsx)(ul,{})]}):e===Oi.TRACKING?(0,ws.jsxs)("div",{id:"panels",className:`${dl.panelContainer} ${dl.panelContainerTracking}`,children:[(0,ws.jsxs)("div",{className:dl.rundownLayout,children:[(0,ws.jsx)("div",{className:dl.titlesPanel,children:(0,ws.jsx)(vu,{mode:Qe.Run})}),(0,ws.jsx)("div",{className:dl.rundownPanel,children:(0,ws.jsx)(ul,{})})]}),(0,ws.jsx)(xu,{})]}):(0,ws.jsx)("div",{id:"panels",className:dl.panelContainer,children:(0,ws.jsxs)("div",{className:dl.rundownLayout,children:[(0,ws.jsx)("div",{className:dl.titlesPanel,children:(0,ws.jsx)(vu,{mode:Qe.Edit})}),(0,ws.jsx)("div",{className:dl.rundownPanel,children:(0,ws.jsx)(ul,{})})]})})}function Nu(){const{layoutMode:e,setLayoutMode:t}=qi(),n=(0,js.useMemo)(()=>[{type:"item",label:"Planning",description:"Edit focused list with planning stats",icon:e===Oi.PLANNING?Cn:void 0,onClick:()=>t(Oi.PLANNING)},{type:"item",label:"Tracking",description:"Live timing view with progress and offsets",icon:e===Oi.TRACKING?Cn:void 0,onClick:()=>t(Oi.TRACKING)},{type:"item",label:"Control",description:"All controls and rundown together",icon:e===Oi.CONTROL?Cn:void 0,onClick:()=>t(Oi.CONTROL)}],[e,t]);return(0,ws.jsx)(xi,{render:(0,ws.jsx)(Qi,{"aria-label":"Layout mode",variant:"subtle-white",size:"xlarge"}),items:n,children:(0,ws.jsx)(Ze,{})})}function Eu({onFinish:e}){const t=(0,js.useRef)(null);return(0,ws.jsxs)(ws.Fragment,{children:[(0,ws.jsx)("input",{ref:t,style:{display:"none"},type:"file",onChange:async t=>{const n=t.target?.files?.[0];if(n)try{hd(n),await hs(n)}catch(i){}finally{await f(),e()}},accept:".json","data-testid":"file-input"}),(0,ws.jsx)(qe,{onClick:()=>{t.current?.click()},children:"Import project"})]})}function Iu(e){const{loadProject:t,onClose:n}=e,{data:i}=ds();return(0,ws.jsx)("tbody",{children:i.reorderedProjectFiles.map(e=>e.filename===i.lastLoadedProject?(0,ws.jsxs)("tr",{className:fl.current,onClick:n,children:[(0,ws.jsx)("td",{children:e.filename}),(0,ws.jsx)("td",{children:"Loaded from last session"})]},e.filename):(0,ws.jsxs)("tr",{onClick:()=>t(e.filename),children:[(0,ws.jsx)("td",{children:e.filename}),(0,ws.jsx)("td",{children:new Date(e.updatedAt).toLocaleString()})]},e.filename))})}function Ru({onClose:e}){const t=Je();return(0,ws.jsx)(Tr,{isOpen:!0,onClose:()=>e(),showBackdrop:!0,bodyElements:(0,ws.jsxs)("div",{className:fl.sections,children:[(0,ws.jsxs)("div",{className:fl.about,children:[(0,ws.jsx)("img",{src:"ontime-logo.png",alt:"ontime",className:fl.logo}),(0,ws.jsxs)("div",{children:["Ontime v",Xt]}),(0,ws.jsx)(Sl,{href:tn,children:"Website"}),(0,ws.jsx)(Sl,{href:At,children:"Read the docs"}),(0,ws.jsx)(Sl,{href:wn,children:"Discord server"})]}),(0,ws.jsxs)("div",{className:fl.column,children:[(0,ws.jsxs)("div",{className:fl.header,children:["Welcome to Ontime",(0,ws.jsx)(Qi,{"aria-label":"close welcome modal",variant:"subtle-white",onClick:()=>e(),children:(0,ws.jsx)(Sn,{})})]}),(0,ws.jsx)(Ar,{children:"Select project"}),(0,ws.jsx)("div",{className:fl.tableContainer,children:(0,ws.jsxs)("table",{className:fl.table,children:[(0,ws.jsx)("thead",{children:(0,ws.jsxs)("tr",{children:[(0,ws.jsx)("th",{children:"File Name"}),(0,ws.jsx)("th",{children:"Last Used"})]})}),(0,ws.jsx)(Iu,{loadProject:async t=>{try{await gs(t),await f(),e()}catch(n){}},onClose:()=>e()})]})})]})]}),footerElements:(0,ws.jsxs)("div",{className:fl.column,children:[(0,ws.jsxs)("div",{className:fl.buttonRow,children:[(0,ws.jsx)(qe,{onClick:async()=>{try{await us(),await f(),e()}catch(t){}},children:"Load demo project"}),(0,ws.jsx)(Eu,{onFinish:()=>e()}),(0,ws.jsx)(qe,{variant:"primary",onClick:()=>{t("/editor?settings=project__create"),e()},children:"Create new..."})]}),(0,ws.jsxs)(Or,{className:fl.inline,children:[(0,ws.jsx)(Un,{defaultChecked:!0,onCheckedChange:e=>Fi(e)}),"Show this modal on next startup"]})]})})}function Tu(){const e=C(e=>e.showDialog),t=C(e=>e.clearDialog);return e?(0,ws.jsx)(Ru,{onClose:t}):null}return e("default",function(){const{isOpen:e,setLocation:t,close:n}=Ai(),[i,r]=si();Br("Editor"),ei(),(0,js.useEffect)(()=>{"renderer"===window.process?.type&&window.ipcRenderer.on("user-request-shutdown",()=>{t("shutdown")})},[t]);const s=(0,js.useCallback)(()=>{e?n():t("settings")},[n,e,t]);return Ei([["mod + ,",s]]),(0,ws.jsx)(Nr,{permission:"editor",children:(0,ws.jsxs)("div",{className:_l.mainContainer,"data-testid":"event-editor",children:[(0,ws.jsx)(Tu,{}),(0,ws.jsx)(ri,{isOpen:i,onClose:r.close}),e?(0,ws.jsx)(mu,{}):(0,ws.jsx)(Su,{}),(0,ws.jsxs)(nl,{children:[(0,ws.jsx)(Qi,{"aria-label":"Toggle navigation",variant:"subtle-white",size:"xlarge",onClick:r.open,children:(0,ws.jsx)(On,{})}),(0,ws.jsx)(Qi,{"aria-label":"Toggle settings",variant:"subtle-white",size:"xlarge",onClick:s,children:e?(0,ws.jsx)(Sn,{}):(0,ws.jsx)(En,{})}),(0,ws.jsx)(pl,{})]})]})})}),{setters:[function(e){n=e.a,i=e.n,r=e.t},function(e){s=e.$,a=e.At,o=e.Bt,l=e.C,c=e.Ct,d=e.Ft,u=e.G,e.Gt,h=e.It,m=e.J,p=e.Jt,f=e.K,_=e.Kt,g=e.Lt,x=e.Mt,y=e.N,j=e.Nt,b=e.Pt,v=e.Q,w=e.Rt,e.S,k=e.Tt,C=e.U,S=e.Ut,e.V,N=e.W,E=e.Xt,I=e.Y,R=e._t,T=e.at,P=e.bt,O=e.c,A=e.ct,q=e.en,L=e.it,D=e.jt,F=e.k,B=e.kt,V=e.n,M=e.o,z=e.pt,$=e.qt,U=e.s,H=e.t,W=e.ut,G=e.w,e.wt,K=e.zt},function(e){Y=e.$,J=e.D,e.En,Q=e.Er,Z=e.Hn,X=e.J,ee=e.K,te=e.Mn,ne=e.Nn,ie=e.Nt,re=e.O,se=e.P,ae=e.Pn,oe=e.Sn,le=e.Sr,ce=e.T,e.Tn,de=e.Tr,ue=e.Un,he=e.Y,e._n,me=e._t,pe=e.bn,fe=e.cn,_e=e.dn,ge=e.dt,xe=e.et,ye=e.fn,je=e.gn,be=e.gr,ve=e.ht,we=e.it,ke=e.kr,Ce=e.kt,Se=e.mn,Ne=e.mr,Ee=e.nn,Ie=e.nt,Re=e.o,Te=e.on,Pe=e.rn,Oe=e.rt,Ae=e.sn,qe=e.t,Le=e.tt,De=e.vr,Fe=e.w,Be=e.wn,Ve=e.xn,Me=e.yn,ze=e.yr,$e=e.yt},function(e){Ue=e.t},function(e){He=e.A,We=e.B,Ge=e.F,Ke=e.M,Ye=e.N,Je=e.T,Qe=e.a,Ze=e.d,Xe=e.j,et=e.n,tt=e.o,nt=e.r},function(e){it=e.A,rt=e.C,st=e.D,at=e.E,ot=e.I,lt=e.M,ct=e.N,dt=e.O,ut=e.P,ht=e.R,mt=e.S,pt=e.T,ft=e.U,_t=e.W,gt=e._,xt=e.c,yt=e.d,jt=e.g,bt=e.h,vt=e.j,wt=e.k,kt=e.l,Ct=e.m,St=e.n,Nt=e.r,Et=e.t,It=e.v,Rt=e.w,Tt=e.x,Pt=e.y,Ot=e.z},function(e){At=e.A,qt=e.C,Lt=e.Ct,Dt=e.D,Ft=e.E,Bt=e.Et,Vt=e.F,Mt=e.Jt,zt=e.K,$t=e.Kt,Ut=e.L,Ht=e.M,Wt=e.N,Gt=e.O,Kt=e.Ot,Yt=e.P,Jt=e.Q,Qt=e.Qt,Zt=e.St,Xt=e.T,en=e.U,tn=e.V,e.W,nn=e.Wt,rn=e.Yt,sn=e._n,an=e._t,on=e.an,ln=e.at,cn=e.b,dn=e.bn,un=e.cn,hn=e.d,mn=e.dn,pn=e.en,fn=e.fn,_n=e.ft,gn=e.gn,xn=e.gt,yn=e.hn,jn=e.i,bn=e.it,vn=e.jt,wn=e.k,kn=e.kt,Cn=e.lt,Sn=e.mt,Nn=e.n,En=e.on,In=e.ot,Rn=e.qt,Tn=e.rt,Pn=e.sn,On=e.tt,An=e.u,qn=e.ut,Ln=e.vn,Dn=e.vt,Fn=e.w,Bn=e.wt,Vn=e.xt,Mn=e.z},function(e){zn=e.t},function(e){$n=e.c,Un=e.l,Hn=e.n},function(e){Wn=e.a,Gn=e.c,Kn=e.d,Yn=e.f,Jn=e.g,Qn=e.h,Zn=e.i,Xn=e.l,ei=e.m,ti=e.n,ni=e.p,ii=e.s,ri=e.t,si=e.v},function(e){ai=e.t},function(e){oi=e.A,li=e.C,ci=e.D,di=e.E,ui=e.M,hi=e.N,mi=e.O,pi=e.T,fi=e.b,_i=e.c,gi=e.f,xi=e.g,yi=e.j,ji=e.k,bi=e.l,vi=e.n,wi=e.r,ki=e.s,Ci=e.t,Si=e.u,Ni=e.w},function(e){Ei=e.t},function(e){Ii=e.n,Ri=e.r,Ti=e.t},function(e){Pi=e.t},function(e){Oi=e.a,Ai=e.n,qi=e.o,Li=e.r,Di=e.t},function(e){Fi=e.a,Bi=e.i,Vi=e.n,Mi=e.o,zi=e.r,$i=e.t},function(e){Ui=e.a,Hi=e.d,Wi=e.f,Gi=e.h,Ki=e.l,Yi=e.u},function(e){Ji=e.n,Qi=e.r,Zi=e.t},function(e){},function(e){},function(e){Xi=e.t},function(e){er=e.a,tr=e.r,nr=e.t},function(e){ir=e.A,rr=e.C,sr=e.D,ar=e.E,or=e.M,lr=e.N,cr=e.O,dr=e.S,ur=e.T,hr=e._,mr=e.b,pr=e.d,fr=e.f,_r=e.g,gr=e.h,xr=e.i,yr=e.k,jr=e.m,br=e.p,vr=e.u,wr=e.v,kr=e.w,Cr=e.x,Sr=e.y},function(e){Nr=e.t},function(e){Er=e.i,Ir=e.r,Rr=e.t},function(e){Tr=e.t},function(e){Pr=e.u},function(e){Or=e.i,Ar=e.s},function(e){qr=e.n,Lr=e.t},function(e){Dr=e.n,Fr=e.t},function(e){Br=e.t},function(e){Vr=e.n,Mr=e.r,zr=e.t},function(e){$r=e.a,Ur=e.i,Hr=e.n,Wr=e.o,Gr=e.r,Kr=e.s,Yr=e.t},function(e){},function(e){},function(e){Jr=e.i,Qr=e.n,Zr=e.r,Xr=e.t},function(e){},function(e){es=e.n,ts=e.r,ns=e.t},function(e){is=e._,rs=e.a,ss=e.c,as=e.d,os=e.f,ls=e.g,cs=e.h,ds=e.i,us=e.l,hs=e.m,ms=e.o,ps=e.p,fs=e.r,_s=e.s,gs=e.u,xs=e.v}],execute:function(){(ys=document.createElement("style")).textContent='._blink_1x7ve_1{animation:1s step-start infinite _blink_1x7ve_1}@keyframes _blink_1x7ve_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1x7ve_13{transform:rotate(45deg)}._contentWrapper_1x7ve_17{flex-direction:column;flex:auto;min-width:0;height:100%;display:flex;position:relative}._corner_1x7ve_26{box-sizing:border-box;flex:none;justify-content:flex-end;width:100%;max-width:1280px;margin-left:auto;margin-right:auto;padding:0 1rem .5rem;display:flex}._content_1x7ve_17{box-sizing:border-box;padding-left:1rem;padding-right:1rem;flex-grow:1;width:100%;max-width:1280px;margin:0 auto 1rem;padding-bottom:40vh;overflow-y:auto}._blink_170ss_1{animation:1s step-start infinite _blink_170ss_1}@keyframes _blink_170ss_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_170ss_13{transform:rotate(45deg)}._search_170ss_17{flex:none;align-items:center;margin:.25rem 1rem .25rem .25rem;display:flex;position:relative}._icon_170ss_25{color:#b1b1b1;pointer-events:none;position:absolute;left:.5rem}._input_170ss_32{padding-left:2rem;padding-right:2rem}._clear_170ss_37{position:absolute;right:.25rem}._blink_q5mud_1{animation:1s step-start infinite _blink_q5mud_1}@keyframes _blink_q5mud_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_q5mud_13{transform:rotate(45deg)}._container_q5mud_17{flex-direction:column;flex:0 0 min(30vw,300px);gap:.75rem;width:min(30vw,300px);min-width:min(30vw,300px);display:flex;overflow-y:auto}._tabs_q5mud_27,ul{margin:0;padding:0;list-style:none}._tabs_q5mud_27{flex-direction:column;display:flex}._primary_q5mud_39,._secondary_q5mud_40{border-radius:2px;margin-right:1rem;padding:.25rem 1rem}._primary_q5mud_39:focus-visible{outline-offset:-2px;background-color:#404040;outline:2px solid #578af4}._secondary_q5mud_40:focus-visible{outline-offset:-2px;background-color:#404040;outline:2px solid #578af4}._primary_q5mud_39:hover,._secondary_q5mud_40:hover{cursor:pointer;background-color:#404040}._primary_q5mud_39{border-left:3px solid transparent;align-items:center;gap:.5rem;font-size:1rem;display:flex}._primary_q5mud_39._groupActive_q5mud_64{color:#779be7;font-weight:600}._primary_q5mud_39._active_q5mud_68{color:#f6f6f6;background-color:rgba(87,138,244,.16);border-left-color:#779be7;font-weight:600}._primary_q5mud_39._highlight_q5mud_74{color:#ff7878}._primary_q5mud_39._highlight_q5mud_74:before{content:"";background-color:#ff7878;border-radius:99px;width:.5em;height:.5em}._secondary_q5mud_40{color:#b1b1b1;border-left:1px solid rgba(255,255,255,.1);margin-left:1rem;font-size:calc(1rem - 2px)}._secondary_q5mud_40._active_q5mud_68{color:#f6f6f6;background-color:rgba(87,138,244,.16);border-left-color:#779be7;font-weight:600}._blink_ac6dr_1{animation:1s step-start infinite _blink_ac6dr_1}@keyframes _blink_ac6dr_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_ac6dr_13{transform:rotate(45deg)}._link_ac6dr_17{color:#578af4;align-items:center;gap:.25rem;width:fit-content;text-decoration:none;transition-property:color;transition-duration:.1s;display:flex}._link_ac6dr_17._inline_ac6dr_27{display:inline-flex}._link_ac6dr_17:hover{color:#ff7597}._link_ac6dr_17:focus{outline:none;box-shadow:0 1px}._link_ac6dr_17:hover ._icon_ac6dr_37{transform:translate(.25rem)}._link_ac6dr_17:focus-visible ._icon_ac6dr_37{transform:translate(.25rem)}._icon_ac6dr_37{flex:0 0 1.5em;font-size:1em;transition:transform .1s}._blink_a0pg1_1{animation:1s step-start infinite _blink_a0pg1_1}@keyframes _blink_a0pg1_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_a0pg1_13{transform:rotate(45deg)}._updateIndicator_a0pg1_17{background-color:#ff7878;border-radius:99px;flex:none;width:.5em;height:.5em}._blink_1csyf_1{animation:1s step-start infinite _blink_1csyf_1}@keyframes _blink_1csyf_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1csyf_13{transform:rotate(45deg)}._card_1csyf_17{background-color:rgba(87,138,244,.06);border-color:rgba(87,138,244,.42);padding:1.5rem}._eyebrow_1csyf_23{color:#779be7;letter-spacing:.08em;text-transform:uppercase;font-size:calc(1rem - 3px);font-weight:700}._title_1csyf_31{margin-top:.35rem;font-size:1.5rem;font-weight:600;line-height:1.15}._description_1csyf_38{color:#cfcfcf;flex-direction:column;gap:.75rem;max-width:33rem;margin-top:.9rem;line-height:1.5;display:flex}._portability_1csyf_48{color:#b1b1b1;border-top:1px solid rgba(255,255,255,.1);padding-top:.75rem;font-size:calc(1rem - 2px)}._benefits_1csyf_55{grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem 1rem;margin-top:1.5rem;padding:0;list-style:none;display:grid}._benefits_1csyf_55 li{align-items:flex-start;gap:.5rem;line-height:1.4;display:flex}._benefits_1csyf_55 svg{color:#779be7;flex:none;margin-top:.1rem;font-size:1.1rem}._actions_1csyf_76{flex-wrap:wrap;align-items:center;gap:1rem;margin-top:1.5rem;display:flex}@media (max-width:500px){._benefits_1csyf_55{grid-template-columns:1fr}}._blink_yanwg_1{animation:1s step-start infinite _blink_yanwg_1}@keyframes _blink_yanwg_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_yanwg_13{transform:rotate(45deg)}._link_yanwg_17{width:calc(100% + var(--panel-card-padding,2rem) * 2);margin:-.75rem calc(var(--panel-card-padding,2rem) * -1);padding:.75rem var(--panel-card-padding,2rem)}._link_yanwg_17>:first-child{flex:1;min-width:0}._action_yanwg_27{color:#779be7;font-size:calc(1rem - 2px)}._blink_1u4lw_1{animation:1s step-start infinite _blink_1u4lw_1}@keyframes _blink_1u4lw_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1u4lw_13{transform:rotate(45deg)}._inputShell_1u4lw_17{position:relative}._fluid_1u4lw_21{width:100%}._input_1u4lw_17{padding-right:2rem}._expandButton_1u4lw_29{position:absolute;top:50%;right:.25rem;transform:translateY(-50%)}._positioner_1u4lw_36{outline:0}._popup_1u4lw_40{box-sizing:border-box;min-width:var(--anchor-width);max-width:var(--available-width);color:#8a8a8a;background:#202020;border:1px solid #404040;border-radius:3px}._list_1u4lw_50{box-sizing:border-box;max-height:min(20rem, var(--available-height));overscroll-behavior:contain;outline:0;padding-top:.25rem;padding-bottom:.25rem;overflow-y:auto}._item_1u4lw_59{box-sizing:border-box;cursor:default;user-select:none;overflow-wrap:anywhere;outline:0;padding:.25rem .5rem}._item_1u4lw_59[data-highlighted]{color:#f6f6f6;background:#2b5abc}._expandedEditor_1u4lw_72{min-height:min(18rem,45vh);font-family:monospace;line-height:1.4}._footerHint_1u4lw_78{color:#8a8a8a;margin-right:auto;font-size:calc(1rem - 2px)}._blink_xhhrk_1{animation:1s step-start infinite _blink_xhhrk_1}@keyframes _blink_xhhrk_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_xhhrk_13{transform:rotate(45deg)}._outerColumn_xhhrk_17{color:#f6f6f6;flex-direction:column;gap:2rem;min-height:100%;padding-top:.5rem;padding-bottom:.5rem;font-size:calc(1rem - 1px);display:flex}._outerColumn_xhhrk_17 h3{font-size:1rem}._innerColumn_xhhrk_30{flex-direction:column;gap:.5rem;display:flex}._ruleSection_xhhrk_36{flex-direction:column;gap:1rem;display:flex}._titleSection_xhhrk_42,._filterSection_xhhrk_43,._oscSection_xhhrk_44,._httpSection_xhhrk_45,._actionSection_xhhrk_46{grid-gap:.5rem;display:grid}._titleSection_xhhrk_42 button,._filterSection_xhhrk_43 button,._oscSection_xhhrk_44 button,._httpSection_xhhrk_45 button,._actionSection_xhhrk_46 button{align-self:flex-end}._titleSection_xhhrk_42 label,._titleSection_xhhrk_42 div,._ruleSection_xhhrk_36 label,._ruleSection_xhhrk_36 div,._filterSection_xhhrk_43 label,._filterSection_xhhrk_43 div,._oscSection_xhhrk_44 label,._oscSection_xhhrk_44 div,._httpSection_xhhrk_45 label,._httpSection_xhhrk_45 div,._actionSection_xhhrk_46 label,._actionSection_xhhrk_46 div{font-size:calc(1rem - 3px)}._titleSection_xhhrk_42 label,._ruleSection_xhhrk_36 label,._filterSection_xhhrk_43 label,._oscSection_xhhrk_44 label,._httpSection_xhhrk_45 label,._actionSection_xhhrk_46 label{color:#8a8a8a}._titleSection_xhhrk_42{grid-template-columns:1fr}._filterSection_xhhrk_43{grid-template-columns:2fr 1fr 2fr auto}._oscSection_xhhrk_44{grid-template-columns:9rem 5rem 3fr 4fr auto}._httpSection_xhhrk_45{grid-template-columns:1fr auto}._actionSection_xhhrk_46{grid-template-columns:auto 1fr 1fr auto}._actionSection_xhhrk_46 ._test_xhhrk_100{grid-column:-1}._outputCard_xhhrk_104{border-left:.25rem solid #262626;padding-left:.5rem}._blink_1fzu7_1{animation:1s step-start infinite _blink_1fzu7_1}@keyframes _blink_1fzu7_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1fzu7_13{transform:rotate(45deg)}._goIcon_1fzu7_17{margin-bottom:.25rem;margin-left:.25rem;transform:rotate(45deg)}._blink_qqr9x_1{animation:1s step-start infinite _blink_qqr9x_1}@keyframes _blink_qqr9x_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_qqr9x_13{transform:rotate(45deg)}th._over_qqr9x_17{color:#f57c13}th._under_qqr9x_21{color:#55b469}._blink_1sy0c_1{animation:1s step-start infinite _blink_1sy0c_1}@keyframes _blink_1sy0c_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1sy0c_13{transform:rotate(45deg)}._expand_1sy0c_17{flex:1}._column_1sy0c_21{flex-direction:column;gap:1rem;display:flex}._blink_1fjfd_1{animation:1s step-start infinite _blink_1fjfd_1}@keyframes _blink_1fjfd_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1fjfd_13{transform:rotate(45deg)}._halfWidth_1fjfd_17{width:50%}._fullWidth_1fjfd_21{width:100%}._twoCols_1fjfd_25{grid-template-columns:1fr 1fr;gap:1rem;display:grid}._formColumn_1fjfd_31{flex-direction:column;gap:1rem;display:flex}._current_1fjfd_37{background-color:inherit}._blink_1x0da_1{animation:1s step-start infinite _blink_1x0da_1}@keyframes _blink_1x0da_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1x0da_13{transform:rotate(45deg)}._introStack_1x0da_17{flex-direction:column;gap:1rem;display:flex}._setupLead_1x0da_23,._finishTitle_1x0da_24{color:#f6f6f6;margin:0;font-size:1rem;font-weight:600}._setupBody_1x0da_31,._finishDescription_1x0da_32,._sourceDescription_1x0da_33{color:#b1b1b1;margin:0;line-height:1.5}._sourceGrid_1x0da_39,._finishSection_1x0da_40{margin-top:1rem}._finishActions_1x0da_44{flex-wrap:wrap;justify-content:center;gap:.5rem;display:flex}._sourceGrid_1x0da_39{grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;display:grid}._sourceCard_1x0da_57,._finishSection_1x0da_40,._setupBlock_1x0da_59{background:#101010;border:1px solid rgba(255,255,255,.1);border-radius:3px}._sourceCard_1x0da_57{flex-direction:column;gap:1rem;min-height:14rem;padding:1rem;display:flex}._sourceHeader_1x0da_73,._setupIntroText_1x0da_74{flex-direction:column;gap:.35rem;display:flex}._sourceTitle_1x0da_80{color:#f6f6f6;margin:0;font-size:1rem;font-weight:600}._sourceMeta_1x0da_87,._setupHint_1x0da_88{color:#9d9d9d;font-size:calc(1rem - 2px)}._finishSection_1x0da_40{text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:.75rem;padding:2rem 1rem;display:flex}._finishBadge_1x0da_103{letter-spacing:.5px;text-transform:uppercase;color:#afc4ff;background-color:rgba(87,153,255,.12);border:1px solid rgba(87,153,255,.22);border-radius:2px;padding:.35rem .7rem;font-size:calc(1rem - 3px);font-weight:600}._setupShell_1x0da_115{border-top:1px solid rgba(255,255,255,.1);margin-top:1rem;padding-top:1rem}._setupIntro_1x0da_74{justify-content:space-between;align-items:flex-start;gap:1rem;padding:0 2rem;display:flex}._setupBlock_1x0da_59{margin:0 2rem;padding:1rem;list-style:none}._setupActions_1x0da_135{margin-top:.75rem}._statusIdle_1x0da_139{color:#b1b1b1;background-color:rgba(255,255,255,.03)}._statusPending_1x0da_144{color:#ffcc78;background-color:rgba(255,162,0,.1)}._statusReady_1x0da_149{color:#77c785;background-color:rgba(57,198,120,.1)}@media (max-width:1100px){._sourceGrid_1x0da_39{grid-template-columns:1fr}._setupIntro_1x0da_74{flex-direction:column}._setupBlock_1x0da_59{margin:0}}._blink_uj4mr_1{animation:1s step-start infinite _blink_uj4mr_1}@keyframes _blink_uj4mr_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_uj4mr_13{transform:rotate(45deg)}._table_uj4mr_17{border-collapse:separate;border-spacing:0;color:#f6f6f6;text-align:left;table-layout:auto;width:100%;font-size:calc(1rem - 2px)}._table_uj4mr_17 thead{z-index:100;background-color:#101010;position:sticky;top:0}._table_uj4mr_17 th{color:#cfcfcf;letter-spacing:.02em;text-transform:uppercase;vertical-align:bottom;white-space:normal;font-size:.8rem;font-weight:600}._table_uj4mr_17 th,._table_uj4mr_17 td{box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap;border-bottom:1px solid rgba(255,255,255,.1);min-width:8rem;max-width:20rem;padding:.55rem .65rem;overflow:hidden}._table_uj4mr_17 tbody tr{--entry-colour:transparent;background-color:color-mix(in srgb, #1a1a1a 96%, var(--entry-colour) 4%);box-shadow:inset 3px 0 var(--entry-colour)}._table_uj4mr_17 td[data-empty=true]{color:#8a8a8a}._rowNumber_uj4mr_62,._rowType_uj4mr_63{z-index:1;background-color:inherit;position:sticky}._rowNumber_uj4mr_62{color:#b1b1b1;text-align:right;width:3.25rem;left:0;min-width:3.25rem!important}._rowType_uj4mr_63{color:#b1b1b1;width:6.25rem;font-size:.8rem;left:3.25rem;box-shadow:1px 0 rgba(255,255,255,.1);min-width:6.25rem!important}thead ._rowNumber_uj4mr_62,thead ._rowType_uj4mr_63{z-index:2;background-color:#101010}._numericCell_uj4mr_92{font-variant-numeric:tabular-nums;text-align:right}._multilineCell_uj4mr_97{overflow-wrap:anywhere;text-overflow:clip!important;white-space:pre-wrap!important;max-width:30rem!important}._eventRow_uj4mr_104 ._rowNumber_uj4mr_62{font-variant-numeric:tabular-nums}._groupRow_uj4mr_108{font-weight:600;background-color:color-mix(in srgb, #1a1a1a 88%, var(--entry-colour) 12%)!important;box-shadow:inset 4px 0 var(--entry-colour)!important}._groupRow_uj4mr_108 td{border-top:.75rem solid #101010;min-height:3.25rem}._milestoneRow_uj4mr_118{color:#cfcfcf;font-style:italic;background-color:color-mix(in srgb, #1a1a1a 93%, var(--entry-colour) 7%)!important;box-shadow:inset 3px 0 var(--entry-colour)!important}._blink_16fk7_1{animation:1s step-start infinite _blink_16fk7_1}@keyframes _blink_16fk7_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_16fk7_13{transform:rotate(45deg)}._positioner_16fk7_17{outline:0}._popup_16fk7_21{box-sizing:border-box;min-width:var(--anchor-width);max-width:var(--available-width);color:#f6f6f6;background-color:#262626;border:1px solid #404040;border-radius:3px;padding:2px;font-size:1rem}._popup_16fk7_21[data-empty][data-hide-empty]{display:none}._list_16fk7_36{box-sizing:border-box;max-height:20rem;max-height:var(--available-height);overscroll-behavior:contain;outline:0;padding-top:.25rem;padding-bottom:.25rem;scroll-padding-block:1.5rem;overflow-y:auto}._item_16fk7_47,._empty_16fk7_48:not(:empty){box-sizing:border-box;padding:.25rem .5rem;line-height:1rem}._item_16fk7_47{cursor:default;user-select:none;overflow-wrap:break-word;outline:0;justify-content:space-between;align-items:center;gap:.75rem;display:flex}._item_16fk7_47[data-highlighted]{background-color:#2b5abc}._itemLabel_16fk7_68{overflow-wrap:anywhere;min-width:0}._empty_16fk7_48{color:#b1b1b1}._blink_1bj11_1{animation:1s step-start infinite _blink_1bj11_1}@keyframes _blink_1bj11_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1bj11_13{transform:rotate(45deg)}._editor_1bj11_17{flex-direction:column;gap:.75rem;width:100%;max-width:none;height:100%;min-height:0;display:flex}._editorToolbar_1bj11_27{justify-content:space-between;align-items:center;gap:.75rem 1rem;display:flex}._editorToolbar_1bj11_27:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){padding-left:.5rem;padding-right:0}._editorToolbar_1bj11_27:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){padding-left:.5rem;padding-right:0}._editorToolbar_1bj11_27:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){padding-left:0;padding-right:.5rem}._editorToolbar_1bj11_27:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){padding-left:0;padding-right:.5rem}._editorFooter_1bj11_35{padding:.75rem 0 .5rem}._worksheetControl_1bj11_39{align-items:center;gap:.75rem;display:flex}._worksheetLabel_1bj11_45{color:#cfcfcf;white-space:nowrap;font-size:.9rem;font-weight:600}._importModeTrigger_1bj11_52{justify-content:space-between;min-width:12rem}._addColumnTrigger_1bj11_57{white-space:nowrap;justify-content:center}._editorBody_1bj11_62{flex:1;grid-template-columns:minmax(18rem,22rem) minmax(0,1fr);gap:1rem;min-height:0;display:grid}._mappingPane_1bj11_70,._previewPane_1bj11_71{background-color:#101010;border:1px solid rgba(255,255,255,.1);border-radius:3px;flex-direction:column;min-width:0;min-height:0;display:flex}._mappingPaneHeader_1bj11_81,._previewPaneHeader_1bj11_82{box-sizing:border-box;border-bottom:1px solid rgba(255,255,255,.1);align-items:center;min-height:3.5rem;padding:.75rem 1rem;display:flex}._mappingPaneHeader_1bj11_81{flex-wrap:wrap;align-items:flex-start;gap:.75rem}._mappingPaneActions_1bj11_97{flex-wrap:wrap;justify-content:flex-end;row-gap:.5rem;max-width:100%}._mappingPaneTitle_1bj11_104,._previewPaneTitle_1bj11_105{color:#f6f6f6;font-size:.95rem;font-weight:600}._toolbarWarning_1bj11_111{color:#ffcc78}._mappingPaneTitle_1bj11_104{align-self:center}._mappingList_1bj11_119{flex-direction:column;gap:.75rem;min-height:0;padding:.75rem .75rem 2rem;display:flex;overflow:auto}._mappingField_1bj11_128{flex-direction:column;gap:.35rem;display:flex}._mappingFieldHeader_1bj11_134{justify-content:space-between;align-items:center;gap:.5rem;display:flex}._mappingFieldTitle_1bj11_141{align-items:center;gap:.5rem;min-width:0;display:flex}._mappingFieldLabel_1bj11_148{color:#f6f6f6;font-size:.9rem;font-weight:600}._mappingFieldWarning_1bj11_154{color:#ffcc78;font-size:.8rem;line-height:1.3}._tableShell_1bj11_160{flex:1;min-height:0;overflow:auto}._columnInput_1bj11_166{width:100%}._columnInputWarn_1bj11_170{border-color:#ffcc78;box-shadow:0 0 0 1px rgba(255,204,120,.2)}@media (max-width:1100px){._editorBody_1bj11_62{grid-template-columns:1fr}._editorToolbar_1bj11_27{align-items:center}._worksheetControl_1bj11_39{justify-content:space-between}}._blink_v67sj_1{animation:1s step-start infinite _blink_v67sj_1}@keyframes _blink_v67sj_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_v67sj_13{transform:rotate(45deg)}._section_v67sj_17{background-color:#1a1a1a;border:1px solid #2d2d2d;border-radius:3px;flex-direction:column;gap:.75rem;padding:.75rem;display:flex}._sectionHeader_v67sj_27{flex-direction:column;gap:.25rem;display:flex}._separator_v67sj_33{color:#9d9d9d;letter-spacing:.08em;text-transform:uppercase;align-items:center;gap:.75rem;font-size:calc(1rem - 2px);font-weight:600;display:flex}._separator_v67sj_33:before,._separator_v67sj_33:after{content:"";border-top:1px solid #2d2d2d;flex:1}._textEntry_v67sj_49{color:#8a8a8a;flex:1;align-items:center;gap:.5rem;min-width:0;display:flex}._inlineEntry_v67sj_58{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.75rem;display:grid}._redirect_v67sj_65{margin-left:auto}._label_v67sj_69{color:#e2e2e2;font-size:calc(1rem - 1px);font-weight:600}._description_v67sj_75{color:#9d9d9d;font-size:calc(1rem - 2px)}._origin_v67sj_80{color:#9d9d9d;white-space:nowrap;flex:none;font-size:calc(1rem - 2px)}@media (max-width:500px){._inlineEntry_v67sj_58{grid-template-columns:1fr;align-items:stretch}._redirect_v67sj_65{align-self:flex-end}}._blink_142rp_1{animation:1s step-start infinite _blink_142rp_1}@keyframes _blink_142rp_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_142rp_13{transform:rotate(45deg)}._fullWidth_142rp_17{width:100%}._halfWidth_142rp_21{width:50%}._halfWidthNoWrap_142rp_25{white-space:nowrap;width:50%}._copiable_142rp_30{cursor:text;user-select:text}._actionsCell_142rp_35{white-space:nowrap;text-align:right;width:1%}._actionsHeader_142rp_41{text-align:right}._actionsGroup_142rp_45{justify-content:flex-end;width:100%}._current_142rp_50{background-color:inherit}._blink_l21m9_1{animation:1s step-start infinite _blink_l21m9_1}@keyframes _blink_l21m9_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_l21m9_13,._iconRotate_l21m9_17{transform:rotate(45deg)}._blink_1qku8_1{animation:1s step-start infinite _blink_1qku8_1}@keyframes _blink_1qku8_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1qku8_13{transform:rotate(45deg)}._current_1qku8_17{background-color:inherit}._isEditing_1qku8_21{color:#578af4}._form_1qku8_25{justify-content:space-between;align-items:center;gap:1rem;width:100%;display:flex}._formInput_1qku8_33{flex:2}._saveButton_1qku8_37{text-transform:capitalize}._containCell_1qku8_41{max-width:50%}._sortableHeader_1qku8_45{align-items:center;gap:.5em;display:inline-flex}._fullWidth_1qku8_51{width:100%}._innerColumn_1qku8_55{flex-direction:column;gap:1em;margin:0 2rem 2rem;display:flex}._inlineLabels_1qku8_63 label{gap:1rem;display:flex}._warningInfo_1qku8_68{margin-bottom:1rem}._loaderBox_1qku8_72{height:300px;position:relative}._mergeBody_1qku8_77{gap:1rem}._mergeIntro_1qku8_81{flex-direction:column;gap:.5rem;display:flex}._sourceFile_1qku8_87{color:#ffcc78;white-space:nowrap;background-color:rgba(255,255,255,.03);border-radius:999px;padding:.1rem .45rem}._mergeSummary_1qku8_95{color:#b1b1b1;font-size:calc(1rem - 2px);line-height:1.5}._mergeWarningInfo_1qku8_101{margin-bottom:.25rem}._optionList_1qku8_105{gap:0;padding:0}._optionList_1qku8_105>li:not(:last-child){border-bottom:1px solid rgba(255,255,255,.1)}._optionRow_1qku8_114{cursor:pointer;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:1rem;width:100%;min-width:0;display:grid}._optionCopy_1qku8_124{flex-direction:column;gap:.2rem;min-width:0;display:flex}._optionTitle_1qku8_131{color:#f6f6f6;font-size:.95rem;font-weight:600;line-height:1.35}._optionBody_1qku8_138{color:#b1b1b1;font-size:calc(1rem - 3px);line-height:1.45}._footerContent_1qku8_144{flex-direction:column;gap:.75rem;width:100%;display:flex}._footerActions_1qku8_151{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:.75rem;width:100%;display:flex}._blink_hbyi7_1{animation:1s step-start infinite _blink_hbyi7_1}@keyframes _blink_hbyi7_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_hbyi7_13{transform:rotate(45deg)}._uploadForm_hbyi7_17{flex-direction:column;gap:1rem;display:flex}._step_hbyi7_23{flex-direction:column;gap:.5rem;display:flex}._stepTitle_hbyi7_29{color:#e2e2e2;font-weight:600}._filePicker_hbyi7_34{min-height:2rem}._fileName_hbyi7_38{color:#cfcfcf;font-size:calc(1rem - 2px)}._missing_hbyi7_43{color:#ffbc56}._urlCell_hbyi7_47{color:#cfcfcf;user-select:all;white-space:nowrap;font-size:calc(1rem - 2px)}._actionsHeader_hbyi7_54{text-align:right}._actionsCell_hbyi7_58{white-space:nowrap;text-align:right;width:1%}._actionsGroup_hbyi7_64{justify-content:flex-end;width:100%}._blink_cq029_1{animation:1s step-start infinite _blink_cq029_1}@keyframes _blink_cq029_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_cq029_13{transform:rotate(45deg)}._container_cq029_17{align-items:center;gap:.25rem;display:flex}._container_cq029_17 input{width:5em}._blink_1p5nj_1{animation:1s step-start infinite _blink_1p5nj_1}@keyframes _blink_1p5nj_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1p5nj_13{transform:rotate(45deg)}._uploadLogoCard_1p5nj_17{background-color:#101010;border:1px solid rgba(255,255,255,.1);border-radius:3px;flex-direction:column;justify-content:center;align-items:center;gap:1rem;display:flex}._uploadLogoCard_1p5nj_17 img{max-width:250px;height:auto}._logoActions_1p5nj_32{gap:.5rem;display:flex}._customDataItem_1p5nj_37{flex-direction:column;gap:.5rem;width:100%;display:flex}._titleRow_1p5nj_44{align-items:end;gap:1rem;display:flex}._titleRow_1p5nj_44 label{flex:1}._customImage_1p5nj_53{grid-template-columns:1fr 72px;gap:1rem;display:grid}._imageContainer_1p5nj_59{background-color:#202020;width:72px;height:72px}._blink_6wtn0_1{animation:1s step-start infinite _blink_6wtn0_1}@keyframes _blink_6wtn0_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_6wtn0_13{transform:rotate(45deg)}._editorActions_6wtn0_17{width:100%}._right_6wtn0_21{text-align:right;align-self:end}._column_6wtn0_26{flex-direction:column;gap:1rem;width:100%;display:flex}._editorBody_6wtn0_33{background-color:#101010;border:1px solid #2d2d2d;border-radius:3px;height:100%;position:relative;overflow:hidden}._blink_1fy3l_1{animation:1s step-start infinite _blink_1fy3l_1}@keyframes _blink_1fy3l_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1fy3l_13{transform:rotate(45deg)}._container_1fy3l_17{background-color:#101010;grid-area:main;gap:.25rem;width:100%;padding:1rem;display:flex;overflow:hidden}._blink_1m3st_1{animation:1s step-start infinite _blink_1m3st_1}@keyframes _blink_1m3st_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1m3st_13{transform:rotate(45deg)}._container_1m3st_17{background:#1a1a1a;border-radius:8px;grid-template-columns:1fr 1fr 1fr;align-items:center;gap:1rem;padding:.5rem 1rem;display:grid}._itemGroup_1m3st_27{flex-shrink:0;align-items:center;gap:.5rem;display:flex}._goButton_1m3st_34,._iconButtonWithLabel_1m3st_35,._iconButton_1m3st_35{flex-direction:column;justify-content:center;align-items:center;width:4.5rem;display:flex}._goButton_1m3st_34 svg,._iconButtonWithLabel_1m3st_35 svg,._iconButton_1m3st_35 svg{font-size:1.25rem}._goButton_1m3st_34{min-width:8rem;height:4.5rem;line-height:1.1}._goLabel_1m3st_55{font-size:1.25rem;font-weight:600;line-height:1.2}._shortcutHint_1m3st_61{opacity:.6;font-size:calc(1rem - 4px)}._addSection_1m3st_66{display:contents}._separator_1m3st_70{background:rgba(255,255,255,.1);width:1px;height:1.5rem;margin-left:.25rem;margin-right:.25rem}._timerSection_1m3st_77{justify-content:center;gap:.5rem;min-width:0;display:flex}._negativeIndicator_1m3st_84{color:#fa5656;opacity:0;font-size:2.25rem;font-weight:700;line-height:1}._negativeIndicator_1m3st_84[data-active=true]{opacity:1}._auxSection_1m3st_95{flex-shrink:0;justify-self:end;align-items:center;gap:.25rem;display:flex}._auxControls_1m3st_103{gap:.25rem;display:flex}._auxTimeInput_1m3st_108,._auxTimeDisplay_1m3st_109{text-align:center;color:#f6f6f6;background:#303030;border-radius:3px;width:6.5rem;min-width:6.5rem;max-width:6.5rem;height:4.5rem}._auxTimeDisplay_1m3st_109{color:#e2e2e2;font-variant-numeric:tabular-nums;letter-spacing:.5px;outline:none;place-content:center;padding-left:.5em;padding-right:.5em;font-size:1rem;font-weight:400;display:grid}@media (max-width:1048px){._container_1m3st_17{grid-template-columns:1fr 1fr}._timerSection_1m3st_77{justify-self:end}._auxSection_1m3st_95{display:none}}@media (max-width:728px){._addSection_1m3st_66{display:none}}._blink_qfgjn_1{animation:1s step-start infinite _blink_qfgjn_1}@keyframes _blink_qfgjn_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_qfgjn_13{transform:rotate(45deg)}._container_qfgjn_17{background:#101010;height:100%}._emptyState_qfgjn_22{justify-content:center;align-items:center;height:100%;padding:1.5rem;display:flex}._emptyMessage_qfgjn_30{text-align:center;color:rgba(226,226,226,.55);width:min(320px,100%)}._emptyTitle_qfgjn_36{color:rgba(226,226,226,.72);margin:0 0 .25rem;font-size:calc(1rem + 2px);font-weight:400}._emptyBody_qfgjn_43{margin:0;font-size:calc(1rem - 3px)}._blink_qs5et_1{animation:1s step-start infinite _blink_qs5et_1}@keyframes _blink_qs5et_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_qs5et_13{transform:rotate(45deg)}._item_qs5et_17{--color-bar-gap:.5rem;--color-bar-width:4px;--title-left:calc(4px + .5rem + .5rem);--indicator-width:2rem;--chip-width:3.25rem;--chip-padding:.5rem;cursor:pointer;align-items:center;gap:1rem;height:2.5rem;transition:background-color .15s;display:flex;position:relative}._item_qs5et_17:hover{background:rgba(255,255,255,.03);border-radius:3px}._item_qs5et_17:hover ._title_qs5et_36{color:#f6f6f6;font-size:calc(1rem + 2px)}._item_qs5et_17[data-state=past]{opacity:.4}._item_qs5et_17[data-state=running],._item_qs5et_17[data-state=selected]{background:rgba(255,255,255,.07);border-radius:3px;gap:.25rem}._item_qs5et_17[data-state=running] ._title_qs5et_36,._item_qs5et_17[data-state=selected] ._title_qs5et_36{color:#f6f6f6;padding-left:.25rem;padding-right:calc(var(--chip-width) + var(--chip-padding));text-align:left;font-size:calc(1rem + 2px);font-weight:500}._item_qs5et_17[data-state=running]{background:#182f1e}._item_qs5et_17[data-state=running] ._title_qs5et_36{color:#f6f6f6}._item_qs5et_17[data-state=next] ._title_qs5et_36{color:#f6f6f6;font-size:1rem}._item_qs5et_17[data-skipped]{opacity:.3}._item_qs5et_17[data-skipped] ._title_qs5et_36{text-decoration:line-through}._item_qs5et_17[data-group-end=true]{margin-bottom:.5rem}._colourBar_qs5et_76{z-index:1;flex-shrink:0;width:4px;height:100%;position:relative}._title_qs5et_36{padding-top:.5rem;padding-bottom:.5rem;min-width:0;padding-left:.25rem;padding-right:calc(var(--chip-width) + var(--chip-padding));color:#b1b1b1;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:calc(1rem - 2px);line-height:1.3;transition:color .15s;position:relative;overflow:hidden}._chipSlot_qs5et_100{right:var(--chip-padding);min-width:var(--chip-width);justify-content:flex-end;align-items:center;display:flex;position:absolute;top:0;bottom:0}._chipSlot_qs5et_100[data-hover-only]{opacity:0;pointer-events:none;transition:opacity .15s}._item_qs5et_17:hover ._chipSlot_qs5et_100[data-hover-only]{opacity:1;pointer-events:auto}._chipText_qs5et_121{white-space:nowrap;color:#8a8a8a;font-size:calc(1rem - 3px)}._chipText_qs5et_121[data-chip-status=live]{color:#f6f6f6}._chipText_qs5et_121[data-chip-status=due]{color:#ffbc56}._blink_kcrvg_1{animation:1s step-start infinite _blink_kcrvg_1}@keyframes _blink_kcrvg_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_kcrvg_13{transform:rotate(45deg)}._container_kcrvg_17{background:#101010;width:100%;height:100%;padding-top:1rem}._list_kcrvg_24{flex-direction:column;margin:0;display:flex}._bottomSpacer_kcrvg_30{flex-shrink:0;width:100%;height:70vh}._blink_1exbp_1{animation:1s step-start infinite _blink_1exbp_1}@keyframes _blink_1exbp_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1exbp_13{transform:rotate(45deg)}._panelContainer_1exbp_17{grid-area:main;gap:.5rem;height:100%;min-height:0;display:flex;overflow:hidden}._panelContainerTracking_1exbp_26{flex-direction:column;min-height:0}._left_1exbp_31{flex-direction:column;flex:1 2 auto;gap:.5rem;min-width:27rem;max-width:30rem;display:flex}._rundownLayout_1exbp_40{flex:auto;gap:.5rem;min-width:0;min-height:0;display:flex}._rundownPanel_1exbp_48{flex:auto;min-width:0;min-height:0;display:flex}._titlesPanel_1exbp_55{flex:0 0 20rem;min-width:20rem;max-width:20rem;overflow:hidden}._blink_1atdi_1{animation:1s step-start infinite _blink_1atdi_1}@keyframes _blink_1atdi_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1atdi_13{transform:rotate(45deg)}._sections_1atdi_17{grid-template-columns:1fr 5fr;gap:2rem;display:grid}._column_1atdi_23,._about_1atdi_23{flex-direction:column;gap:1rem;width:100%;display:flex}._about_1atdi_23{padding-left:.25rem;padding-right:.25rem;font-size:calc(1rem - 3px)}._inline_1atdi_35{align-items:center;gap:.5rem;display:flex}._header_1atdi_41{justify-content:space-between;align-items:center;font-size:1.5rem;display:flex}._logo_1atdi_48{max-width:100px;height:auto}._buttonRow_1atdi_53{justify-content:end;gap:1rem;display:flex}._buttonRow_1atdi_53 :first-child{margin-right:auto}._tableContainer_1atdi_62{height:350px;max-height:350px;overflow-y:auto}._table_1atdi_62{width:100%;font-size:calc(1rem - 2px)}._table_1atdi_62 tbody{background-color:#1a1a1a}._table_1atdi_62 tbody tr:hover:not(._current_1atdi_75){background-color:#101010}._table_1atdi_62 tbody tr ._current_1atdi_75:hover{background-color:#0036a6}._table_1atdi_62 tr{cursor:pointer;height:2rem}._table_1atdi_62 th,._table_1atdi_62 td{padding-left:.5rem;padding-right:.5rem}._table_1atdi_62 th{text-align:left;color:#8a8a8a;font-size:calc(1rem - 3px)}._current_1atdi_75{background-color:#2b5abc}._current_1atdi_75:hover{background-color:#0036a6}._blink_1m0yz_1{animation:1s step-start infinite _blink_1m0yz_1}@keyframes _blink_1m0yz_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1m0yz_13{transform:rotate(45deg)}._mainContainer_1m0yz_17{color:#f6f6f6;background-color:#101010;grid-template:"overview"3.5rem"main"1fr/auto;gap:.5rem;width:100%;height:100%;padding:.5rem;display:grid}\n/*$vite$:1*/',document.head.appendChild(ys),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]="1c8d4b59-8ddb-4856-93cd-78eae3b81ffb",e._sentryDebugIdIdentifier="sentry-dbid-1c8d4b59-8ddb-4856-93cd-78eae3b81ffb")}catch(e){}}(),js=n(i(),1),bs=(e,t,n={})=>{const{isDisabled:i=!1}=n,r=(0,js.useCallback)(n=>{n.key!==t||n.repeat||i||(n.preventDefault(),e())},[e,i,t]);(0,js.useEffect)(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r])},vs={blink:"_blink_1x7ve_1",fourtyfive:"_fourtyfive_1x7ve_13",contentWrapper:"_contentWrapper_1x7ve_17",corner:"_corner_1x7ve_26",content:"_content_1x7ve_17"},ws=r(),ks={url:"",version:"",hasUpdates:!1},Cs=[{id:"settings",label:"Settings",secondary:[{id:"settings__data",label:"Project data",keywords:["title","description","logo","url","info"]},{id:"settings__general",label:"General settings",keywords:["pin","password","lock","language","time format","timezone"]},{id:"settings__view",label:"View settings",keywords:["css","style","theme","translation","freeze","overtime"]},{id:"settings__custom-views",label:"Custom views",keywords:["html","upload","external","embed"]},{id:"settings__mcp",label:"MCP Server",keywords:["ai","agent","model"]},{id:"settings__port",label:"Server port",keywords:["http","network","address"]}]},{id:"project",label:"Project",secondary:[{id:"project__create",label:"Create...",keywords:["new project","quick start","wizard"]},{id:"project__list",label:"Manage projects",keywords:["load","open","rename","duplicate","delete","download","import","backup","merge"]}]},{id:"manage",label:"Project settings",secondary:[{id:"manage__defaults",label:"Rundown defaults",keywords:["duration","warning","danger","defaults"]},{id:"manage__custom",label:"Custom fields",keywords:["metadata","columns","extra data","image field"]},{id:"manage__rundowns",label:"Manage rundowns",keywords:["rundown","xlsx","excel","load","export"]},{id:"manage__sheets",label:"Import spreadsheet",keywords:["google sheet","sync","spreadsheet","xlsx","excel","csv","export"]}]},{id:"automation",label:"Automation",secondary:[{id:"automation__settings",label:"Automation settings",keywords:["osc input","port","enable","remote control"]},{id:"automation__automations",label:"Manage automations",keywords:["osc","http","webhook","integration","api","output","action"]},{id:"automation__triggers",label:"Manage triggers",keywords:["lifecycle","on load","on start","on finish","on update"]}]},{id:"sharing",label:"Sharing and reporting",secondary:[{id:"sharing__presets",label:"URL Presets",keywords:["alias","link","url","shortcut"]},{id:"sharing__link",label:"Share link",keywords:["qr code","guest","cuesheet link","permissions","read only"]},{id:"sharing__report",label:"Runtime report",keywords:["actual times","csv","export","history"]}]},{id:"network",label:"Network",secondary:[{id:"network__log",label:"Event log",keywords:["debug","errors","console","export log"]},{id:"network__clients",label:"Manage clients",keywords:["redirect","identify","rename client","connected"]}]},{id:"about",label:"About",keywords:["version","update","licence","license","credits"]},{id:"shutdown",label:"Shutdown",keywords:["quit","exit","close ontime"]}],Ss={blink:"_blink_170ss_1",fourtyfive:"_fourtyfive_170ss_13",search:"_search_170ss_17",icon:"_icon_170ss_25",input:"_input_170ss_32",clear:"_clear_170ss_37"},Ns={blink:"_blink_q5mud_1",fourtyfive:"_fourtyfive_q5mud_13",container:"_container_q5mud_17",tabs:"_tabs_q5mud_27",primary:"_primary_q5mud_39",secondary:"_secondary_q5mud_40",groupActive:"_groupActive_q5mud_64",active:"_active_q5mud_68",highlight:"_highlight_q5mud_74"},Es={blink:"_blink_ac6dr_1",fourtyfive:"_fourtyfive_ac6dr_13",link:"_link_ac6dr_17",inline:"_inline_ac6dr_27",icon:"_icon_ac6dr_37"},Is={blink:"_blink_a0pg1_1",fourtyfive:"_fourtyfive_a0pg1_13",updateIndicator:"_updateIndicator_a0pg1_17"},Rs={blink:"_blink_1csyf_1",fourtyfive:"_fourtyfive_1csyf_13",card:"_card_1csyf_17",eyebrow:"_eyebrow_1csyf_23",title:"_title_1csyf_31",description:"_description_1csyf_38",portability:"_portability_1csyf_48",benefits:"_benefits_1csyf_55",actions:"_actions_1csyf_76"},Ts={blink:"_blink_yanwg_1",fourtyfive:"_fourtyfive_yanwg_13",link:"_link_yanwg_17",action:"_action_yanwg_27"},Ps="https://docs.getontime.no/api/protocols/osc/",Os=[{id:1,label:"On Load",value:"onLoad"},{id:2,label:"On Start",value:"onStart"},{id:3,label:"On Pause",value:"onPause"},{id:4,label:"On Stop",value:"onStop"},{id:5,label:"Every second",value:"onClock"},{id:6,label:"On Timer Update",value:"onUpdate"},{id:7,label:"On Finish",value:"onFinish"},{id:8,label:"On Warning",value:"onWarning"},{id:9,label:"On Danger",value:"onDanger"}],As=[{value:null,label:"Select field"},{value:"eventNow.id",label:"ID"},{value:"eventNow.title",label:"Title"},{value:"eventNow.cue",label:"Cue"},{value:"eventNow.countToEnd",label:"Count to end"},{value:"eventNow.note",label:"Note"},{value:"eventNow.colour",label:"Colour"}],qs=[{value:"eventNext.id",label:"Next ID"},{value:"eventNext.title",label:"Next Title"},{value:"eventNext.cue",label:"Next Cue"}],Ls=js.createContext(void 0),Ds=js.createContext(void 0),Fs=js.createContext(void 0),Bs=js.createContext(!1),Vs=js.createContext(""),Ms={id:Le(e=>e.id),labelId:Le(e=>e.labelId),items:Le(e=>e.items),selectedValue:Le(e=>e.selectedValue),hasSelectionChips:Le(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:Le(e=>{const{selectedValue:t,selectionMode:n}=e;return null!=t&&("multiple"!==n||!Array.isArray(t)||t.length>0)}),hasNullItemLabel:Le((e,t)=>!!t&&jt(e.items)),open:Le(e=>e.open),mounted:Le(e=>e.mounted),forceMounted:Le(e=>e.forceMounted),inline:Le(e=>e.inline),activeIndex:Le(e=>e.activeIndex),selectedIndex:Le(e=>e.selectedIndex),isActive:Le((e,t)=>e.activeIndex===t),isSelected:Le((e,t)=>{const n=e.isItemEqualToValue,i=e.selectedValue;return Array.isArray(i)?i.some(e=>Tt(t,e,n)):Tt(t,i,n)}),transitionStatus:Le(e=>e.transitionStatus),popupProps:Le(e=>e.popupProps),inputProps:Le(e=>e.inputProps),triggerProps:Le(e=>e.triggerProps),itemProps:Le(e=>e.itemProps),positionerElement:Le(e=>e.positionerElement),listElement:Le(e=>e.listElement),popupId:Le(e=>e.popupId),triggerElement:Le(e=>e.triggerElement),inputElement:Le(e=>e.inputElement),inputGroupElement:Le(e=>e.inputGroupElement),popupSide:Le(e=>e.popupSide),openMethod:Le(e=>e.openMethod),inputInsidePopup:Le(e=>e.inputInsidePopup),inputOwnsFormValue:Le(e=>e.inputOwnsFormValue),selectionMode:Le(e=>e.selectionMode),name:Le(e=>e.name),form:Le(e=>e.form),disabled:Le(e=>e.disabled),readOnly:Le(e=>e.readOnly),required:Le(e=>e.required),grid:Le(e=>e.grid),virtualized:Le(e=>e.virtualized),itemToStringLabel:Le(e=>e.itemToStringLabel),isItemEqualToValue:Le(e=>e.isItemEqualToValue),modal:Le(e=>e.modal),autoHighlight:Le(e=>e.autoHighlight),submitOnItemClick:Le(e=>e.submitOnItemClick)},zs=new Map,$s=Bl,Us=Symbol("none"),Hs={value:Us,index:-1},Ws={...re,...ct,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},Gs=js.createContext(void 0),Ks=js.createContext(void 0),Ys=js.forwardRef(function(e,t){const n=ql(),{buttonRef:i,getButtonProps:r}=Ot({native:!1}),s=fe(t,i);return(0,ws.jsx)("span",{ref:s,...r({onClick:function(e){n.state.setOpen(!1,_e(Se,e.nativeEvent,e.currentTarget))}}),"aria-label":"Dismiss",tabIndex:void 0,style:Pe})}),Js=js.forwardRef(function(e,t){const{render:n,className:i,disabled:r=!1,id:s,style:a,...o}=e,{state:l,disabled:c,setTouched:d,setFocused:u,validationMode:h,validation:m}=vt(),{labelId:p}=st(),f=js.useContext(Gs),_=zl(!0),g=Boolean(_),x=ql(),{filteredItems:y}=Dl(),j=js.useContext(Vs),b=Ge(),v=xe(x,Ms.required),w=xe(x,Ms.disabled),k=xe(x,Ms.readOnly),C=xe(x,Ms.name),S=xe(x,Ms.form),N=xe(x,Ms.selectionMode),E=xe(x,Ms.autoHighlight),I=xe(x,Ms.inputProps),R=xe(x,Ms.triggerProps),T=xe(x,Ms.open),P=xe(x,Ms.mounted),O=xe(x,Ms.selectedValue),A=xe(x,Ms.popupSide),q=xe(x,Ms.positionerElement),L=xe(x,Ms.id),D=xe(x,Ms.inline),F=xe(x,Ms.modal),B=Boolean(E),V=P&&q?A:null,M=c||w||r,z=0===y.length,$=g||D,U=!$||F,H=ce(s??($?void 0:L)),W=yt(p,void 0),G=g?lt:l,[K,Y]=js.useState(null),J=js.useRef(!1),Q=js.useRef(null),Z=js.useRef(!1),X="none"===N&&!g,ee=Te(e=>{const t=g||x.state.inline;t&&!x.state.hasInputValue&&x.state.setInputValue("",_e(Be)),x.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:X})}),te=g||!m?o:m.getValidationProps(M,o),ne={...G,open:T,disabled:M,readOnly:k,popupSide:V,listEmpty:z},ie=me("input",e,{state:ne,ref:[t,x.state.inputRef,ee],props:[I,R,{type:"text",value:e.value??K??j,"aria-readonly":k||void 0,"aria-required":v||void 0,"aria-labelledby":W,disabled:M,readOnly:k,required:"none"===N?v:void 0,form:S,...X&&C&&{name:C},id:H,onFocus(){if(u(!0),!D||!Z.current)return;Z.current=!1;const e=Q.current;null!=e&&Object.hasOwn(x.state.valuesRef.current,e)&&x.state.setIndices({activeIndex:e})},onBlur(){d(!0),u(!1);const e=x.state.activeIndex;if(D&&null!==e&&"always"!==E&&(Q.current=e,Z.current=!0,x.state.setIndices({activeIndex:null})),"onBlur"===h){const e="none"===N?j:O;m.commit(e)}},onCompositionStart(e){De||(J.current=!0,Y(e.currentTarget.value))},onCompositionEnd(e){J.current=!1;const t=e.currentTarget.value;Y(null),x.state.setInputValue(t,_e(Me,e.nativeEvent))},onChange(e){const t=e.nativeEvent.inputType,n=!t||"insertReplacementText"===t,i=J.current||!n;if(J.current){const t=e.currentTarget.value;Y(t),""!==t||x.state.openOnInputClick||x.state.inputInsidePopup||x.state.setOpen(!1,_e(pe,e.nativeEvent));const n=t.trim(),r=B&&""!==n;return k||M||!n||i&&(x.state.setOpen(!0,_e(Me,e.nativeEvent)),B||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),void(T&&null!==x.state.activeIndex&&!r&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}))}const r=_e(Me,e.nativeEvent);if(x.state.setInputValue(e.currentTarget.value,r),r.isCanceled)return;const s=""===e.currentTarget.value,a=_e(pe,e.nativeEvent);s&&!x.state.inputInsidePopup&&("single"===N&&x.state.setSelectedValue(null,a),x.state.openOnInputClick||x.state.setOpen(!1,a));const o=e.currentTarget.value.trim();k||M||!o||i&&(x.state.setOpen(!0,_e(Me,e.nativeEvent)),B||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),T&&null!==x.state.activeIndex&&!B&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(e){if(M||k)return;if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;x.state.keyboardActiveRef.current=!0;const t=e.currentTarget,n=t.scrollWidth-t.clientWidth,i="rtl"===b;if("Home"===e.key){Ne(e);const n=be&&i?t.value.length:0;return t.setSelectionRange(n,n),void(t.scrollLeft=0)}if("End"===e.key){Ne(e);const r=be&&i?0:t.value.length;return t.setSelectionRange(r,r),void(t.scrollLeft=i?-n:n)}if(!P&&"Escape"===e.key){const t="multiple"===N&&Array.isArray(O)?0===O.length:null===O,n=_e(je,e.nativeEvent),i="multiple"===N?[]:null;return x.state.setInputValue("",n),x.state.setSelectedValue(i,n),void(t||x.state.inline||n.isPropagationAllowed||e.stopPropagation())}if(f&&"Backspace"===e.key&&""===t.value&&void 0===f.highlightedChipIndex&&Array.isArray(O)&&O.length>0){const t=f.chipsRef.current.length,n=t>0?t-1:O.length-1,i=O.filter((e,t)=>t!==n);return x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}),void x.state.setSelectedValue(i,_e(Be,e.nativeEvent))}const r=void 0!==f?.highlightedChipIndex,s=function(e){if(!f)return;let t;const{highlightedChipIndex:n}=f,i=f.chipsRef.current.length,r="rtl"===b,s=r?"ArrowRight":"ArrowLeft",a=r?"ArrowLeft":"ArrowRight";if(void 0!==n){if(e.key===s)e.preventDefault(),t=n>0?n-1:void 0;else if(e.key===a)e.preventDefault(),t=n<i-1?n+1:void 0;else if("Backspace"===e.key||"Delete"===e.key){e.preventDefault();const i=n>=O.length-1?O.length-2:n;t=i>=0?i:void 0,x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return t}return e.key===s&&0===(e.currentTarget.selectionStart??0)&&O.length>0?(e.preventDefault(),t=i>0?i-1:void 0):"Backspace"===e.key&&""===e.currentTarget.value&&O.length>0&&(x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),e.preventDefault()),t}(e);if(f?.setHighlightedChipIndex(s),void 0!==s?f?.chipsRef.current[s]?.focus():r&&x.state.inputRef.current?.focus(),229!==e.which&&"Enter"===e.key&&T){const t=x.state.activeIndex,n=e.nativeEvent;if(null===t){if(D)return;return void x.state.setOpen(!1,_e(Be,n))}Ne(e);const i=x.state.listRef.current[t];i&&(x.state.selectionEventRef.current=n,i.click(),x.state.selectionEventRef.current=null)}},onPointerMove(){x.state.keyboardActiveRef.current=!1},onPointerDown(){x.state.keyboardActiveRef.current=!1}},te],stateAttributesMapping:Ws}),re=g?(0,ws.jsx)(it.Provider,{value:wt,children:ie}):ie;return(0,ws.jsxs)(js.Fragment,{children:[T&&U&&(0,ws.jsx)(Ys,{ref:x.state.startDismissRef}),re]})}),Qs=js.createContext(null),Zs=js.forwardRef(function(e,t){var n;const{render:i,className:r,style:s,children:a,...o}=e,l=ql(),c=Ll(),d=Boolean(zl(!0)),{filteredItems:u,hasItems:h}=Dl(),m=xe(l,Ms.selectionMode),p=xe(l,Ms.grid),f=xe(l,Ms.popupProps),_=xe(l,Ms.virtualized),g=xe(l,Ms.forceMounted),x="multiple"===m,y=0===u.length,j=Te(e=>{l.set("positionerElement",e)}),b=Te(e=>{l.set("listElement",e)}),v=js.useMemo(()=>"function"==typeof a?n||(n=(0,ws.jsx)($l,{children:a})):a,[a]),w={empty:y},k=c.useState("floatingId"),C=me("div",e,{state:w,ref:[t,b,d?null:j],props:[f,{children:v,tabIndex:-1,id:k,role:p?"grid":"listbox","aria-multiselectable":x?"true":void 0,onKeyDown(e){if(!l.state.disabled&&!l.state.readOnly&&"Enter"===e.key){const t=l.state.activeIndex;if(null==t)return;Ne(e);const n=e.nativeEvent,i=l.state.listRef.current[t];i&&(l.state.selectionEventRef.current=n,i.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},o]});if(_)return C;const S=h&&!g?void 0:l.state.labelsRef;return(0,ws.jsx)(kt,{elementsRef:l.state.listRef,labelsRef:S,children:C})}),Xs="",ea=js.createContext(void 0),ta=js.forwardRef(function(e,t){const{keepMounted:n=!1,...i}=e,r=ql(),s=xe(r,Ms.mounted),a=xe(r,Ms.forceMounted);return s||n||a?(0,ws.jsx)(ea.Provider,{value:n,children:(0,ws.jsx)(ge,{ref:t,...i})}):null}),na=js.forwardRef(function(e,t){const{render:n,className:i,anchor:r,positionMethod:s="absolute",side:a="bottom",align:o="center",sideOffset:l=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:u=5,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:p=!1,collisionAvoidance:f=ve,style:_,...g}=e,x=ql(),{filteredItems:y}=Dl(),j=Ll(),b=function(){const e=js.useContext(ea);if(void 0===e)throw new Error(de(20));return e}(),v=xe(x,Ms.modal),w=xe(x,Ms.open),k=xe(x,Ms.mounted),C=xe(x,Ms.openMethod),S=xe(x,Ms.positionerElement),N=xe(x,Ms.triggerElement),E=xe(x,Ms.inputElement),I=xe(x,Ms.inputGroupElement),R=xe(x,Ms.inputInsidePopup),T=xe(x,Ms.transitionStatus),P=0===y.length,O=Ye({anchor:r??(R?N:I??E),floatingRootContext:j,positionMethod:s,mounted:k,side:a,sideOffset:l,align:o,alignOffset:c,arrowPadding:h,collisionBoundary:d,collisionPadding:u,sticky:m,disableAnchorTracking:p,keepMounted:b,collisionAvoidance:f,lazyFlip:!0});xt(w&&v,"touch"===C,S,N);const A={open:w,side:O.side,align:O.align,anchorHidden:O.anchorHidden,empty:P};Q(()=>{x.set("popupSide",O.side)},[x,O.side]);const q=Te(e=>{x.set("positionerElement",e)}),L=Xe(e,A,{styles:O.positionerStyles,transitionStatus:T,props:g,refs:[t,q],hidden:!k,inert:!w});return(0,ws.jsxs)(Ks.Provider,{value:O,children:[k&&v&&(0,ws.jsx)(Re,{inert:Fe(!w),cutout:I??E??N}),L]})}),ia={...J,...X},ra=js.forwardRef(function(e,t){const{render:n,className:i,style:r,initialFocus:s,finalFocus:a,...o}=e,l=ql(),c=zl(),d=Ll(),{filteredItems:u}=Dl(),h=xe(l,Ms.mounted),m=xe(l,Ms.open),p=xe(l,Ms.openMethod),f=xe(l,Ms.transitionStatus),_=xe(l,Ms.inputInsidePopup),g=xe(l,Ms.inputElement),x=xe(l,Ms.modal),y=xe(l,Ms.id),j=0===u.length,b=o.id??(_?function(e){return null==e?void 0:`${e}-popup`}(y):void 0);Q(()=>(l.set("popupId",l.state.popupRef.current?.id||b),()=>{l.set("popupId",void 0)}),[l,b]),ee({open:m,ref:l.state.popupRef,onComplete(){m&&l.state.onOpenChangeComplete(!0)}});const v=me("div",e,{state:{open:m,side:c.side,align:c.align,anchorHidden:c.anchorHidden,transitionStatus:f,empty:j},ref:[t,l.state.popupRef],props:[{id:b,role:_?"dialog":"presentation",tabIndex:-1,onFocus(e){const t=ue(e.nativeEvent);"touch"===p||!Z(l.state.listElement,t)&&t!==e.currentTarget||l.state.inputRef.current?.focus()}},Ke(f),o],stateAttributesMapping:ia}),w=void 0===s?!!_&&(e=>"touch"===e?l.state.popupRef.current:g):s;let k;k=null!=a?a:!!_&&void 0;const C=!_||x;return(0,ws.jsx)(we,{context:d,disabled:!h,modal:C,openInteractionType:p,initialFocus:w,returnFocus:k,getInsideElements:()=>[l.state.startDismissRef.current,l.state.endDismissRef.current],children:(0,ws.jsxs)(js.Fragment,{children:[v,C&&(0,ws.jsx)(Ys,{ref:l.state.endDismissRef})]})})}),sa=js.createContext(void 0),aa=js.createContext(!1),oa=n(q(),1),la=js.memo(js.forwardRef(function(e,t){const n=xe(ql(),Ms.virtualized);return n&&null==e.index?(0,ws.jsx)(Wl,{componentProps:e,forwardedRef:t}):(0,ws.jsx)(Hl,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),ca=js.forwardRef(function(e,t){const{render:n,className:i,style:r,children:s,...a}=e,{filteredItems:o}=Dl(),l=ql(),c=Ul(),d=0===o.length?s:null;return me("div",e,{ref:[t,l.state.emptyRef,c],props:[{children:d,role:"status","aria-live":"polite","aria-atomic":!0},a]})}),da=["{{human.clock}}","{{human.duration}}","{{human.expectedEnd}}","{{human.runningTimer}}","{{human.elapsedTime}}","{{human.startedAt}}"],ua=["{{clock}}","{{timer.addedTime}}","{{timer.current}}","{{timer.duration}}","{{timer.elapsed}}","{{timer.expectedFinish}}","{{timer.secondaryTimer}}","{{timer.startedAt}}","{{rundown.selectedEventIndex}}","{{rundown.numEvents}}","{{rundown.plannedStart}}","{{rundown.plannedEnd}}","{{rundown.actualStart}}","{{offset.absolute}}","{{offset.relative}}","{{offset.expectedRundownEnd}}","{{offset.expectedGroupEnd}}","{{offset.expectedFlagStart}}"],ha=["{{eventNow.id}}","{{eventNow.cue}}","{{eventNow.title}}","{{eventNow.note}}","{{eventNow.timeStart}}","{{eventNow.timeEnd}}","{{eventNow.duration}}","{{eventNow.colour}}","{{eventNow.delay}}"],ma=["{{eventNext.id}}","{{eventNext.cue}}","{{eventNext.title}}","{{eventNext.note}}","{{eventNext.timeStart}}","{{eventNext.timeEnd}}","{{eventNext.duration}}","{{eventNext.colour}}","{{eventNext.delay}}"],pa=["{{groupNow.id}}","{{groupNow.title}}","{{groupNow.note}}","{{groupNow.colour}}","{{groupNow.timeStart}}","{{groupNow.timeEnd}}","{{groupNow.duration}}"],fa=e=>[`{{auxtimer${e}.current}}`,`{{auxtimer${e}.duration}}`,`{{auxtimer${e}.playback}}`,`{{auxtimer${e}.direction}}`],_a={blink:"_blink_1u4lw_1",fourtyfive:"_fourtyfive_1u4lw_13",inputShell:"_inputShell_1u4lw_17",fluid:"_fluid_1u4lw_21",input:"_input_1u4lw_17",expandButton:"_expandButton_1u4lw_29",positioner:"_positioner_1u4lw_36",popup:"_popup_1u4lw_40",list:"_list_1u4lw_50",item:"_item_1u4lw_59",expandedEditor:"_expandedEditor_1u4lw_72",footerHint:"_footerHint_1u4lw_78"},ga={blink:"_blink_xhhrk_1",fourtyfive:"_fourtyfive_xhhrk_13",outerColumn:"_outerColumn_xhhrk_17",innerColumn:"_innerColumn_xhhrk_30",ruleSection:"_ruleSection_xhhrk_36",titleSection:"_titleSection_xhhrk_42",filterSection:"_filterSection_xhhrk_43",oscSection:"_oscSection_xhhrk_44",httpSection:"_httpSection_xhhrk_45",actionSection:"_actionSection_xhhrk_46",test:"_test_xhhrk_100",outputCard:"_outputCard_xhhrk_104"},xa="https://docs.getontime.no/api/automation/#using-variables-in-automation",ya="automation-form",ja={title:"",filterRule:"all",filters:[],outputs:[]},ba="trigger-form",va={blink:"_blink_1fzu7_1",fourtyfive:"_fourtyfive_1fzu7_13",goIcon:"_goIcon_1fzu7_17"},wa="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},ka=[],Ca=[],Sa="undefined"!=typeof Uint8Array?Uint8Array:Array,Na=!1,Ea={}.toString,Ia=Array.isArray||function(e){return"[object Array]"==Ea.call(e)},gc.TYPED_ARRAY_SUPPORT=void 0===wa.TYPED_ARRAY_SUPPORT||wa.TYPED_ARRAY_SUPPORT,fc(),gc.poolSize=8192,gc._augment=function(e){return e.__proto__=gc.prototype,e},gc.from=function(e,t,n){return xc(null,e,t,n)},gc.TYPED_ARRAY_SUPPORT&&(gc.prototype.__proto__=Uint8Array.prototype,gc.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&gc[Symbol.species]),gc.alloc=function(e,t,n){return function(e,t,n,i){return yc(t),t<=0?_c(e,t):void 0!==n?"string"==typeof i?_c(e,t).fill(n,i):_c(e,t).fill(n):_c(e,t)}(null,e,t,n)},gc.allocUnsafe=function(e){return jc(null,e)},gc.allocUnsafeSlow=function(e){return jc(null,e)},gc.isBuffer=Zc,gc.compare=function(e,t){if(!wc(e)||!wc(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,r=0,s=Math.min(n,i);r<s;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},gc.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},gc.concat=function(e,t){if(!Ia(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return gc.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=gc.allocUnsafe(t),r=0;for(n=0;n<e.length;++n){var s=e[n];if(!wc(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,r),r+=s.length}return i},gc.byteLength=kc,gc.prototype._isBuffer=!0,gc.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Sc(this,t,t+1);return this},gc.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Sc(this,t,t+3),Sc(this,t+1,t+2);return this},gc.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Sc(this,t,t+7),Sc(this,t+1,t+6),Sc(this,t+2,t+5),Sc(this,t+3,t+4);return this},gc.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Lc(this,0,e):Cc.apply(this,arguments)},gc.prototype.equals=function(e){if(!wc(e))throw new TypeError("Argument must be a Buffer");return this===e||0===gc.compare(this,e)},gc.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},gc.prototype.compare=function(e,t,n,i,r){if(!wc(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),o=Math.min(s,a),l=this.slice(i,r),c=e.slice(t,n),d=0;d<o;++d)if(l[d]!==c[d]){s=l[d],a=c[d];break}return s<a?-1:a<s?1:0},gc.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},gc.prototype.indexOf=function(e,t,n){return Nc(this,e,t,n,!0)},gc.prototype.lastIndexOf=function(e,t,n){return Nc(this,e,t,n,!1)},gc.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return Ic(this,e,t,n);case"utf8":case"utf-8":return Rc(this,e,t,n);case"ascii":return Tc(this,e,t,n);case"latin1":case"binary":return Pc(this,e,t,n);case"base64":return Oc(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ac(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},gc.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Ra=4096,gc.prototype.slice=function(e,t){var n,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e),gc.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=gc.prototype;else{var r=t-e;n=new gc(r,void 0);for(var s=0;s<r;++s)n[s]=this[s+e]}return n},gc.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Mc(e,t,this.length);for(var i=this[e],r=1,s=0;++s<t&&(r*=256);)i+=this[e+s]*r;return i},gc.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Mc(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},gc.prototype.readUInt8=function(e,t){return t||Mc(e,1,this.length),this[e]},gc.prototype.readUInt16LE=function(e,t){return t||Mc(e,2,this.length),this[e]|this[e+1]<<8},gc.prototype.readUInt16BE=function(e,t){return t||Mc(e,2,this.length),this[e]<<8|this[e+1]},gc.prototype.readUInt32LE=function(e,t){return t||Mc(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},gc.prototype.readUInt32BE=function(e,t){return t||Mc(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},gc.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Mc(e,t,this.length);for(var i=this[e],r=1,s=0;++s<t&&(r*=256);)i+=this[e+s]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*t)),i},gc.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Mc(e,t,this.length);for(var i=t,r=1,s=this[e+--i];i>0&&(r*=256);)s+=this[e+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*t)),s},gc.prototype.readInt8=function(e,t){return t||Mc(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},gc.prototype.readInt16LE=function(e,t){t||Mc(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},gc.prototype.readInt16BE=function(e,t){t||Mc(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},gc.prototype.readInt32LE=function(e,t){return t||Mc(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},gc.prototype.readInt32BE=function(e,t){return t||Mc(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},gc.prototype.readFloatLE=function(e,t){return t||Mc(e,4,this.length),mc(this,e,!0,23,4)},gc.prototype.readFloatBE=function(e,t){return t||Mc(e,4,this.length),mc(this,e,!1,23,4)},gc.prototype.readDoubleLE=function(e,t){return t||Mc(e,8,this.length),mc(this,e,!0,52,8)},gc.prototype.readDoubleBE=function(e,t){return t||Mc(e,8,this.length),mc(this,e,!1,52,8)},gc.prototype.writeUIntLE=function(e,t,n,i){e=+e,t|=0,n|=0,i||zc(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[t]=255&e;++s<n&&(r*=256);)this[t+s]=e/r&255;return t+n},gc.prototype.writeUIntBE=function(e,t,n,i){e=+e,t|=0,n|=0,i||zc(this,e,t,n,Math.pow(2,8*n)-1,0);var r=n-1,s=1;for(this[t+r]=255&e;--r>=0&&(s*=256);)this[t+r]=e/s&255;return t+n},gc.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,1,255,0),gc.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},gc.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,2,65535,0),gc.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$c(this,e,t,!0),t+2},gc.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,2,65535,0),gc.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$c(this,e,t,!1),t+2},gc.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,4,4294967295,0),gc.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Uc(this,e,t,!0),t+4},gc.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,4,4294967295,0),gc.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Uc(this,e,t,!1),t+4},gc.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);zc(this,e,t,n,r-1,-r)}var s=0,a=1,o=0;for(this[t]=255&e;++s<n&&(a*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+n},gc.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);zc(this,e,t,n,r-1,-r)}var s=n-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+n},gc.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,1,127,-128),gc.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},gc.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,2,32767,-32768),gc.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$c(this,e,t,!0),t+2},gc.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,2,32767,-32768),gc.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$c(this,e,t,!1),t+2},gc.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,4,2147483647,-2147483648),gc.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Uc(this,e,t,!0),t+4},gc.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||zc(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),gc.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Uc(this,e,t,!1),t+4},gc.prototype.writeFloatLE=function(e,t,n){return Wc(this,e,t,!0,n)},gc.prototype.writeFloatBE=function(e,t,n){return Wc(this,e,t,!1,n)},gc.prototype.writeDoubleLE=function(e,t,n){return Gc(this,e,t,!0,n)},gc.prototype.writeDoubleBE=function(e,t,n){return Gc(this,e,t,!1,n)},gc.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var r,s=i-n;if(this===e&&n<t&&t<i)for(r=s-1;r>=0;--r)e[r+t]=this[r+n];else if(s<1e3||!gc.TYPED_ARRAY_SUPPORT)for(r=0;r<s;++r)e[r+t]=this[r+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},gc.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!gc.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=wc(e)?e:Yc(new gc(e,i).toString()),o=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%o]}return this},Ta=/[^+\/0-9A-Za-z-_]/g,Pa=".".charCodeAt(0),Oa=/\\(\\)?/g,Aa=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),qa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,La=/^\w*$/,Da=function(e){return Object.prototype.toString.call(e)},Fa=function(e){const t=typeof e;return"symbol"===t||"object"===t&&e&&"[object Symbol]"===Da(e)},Ba=function(e,t){if(Array.isArray(e))return!1;const n=typeof e;return!("number"!==n&&"symbol"!==n&&"boolean"!==n&&e&&!Fa(e))||La.test(e)||!qa.test(e)||null!=t&&e in Object(t)},Va=function(e){const t=[];return e.charCodeAt(0)===Pa&&t.push(""),e.replace(Aa,function(e,n,i,r){let s=e;i?s=r.replace(Oa,"$1"):n&&(s=n.trim()),t.push(s)}),t},Ma=function(e,t){return Array.isArray(e)?e:Ba(e,t)?[e]:Va(e)},za=function(e){if("string"==typeof e||Fa(e))return e;const t=`${e}`;return"0"==t&&1/e==-INFINITY?"-0":t},$a=function(e,t){let n=0;const i=(t=Ma(t,e)).length;for(;null!=e&&n<i;)e=e[za(t[n++])];return n&&n===i?e:void 0},Ua=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},Ha=function(e){if(null==e)return[void 0,void 0];if("object"!=typeof e)return[Error('Invalid option "columns": expect an array or an object')];if(Array.isArray(e)){const t=[];for(const n of e)if("string"==typeof n)t.push({key:n,header:n});else{if("object"!=typeof n||null===n||Array.isArray(n))return[Error("Invalid column definition: expect a string or an object")];if(!n.key)return[Error('Invalid column definition: property "key" is required')];void 0===n.header&&(n.header=n.key),t.push(n)}e=t}else{const t=[];for(const n in e)t.push({key:n,header:e[n]});e=t}return[void 0,e]},Wa=class e extends Error{constructor(t,n,...i){Array.isArray(n)&&(n=n.join(" ")),super(n),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,e),this.code=t;for(const e of i)for(const t in e){const n=e[t];this[t]=Zc(n)?n.toString():null==n?n:JSON.parse(JSON.stringify(n))}}},Ga=function(e){return e.replace(/([A-Z])/g,function(e,t){return"_"+t.toLowerCase()})},Ka=function(e){const t={};for(const r in e)t[Ga(r)]=e[r];if(void 0===t.bom||null===t.bom||!1===t.bom)t.bom=!1;else if(!0!==t.bom)return[new Wa("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify(t.bom)}`])];if(void 0===t.delimiter||null===t.delimiter)t.delimiter=",";else if(Zc(t.delimiter))t.delimiter=t.delimiter.toString();else if("string"!=typeof t.delimiter)return[new Wa("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify(t.delimiter)}`])];if(void 0===t.quote||null===t.quote)t.quote='"';else if(!0===t.quote)t.quote='"';else if(!1===t.quote)t.quote="";else if(Zc(t.quote))t.quote=t.quote.toString();else if("string"!=typeof t.quote)return[new Wa("CSV_OPTION_QUOTE_INVALID_TYPE",["option `quote` must be a boolean, a buffer or a string,",`got ${JSON.stringify(t.quote)}`])];if(void 0!==t.quoted&&null!==t.quoted||(t.quoted=!1),void 0===t.escape_formulas||null===t.escape_formulas)t.escape_formulas=!1;else if("boolean"!=typeof t.escape_formulas)return[new Wa("CSV_OPTION_ESCAPE_FORMULAS_INVALID_TYPE",["option `escape_formulas` must be a boolean,",`got ${JSON.stringify(t.escape_formulas)}`])];if(void 0!==t.quoted_empty&&null!==t.quoted_empty||(t.quoted_empty=void 0),void 0===t.quoted_match||null===t.quoted_match||!1===t.quoted_match?t.quoted_match=null:Array.isArray(t.quoted_match)||(t.quoted_match=[t.quoted_match]),t.quoted_match)for(const r of t.quoted_match){const e=r instanceof RegExp;if("string"!=typeof r&&!e)return[Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(r)}`)]}if(void 0!==t.quoted_string&&null!==t.quoted_string||(t.quoted_string=!1),void 0!==t.eof&&null!==t.eof||(t.eof=!0),void 0===t.escape||null===t.escape)t.escape='"';else if(Zc(t.escape))t.escape=t.escape.toString();else if("string"!=typeof t.escape)return[Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(t.escape)}`)];if(t.escape.length>1)return[Error(`Invalid Option: escape must be one character, got ${t.escape.length} characters`)];void 0!==t.header&&null!==t.header||(t.header=!1);const[n,i]=Ha(t.columns);if(void 0!==n)return[n];if(t.columns=i,void 0!==t.quoted&&null!==t.quoted||(t.quoted=!1),void 0!==t.cast&&null!==t.cast||(t.cast={}),void 0!==t.cast.bigint&&null!==t.cast.bigint||(t.cast.bigint=e=>""+e),void 0!==t.cast.boolean&&null!==t.cast.boolean||(t.cast.boolean=e=>e?"1":""),void 0!==t.cast.date&&null!==t.cast.date||(t.cast.date=e=>""+e.getTime()),void 0!==t.cast.number&&null!==t.cast.number||(t.cast.number=e=>""+e),void 0!==t.cast.object&&null!==t.cast.object||(t.cast.object=e=>JSON.stringify(e)),void 0!==t.cast.string&&null!==t.cast.string||(t.cast.string=function(e){return e}),void 0!==t.on_record&&"function"!=typeof t.on_record)return[Error('Invalid Option: "on_record" must be a function.')];if(void 0===t.record_delimiter||null===t.record_delimiter)t.record_delimiter="\n";else if(Zc(t.record_delimiter))t.record_delimiter=t.record_delimiter.toString();else if("string"!=typeof t.record_delimiter)return[Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(t.record_delimiter)}`)];switch(t.record_delimiter){case"unix":t.record_delimiter="\n";break;case"mac":t.record_delimiter="\r";break;case"windows":t.record_delimiter="\r\n";break;case"ascii":t.record_delimiter="";break;case"unicode":t.record_delimiter="\u2028"}return[void 0,t]},Ya=gc.from([239,187,191]),Ja=function(e,t,n){return{options:e,state:t,info:n,__transform:function(e,t){if(!Array.isArray(e)&&"object"!=typeof e)return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(e)}`);if(0===this.info.records)if(Array.isArray(e)){if(!0===this.options.header&&void 0===this.options.columns)return Error("Undiscoverable Columns: header option requires column option or object records")}else if(void 0===this.options.columns){const[t,n]=Ha(Object.keys(e));if(t)return;this.options.columns=n}if(0===this.info.records){this.bom(t);const e=this.headers(t);if(e)return e}try{this.options.on_record&&this.options.on_record(e,this.info.records)}catch(n){return n}let n,i;if(this.options.eof){if([n,i]=this.stringify(e),n)return n;if(void 0===i)return;i+=this.options.record_delimiter}else{if([n,i]=this.stringify(e),n)return n;if(void 0===i)return;(this.options.header||this.info.records)&&(i=this.options.record_delimiter+i)}this.info.records++,t(i)},stringify:function(e,t=!1){if("object"!=typeof e)return[void 0,e];const{columns:n}=this.options,i=[];if(Array.isArray(e)){n&&e.splice(n.length);for(let n=0;n<e.length;n++){const r=e[n],[s,a]=this.__cast(r,{index:n,column:n,records:this.info.records,header:t});if(s)return[s];i[n]=[a,r]}}else for(let s=0;s<n.length;s++){const r=$a(e,n[s].key),[a,o]=this.__cast(r,{index:s,column:n[s].key,records:this.info.records,header:t});if(a)return[a];i[s]=[o,r]}let r="";for(let s=0;s<i.length;s++){let e,t,[n,a]=i[s];if("string"==typeof n)e=this.options;else if(Ua(n)){if(e=n,n=e.value,delete e.value,"string"!=typeof n&&null!=n&&t)return[Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(n)}`)];if(e={...this.options,...e},[t,e]=Ka(e),void 0!==t)return[t]}else{if(null!=n)return[Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(n)}`)];e=this.options}const{delimiter:o,escape:l,quote:c,quoted:d,quoted_empty:u,quoted_string:h,quoted_match:m,record_delimiter:p,escape_formulas:f}=e;if(""===n&&""===a){let e=m&&m.filter(e=>"string"==typeof e?-1!==n.indexOf(e):e.test(n));e=e&&e.length>0,!0===(e||!0===u||!0===h&&!1!==u)&&(n=c+n+c),r+=n}else if(n){if("string"!=typeof n)return[Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(n)}`)];const e=o.length&&n.indexOf(o)>=0,t=""!==c&&n.indexOf(c)>=0,i=n.indexOf(l)>=0&&l!==c,s=n.indexOf(p)>=0,u=h&&"string"==typeof a;let _=m&&m.filter(e=>"string"==typeof e?-1!==n.indexOf(e):e.test(n));if(_=_&&_.length>0,f)switch(n[0]){case"=":case"+":case"-":case"@":case"\t":case"\r":case"=":case"+":case"-":case"@":n=`'${n}`}const g=!0===t||e||s||d||u||_;if(!0===g&&!0===i){const e="\\"===l?new RegExp(l+l,"g"):new RegExp(l,"g");n=n.replace(e,l+l)}if(!0===t){const e=new RegExp(c,"g");n=n.replace(e,l+c)}!0===g&&(n=c+n+c),r+=n}else(!0===u||""===a&&!0===h&&!1!==u)&&(r+=c+c);s!==i.length-1&&(r+=o)}return[void 0,r]},bom:function(e){!0===this.options.bom&&e(Ya)},headers:function(e){if(!1===this.options.header)return;if(void 0===this.options.columns)return;let t,n=this.options.columns.map(e=>e.header);if(this.options.eof?([t,n]=this.stringify(n,!0),n+=this.options.record_delimiter):[t,n]=this.stringify(n),t)return t;e(n)},__cast:function(e,t){const n=typeof e;try{return"string"===n?[void 0,this.options.cast.string(e,t)]:"bigint"===n?[void 0,this.options.cast.bigint(e,t)]:"number"===n?[void 0,this.options.cast.number(e,t)]:"boolean"===n?[void 0,this.options.cast.boolean(e,t)]:e instanceof Date?[void 0,this.options.cast.date(e,t)]:"object"===n&&null!==e?[void 0,this.options.cast.object(e,t)]:[void 0,e,e]}catch(i){return[i]}}}},Qa=function(e,t={}){const n=[],[i,r]=Ka(t);if(void 0!==i)throw i;const s=Ja(r,{stop:!1},{records:0});for(const a of e){const e=s.__transform(a,function(e){n.push(e)});if(void 0!==e)throw e}if(0===n.length){s.bom(e=>{n.push(e)});const e=s.headers(e=>{n.push(e)});if(void 0!==e)throw e}return n.join("")},Za=["Index","Title","Cue","Scheduled Start","Actual Start","Scheduled End","Actual End"],Xa={blink:"_blink_qqr9x_1",fourtyfive:"_fourtyfive_qqr9x_13",over:"_over_qqr9x_17",under:"_under_qqr9x_21"},eo={blink:"_blink_1sy0c_1",fourtyfive:"_fourtyfive_1sy0c_13",expand:"_expand_1sy0c_17",column:"_column_1sy0c_21"},to=[{value:_.Cuesheet,label:"Cuesheet"},{value:_.Operator,label:"Operator"},{value:_.Timer,label:"Timer"},{value:_.Backstage,label:"Backstage"},{value:_.Timeline,label:"Timeline"},{value:_.StudioClock,label:"Studio Clock"},{value:_.Countdown,label:"Countdown"},{value:_.ProjectInfo,label:"Project Info"},{value:_.Teleprompter,label:"Teleprompter"}],no="url-preset-form",io={alias:"",target:_.Timer,search:"",enabled:!0,displayInNav:!1},ro="https://docs.getontime.no/features/url-presets/",so={blink:"_blink_1fjfd_1",fourtyfive:"_fourtyfive_1fjfd_13",halfWidth:"_halfWidth_1fjfd_17",fullWidth:"_fullWidth_1fjfd_21",twoCols:"_twoCols_1fjfd_25",formColumn:"_formColumn_1fjfd_31",current:"_current_1fjfd_37"},ao="custom-field-form",oo=`${cn}/excel`,lo="new-rundown-form",co=`${cn}/sheets`,uo=async()=>(await sn.get(`${co}/connect`)).data,ho=async(e,t,n)=>{const i=new FormData;return i.append("client_secret",e),(await sn.post(`${co}/${t}/connect`,i,{signal:n?.signal,timeout:n?.timeout??lr.longTimeout,headers:{"Content-Type":"multipart/form-data"}})).data},mo=async()=>(await sn.post(`${co}/revoke`)).data,po=async(e,t,n)=>(await sn.post(`${co}/${e}/read`,{options:t},{signal:n?.signal,timeout:n?.timeout??lr.longTimeout})).data,fo=async(e,t,n)=>(await sn.post(`${co}/${e}/metadata`,{worksheet:t},{signal:n?.signal,timeout:n?.timeout??lr.longTimeout})).data,_o=async(e,t)=>(await sn.post(`${co}/${e}/worksheet-options`,void 0,{signal:t?.signal,timeout:t?.timeout??lr.longTimeout})).data,go=async(e,t,n)=>(await sn.post(`${co}/${e}/write`,{options:t},{signal:n?.signal,timeout:n?.timeout??lr.longTimeout})).data,xo=/\/spreadsheets\/d\/([a-zA-Z0-9_-]+)/,yo=W("gsheet:lastSheetId"),jo={blink:"_blink_1x0da_1",fourtyfive:"_fourtyfive_1x0da_13",introStack:"_introStack_1x0da_17",setupLead:"_setupLead_1x0da_23",finishTitle:"_finishTitle_1x0da_24",setupBody:"_setupBody_1x0da_31",finishDescription:"_finishDescription_1x0da_32",sourceDescription:"_sourceDescription_1x0da_33",sourceGrid:"_sourceGrid_1x0da_39",finishSection:"_finishSection_1x0da_40",finishActions:"_finishActions_1x0da_44",sourceCard:"_sourceCard_1x0da_57",setupBlock:"_setupBlock_1x0da_59",sourceHeader:"_sourceHeader_1x0da_73",setupIntroText:"_setupIntroText_1x0da_74",sourceTitle:"_sourceTitle_1x0da_80",sourceMeta:"_sourceMeta_1x0da_87",setupHint:"_setupHint_1x0da_88",finishBadge:"_finishBadge_1x0da_103",setupShell:"_setupShell_1x0da_115",setupIntro:"_setupIntro_1x0da_74",setupActions:"_setupActions_1x0da_135",statusIdle:"_statusIdle_1x0da_139",statusPending:"_statusPending_1x0da_144",statusReady:"_statusReady_1x0da_149"},bo=[{label:"Flag",importKey:"flag",defaultHeader:"flag"},{label:"Start",importKey:"timeStart",defaultHeader:"time start"},{label:"Link start",importKey:"linkStart",defaultHeader:"link start"},{label:"End",importKey:"timeEnd",defaultHeader:"time end"},{label:"Duration",importKey:"duration",defaultHeader:"duration"},{label:"Cue",importKey:"cue",defaultHeader:"cue"},{label:"Title",importKey:"title",defaultHeader:"title"},{label:"Count to end",importKey:"countToEnd",defaultHeader:"count to end"},{label:"Skip",importKey:"skip",defaultHeader:"skip"},{label:"Note",importKey:"note",defaultHeader:"notes"},{label:"Colour",importKey:"colour",defaultHeader:"colour"},{label:"End action",importKey:"endAction",defaultHeader:"end action"},{label:"Timer type",importKey:"timerType",defaultHeader:"timer type"},{label:"Time warning",importKey:"timeWarning",defaultHeader:"warning time"},{label:"Time danger",importKey:"timeDanger",defaultHeader:"danger time"},{label:"ID",importKey:"id",defaultHeader:"id"}],vo="override",wo=new Map(bo.map(e=>[e.label,e.importKey])),ko={blink:"_blink_uj4mr_1",fourtyfive:"_fourtyfive_uj4mr_13",table:"_table_uj4mr_17",rowNumber:"_rowNumber_uj4mr_62",rowType:"_rowType_uj4mr_63",numericCell:"_numericCell_uj4mr_92",multilineCell:"_multilineCell_uj4mr_97",eventRow:"_eventRow_uj4mr_104",groupRow:"_groupRow_uj4mr_108",milestoneRow:"_milestoneRow_uj4mr_118"},Co=["Title","Cue","Start","End","Duration"],So=new Set(["Start","End","Duration","Time warning","Time danger"]),No="transparent",Eo={blink:"_blink_16fk7_1",fourtyfive:"_fourtyfive_16fk7_13",positioner:"_positioner_16fk7_17",popup:"_popup_16fk7_21",list:"_list_16fk7_36",item:"_item_16fk7_47",empty:"_empty_16fk7_48",itemLabel:"_itemLabel_16fk7_68"},Io={blink:"_blink_1bj11_1",fourtyfive:"_fourtyfive_1bj11_13",editor:"_editor_1bj11_17",editorToolbar:"_editorToolbar_1bj11_27",editorFooter:"_editorFooter_1bj11_35",worksheetControl:"_worksheetControl_1bj11_39",worksheetLabel:"_worksheetLabel_1bj11_45",importModeTrigger:"_importModeTrigger_1bj11_52",addColumnTrigger:"_addColumnTrigger_1bj11_57",editorBody:"_editorBody_1bj11_62",mappingPane:"_mappingPane_1bj11_70",previewPane:"_previewPane_1bj11_71",mappingPaneHeader:"_mappingPaneHeader_1bj11_81",previewPaneHeader:"_previewPaneHeader_1bj11_82",mappingPaneActions:"_mappingPaneActions_1bj11_97",mappingPaneTitle:"_mappingPaneTitle_1bj11_104",previewPaneTitle:"_previewPaneTitle_1bj11_105",toolbarWarning:"_toolbarWarning_1bj11_111",mappingList:"_mappingList_1bj11_119",mappingField:"_mappingField_1bj11_128",mappingFieldHeader:"_mappingFieldHeader_1bj11_134",mappingFieldTitle:"_mappingFieldTitle_1bj11_141",mappingFieldLabel:"_mappingFieldLabel_1bj11_148",mappingFieldWarning:"_mappingFieldWarning_1bj11_154",tableShell:"_tableShell_1bj11_160",columnInput:"_columnInput_1bj11_166",columnInputWarn:"_columnInputWarn_1bj11_170"},Ro={loading:"",error:"",preview:null,needsPreviewRefresh:!1},To=[],Po=[{value:"override",label:"Replace current rundown",description:"Spreadsheet data completely replaces current rundown"},{value:"merge",label:"Merge with current rundown",description:"Merge entries referencing their IDs, entries not present in spreadsheet rundown are deleted"},{value:"new",label:"New rundown",description:"Create a new rundown to import the data into. Loads the new rundown"}],Oo="https://docs.getontime.no/features/import-spreadsheet-gsheet/",Ao={blink:"_blink_v67sj_1",fourtyfive:"_fourtyfive_v67sj_13",section:"_section_v67sj_17",sectionHeader:"_sectionHeader_v67sj_27",separator:"_separator_v67sj_33",textEntry:"_textEntry_v67sj_49",inlineEntry:"_inlineEntry_v67sj_58",redirect:"_redirect_v67sj_65",label:"_label_v67sj_69",description:"_description_v67sj_75",origin:"_origin_v67sj_80"},qo={blink:"_blink_142rp_1",fourtyfive:"_fourtyfive_142rp_13",fullWidth:"_fullWidth_142rp_17",halfWidth:"_halfWidth_142rp_21",halfWidthNoWrap:"_halfWidthNoWrap_142rp_25",copiable:"_copiable_142rp_30",actionsCell:"_actionsCell_142rp_35",actionsHeader:"_actionsHeader_142rp_41",actionsGroup:"_actionsGroup_142rp_45",current:"_current_142rp_50"},Lo={blink:"_blink_l21m9_1",fourtyfive:"_fourtyfive_l21m9_13",iconRotate:"_iconRotate_l21m9_17"},Do={project:{title:""},settings:{timeFormat:"24",language:"en"}},Fo={blink:"_blink_1qku8_1",fourtyfive:"_fourtyfive_1qku8_13",current:"_current_1qku8_17",isEditing:"_isEditing_1qku8_21",form:"_form_1qku8_25",formInput:"_formInput_1qku8_33",saveButton:"_saveButton_1qku8_37",containCell:"_containCell_1qku8_41",sortableHeader:"_sortableHeader_1qku8_45",fullWidth:"_fullWidth_1qku8_51",innerColumn:"_innerColumn_1qku8_55",inlineLabels:"_inlineLabels_1qku8_63",warningInfo:"_warningInfo_1qku8_68",loaderBox:"_loaderBox_1qku8_72",mergeBody:"_mergeBody_1qku8_77",mergeIntro:"_mergeIntro_1qku8_81",sourceFile:"_sourceFile_1qku8_87",mergeSummary:"_mergeSummary_1qku8_95",mergeWarningInfo:"_mergeWarningInfo_1qku8_101",optionList:"_optionList_1qku8_105",optionRow:"_optionRow_1qku8_114",optionCopy:"_optionCopy_1qku8_124",optionTitle:"_optionTitle_1qku8_131",optionBody:"_optionBody_1qku8_138",footerContent:"_footerContent_1qku8_144",footerActions:"_footerActions_1qku8_151"},Bo="project-merge-form",Vo=`${cn}/custom-views`,Mo={views:[]},zo="https://docs.getontime.no/features/custom-views/",$o=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,Ho=(Uo=4e6)/1e6+"MB",Wo={blink:"_blink_hbyi7_1",fourtyfive:"_fourtyfive_hbyi7_13",uploadForm:"_uploadForm_hbyi7_17",step:"_step_hbyi7_23",stepTitle:"_stepTitle_hbyi7_29",filePicker:"_filePicker_hbyi7_34",fileName:"_fileName_hbyi7_38",missing:"_missing_hbyi7_43",urlCell:"_urlCell_hbyi7_47",actionsHeader:"_actionsHeader_hbyi7_54",actionsCell:"_actionsCell_hbyi7_58",actionsGroup:"_actionsGroup_hbyi7_64"},Go="custom-view-form",Ko={blink:"_blink_cq029_1",fourtyfive:"_fourtyfive_cq029_13",container:"_container_cq029_17"},Yo=(0,js.lazy)(()=>He(()=>t.import("./CustomTranslationModal-legacy-K5flwd7m.js"),void 0,t.meta.url)),Jo={blink:"_blink_1p5nj_1",fourtyfive:"_fourtyfive_1p5nj_13",uploadLogoCard:"_uploadLogoCard_1p5nj_17",logoActions:"_logoActions_1p5nj_32",customDataItem:"_customDataItem_1p5nj_37",titleRow:"_titleRow_1p5nj_44",customImage:"_customImage_1p5nj_53",imageContainer:"_imageContainer_1p5nj_59"},Qo={port:4001,pendingRestart:!1},Zo={blink:"_blink_6wtn0_1",fourtyfive:"_fourtyfive_6wtn0_13",editorActions:"_editorActions_6wtn0_17",right:"_right_6wtn0_21",column:"_column_6wtn0_26",editorBody:"_editorBody_6wtn0_33"},Xo=(0,js.lazy)(()=>He(()=>t.import("./StyleEditor-legacy-BZti4570.js"),void 0,t.meta.url)),el="https://docs.getontime.no/features/custom-styling/",tl={blink:"_blink_1fy3l_1",fourtyfive:"_fourtyfive_1fy3l_13",container:"_container_1fy3l_17"},nl=(0,js.memo)(pu),il={blink:"_blink_1m3st_1",fourtyfive:"_fourtyfive_1m3st_13",container:"_container_1m3st_17",itemGroup:"_itemGroup_1m3st_27",goButton:"_goButton_1m3st_34",iconButtonWithLabel:"_iconButtonWithLabel_1m3st_35",iconButton:"_iconButton_1m3st_35",goLabel:"_goLabel_1m3st_55",shortcutHint:"_shortcutHint_1m3st_61",addSection:"_addSection_1m3st_66",separator:"_separator_1m3st_70",timerSection:"_timerSection_1m3st_77",negativeIndicator:"_negativeIndicator_1m3st_84",auxSection:"_auxSection_1m3st_95",auxControls:"_auxControls_1m3st_103",auxTimeInput:"_auxTimeInput_1m3st_108",auxTimeDisplay:"_auxTimeDisplay_1m3st_109"},rl=5,sl={blink:"_blink_qfgjn_1",fourtyfive:"_fourtyfive_qfgjn_13",container:"_container_qfgjn_17",emptyState:"_emptyState_qfgjn_22",emptyMessage:"_emptyMessage_qfgjn_30",emptyTitle:"_emptyTitle_qfgjn_36",emptyBody:"_emptyBody_qfgjn_43"},al={blink:"_blink_qs5et_1",fourtyfive:"_fourtyfive_qs5et_13",item:"_item_qs5et_17",title:"_title_qs5et_36",colourBar:"_colourBar_qs5et_76",chipSlot:"_chipSlot_qs5et_100",chipText:"_chipText_qs5et_121"},ol=(0,js.memo)(ju),ll=(0,js.memo)(bu),cl={blink:"_blink_kcrvg_1",fourtyfive:"_fourtyfive_kcrvg_13",container:"_container_kcrvg_17",list:"_list_kcrvg_24",bottomSpacer:"_bottomSpacer_kcrvg_30"},ku.displayName="VirtuosoListComponent",dl={blink:"_blink_1exbp_1",fourtyfive:"_fourtyfive_1exbp_13",panelContainer:"_panelContainer_1exbp_17",panelContainerTracking:"_panelContainerTracking_1exbp_26",left:"_left_1exbp_31",rundownLayout:"_rundownLayout_1exbp_40",rundownPanel:"_rundownPanel_1exbp_48",titlesPanel:"_titlesPanel_1exbp_55"},ul=(0,js.lazy)(()=>He(()=>t.import("./RundownExport-legacy-VGu1i8he.js"),void 0,t.meta.url)),hl=(0,js.lazy)(()=>He(()=>t.import("./TimerControlExport-legacy-DsD8liQZ.js"),void 0,t.meta.url)),ml=(0,js.lazy)(()=>He(()=>t.import("./MessageControlExport-legacy-BysmdwbE.js"),void 0,t.meta.url)),pl=(0,js.memo)(Nu),fl={blink:"_blink_1atdi_1",fourtyfive:"_fourtyfive_1atdi_13",sections:"_sections_1atdi_17",column:"_column_1atdi_23",about:"_about_1atdi_23",inline:"_inline_1atdi_35",header:"_header_1atdi_41",logo:"_logo_1atdi_48",buttonRow:"_buttonRow_1atdi_53",tableContainer:"_tableContainer_1atdi_62",table:"_table_1atdi_62",current:"_current_1atdi_75"},_l={blink:"_blink_1m0yz_1",fourtyfive:"_fourtyfive_1m0yz_13",mainContainer:"_mainContainer_1m0yz_17"}}}});
//# sourceMappingURL=ProtectedEditor-legacy-Cyjq5LU3.js.map