@getontime/cli
Version:
Time keeping for live events
2 lines • 22.6 kB
JavaScript
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./Button-legacy-DpgzgT04.js","./useIsSmallScreen-legacy-DavgXfPB.js","./Select-legacy-DHLEukf3.js","./constants-legacy-CvecvM28.js","./GenerateLinkFormExport-legacy-BXqi2OlY.js","./useRundown-legacy-zes2lKPp.js","./errorboundary-legacy-CiQMUIM4.js","./index-legacy-NWDCUII5.js","./useProjectData-legacy-BeF8hAuC.js"],function(e,t){var r,n,o,a,i,l,s,c,d,u,f,h,v,w,p,_,m,g,y,x,b,S,E,R,z,j,P,Y,O,X,C,M,T,A,H,N,$,k,I,W,D,L,F,U,q,B,K,V,G,J,Q,Z,ee,te,re,ne,oe,ae,ie,le,se,ce,de,ue,fe,he;function ve(){const e=D.useContext(L);if(void 0===e)throw new Error(f(53));return e}function we(e,t,r){if(!e)return 0;const n=getComputedStyle(e),o="x"===r?"Inline":"Block";return"x"===r&&"margin"===t?2*parseFloat(n[`${t}InlineStart`]):parseFloat(n[`${t}${o}Start`])+parseFloat(n[`${t}${o}End`])}function pe({className:e,viewportClassName:t,contentClassName:r,contentStyle:n,children:o,ref:a,orientation:i="vertical"}){return(0,W.jsxs)(Q,{className:R([se.root,e]),children:[(0,W.jsx)(re,{ref:a,className:R([se.viewport,t]),children:(0,W.jsx)(ie,{className:r,style:n,children:o})}),(0,W.jsx)(ae,{className:se.scrollbar,orientation:i,children:(0,W.jsx)(le,{className:se.thumb})})]})}function _e(e){return j.post(`${de}/download`,{filename:e},{timeout:A.longTimeout})}function me(){const{data:e,status:t,refetch:r}=O({queryKey:Y,queryFn:({signal:e})=>async function(e){return(await j.get(`${de}/all`,{signal:e?.signal,timeout:e?.timeout})).data}({signal:e}),placeholderData:(e,t)=>e,refetchInterval:y});return{data:e??ue,status:t,refetch:r}}function ge(e="modified-desc"){const t=me(),{files:r,lastLoadedProject:n}=t.data,o=(0,D.useMemo)(()=>{if(!r.length)return[];const t=[...r].sort(fe[e]),o=t.findIndex(e=>e.filename===n);if(o>0){const[e]=t.splice(o,1);t.unshift(e)}return t},[r,n,e]);return{...t,data:{reorderedProjectFiles:o,lastLoadedProject:t.data.lastLoadedProject}}}function ye(e,t){return`cuesheet-selected-rundown:${e}:${t}`}function xe(e){const{id:t}=e;return t}return e({_:pe,a:async function(e){const t=decodeURIComponent(`${de}/${e}`);return(await j.delete(t)).data},c:_e,d:async function(e){return await j.patch(de,e)},f:async function(e){return(await j.post(`${de}/quick`,e)).data},h:function({navElements:e,children:t}){const r=l();return(0,W.jsx)("div",{className:R([ce.overview,!r&&ce.isOffline]),children:(0,W.jsxs)(T,{children:[(0,W.jsx)("div",{className:ce.nav,children:e}),(0,W.jsx)(pe,{className:ce.infoScroll,contentClassName:ce.info,contentStyle:{minWidth:"100%"},orientation:"horizontal",children:t})]})})},i:ge,l:async function(){return(await j.post(`${de}/demo`)).data},m:async function(e){const t=new FormData;return t.append("project",e),(await j.post(`${de}/upload`,t,{timeout:A.longTimeout,headers:{"Content-Type":"multipart/form-data"}})).data},n:function(){const e=(0,I.c)(15),{data:t}=M(),{data:r}=ge(),{lastLoadedProject:n}=r;let o;e[0]!==n?(o=ye(z,n),e[0]=n,e[1]=o):o=e[1];const a=o;let i;e[2]!==a?(i={key:a,defaultValue:he},e[2]=a,e[3]=i):i=e[3];const[l,s]=X(i);let c,d;if(e[4]!==t||e[5]!==l){const r=new Set(t.rundowns.map(xe)).add(he);({loaded:c}=t),d=function(e,t){return e&&t.has(e)?e:he}(l,r),e[4]=t,e[5]=l,e[6]=c,e[7]=d}else c=e[6],d=e[7];const u=d;let f,h;return e[8]!==s?(f=e=>{(0,D.startTransition)(()=>{s(e)})},e[8]=s,e[9]=f):f=e[9],e[10]!==c||e[11]!==t.rundowns||e[12]!==u||e[13]!==f?(h={loadedRundownId:c,selectedRundownId:u,projectRundowns:t.rundowns,setSelectedRundownId:f},e[10]=c,e[11]=t.rundowns,e[12]=u,e[13]=f,e[14]=h):h=e[14],h},o:async function(e){try{const{data:t,name:r}=await async function(e){const t=await _e(e),r=t.headers["Content-Disposition"];let n=e;if(null!=r){const e=r.indexOf('"')+1,t=r.lastIndexOf('"');n=r.substring(e,t)}return{data:t.data,name:n}}(e);a(i(JSON.stringify(t,null,2),"application/json;charset=utf-8;"),`${r}.json`)}catch(t){console.error(t)}},p:async function(e,t){const r=decodeURIComponent(`${de}/${e}/rename`);return(await j.put(r,{newFilename:t})).data},r:function(){const{data:{lastLoadedProject:e}}=ge(),t=g(),[r,n]=X({key:ye(z,e),defaultValue:null});return(0,D.useCallback)(async e=>{await t("/cuesheet"),(0,D.startTransition)(()=>n(e))},[n,t])},s:async function(e,t){const r=decodeURIComponent(`${de}/${e}/duplicate`);return(await j.post(r,{newFilename:t})).data},u:async function(e){return(await j.post(`${de}/load`,{filename:e})).data},v:function(){const e=(0,I.c)(11),{data:t}=N(),{data:r}=C();let n;e[0]!==t.title?(n=t.title.trim(),e[0]=t.title,e[1]=n):n=e[1];const o=n;let a;e[2]!==r.title?(a=r.title.trim(),e[2]=r.title,e[3]=a):a=e[3];const i=a;if(!o&&!i)return null;let l,s,c;return e[4]!==o?(l=o&&(0,W.jsx)("div",{className:k.project,children:o}),e[4]=o,e[5]=l):l=e[5],e[6]!==i?(s=i&&(0,W.jsx)("div",{className:k.rundown,children:i}),e[6]=i,e[7]=s):s=e[7],e[8]!==l||e[9]!==s?(c=(0,W.jsxs)("div",{className:k.titleOverview,children:[l,s]}),e[8]=l,e[9]=s,e[10]=c):c=e[10],c}}),{setters:[function(e){r=e.a,n=e.n,o=e.t},function(e){a=e.G,i=e.W,l=e._},function(e){s=e.Er,c=e.Hn,d=e.Sr,u=e.T,f=e.Tr,h=e.Un,v=e._r,w=e._t,p=e.on,_=e.un},function(e){m=e.F,g=e.T,y=e.o},function(e){x=e.f,b=e.i,S=e.p,E=e.s},function(e){R=e.K,z=e.L,j=e._n,P=e.b,Y=e.f,O=e.vn},function(e){X=e.P},function(e){C=e.o,M=e.u},function(e){T=e.t},function(e){A=e.N,H=e.a},function(e){N=e.t}],execute:function(){($=document.createElement("style")).textContent='._blink_1tt3s_1{animation:1s step-start infinite _blink_1tt3s_1}@keyframes _blink_1tt3s_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1tt3s_13{transform:rotate(45deg)}._titleOverview_1tt3s_17{flex-direction:column;flex:0 18rem;gap:.125rem;width:18rem;min-width:0;max-width:100%;display:flex}._project_1tt3s_27,._rundown_1tt3s_28{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}._project_1tt3s_27{color:#b1b1b1;letter-spacing:.04em;text-transform:uppercase;font-size:.75rem;font-weight:400;line-height:1.1}._rundown_1tt3s_28{color:#f6f6f6;font-size:1.5rem;font-weight:600;line-height:1.1}._project_1tt3s_27:only-child,._rundown_1tt3s_28:only-child{color:#f6f6f6;font-size:1.5rem}._project_1tt3s_27:only-child{letter-spacing:normal;text-transform:none;font-weight:600}._blink_1z0ax_1{animation:1s step-start infinite _blink_1z0ax_1}@keyframes _blink_1z0ax_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1z0ax_13{transform:rotate(45deg)}._root_1z0ax_17{position:relative;overflow:hidden}._viewport_1z0ax_22{overscroll-behavior:contain;width:100%;height:100%}._viewport_1z0ax_22:focus-visible{outline-offset:-2px;outline:2px solid #578af4}._scrollbar_1z0ax_32{opacity:0;background:0 0;transition:opacity .15s}._scrollbar_1z0ax_32[data-orientation=vertical]{width:6px}._scrollbar_1z0ax_32[data-orientation=horizontal]{height:6px}._scrollbar_1z0ax_32[data-orientation=horizontal][data-has-overflow-x]{opacity:1;pointer-events:auto}._scrollbar_1z0ax_32[data-scrolling]{transition-duration:0s}._scrollbar_1z0ax_32[data-hovering],._scrollbar_1z0ax_32[data-scrolling]{opacity:1;pointer-events:auto}._thumb_1z0ax_55{background:rgba(255,255,255,.2);border-radius:2px}._thumb_1z0ax_55:hover{background:rgba(255,255,255,.6)}._blink_597w9_1{animation:1s step-start infinite _blink_597w9_1}@keyframes _blink_597w9_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_597w9_13{transform:rotate(45deg)}._overview_597w9_17{grid-area:overview;font-size:calc(1rem - 2px);display:flex;overflow:hidden}._isOffline_597w9_24 ._info_597w9_24{opacity:.4}._isOffline_597w9_24:after{content:"Disconnected";z-index:1000;background-color:#d20300;border-radius:2px;padding-left:.5rem;padding-right:.5rem;font-size:calc(1rem - 2px);position:absolute;bottom:.5rem;right:.5rem}._nav_597w9_39{align-items:center;gap:.5rem;display:flex}._info_597w9_24{justify-content:space-between;align-items:center;width:max-content;height:100%;padding-left:1rem;display:flex}._infoScroll_597w9_54{flex:1;min-width:0;height:100%}._inline_597w9_60{align-items:center;gap:1rem;display:flex}\n/*$vite$:1*/',document.head.appendChild($),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]="ed44060f-34e2-46f2-a993-705ae88c74e3",e._sentryDebugIdIdentifier="sentry-dbid-ed44060f-34e2-46f2-a993-705ae88c74e3")}catch(e){}}(),k={blink:"_blink_1tt3s_1",fourtyfive:"_fourtyfive_1tt3s_13",titleOverview:"_titleOverview_1tt3s_17",project:"_project_1tt3s_27",rundown:"_rundown_1tt3s_28"},I=H(),W=o(),D=r(n(),1),L=D.createContext(void 0),F=function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e}({}),U=function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e}({}),q=function(e){return e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e}({}),B={hasOverflowX:e=>e?{[q.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[q.hasOverflowY]:""}:null,overflowXStart:e=>e?{[q.overflowXStart]:""}:null,overflowXEnd:e=>e?{[q.overflowXEnd]:""}:null,overflowYStart:e=>e?{[q.overflowYStart]:""}:null,overflowYEnd:e=>e?{[q.overflowYEnd]:""}:null,cornerHidden:()=>null},K={x:0,y:0},V={width:0,height:0},G={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},J={x:!0,y:!0,corner:!0},Q=D.forwardRef(function(e,t){const{render:r,className:n,overflowEdgeThreshold:o,style:a,...i}=e,{xStart:l,xEnd:s,yStart:f,yEnd:h}=function(e){if("number"==typeof e){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}(o),v=u(),_=d(),m=d(),{nonce:g,disableStyleElements:y}=b(),[x,S]=D.useState(!1),[R,z]=D.useState(!1),[j,P]=D.useState(!1),[Y,O]=D.useState(!1),[X,C]=D.useState(!1),[M,T]=D.useState(V),[A,H]=D.useState(V),[N,$]=D.useState(G),[k,I]=D.useState(J),q=D.useRef(null),Q=D.useRef(null),Z=D.useRef(null),ee=D.useRef(null),te=D.useRef(null),re=D.useRef(null),ne=D.useRef(null),oe=D.useRef(!1),ae=D.useRef(0),ie=D.useRef(0),le=D.useRef(0),se=D.useRef(0),ce=D.useRef("vertical"),de=D.useRef(K),ue=p(e=>{const t=e.x-de.current.x,r=e.y-de.current.y;de.current=e,0!==r&&(P(!0),_.start(500,()=>{P(!1)})),0!==t&&(z(!0),m.start(500,()=>{z(!1)}))}),fe=p(e=>{0===e.button&&(oe.current=!0,ae.current=e.clientY,ie.current=e.clientX,ce.current=e.currentTarget.getAttribute(U.orientation),Q.current&&(le.current=Q.current.scrollTop,se.current=Q.current.scrollLeft),te.current&&"vertical"===ce.current&&te.current.setPointerCapture(e.pointerId),re.current&&"horizontal"===ce.current&&re.current.setPointerCapture(e.pointerId))}),he=p(e=>{if(!oe.current)return;const t=e.clientY-ae.current,r=e.clientX-ie.current;if(Q.current){const n=Q.current.scrollHeight,o=Q.current.clientHeight,a=Q.current.scrollWidth,i=Q.current.clientWidth;if(te.current&&Z.current&&"vertical"===ce.current){const r=we(Z.current,"padding","y"),a=we(te.current,"margin","y"),i=te.current.offsetHeight,l=t/(Z.current.offsetHeight-i-r-a);Q.current.scrollTop=le.current+l*(n-o),e.preventDefault(),P(!0),_.start(500,()=>{P(!1)})}if(re.current&&ee.current&&"horizontal"===ce.current){const t=we(ee.current,"padding","x"),n=we(re.current,"margin","x"),o=re.current.offsetWidth,l=r/(ee.current.offsetWidth-o-t-n);Q.current.scrollLeft=se.current+l*(a-i),e.preventDefault(),z(!0),m.start(500,()=>{z(!1)})}}}),ve=p(e=>{oe.current=!1,te.current&&"vertical"===ce.current&&te.current.hasPointerCapture(e.pointerId)&&te.current.releasePointerCapture(e.pointerId),re.current&&"horizontal"===ce.current&&re.current.hasPointerCapture(e.pointerId)&&re.current.releasePointerCapture(e.pointerId)});function pe(e){O("touch"===e.pointerType)}function _e(e){pe(e),"touch"!==e.pointerType&&S(c(q.current,e.target))}const me=D.useMemo(()=>({scrolling:R||j,hasOverflowX:!k.x,hasOverflowY:!k.y,overflowXStart:N.xStart,overflowXEnd:N.xEnd,overflowYStart:N.yStart,overflowYEnd:N.yEnd,cornerHidden:k.corner}),[R,j,k.x,k.y,k.corner,N]),ge={role:"presentation",onPointerEnter:_e,onPointerMove:_e,onPointerDown:pe,onPointerLeave(){S(!1)},style:{position:"relative",[F.scrollAreaCornerHeight]:`${M.height}px`,[F.scrollAreaCornerWidth]:`${M.width}px`}},ye=w("div",e,{state:me,ref:[t,q],props:[ge,i],stateAttributesMapping:B}),xe=D.useMemo(()=>({handlePointerDown:fe,handlePointerMove:he,handlePointerUp:ve,handleScroll:ue,cornerSize:M,setCornerSize:T,thumbSize:A,setThumbSize:H,hasMeasuredScrollbar:X,setHasMeasuredScrollbar:C,touchModality:Y,cornerRef:ne,scrollingX:R,setScrollingX:z,scrollingY:j,setScrollingY:P,hovering:x,setHovering:S,viewportRef:Q,rootRef:q,scrollbarYRef:Z,scrollbarXRef:ee,thumbYRef:te,thumbXRef:re,rootId:v,hiddenState:k,setHiddenState:I,overflowEdges:N,setOverflowEdges:$,viewportState:me,overflowEdgeThreshold:{xStart:l,xEnd:s,yStart:f,yEnd:h}}),[fe,he,ve,ue,M,A,X,Y,R,z,j,P,x,S,v,k,N,me,l,s,f,h]);return(0,W.jsxs)(L.Provider,{value:xe,children:[!y&&E.getElement(g),ye]})}),Z=D.createContext(void 0),ee=function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e}({}),te=!1,re=D.forwardRef(function(e,t){const{render:r,className:n,style:o,...a}=e,{viewportRef:i,scrollbarYRef:l,scrollbarXRef:c,thumbYRef:u,thumbXRef:f,cornerRef:h,cornerSize:_,setCornerSize:g,setThumbSize:y,rootId:b,setHiddenState:R,hiddenState:z,setHasMeasuredScrollbar:j,handleScroll:P,setHovering:Y,setOverflowEdges:O,overflowEdges:X,overflowEdgeThreshold:C,scrollingX:M,scrollingY:T}=ve(),A=m(),H=D.useRef(!0),N=D.useRef([NaN,NaN,NaN,NaN]),$=d(),k=d(),I=p(()=>{const e=i.current,t=l.current,r=c.current,n=u.current,o=f.current,a=h.current;if(!e)return;const s=e.scrollHeight,d=e.scrollWidth,v=e.clientHeight,w=e.clientWidth,p=e.scrollTop,m=e.scrollLeft,b=N.current,E=Number.isNaN(b[0]);if(b[0]=v,b[1]=s,b[2]=w,b[3]=d,E&&j(!0),0===s||0===d)return;const z=function(e){const t=e.clientHeight>=e.scrollHeight,r=e.clientWidth>=e.scrollWidth;return{y:t,x:r,corner:t||r}}(e),P=z.y,Y=z.x,X=w/d,M=v/s,T=Math.max(0,d-w),H=Math.max(0,s-v);let $=0,k=0;if(!Y){let e=0;e=S("rtl"===A?-m:m,0,T),$=x(e,T),k=T-$}const I=P?0:S(p,0,H),W=P?0:x(I,H),D=P?0:H-W,L=Y?0:w,F=P?0:v;let U=0,q=0;Y||P||(U=t?.offsetWidth||0,q=r?.offsetHeight||0);const B=0===_.width&&0===_.height,K=B?U:0,V=B?q:0,G=we(r,"padding","x"),J=we(t,"padding","y"),Q=we(o,"margin","x"),Z=we(n,"margin","y"),te=L-G-Q,re=F-J-Z,ne=r?Math.min(r.offsetWidth-K,te):te,oe=t?Math.min(t.offsetHeight-V,re):re,ae=Math.max(16,ne*X),ie=Math.max(16,oe*M);if(y(e=>e.height===ie&&e.width===ae?e:{width:ae,height:ie}),t&&n){const e=t.offsetHeight-ie-J-Z,r=s-v,o=0===r?0:p/r,a=Math.min(e,Math.max(0,o*e));n.style.transform=`translate3d(0,${a}px,0)`}if(r&&o){const e=r.offsetWidth-ae-G-Q,t=d-w,n=0===t?0:m/t,a="rtl"===A?S(n*e,-e,0):S(n*e,0,e);o.style.transform=`translate3d(${a}px,0,0)`}const le=[[ee.scrollAreaOverflowXStart,$],[ee.scrollAreaOverflowXEnd,k],[ee.scrollAreaOverflowYStart,W],[ee.scrollAreaOverflowYEnd,D]];for(const[i,l]of le)e.style.setProperty(i,`${l}px`);a&&(Y||P?g({width:0,height:0}):Y||P||g({width:U,height:q})),R(e=>function(e,t){return e.y===t.y&&e.x===t.x&&e.corner===t.corner?e:t}(e,z));const se={xStart:!Y&&$>C.xStart,xEnd:!Y&&k>C.xEnd,yStart:!P&&W>C.yStart,yEnd:!P&&D>C.yEnd};O(e=>e.xStart===se.xStart&&e.xEnd===se.xEnd&&e.yStart===se.yStart&&e.yEnd===se.yEnd?e:se)});function L(){H.current=!1}s(()=>{i.current&&(te||v||("undefined"!=typeof CSS&&"registerProperty"in CSS&&[ee.scrollAreaOverflowXStart,ee.scrollAreaOverflowXEnd,ee.scrollAreaOverflowYStart,ee.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),te=!0))},[i]),s(()=>{queueMicrotask(I)},[I,z,A,C.xStart,C.xEnd,C.yStart,C.yEnd]),s(()=>{i.current?.matches(":hover")&&Y(!0)},[i,Y]),s(()=>{const e=i.current;if("undefined"==typeof ResizeObserver||!e)return;let t=!1;const r=new ResizeObserver(()=>{if(!t){t=!0;const r=N.current;if(r[0]===e.clientHeight&&r[1]===e.scrollHeight&&r[2]===e.clientWidth&&r[3]===e.scrollWidth)return}I()});return r.observe(e),k.start(0,()=>{const t=e.getAnimations({subtree:!0});0!==t.length&&Promise.allSettled(t.map(e=>e.finished)).then(I).catch(()=>{})}),()=>{r.disconnect(),k.clear()}},[I,i,k]);const F={role:"presentation",...b&&{"data-id":`${b}-viewport`},tabIndex:z.x&&z.y?-1:0,className:E.className,style:{overflow:"scroll"},onScroll(){i.current&&(I(),H.current||P({x:i.current.scrollLeft,y:i.current.scrollTop}),$.start(100,()=>{H.current=!0}))},onWheel:L,onTouchMove:L,onPointerMove:L,onPointerEnter:L,onKeyDown:L},U=D.useMemo(()=>({scrolling:M||T,hasOverflowX:!z.x,hasOverflowY:!z.y,overflowXStart:X.xStart,overflowXEnd:X.xEnd,overflowYStart:X.yStart,overflowYEnd:X.yEnd,cornerHidden:z.corner}),[M,T,z.x,z.y,z.corner,X]),q=w("div",e,{ref:[t,i],state:U,props:[F,a],stateAttributesMapping:B}),K=D.useMemo(()=>({computeThumbPosition:I}),[I]);return(0,W.jsx)(Z.Provider,{value:K,children:q})}),ne=D.createContext(void 0),oe=function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e}({}),ae=D.forwardRef(function(e,t){const{render:r,className:n,orientation:o="vertical",keepMounted:a=!1,style:i,...l}=e,{hovering:s,scrollingX:d,scrollingY:u,hiddenState:f,overflowEdges:v,scrollbarYRef:p,scrollbarXRef:g,viewportRef:y,thumbYRef:x,thumbXRef:b,handlePointerDown:S,handlePointerUp:E,handleScroll:R,rootId:z,thumbSize:j,hasMeasuredScrollbar:P}=ve(),Y={hovering:s,scrolling:{horizontal:d,vertical:u}[o],orientation:o,hasOverflowX:!f.x,hasOverflowY:!f.y,overflowXStart:v.xStart,overflowXEnd:v.xEnd,overflowYStart:v.yStart,overflowYEnd:v.yEnd,cornerHidden:f.corner},O=m(),X=!P&&!a,C="vertical"===o?f.y:f.x,M=a||!C;D.useEffect(()=>{if(!M)return;const e=y.current,t="vertical"===o?p.current:g.current;return t?_(t,"wheel",function(r){if(!e||!t||r.ctrlKey)return;const n="horizontal"===o,a=n?"scrollLeft":"scrollTop",i=n?r.deltaX:r.deltaY;if(0===i)return;const l=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,s=n&&"rtl"===O?-l:0,c=n&&"rtl"===O?0:l,d=e[a];d<=s&&i<0||d>=c&&i>0||(r.preventDefault(),e[a]=Math.min(c,Math.max(s,d+i)),R({x:e.scrollLeft,y:e.scrollTop}))},{passive:!1}):void 0},[O,R,o,g,p,M,y]);const T={...z&&{"data-id":`${z}-scrollbar`},onPointerDown(e){if(0!==e.button)return;const t=h(e.nativeEvent),r="vertical"===o?x.current:b.current;if((!r||!c(r,t))&&y.current){if(x.current&&p.current&&"vertical"===o){const t=we(x.current,"margin","y"),r=we(p.current,"padding","y"),n=x.current.offsetHeight,o=p.current.getBoundingClientRect(),a=e.clientY-o.top-n/2-r+t/2,i=y.current.scrollHeight,l=y.current.clientHeight,s=a/(p.current.offsetHeight-n-r-t)*(i-l);y.current.scrollTop=s}if(b.current&&g.current&&"horizontal"===o){const t=we(b.current,"margin","x"),r=we(g.current,"padding","x"),n=b.current.offsetWidth,o=g.current.getBoundingClientRect(),a=e.clientX-o.left-n/2-r+t/2,i=y.current.scrollWidth,l=y.current.clientWidth,s=a/(g.current.offsetWidth-n-r-t);let c;"rtl"===O?(c=(1-s)*(i-l),y.current.scrollLeft<=0&&(c=-c)):c=s*(i-l),y.current.scrollLeft=c}R({x:y.current.scrollLeft,y:y.current.scrollTop}),S(e)}},onPointerUp:E,onPointerCancel:E,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:X?"hidden":void 0,..."vertical"===o&&{top:0,bottom:`var(${F.scrollAreaCornerHeight})`,insetInlineEnd:0,[oe.scrollAreaThumbHeight]:`${j.height}px`},..."horizontal"===o&&{insetInlineStart:0,insetInlineEnd:`var(${F.scrollAreaCornerWidth})`,bottom:0,[oe.scrollAreaThumbWidth]:`${j.width}px`}}},A=w("div",e,{ref:[t,"vertical"===o?p:g],state:Y,props:[T,l],stateAttributesMapping:B}),H=D.useMemo(()=>({orientation:o}),[o]);return M?(0,W.jsx)(ne.Provider,{value:H,children:A}):null}),ie=D.forwardRef(function(e,t){const{render:r,className:n,style:o,...a}=e,{computeThumbPosition:i}=function(){const e=D.useContext(Z);if(void 0===e)throw new Error(f(55));return e}(),{hasMeasuredScrollbar:l,viewportState:c}=ve(),d=D.useRef(null),u=D.useRef(l);return s(()=>{if("undefined"==typeof ResizeObserver)return;let e=!1;const t=new ResizeObserver(()=>{(e||(e=!0,u.current))&&i()});return d.current&&t.observe(d.current),()=>{t.disconnect()}},[i]),w("div",e,{ref:[t,d],state:c,stateAttributesMapping:B,props:[{role:"presentation",style:{minWidth:"fit-content"}},a]})}),le=D.forwardRef(function(e,t){const{render:r,className:n,style:o,...a}=e,{thumbYRef:i,thumbXRef:l,handlePointerDown:s,handlePointerMove:c,handlePointerUp:d,setScrollingX:u,setScrollingY:h,scrollingX:v,scrollingY:p,hasMeasuredScrollbar:_}=ve(),{orientation:m}=function(){const e=D.useContext(ne);if(void 0===e)throw new Error(f(54));return e}();function g(e){"vertical"===m&&h(!1),"horizontal"===m&&u(!1),d(e)}return w("div",e,{ref:[t,"vertical"===m?i:l],state:{scrolling:"horizontal"===m?v:p,orientation:m},props:[{onPointerDown:s,onPointerMove:c,onPointerUp:g,onPointerCancel:g,style:{visibility:_?void 0:"hidden",..."vertical"===m&&{height:`var(${oe.scrollAreaThumbHeight})`},..."horizontal"===m&&{width:`var(${oe.scrollAreaThumbWidth})`}}},a]})}),se={blink:"_blink_1z0ax_1",fourtyfive:"_fourtyfive_1z0ax_13",root:"_root_1z0ax_17",viewport:"_viewport_1z0ax_22",scrollbar:"_scrollbar_1z0ax_32",thumb:"_thumb_1z0ax_55"},e("g",ce={blink:"_blink_597w9_1",fourtyfive:"_fourtyfive_597w9_13",overview:"_overview_597w9_17",isOffline:"_isOffline_597w9_24",info:"_info_597w9_24",nav:"_nav_597w9_39",infoScroll:"_infoScroll_597w9_54",inline:"_inline_597w9_60"}),de=`${P}/db`,ue={files:[],lastLoadedProject:""},fe={"alphabetical-asc":(e,t)=>e.filename.localeCompare(t.filename),"alphabetical-desc":(e,t)=>t.filename.localeCompare(e.filename),"modified-asc":(e,t)=>new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime(),"modified-desc":(e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()},e("t",he="__follow-loaded__")}}});
//# sourceMappingURL=useCuesheetRundownSelection-legacy-BPYx6P_A.js.map