@getontime/cli
Version:
Time keeping for live events
2 lines • 177 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","./SwatchPicker-legacy-DpR2sNl5.js","./NavigationMenu-legacy-AAR54e_T.js","./use-local-storage-legacy-Xbm6tq51.js","./GenerateLinkFormExport-legacy-BXqi2OlY.js","./DelayIndicator-legacy-CnsTYEkX.js","./EmptyFill-legacy-CZaM-mIh.js","./parseUserTime-legacy-BAw2X6qu.js","./useRundown-legacy-zes2lKPp.js","./Input-legacy-CNt711cd.js","./index-legacy-NWDCUII5.js","./Info-legacy-6yM0-oGU.js","./Modal-legacy-CjFHV5U2.js","./tb-legacy-C5yyMA4Y.js","./EditorUtils-legacy-CWdX_BN4.js","./AppLink-legacy-CNq__WK8.js","./Empty-legacy-ZRfHevNV.js","./editorSettings-legacy-Bzf9rUwb.js","./offset-legacy-DV3hCcrF.js","./useCustomFields-legacy-B9FQxHWS.js"],function(e,t){var n,o,i,l,r,a,s,d,u,c,g,m,f,p,h,v,b,_,x,y,w,C,S,R,k,j,E,I,D,M,N,F,z,P,T,V,L,A,O,H,G,B,U,q,W,K,$,X,Y,J,Q,Z,ee,te,ne,oe,ie,le,re,ae,se,de,ue,ce,ge,me,fe,pe,he,ve,be,_e,xe,ye,we,Ce,Se,Re,ke,je,Ee,Ie,De,Me,Ne,Fe,ze,Pe,Te,Ve,Le,Ae,Oe,He,Ge,Be,Ue,qe,We,Ke,$e,Xe,Ye,Je,Qe,Ze,et,tt,nt,ot,it,lt,rt,at,st,dt,ut,ct,gt,mt,ft,pt,ht,vt,bt,_t,xt,yt,wt,Ct,St,Rt,kt,jt,Et,It,Dt,Mt,Nt,Ft,zt,Pt,Tt,Vt,Lt,At,Ot,Ht,Gt,Bt,Ut,qt,Wt,Kt,$t,Xt,Yt,Jt,Qt,Zt,en,tn,nn,on,ln,rn,an,sn,dn,un,cn,gn,mn,fn,pn,hn,vn,bn,_n,xn,yn,wn,Cn,Sn,Rn,kn,jn,En,In,Dn,Mn,Nn,Fn,zn,Pn,Tn,Vn,Ln,An,On,Hn,Gn,Bn,Un,qn,Wn,Kn,$n,Xn,Yn,Jn,Qn,Zn,eo,to,no,oo,io,lo,ro,ao,so,uo,co,go,mo,fo,po,ho,vo,bo,_o,xo,yo,wo,Co,So,Ro,ko,jo,Eo,Io,Do,Mo,No,Fo,zo,Po,To,Vo,Lo,Ao,Oo,Ho,Go,Bo,Uo,qo,Wo,Ko,$o,Xo,Yo,Jo,Qo,Zo,ei,ti,ni,oi;function ii(){const e=(0,Ye.useContext)(Qe);if(!e)throw new Error("useEntryActionsContext must be used within EntryActionsProvider");return e}function li(e,t){const n=null!==e&&e===t,o=x(),i=n?o:null,{data:l,status:r}=Me(e),a=(0,Ye.useMemo)(()=>De(l,i),[i,l]);return(0,Ye.useMemo)(()=>({rundownId:e,rundown:l,flatRundown:a,status:r,selectedEventId:i}),[i,a,l,e,r])}function ri({src:e}){return(0,Je.jsxs)("div",{className:Ze.imageContainer,children:[Boolean(e)&&(0,Je.jsx)("img",{loading:"lazy",src:e}),(0,Je.jsx)("div",{className:Ze.imageOverlay})]})}function ai({value:e,inputref:t,...n}){return(0,Ye.useEffect)(()=>{const e=t.current;return(0,et.default)(t.current),()=>{et.default.destroy(e)}},[t,e]),(0,Je.jsx)(We,{ref:t,value:e,...n})}function si(e,t,n,o){const[i,l]=(0,Ye.useState)(e),r=(0,Ye.useRef)(!1),a=(0,Ye.useRef)(!1),s=(0,Ye.useRef)(!1);(0,Ye.useEffect)(()=>{l(void 0===e?"":e)},[e]);const d=(0,Ye.useCallback)(e=>{e!==i&&l(e)},[i]),u=(0,Ye.useCallback)(i=>{if(i!==e||o?.allowSubmitSameValue){const e=i.trim();t(e),e!==i&&l(e)}else o?.onCancelUpdate?.();setTimeout(()=>{o?.allowKeyboardNavigation?n.current?.parentElement?.focus():n.current?.blur()})},[e,o,n,t]),c=(0,Ye.useCallback)(()=>{a.current=!0,l(e),n.current&&(n.current.value=e),o?.onCancelUpdate?.(),setTimeout(()=>n.current?.blur())},[e,o,n]);return{value:i,onChange:e=>d(e.target.value),onBlur:e=>{if(s.current)return s.current=!1,void(o?.onTabCancel??o?.onCancelUpdate)?.();a.current?a.current=!1:r.current||u(e.target.value)},onKeyDown:(0,Ye.useMemo)(()=>{const e=[["Escape",e=>{e.preventDefault(),c()},{preventDefault:!0}]];o?.submitOnEnter&&e.push(["Enter",()=>{r.current=!0,u(i),setTimeout(()=>{r.current=!1},0)}]),o?.submitOnCtrlEnter&&e.push(["mod + Enter",()=>{r.current=!0,u(i),setTimeout(()=>{r.current=!1},0)}]);const t=fe(e);return e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.stopPropagation(),"Tab"===e.key&&!1===o?.submitOnTab&&(s.current=!0),t(e)}},[c,u,o?.submitOnCtrlEnter,o?.submitOnEnter,o?.submitOnTab,i])}}function di({className:e,field:t,label:n,initialValue:o,style:i,submitHandler:l}){const r=(0,Ye.useRef)(null),{value:a,onChange:s,onBlur:d,onKeyDown:u}=si(o,(0,Ye.useCallback)(e=>l(t,e),[t,l]),r,{submitOnCtrlEnter:!0});return(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{className:e,htmlFor:t,style:i,children:n}),(0,Je.jsx)(ai,{id:t,inputref:r,rows:1,"data-testid":"input-textarea",fluid:!0,value:a,onChange:s,onBlur:d,onKeyDown:u})]})}function ui({className:e,field:t,label:n,initialValue:o,style:i,submitHandler:l,maxLength:r,placeholder:a}){const s=(0,Ye.useRef)(null),{value:d,onChange:u,onBlur:c,onKeyDown:g}=si(o,(0,Ye.useCallback)(e=>l(t,e),[t,l]),s,{submitOnEnter:!0});return(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{className:e,htmlFor:t,style:i,children:n}),(0,Je.jsx)(ze,{id:t,ref:s,maxLength:r,fluid:!0,"data-testid":"input-textfield",value:d,placeholder:a,onChange:u,onBlur:c,onKeyDown:g})]})}function ci({fields:e,handleSubmit:t,entry:n}){return(0,Je.jsx)(Ye.Fragment,{children:Object.keys(e).map(o=>{const i=`${n.id}-${o}`,l=`custom-${o}`,r=n.custom[o]??"",{backgroundColor:a,color:s}=ie(e[o].colour),d=e[o].label;return"text"===e[o].type?(0,Je.jsx)(di,{field:l,label:d,initialValue:r,submitHandler:t,className:tt.decorated,style:{"--decorator-bg":a,"--decorator-color":s}},i):"image"===e[o].type?(0,Je.jsxs)("div",{className:tt.customImage,children:[(0,Je.jsx)(ui,{field:l,label:d,initialValue:r,placeholder:"Paste image URL",submitHandler:t,className:tt.decorated,maxLength:255,style:{"--decorator-bg":a,"--decorator-color":s}},i),(0,Je.jsx)(ri,{src:r})]},i):null})})}function gi({hasDelay:e,children:t}){return(0,Je.jsx)("div",{className:U([nt.inputGroup,e&&nt.delayed]),children:t})}function mi({eventId:e,timeStart:t,timeEnd:n,duration:o,timeStrategy:i,linkStart:l,delay:r,showLabels:a,showWarnings:s=!0}){const{updateEntry:d,updateTimer:u}=ii(),g=(t,n)=>{u(e,t,n)},m=t=>{d({id:e,timeStrategy:t})},f=[];t+o>864e5&&f.push("Over midnight");const p=0!==r,h=i===c.LockEnd,v=i===c.LockDuration;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)("div",{className:ot.inputWrapper,children:[a&&(0,Je.jsx)(Ae,{className:ot.sectionTitle,children:"Start time"}),(0,Je.jsx)(Ae,{className:ot.hoverLabel,children:"Start"}),(0,Je.jsxs)(gi,{hasDelay:p,children:[(0,Je.jsx)(Ge,{name:"timeStart",submitHandler:g,time:t,placeholder:"Start",align:"left",disabled:l,shouldFormat:!0}),(0,Je.jsx)(z,{text:"Link start to previous end",onClick:()=>{d({id:e,linkStart:!l})},render:(0,Je.jsx)(Fe,{variant:"subtle-white",className:l?ot.active:ot.inactive}),children:(0,Je.jsx)("span",{className:ot.fourtyfive,children:l?(0,Je.jsx)(K,{}):(0,Je.jsx)(oe,{})})})]})]}),(0,Je.jsxs)("div",{className:ot.inputWrapper,children:[a&&(0,Je.jsx)(Ae,{children:"End time"}),(0,Je.jsx)(Ae,{className:ot.hoverLabel,children:"End"}),(0,Je.jsxs)(gi,{hasDelay:p,children:[(0,Je.jsx)(Ge,{name:"timeEnd",submitHandler:g,time:n,placeholder:"End",align:"left",disabled:v,shouldFormat:!0}),(0,Je.jsx)(z,{text:"Lock end",render:(0,Je.jsx)(Fe,{variant:"subtle-white",className:h?ot.active:ot.inactive}),onClick:()=>m(c.LockEnd),"data-testid":"lock__end",children:h?(0,Je.jsx)(X,{}):(0,Je.jsx)($,{})})]})]}),(0,Je.jsxs)("div",{className:ot.inputWrapper,children:[a&&(0,Je.jsx)(Ae,{children:"Duration"}),(0,Je.jsx)(Ae,{className:ot.hoverLabel,children:"Duration"}),(0,Je.jsxs)(gi,{hasDelay:p,children:[(0,Je.jsx)(Ge,{name:"duration",submitHandler:g,time:o,placeholder:"Duration",align:"left",disabled:h}),(0,Je.jsx)(z,{text:"Lock duration",render:(0,Je.jsx)(Fe,{variant:"subtle-white",className:v?ot.active:ot.inactive}),onClick:()=>m(c.LockDuration),"data-testid":"lock__duration",children:v?(0,Je.jsx)(X,{}):(0,Je.jsx)($,{})})]})]}),s&&(f.length>0?(0,Je.jsx)(z,{text:f.join(" - "),className:ot.timerNote,"data-testid":"event-warning",render:(0,Je.jsx)("span",{}),children:(0,Je.jsx)(te,{})}):(0,Je.jsx)("span",{className:`${ot.timerNote} ${ot.timerNotePlaceholder}`,"aria-hidden":"true"}))]})}function fi({eventId:e,timeStart:t,timeEnd:n,duration:o,timeStrategy:i,linkStart:l,countToEnd:a,delay:s,endAction:d,timerType:u,timeWarning:c,timeDanger:g}){const{updateEntry:m}=ii(),f=(t,n)=>{if("countToEnd"!==t){if("timeWarning"===t||"timeDanger"===t){const o=Ie(n);return void m({id:e,[t]:o})}"timerType"!==t&&"endAction"!==t||m({id:e,[t]:n})}else m({id:e,countToEnd:n})},p=0!==s,v=w(t+s),b=w(n+s),_=p?`Event is ${ke(s,"expanded")}. New schedule ${r(v)} → ${r(b)}`:"";return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsx)(He,{children:"Event schedule"}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)("div",{className:tt.inline,children:(0,Je.jsx)(it,{eventId:e,timeStart:t,timeEnd:n,duration:o,timeStrategy:i,linkStart:l,delay:s,showLabels:!0})}),(0,Je.jsx)("div",{className:tt.delayLabel,children:_})]})]}),(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsx)(He,{children:"Event Behaviour"}),(0,Je.jsxs)("div",{className:tt.splitTwo,children:[(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"endAction",children:"End Action"}),(0,Je.jsx)(O,{value:d,onValueChange:e=>{null!==e&&f("endAction",e)},options:[{value:h.None,label:"None"},{value:h.LoadNext,label:"Load next event"},{value:h.PlayNext,label:"Play next event"}]})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"countToEnd",children:"Count to End"}),(0,Je.jsxs)(Ae,{className:tt.switchLabel,children:[(0,Je.jsx)(se,{id:"countToEnd",checked:a,onCheckedChange:e=>f("countToEnd",e)}),a?"On":"Off"]})]})]})]}),(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsx)(He,{children:(0,Je.jsxs)(z,{text:"Changes how the timer is displayed in different views. It is not reflected in the rundown",render:(0,Je.jsx)("span",{}),children:["Display Options",(0,Je.jsx)(q,{className:tt.tooltipIcon})]})}),(0,Je.jsxs)("div",{className:tt.splitTwo,children:[(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"timerType",children:"Timer Type"}),(0,Je.jsx)(O,{value:u,onValueChange:e=>{null!==e&&f("timerType",e)},options:[{value:y.CountDown,label:"Count down"},{value:y.CountUp,label:"Count up"},{value:y.Clock,label:"Clock"},{value:y.None,label:"None"}]})]}),(0,Je.jsxs)("div",{className:tt.inline,children:[(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"timeWarning",children:"Warning Time"}),(0,Je.jsx)(Ge,{id:"timeWarning",name:"timeWarning",submitHandler:f,time:c,placeholder:"Duration"})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"timeDanger",children:"Danger Time"}),(0,Je.jsx)(Ge,{id:"timeDanger",name:"timeDanger",submitHandler:f,time:g,placeholder:"Duration"})]})]})]})]})]})}function pi({eventId:e,cue:t,flag:n,title:o,note:i,colour:l}){const{updateEntry:r}=ii(),a=(t,n)=>{r({id:e,[t]:n})};return(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsx)(He,{children:"Event Data"}),(0,Je.jsxs)("div",{className:tt.splitThree,children:[(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"eventId",children:"Event ID (read only)"}),(0,Je.jsx)(ze,{id:"eventId","data-testid":"input-textfield",value:e,readOnly:!0,fluid:!0})]}),(0,Je.jsx)(ui,{field:"cue",label:"Cue",initialValue:t,submitHandler:a,maxLength:10}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"flag",children:"Flag"}),(0,Je.jsxs)(Ae,{className:tt.switchLabel,children:[(0,Je.jsx)(se,{id:"flag",checked:n,onCheckedChange:t=>{r({id:e,flag:t})}}),n?"On":"Off"]})]})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{children:"Colour"}),(0,Je.jsx)(ve,{name:"colour",value:l,handleChange:a})]}),(0,Je.jsx)(ui,{field:"title",label:"Title",initialValue:o,submitHandler:a}),(0,Je.jsx)(di,{field:"note",label:"Note",initialValue:i,submitHandler:a})]})}function hi({triggers:e,eventId:t}){const{data:n,status:o}=he(),{updateEntry:i}=ii(),l="pending"===o?void 0:n.enabledAutomations,r=Object.values(n.automations).map(({id:e,title:t})=>({value:e,label:t})),a=r.length>0,s=at.map(e=>({value:e,label:e})),d=new Set,u=new Map;for(const g of e){const e=`${g.trigger}:${g.automationId}`;u.has(e)?d.add(g.id):u.set(e,g.id)}const c=(n,o,l)=>{i({id:t,triggers:e.map(e=>e.id!==n?e:{...e,[o]:l})})};return(0,Je.jsxs)("div",{className:st.triggers,children:[!1===l&&(0,Je.jsx)(Te,{children:"Automations are disabled. Event triggers stay configured, but they will not run until enabled."}),l&&!a&&(0,Je.jsxs)(Te,{children:[(0,Je.jsx)(Te.Title,{children:"No automations available"}),(0,Je.jsx)(Te.Body,{children:"Create an automation before attaching it to this event."})]}),e.length>0&&(0,Je.jsxs)("div",{className:st.triggerList,children:[(0,Je.jsxs)("div",{className:st.triggerHeader,children:[(0,Je.jsx)("span",{children:"Lifecycle"}),(0,Je.jsx)("span",{children:"Automation"})]}),e.map(n=>{const o=d.has(n.id),l=o?s.map(e=>e.value===n.trigger?{...e,label:`${e.label} *`}:e):s,a=o?r.map(e=>e.value===n.automationId?{...e,label:`${e.label} *`}:e):r;return(0,Je.jsxs)("div",{className:st.trigger,"data-duplicate":o||void 0,children:[(0,Je.jsx)(O,{value:n.trigger,onValueChange:e=>{null!==e&&c(n.id,"trigger",e)},options:l}),(0,Je.jsx)(O,{value:n.automationId,onValueChange:e=>{null!==e&&c(n.id,"automationId",e)},options:a}),(0,Je.jsx)(Fe,{variant:"ghosted-destructive",onClick:()=>{return o=n.id,void i({id:t,triggers:e.filter(e=>e.id!==o)});var o},children:(0,Je.jsx)(ee,{})})]},n.id)})]}),d.size>0&&(0,Je.jsx)("span",{className:st.duplicateMessage,children:"* Duplicate combinations will only fire once per lifecycle event."}),a&&(0,Je.jsxs)(N,{variant:"ghosted",onClick:()=>{a&&i({id:t,triggers:[...e,{id:S(),title:"",trigger:at[0],automationId:r[0].value}]})},children:[(0,Je.jsx)(W,{})," Add automation"]})]})}function vi({event:e}){const{data:t}=$e(),{updateEntry:n}=ii(),o=window.location.pathname.includes("editor"),i=(0,Ye.useCallback)((t,o)=>{if(t.startsWith("custom-")){const i=t.split("custom-")[1];n({id:e.id,custom:{[i]:o}})}else n({id:e.id,[t]:o})},[e.id,n]);return(0,Je.jsxs)("div",{className:tt.content,children:[(0,Je.jsx)(lt,{eventId:e.id,timeStart:e.timeStart,timeEnd:e.timeEnd,duration:e.duration,timeStrategy:e.timeStrategy,linkStart:e.linkStart,countToEnd:e.countToEnd,delay:e.delay,endAction:e.endAction,timerType:e.timerType,timeWarning:e.timeWarning,timeDanger:e.timeDanger},`${e.id}-times`),(0,Je.jsx)(rt,{eventId:e.id,cue:e.cue,flag:e.flag,title:e.title,note:e.note,colour:e.colour},`${e.id}-titles`),(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsxs)(He,{children:["Custom Fields",o&&(0,Je.jsx)(Ue,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),(0,Je.jsx)(ci,{fields:t,handleSubmit:i,entry:e})]}),(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsxs)(He,{children:["Automations",o&&(0,Je.jsx)(Ue,{search:"settings=automation",children:"Manage Automations"})]}),(0,Je.jsx)(hi,{triggers:e.triggers,eventId:e.id})]})]})}function bi({id:e,name:t,submitHandler:n,time:o,emptyDisplay:i,placeholder:l,disabled:r,align:a="center",className:s}){const d=(0,Ye.useRef)(null),[u,c]=(0,Ye.useState)(""),g=(0,Ye.useRef)(!1),m=(0,Ye.useCallback)(()=>{"number"!=typeof o||isNaN(o)?c(i):c(b(o))},[i,o]),f=(0,Ye.useCallback)(()=>{d.current?.select()},[]),p=(0,Ye.useCallback)(e=>{if(""===e&&null===o)return!1;const i=Ie(e);return i!==o&&(n(t,i),!0)},[t,n,o]),h=(0,Ye.useCallback)(e=>{p(e)||m()},[p,m]),v=(0,Ye.useCallback)(e=>{"Enter"===e.key&&d.current?.blur(),"Escape"===e.key&&(g.current=!0,d.current?.blur(),m())},[m]),_=(0,Ye.useCallback)(e=>{g.current?g.current=!1:h(e.target.value)},[h]);return(0,Ye.useEffect)(()=>{m()},[m]),(0,Je.jsx)(ze,{id:e,disabled:r,ref:d,"data-testid":`time-input-${t}`,className:U([Be.timeInput,s]),placeholder:l,onFocus:f,onChange:e=>c(e.target.value),onBlur:_,onKeyDown:v,value:u,maxLength:8,autoComplete:"off",style:{textAlign:a}})}function _i({duration:e,targetDuration:t,submitHandler:n}){const o=null!==t;return(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"targetDuration",children:"Target duration"}),(0,Je.jsxs)(gi,{hasDelay:o&&t!==e,children:[(0,Je.jsx)(bi,{name:"targetDuration",time:t,submitHandler:n,emptyDisplay:"–",className:o?"":tt.inactive}),(0,Je.jsx)(z,{text:"Lock to target duration",className:U([tt.timeAction,o&&tt.active]),onClick:()=>n("targetDuration",o?null:e),"data-testid":"lock__duration",render:(0,Je.jsx)(Fe,{variant:"subtle-white",className:o?tt.active:tt.inactive}),children:o?(0,Je.jsx)(X,{}):(0,Je.jsx)($,{})})]})]})}function xi({group:e}){const{data:t}=$e(),{updateEntry:n}=ii(),o=(0,Ye.useCallback)((t,o)=>{if("string"==typeof t&&t.startsWith("custom-")){const i=t.split("custom-")[1];return void n({id:e.id,custom:{[i]:o}})}return n("targetDuration"===t?{id:e.id,targetDuration:o}:{id:e.id,[t]:o})},[e.id,n]),i=window.location.pathname.includes("editor"),l=null===e.targetDuration?null:e.duration-e.targetDuration,a=null!==l?Ke(l):null;return(0,Je.jsxs)("div",{className:tt.content,children:[(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsx)(He,{children:"Group schedule"}),(0,Je.jsxs)("div",{className:tt.inline,children:[(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{children:"First event start"}),(0,Je.jsx)(ct,{className:tt.textLikeInput,disabled:!0,children:r(e.timeStart)})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{children:"Last event end"}),(0,Je.jsx)(ct,{className:tt.textLikeInput,disabled:!0,children:r(e.timeEnd)})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"duration",children:"Scheduled duration"}),(0,Je.jsx)(ct,{className:tt.textLikeInput,disabled:!0,children:b(e.duration,{fallback:"–"})})]})]}),(0,Je.jsxs)("div",{className:tt.inline,children:[(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"eventId",children:"Plan offset"}),(0,Je.jsxs)(ct,{offset:"under"===a?"over":a,className:U([tt.textLikeInput,null===l&&tt.inactive]),disabled:!0,children:[null!==l&&l>0?"+":"",b(l,{fallback:"–"})]})]}),(0,Je.jsx)(_i,{duration:e.duration,targetDuration:e.targetDuration,submitHandler:o})]})]}),(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsx)(He,{children:"Group data"}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{children:"Colour"}),(0,Je.jsx)(ve,{name:"colour",value:e.colour,handleChange:o})]}),(0,Je.jsx)(ui,{field:"title",label:"Title",initialValue:e.title,submitHandler:o}),(0,Je.jsx)(di,{field:"note",label:"Note",initialValue:e.note,submitHandler:o})]}),(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsxs)(He,{children:["Custom Fields",i&&(0,Je.jsx)(Ue,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),(0,Je.jsx)(ci,{fields:t,handleSubmit:o,entry:e})]})]})}function yi({milestone:e}){const{data:t}=$e(),{updateEntry:n}=ii(),o=(0,Ye.useCallback)((t,o)=>{if("string"==typeof t&&t.startsWith("custom-")){const i=t.split("custom-")[1];return void n({id:e.id,custom:{[i]:o}})}return n({id:e.id,[t]:o})},[e.id,n]),i=window.location.pathname.includes("editor");return(0,Je.jsxs)("div",{className:tt.content,children:[(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsx)(He,{children:"Milestone data"}),(0,Je.jsxs)("div",{className:tt.splitTwo,children:[(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{htmlFor:"entryId",children:"Milestone ID (read only)"}),(0,Je.jsx)(ze,{id:"entryId","data-testid":"input-textfield",value:e.id,readOnly:!0,fluid:!0})]}),(0,Je.jsx)(ui,{field:"cue",label:"Cue",initialValue:e.cue,submitHandler:o,maxLength:10})]}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)(Ae,{children:"Colour"}),(0,Je.jsx)(ve,{name:"colour",value:e.colour,handleChange:o})]}),(0,Je.jsx)(ui,{field:"title",label:"Title",initialValue:e.title,submitHandler:o}),(0,Je.jsx)(di,{field:"note",label:"Note",initialValue:e.note,submitHandler:o})]}),(0,Je.jsxs)("div",{className:tt.column,children:[(0,Je.jsxs)(He,{children:["Custom Fields",i&&(0,Je.jsx)(Ue,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),(0,Je.jsx)(ci,{fields:t,handleSubmit:o,entry:e})]})]})}function wi({entryId:e,rundown:t}){const n=(0,Ye.useMemo)(()=>0===t.order.length?null:t.entries[e]??null,[e,t.entries,t.order.length]);return f(n)?(0,Je.jsx)("div",{className:tt.entryEditor,"data-testid":"editor-container",children:(0,Je.jsx)(vi,{event:n})}):u(n)?(0,Je.jsx)("div",{className:tt.inModal,"data-testid":"editor-container",children:(0,Je.jsx)(yi,{milestone:n})}):s(n)?(0,Je.jsx)("div",{className:tt.inModal,"data-testid":"editor-container",children:(0,Je.jsx)(xi,{group:n})}):null}function Ci({rundown:e}){const t=gt(e=>e.selectedEntryId),n=gt(e=>e.clearSelection);return null===t?null:(0,Je.jsx)(Ve,{isOpen:!0,onClose:n,title:"Edit entry",showCloseButton:!0,bodyElements:(0,Je.jsx)(wi,{entryId:t,rundown:e})})}function Si(e){const t=Ye.useContext(pt);if(void 0===t&&!e)throw new Error(E(68));return t}function Ri(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function ki(e){return"nodeType"in e}function ji(e){var t,n;return e?Ri(e)?e:ki(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Ei(e){const{Document:t}=ji(e);return e instanceof t}function Ii(e){return!Ri(e)&&e instanceof ji(e).HTMLElement}function Di(e){return e instanceof ji(e).SVGElement}function Mi(e){return e?Ri(e)?e.document:ki(e)?Ei(e)?e:Ii(e)||Di(e)?e.ownerDocument:document:document:document}function Ni(e){const t=(0,Ye.useRef)(e);return St(()=>{t.current=e}),(0,Ye.useCallback)(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)},[])}function Fi(e,t){void 0===t&&(t=[e]);const n=(0,Ye.useRef)(e);return St(()=>{n.current!==e&&(n.current=e)},t),n}function zi(e,t){const n=(0,Ye.useRef)();return(0,Ye.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Pi(e){const t=Ni(e),n=(0,Ye.useRef)(null);return[n,(0,Ye.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Ti(e){const t=(0,Ye.useRef)();return(0,Ye.useEffect)(()=>{t.current=e},[e]),t.current}function Vi(e,t){return(0,Ye.useMemo)(()=>{if(t)return t;const n=null==Rt[e]?0:Rt[e]+1;return Rt[e]=n,e+"-"+n},[e,t])}function Li(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((t,n)=>{const o=Object.entries(n);for(const[i,l]of o){const n=t[i];null!=n&&(t[i]=n+e*l)}return t},{...t})}}function Ai(e){if(!e)return!1;const{KeyboardEvent:t}=ji(e.target);return t&&e instanceof t}function Oi(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=ji(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}function Hi(e){return e.matches(It)?e:e.querySelector(It)}function Gi(e){let{id:t,value:n}=e;return Ye.createElement("div",{id:t,style:Dt},n)}function Bi(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return Ye.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},n)}function Ui(e){let{announcements:t=zt,container:n,hiddenTextDescribedById:o,screenReaderInstructions:i=Ft}=e;const{announce:l,announcement:r}=function(){const[e,t]=(0,Ye.useState)("");return{announce:(0,Ye.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=Vi("DndLiveRegion"),[s,d]=(0,Ye.useState)(!1);if((0,Ye.useEffect)(()=>{d(!0)},[]),function(e){const t=(0,Ye.useContext)(Nt);(0,Ye.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,Ye.useMemo)(()=>({onDragStart(e){let{active:n}=e;l(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&l(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;l(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;l(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;l(t.onDragCancel({active:n,over:o}))}}),[l,t])),!s)return null;const u=Ye.createElement(Ye.Fragment,null,Ye.createElement(Gi,{id:o,value:i.draggable}),Ye.createElement(Bi,{id:a,announcement:r}));return n?(0,Mt.createPortal)(u,n):u}function qi(){}function Wi(e,t){return(0,Ye.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function Ki(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,Ye.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}function $i(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Xi(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function Yi(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Ji(e){let{left:t,top:n,height:o,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+o},{x:t+i,y:n+o}]}function Qi(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}function Zi(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),r=i-o,a=l-n;if(o<i&&n<l){const n=t.width*t.height,o=e.width*e.height,i=r*a;return Number((i/(n+o-i)).toFixed(4))}return 0}function el(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Tt}function tl(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}function nl(e,t){void 0===t&&(t=Ot);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=ji(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!o)return e;const{scaleX:i,scaleY:l,x:r,y:a}=o,s=e.left-r-(1-i)*parseFloat(n),d=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,c=l?e.height/l:e.height;return{width:u,height:c,top:d,right:s+u,bottom:d+c,left:s}}(n,t,o))}const{top:o,left:i,width:l,height:r,bottom:a,right:s}=n;return{top:o,left:i,width:l,height:r,bottom:a,right:s}}function ol(e){return nl(e,{ignoreTransform:!0})}function il(e,t){const n=[];return e?function o(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if(Ei(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Ii(i)||Di(i))return n;if(n.includes(i))return n;const l=ji(e).getComputedStyle(i);return i!==e&&function(e,t){void 0===t&&(t=ji(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const o=t[e];return"string"==typeof o&&n.test(o)})}(i,l)&&n.push(i),function(e,t){return void 0===t&&(t=ji(e).getComputedStyle(e)),"fixed"===t.position}(i,l)?n:o(i.parentNode)}(e):n}function ll(e){const[t]=il(e,1);return null!=t?t:null}function rl(e){return Ct&&e?Ri(e)?e:ki(e)?Ei(e)||e===Mi(e).scrollingElement?window:Ii(e)?e:null:null:null}function al(e){return Ri(e)?e.scrollX:e.scrollLeft}function sl(e){return Ri(e)?e.scrollY:e.scrollTop}function dl(e){return{x:al(e),y:sl(e)}}function ul(e){return!(!Ct||!e)&&e===document.scrollingElement}function cl(e){const t={x:0,y:0},n=ul(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}function gl(e,t,n,o,i){let{top:l,left:r,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===i&&(i=Gt);const{isTop:d,isBottom:u,isLeft:c,isRight:g}=cl(e),m={x:0,y:0},f={x:0,y:0},p=t.height*i.y,h=t.width*i.x;return!d&&l<=t.top+p?(m.y=Ht.Backward,f.y=o*Math.abs((t.top+p-l)/p)):!u&&s>=t.bottom-p&&(m.y=Ht.Forward,f.y=o*Math.abs((t.bottom-p-s)/p)),!g&&a>=t.right-h?(m.x=Ht.Forward,f.x=o*Math.abs((t.right-h-a)/h)):!c&&r<=t.left+h&&(m.x=Ht.Backward,f.x=o*Math.abs((t.left+h-r)/h)),{direction:m,speed:f}}function ml(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:o,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:i,width:e.clientWidth,height:e.clientHeight}}function fl(e){return e.reduce((e,t)=>kt(e,dl(t)),Tt)}function pl(e){return e.reduce((e,t)=>e+al(t),0)}function hl(e){return e.reduce((e,t)=>e+sl(t),0)}function vl(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}function bl(e){e.preventDefault()}function _l(e){e.stopPropagation()}function xl(e){return Boolean(e&&"distance"in e)}function yl(e){return Boolean(e&&"delay"in e)}function wl(e){let{acceleration:t,activator:n=ln.Pointer,canScroll:o,draggingRect:i,enabled:l,interval:r=5,order:a=rn.TreeOrder,pointerCoordinates:s,scrollableAncestors:d,scrollableAncestorRects:u,delta:c,threshold:g}=e;const m=function(e){let{delta:t,disabled:n}=e;const o=Ti(t);return zi(e=>{if(n||!o||!e)return an;const i={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[Ht.Backward]:e.x[Ht.Backward]||-1===i.x,[Ht.Forward]:e.x[Ht.Forward]||1===i.x},y:{[Ht.Backward]:e.y[Ht.Backward]||-1===i.y,[Ht.Forward]:e.y[Ht.Forward]||1===i.y}}},[n,t,o])}({delta:c,disabled:!l}),[f,p]=function(){const e=(0,Ye.useRef)(null);return[(0,Ye.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,Ye.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),h=(0,Ye.useRef)({x:0,y:0}),v=(0,Ye.useRef)({x:0,y:0}),b=(0,Ye.useMemo)(()=>{switch(n){case ln.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case ln.DraggableRect:return i}},[n,i,s]),_=(0,Ye.useRef)(null),x=(0,Ye.useCallback)(()=>{const e=_.current;if(!e)return;const t=h.current.x*v.current.x,n=h.current.y*v.current.y;e.scrollBy(t,n)},[]),y=(0,Ye.useMemo)(()=>a===rn.TreeOrder?[...d].reverse():d,[a,d]);(0,Ye.useEffect)(()=>{if(l&&d.length&&b){for(const e of y){if(!1===(null==o?void 0:o(e)))continue;const n=u[d.indexOf(e)];if(!n)continue;const{direction:i,speed:l}=gl(e,n,b,t,g);for(const e of["x","y"])m[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return p(),_.current=e,f(x,r),h.current=l,void(v.current=i)}h.current={x:0,y:0},v.current={x:0,y:0},p()}else p()},[t,x,o,p,l,r,JSON.stringify(b),JSON.stringify(m),f,d,y,u,JSON.stringify(g)])}function Cl(e,t){return zi(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Sl(e){let{callback:t,disabled:n}=e;const o=Ni(t),i=(0,Ye.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[n]);return(0,Ye.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function Rl(e){return new Ut(nl(e),e)}function kl(e,t,n){void 0===t&&(t=Rl);const[o,i]=(0,Ye.useState)(null);function l(){i(o=>{if(!e)return null;var i;if(!1===e.isConnected)return null!=(i=null!=o?o:n)?i:null;const l=t(e);return JSON.stringify(o)===JSON.stringify(l)?o:l})}const r=function(e){let{callback:t,disabled:n}=e;const o=Ni(t),i=(0,Ye.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,n]);return(0,Ye.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){l();break}}}}),a=Sl({callback:l});return St(()=>{l(),e?(a?.observe(e),r?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),r?.disconnect())},[e]),o}function jl(e,t){void 0===t&&(t=[]);const n=(0,Ye.useRef)(null);return(0,Ye.useEffect)(()=>{n.current=null},t),(0,Ye.useEffect)(()=>{const t=e!==Tt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?jt(e,n.current):Tt}function El(e){return(0,Ye.useMemo)(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}function Il(e){let{measure:t}=e;const[n,o]=(0,Ye.useState)(null),i=Sl({callback:(0,Ye.useCallback)(e=>{for(const{target:n}of e)if(Ii(n)){o(e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o});break}},[t])}),[l,r]=Pi((0,Ye.useCallback)(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ii(t)?t:e}(e);i?.disconnect(),n&&i?.observe(n),o(n?t(n):null)},[t,i]));return(0,Ye.useMemo)(()=>({nodeRef:l,rect:n,setRef:r}),[n,l,r])}function Dl(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new hn}}}function Ml(e,t){switch(t.type){case Pt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Pt.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Pt.DragEnd:case Pt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Pt.RegisterDroppable:{const{element:n}=t,{id:o}=n,i=new hn(e.droppable.containers);return i.set(o,n),{...e,droppable:{...e.droppable,containers:i}}}case Pt.SetDroppableDisabled:{const{id:n,key:o,disabled:i}=t,l=e.droppable.containers.get(n);if(!l||o!==l.key)return e;const r=new hn(e.droppable.containers);return r.set(n,{...l,disabled:i}),{...e,droppable:{...e.droppable,containers:r}}}case Pt.UnregisterDroppable:{const{id:n,key:o}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const l=new hn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Nl(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:i}=(0,Ye.useContext)(_n),l=Ti(o),r=Ti(null==n?void 0:n.id);return(0,Ye.useEffect)(()=>{if(!t&&!o&&l&&null!=r){if(!Ai(l))return;if(document.activeElement===l.target)return;const e=i.get(r);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Hi(e);if(t){t.focus();break}}})}},[o,t,i,r,l]),null}function Fl(e){let{id:t,data:n,disabled:o=!1,attributes:i}=e;const l=Vi(kn),{activators:r,activatorEvent:a,active:s,activeNodeRect:d,ariaDescribedById:u,draggableNodes:c,over:g}=(0,Ye.useContext)(_n),{role:m=Rn,roleDescription:f="draggable",tabIndex:p=0}=null!=i?i:{},h=(null==s?void 0:s.id)===t,v=(0,Ye.useContext)(h?yn:Sn),[b,_]=Pi(),[x,y]=Pi(),w=function(e,t){return(0,Ye.useMemo)(()=>e.reduce((e,n)=>{let{eventName:o,handler:i}=n;return e[o]=e=>{i(e,t)},e},{}),[e,t])}(r,t),C=Fi(n);return St(()=>(c.set(t,{id:t,key:l,node:b,activatorNode:x,data:C}),()=>{const e=c.get(t);e&&e.key===l&&c.delete(t)}),[c,t]),{active:s,activatorEvent:a,activeNodeRect:d,attributes:(0,Ye.useMemo)(()=>({role:m,tabIndex:p,"aria-disabled":o,"aria-pressed":!(!h||m!==Rn)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[o,m,p,h,f,u.draggable]),isDragging:h,listeners:o?void 0:w,node:b,over:g,setNodeRef:_,setActivatorNodeRef:y,transform:v}}function zl(e="cuesheet"){const t=(0,Ye.useMemo)(()=>C(`${e}-table-sizes`),[e]),[n,o]=(0,Ye.useState)(()=>{try{const e=localStorage.getItem(t);return e?JSON.parse(e):{}}catch{return{}}});return(0,Ye.useEffect)(()=>{!function(e,t){let n;return(...o)=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,e(...o)},t)}}(e=>{localStorage.setItem(t,JSON.stringify(e))},500)(n)},[n,t]),{columnSizing:n,setColumnSizing:(0,Ye.useCallback)(e=>{o(e)},[])}}function Pl(e,t="cuesheet"){const[n,o]=pe({key:(0,Ye.useMemo)(()=>C(`${t}-table-order`),[t]),defaultValue:e.map(e=>e.id)});return(0,Ye.useEffect)(()=>{const t=e.map(e=>e.id);t.some(e=>!n.includes(e))&&o(t)},[n,e,o]),{columnOrder:n,saveColumnOrder:o,resetColumnOrder:(0,Ye.useCallback)(()=>{o(e.map(e=>e.id))},[e,o])}}function Tl(e,t){return"function"==typeof e?e(t):e}function Vl(e,t){return n=>{t.setState(t=>({...t,[e]:Tl(n,t[e])}))}}function Ll(e){return e instanceof Function}function Al(e,t,n){let o,i=[];return l=>{let r;n.key&&n.debug&&(r=Date.now());const a=e(l);if(a.length===i.length&&!a.some((e,t)=>i[t]!==e))return o;let s;if(i=a,n.key&&n.debug&&(s=Date.now()),o=t(...a),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-r))/100,t=Math.round(100*(Date.now()-s))/100,o=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function Ol(e,t,n,o){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:o}}function Hl(e,t,n){var o;let i={id:null!=(o=n.id)?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(i),e},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(i,e)}),i}function Gl(e,t,n,o){var i,l;let r=0;const a=function(e,t){void 0===t&&(t=1),r=Math.max(r,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&a(e.columns,t+1)},0)};a(e);let s=[];const d=(e,t)=>{const i={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},l=[];e.forEach(e=>{const r=[...l].reverse()[0];let a,s=!1;if(e.column.depth===i.depth&&e.column.parent?a=e.column.parent:(a=e.column,s=!0),r&&(null==r?void 0:r.column)===a)r.subHeaders.push(e);else{const i=Hl(n,a,{id:[o,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:s,placeholderId:s?`${l.filter(e=>e.column===a).length}`:void 0,depth:t,index:l.length});i.subHeaders.push(e),l.push(i)}i.headers.push(e),e.headerGroup=i}),s.push(i),t>0&&d(l,t-1)};d(t.map((e,t)=>Hl(n,e,{depth:r,index:t})),r-1),s.reverse();const u=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,o=[0];return e.subHeaders&&e.subHeaders.length?(o=[],u(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,o.push(i)})):t=1,n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return u(null!=(i=null==(l=s[0])?void 0:l.headers)?i:[]),s}function Bl(e){return null==e||""===e}function Ul(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}function ql(e){return"touchstart"===e.type}function Wl(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}function Kl(e,t){const n=e.getState().rowSelection,o=[],i={},l=function(e,t){return e.map(e=>{var t;const r=$l(e,n);if(r&&(o.push(e),i[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:l(e.subRows)}),r)return e}).filter(Boolean)};return{rows:l(t.rows),flatRows:o,rowsById:i}}function $l(e,t){var n;return null!=(n=t[e.id])&&n}function Xl(e,t,n){var o;if(null==(o=e.subRows)||!o.length)return!1;let i=!0,l=!1;return e.subRows.forEach(e=>{if((!l||i)&&(e.getCanSelect()&&($l(e,t)?l=!0:i=!1),e.subRows&&e.subRows.length)){const n=Xl(e,t);"all"===n?l=!0:"some"===n?(l=!0,i=!1):i=!1}}),i?"all":!!l&&"some"}function Yl(e,t){return e===t?0:e>t?1:-1}function Jl(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Ql(e,t){const n=e.split(vo).filter(Boolean),o=t.split(vo).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),i=parseInt(e,10),l=parseInt(t,10),r=[i,l].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}}return n.length-o.length}function Zl(e){var t,n;const o=[...xo,...null!=(t=e._features)?t:[]];let i={_features:o};const l=i._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(i)),{});let r={...null!=(n=e.initialState)?n:{}};i._features.forEach(e=>{var t;r=null!=(t=null==e.getInitialState?void 0:e.getInitialState(r))?t:r});const a=[];let s=!1;const d={_features:o,options:{...l,...e},initialState:r,_queue:e=>{a.push(e),s||(s=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();s=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{i.setState(i.initialState)},setOptions:e=>{i.options=(e=>i.options.mergeOptions?i.options.mergeOptions(l,e):{...l,...e})(Tl(e,i.options))},getState:()=>i.options.state,setState:e=>{null==i.options.onStateChange||i.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==i.options.getRowId?void 0:i.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?i.getPrePaginationRowModel():i.getRowModel()).rowsById[e];if(!n&&(n=i.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:Al(()=>[i.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...i._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},Ol(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:Al(()=>[i._getColumnDefs()],e=>{const t=function(e,n,o){return void 0===o&&(o=0),e.map(e=>{const l=function(e,t,n,o){var i,l;const r={...e._getDefaultColumnDef(),...t},a=r.accessorKey;let s,d=null!=(i=null!=(l=r.id)?l:a?"function"==typeof String.prototype.replaceAll?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)?i:"string"==typeof r.header?r.header:void 0;if(r.accessorFn?s=r.accessorFn:a&&(s=a.includes(".")?e=>{let t=e;for(const o of a.split(".")){var n;t=null==(n=t)?void 0:n[o]}return t}:e=>e[r.accessorKey]),!d)throw new Error;let u={id:`${String(d)}`,accessorFn:s,parent:o,depth:n,columnDef:r,columns:[],getFlatColumns:Al(()=>[!0],()=>{var e;return[u,...null==(e=u.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},Ol(e.options,"debugColumns")),getLeafColumns:Al(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=u.columns)&&t.length?e(u.columns.flatMap(e=>e.getLeafColumns())):[u]},Ol(e.options,"debugColumns"))};for(const c of e._features)null==c.createColumn||c.createColumn(u,e);return u}(i,e,o,n),r=e;return l.columns=r.columns?t(r.columns,l,o+1):[],l})};return t(e)},Ol(e,"debugColumns")),getAllFlatColumns:Al(()=>[i.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),Ol(e,"debugColumns")),_getAllFlatColumnsById:Al(()=>[i.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),Ol(e,"debugColumns")),getAllLeafColumns:Al(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),Ol(e,"debugColumns")),getColumn:e=>i._getAllFlatColumnsById()[e]};Object.assign(i,d);for(let u=0;u<i._features.length;u++){const e=i._features[u];null==e||null==e.createTable||e.createTable(i)}return i}function er(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?Ye.createElement(e,t):e:null;var n}function tr({handleAddNew:e}){const{getLocalizedString:t}=Pe(),n=t("common.no_data");return(0,Je.jsx)("tbody",{className:yo.emptyContainer,children:(0,Je.jsx)("tr",{children:(0,Je.jsxs)("td",{colSpan:99,className:yo.emptyCell,children:[(0,Je.jsx)(qe,{text:n,injectedStyles:{marginTop:"5vh"}}),e&&(0,Je.jsx)("div",{className:yo.inline,children:(0,Je.jsxs)(N,{onClick:()=>e(v.Event),variant:"primary",size:"large",children:[(0,Je.jsx)(W,{}),"Create Event"]})})]})})})}function nr(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function or(e,t){return e.reduce((e,n,o)=>{const i=t.get(n);return i&&(e[o]=i),e},Array(e.length))}function ir(e){return null!==e&&e>=0}function lr(e){let{children:t,id:n,items:o,strategy:i=Ro,disabled:l=!1}=e;const{active:r,dragOverlay:a,droppableRects:s,over:d,measureDroppableContainers:u}=(0,Ye.useContext)(xn),c=Vi(jo,n),g=Boolean(null!==a.rect),m=(0,Ye.useMemo)(()=>o.map(e=>"object"==typeof e&&"id"in e?e.id:e),[o]),f=null!=r,p=r?m.indexOf(r.id):-1,h=d?m.indexOf(d.id):-1,v=(0,Ye.useRef)(m),b=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,v.current),_=-1!==h&&-1===p||b,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(l);St(()=>{b&&f&&u(m)},[b,m,f,u]),(0,Ye.useEffect)(()=>{v.current=m},[m]);const y=(0,Ye.useMemo)(()=>({activeIndex:p,containerId:c,disabled:x,disableTransforms:_,items:m,overIndex:h,useDragOverlay:g,sortedRects:or(m,s),strategy:i}),[p,c,x.draggable,x.droppable,_,m,h,s,g,i]);return Ye.createElement(Eo.Provider,{value:y},t)}function rr(e){let{animateLayoutChanges:t=Do,attributes:n,disabled:o,data:i,getNewIndex:l=Io,id:r,strategy:a,resizeObserverConfig:s,transition:d=Mo}=e;const{items:u,containerId:c,activeIndex:g,disabled:m,disableTransforms:f,sortedRects:p,overIndex:h,useDragOverlay:v,strategy:b}=(0,Ye.useContext)(Eo),_=function(e,t){var n,o;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(o,m),x=u.indexOf(r),y=(0,Ye.useMemo)(()=>({sortable:{containerId:c,index:x,items:u},...i}),[c,i,x,u]),w=(0,Ye.useMemo)(()=>u.slice(u.indexOf(r)),[u,r]),{rect:C,node:S,isOver:R,setNodeRef:k}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:i}=e;const l=Vi(jn),{active:r,dispatch:a,over:s,measureDroppableContainers:d}=(0,Ye.useContext)(_n),u=(0,Ye.useRef)({disabled:n}),c=(0,Ye.useRef)(!1),g=(0,Ye.useRef)(null),m=(0,Ye.useRef)(null),{disabled:f,updateMeasurementsFor:p,timeout:h}={...En,...i},v=Fi(null!=p?p:o),b=Sl({callback:(0,Ye.useCallback)(()=>{c.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),m.current=null},h)):c.current=!0},[h]),disabled:f||!r}),[_,x]=Pi((0,Ye.useCallback)((e,t)=>{b&&(t&&(b.unobserve(t),c.current=!1),e&&b.observe(e))},[b])),y=Fi(t);return(0,Ye.useEffect)(()=>{b&&_.current&&(b.disconnect(),c.current=!1,b.observe(_.current))},[_,b]),(0,Ye.useEffect)(()=>(a({type:Pt.RegisterDroppable,element:{id:o,key:l,disabled:n,node:_,rect:g,data:y}}),()=>a({type:Pt.UnregisterDroppable,key:l,id:o})),[o]),(0,Ye.useEffect)(()=>{n!==u.current.disabled&&(a({type:Pt.SetDroppableDisabled,id:o,key:l,disabled:n}),u.current.disabled=n)},[o,l,n,a]),{active:r,rect:g,isOver:(null==s?void 0:s.id)===o,node:_,over:s,setNodeRef:x}}({id:r,data:y,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...s}}),{active:j,activatorEvent:E,activeNodeRect:I,attributes:D,setNodeRef:M,listeners:N,isDragging:F,over:z,setActivatorNodeRef:P,transform:T}=Fl({id:r,data:y,attributes:{...zo,...n},disabled:_.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,Ye.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(k,M),L=Boolean(j),A=L&&!f&&ir(g)&&ir(h),O=!v&&F,H=O&&A?T:null,G=A?null!=H?H:(null!=a?a:b)({rects:p,activeNodeRect:I,activeIndex:g,overIndex:h,index:x}):null,B=ir(g)&&ir(h)?l({id:r,items:u,activeIndex:g,overIndex:h}):x,U=null==j?void 0:j.id,q=(0,Ye.useRef)({activeId:U,items:u,newIndex:B,containerId:c}),W=u!==q.current.items,K=t({active:j,containerId:c,isDragging:F,isSorting:L,id:r,index:x,items:u,newIndex:q.current.newIndex,previousItems:q.current.items,previousContainerId:q.current.containerId,transition:d,wasDragging:null!=q.current.activeId}),$=function(e){let{disabled:t,index:n,node:o,rect:i}=e;const[l,r]=(0,Ye.useState)(null),a=(0,Ye.useRef)(n);return St(()=>{if(!t&&n!==a.current&&o.current){const e=i.current;if(e){const t=nl(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&r(n)}}n!==a.current&&(a.current=n)},[t,n,o,i]),(0,Ye.useEffect)(()=>{l&&r(null)},[l]),l}({disabled:!K,index:x,node:S,rect:C});return(0,Ye.useEffect)(()=>{L&&q.current.newIndex!==B&&(q.current.newIndex=B),c!==q.current.containerId&&(q.current.containerId=c),u!==q.current.items&&(q.current.items=u)},[L,B,c,u]),(0,Ye.useEffect)(()=>{if(U===q.current.activeId)return;if(null!=U&&null==q.current.activeId)return void(q.current.activeId=U);const e=setTimeout(()=>{q.current.activeId=U},50);return()=>clearTimeout(e)},[U]),{active:j,activeIndex:g,attributes:D,data:y,rect:C,index:x,newIndex:B,items:u,isOver:R,isSorting:L,isDragging:F,listeners:N,node:S,overIndex:h,over:z,setNodeRef:V,setActivatorNodeRef:P,setDroppableNodeRef:k,setDraggableNodeRef:M,transform:null!=$?$:G,transition:$||W&&q.current.newIndex===x?Fo:O&&!Ai(E)||!d?void 0:L||K?Et.Transition.toString({...d,property:No}):void 0}}function ar({columnId:e,colSpan:t,injectedStyles:n,children:o,draggable:i}){const{attributes:l,listeners:r,setNodeRef:a,transform:s,transition:d,isDragging:u}=rr({id:e});return(0,Je.jsxs)("th",{ref:a,style:{...n,zIndex:u?2:"inherit",transform:Et.Translate.toString(s),transition:d},colSpan:t,tabIndex:-1,children:[(0,Je.jsx)("div",{...l,...r,children:o}),i]})}function sr({colSpan:e,injectedStyles:t,children:n,draggable:o}){return(0,Je.jsxs)("th",{style:t,colSpan:e,tabIndex:-1,children:[(0,Je.jsx)("div",{children:n}),o]})}function dr({header:e}){return(0,Je.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:Po.resizer})}function ur({headerGroup:e,cuesheetMode:t,hideIndexColumn:n}){return(0,Je.jsxs)("tr",{children:[t===P.Edit&&(0,Je.jsx)("th",{className:Po.actionColumn,tabIndex:-1}),!n&&(0,Je.jsx)("th",{className:Po.indexColumn,tabIndex:-1,children:"#"}),(0,Je.jsx)(lr,{items:e.headers,strategy:So,children:e.headers.map(e=>{const t=e.column.columnDef.meta?.colour,n={opacity:e.column.columnDef.meta?.canWrite?1:.6};if(t){const e=ie(t);n.backgroundColor=e.backgroundColor,n.color=e.color}return(0,Je.jsx)(ar,{columnId:e.column.id,colSpan:e.colSpan,injectedStyles:{width:`calc(var(--header-${e?.id}-size) * 1px)`,...n},draggable:(0,Je.jsx)(dr,{header:e}),children:e.isPlaceholder?null:er(e.column.columnDef.header,e.getContext())},e.column.columnDef.id)})},e.id)]},e.id)}function cr({headerGroup:e,cuesheetMode:t,hideIndexColumn:n}){return(0,Je.jsxs)("tr",{children:[t===P.Edit&&(0,Je.jsx)("th",{className:Po.actionColumn,tabIndex:-1}),!n&&(0,Je.jsx)("th",{className:Po.indexColumn,tabIndex:-1,children:"#"}),e.headers.map(e=>{const t=e.column.columnDef.meta?.colour,n={opacity:e.column.columnDef.meta?.canWrite?1:.6};if(t){const e=ie(t);n.backgroundColor=e.backgroundColor,n.color=e.color}return(0,Je.jsx)(sr,{columnId:e.column.id,colSpan:e.colSpan,injectedStyles:{width:`calc(var(--header-${e?.id}-size) * 1px)`,...n},draggable:(0,Je.jsx)(dr,{header:e}),children:e.isPlaceholder?null:er(e.column.columnDef.header,e.getContext())},e.column.columnDef.id)})]},e.id)}function gr({duration:e,injectedStyles:t,hasCursor:n,...o}){if(xe(e=>e.hideDelays)||0===e)return(0,Je.jsx)("tr",{className:`${To.delayRow} ${To.delayRowHidden}`,"data-testid":"cuesheet-delay-hidden",style:t,...o,children:(0,Je.jsx)("td",{})});const i=ke(e,"expanded");return(0,Je.jsx)("tr",{className:To.delayRow,"data-testid":"cuesheet-delay",style:t,"data-cursor":n,...o,children:(0,Je.jsx)("td",{tabIndex:0,children:i})})}function mr({rowId:e,id:t,eventIndex:n,colour:o,isFirstAfterGroup:i,isLoaded:l,isPast:r,groupColour:a,flag:s,skip:d,parent:u,rowIndex:c,table:g,injectedStyles:m,hasCursor:f,...p}){const{cuesheetMode:h,hideIndexColumn:b}=g.options.meta?.options??{cuesheetMode:P.Edit,hideIndexColumn:!1},_=Lo(e=>e.openMenu),{rowBgColour:x,backgroundColor:y,mutedText:w}=(0,Ye.useMemo)(()=>{const e=ie(o),t=J(e.color);let n;if(l)n="#087A27";else if(o){const t=J(e.backgroundColor);null!==t&&(n=Y({...t,alpha:.25*t.alpha}))}return{rowBgColour:n,backgroundColor:e.backgroundColor,mutedText:Y({...t,alpha:.8*t.alpha})}},[o,l]);return(0,Je.jsxs)("tr",{id:e,className:U([Ao.eventRow,d&&Ao.skip,i&&Ao.firstAfterGroup,u&&Ao.hasParent]),style:{...m,opacity:r?"0.2":"1","--user-bg":a??"transparent"},"data-cursor":f,"data-testid":"cuesheet-event","data-entry-id":t,...p,children:[h===P.Edit&&(0,Je.jsx)("td",{className:Ao.actionColumn,tabIndex:-1,role:"cell",children:(0,Je.jsx)(Fe,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:e=>{const n=e.currentTarget.getBoundingClientRect(),o=8+n.y+n.height/2;_({x:n.x,y:o},t,v.Event,c,u,s)},children:(0,Je.jsx)(G,{})})}),!b&&(0,Je.jsx)("td",{className:Ao.indexColumn,style:{backgroundColor:y,color:w},tabIndex:-1,role:"cell",children:n}),g.getRow(e).getVisibleCells().map(e=>(0,Je.jsx)("td",{style:{width:`calc(var(--col-${e.column.id}-size) * 1px)`,backgroundColor:x},tabIndex:-1,role:"cell","data-testid":`cuesheet-cell-${e.column.id}`,"data-column-id":e.column.id,children:er(e.column.columnDef.cell,e.getContext())},e.id))]})}function fr({groupId:e,colour:t,rowId:n,rowIndex:o,table:i,injectedStyles:l,hasCursor:r,...a}){const{cuesheetMode:s,hideIndexColumn:d}=i.options.meta?.options??{cuesheetMode:P.Edit,hideIndexColumn:!1},u=Lo(e=>e.openMenu);return(0,Je.jsxs)("tr",{className:Ho.groupRow,style:{...l,"--user-bg":t},"data-testid":"cuesheet-group","data-cursor":r,...a,children:[s===P.Edit&&(0,Je.jsx)("td",{className:Ho.actionColumn,tabIndex:-1,role:"cell",children:(0,Je.jsx)(Fe,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:t=>{const n=t.currentTarget.getBoundingClientRect(),i=8+n.y+n.height/2;u({x:n.x,y:i},e,v.Group,o,null,null)},children:(0,Je.jsx)(G,{})})}),!d&&(0,Je.jsx)("td",{className:Ho.indexColumn,tabIndex:-1,role:"cell"}),i.getRow(n).getVisibleCells().map(e=>(0,Je.jsx)("td",{tabIndex:-1,style:{width:`calc(var(--col-${e.column.id}-size) * 1px)`},role:"cell",children:er(e.column.columnDef.cell,e.getContext())},e.id))]})}function pr({entryId:e,isPast:t,parentBgColour:n,parentId:o,colour:i,rowId:l,rowIndex:r,hasCursor:a,table:s,injectedStyles:d,...u}){const{cuesheetMode:c,hideIndexColumn:g}=s.options.meta?.options??{cuesheetMode:P.Edit,hideIndexColumn:!1},m=Lo(e=>e.openMenu),f=(0,Ye.useMemo)(()=>{if(!i)return;const e=J(ie(i).backgroundColor);return null!==e?Y({...e,alpha:.25*e.alpha}):void 0},[i]);return(0,Je.jsxs)("tr",{className:U([Bo.milestoneRow,Boolean(n)&&Bo.hasParent]),style:{...d,opacity:t?"0.2":"1","--user-bg":n??"transparent"},"data-testid":"cuesheet-milestone","data-cursor":a,...u,children:[c===P.Edit&&(0,Je.jsx)("td",{className:Bo.actionColumn,tabIndex:-1,role:"cell",children:(0,Je.jsx)(Fe,{"aria-label":"Options",variant:"ghosted-white",size:"small",onClick:t=>{const n=t.currentTarget.getBoundingClientRect(),i=8+n.y+n.height/2;m({x:n.x,y:i},e,v.Milestone,r,o,null)},children:(0,Je.jsx)(G,{})})}),!g&&(0,Je.jsx)("td",{className:Bo.indexColumn,tabIndex:-1,role:"cell",children:"–"}),s.getRow(l).getVisibleCells().map(e=>{const t="duration"!==e.column.id&&"timeStart"!==e.column.id&&"timeEnd"!==e.column.id;return(0,Je.jsx)("td",{style:{width:`calc(var(--col-${e.column.id}-size) * 1px)`,backgroundColor:f,opacity:t?1:.4},tabIndex:-1,children:t&&er(e.column.columnDef.cell,e.getContext())},e.id)})]})}function hr(){const{isOpen:e,entryId:t,entryIndex:n,parentId:o,flag:i,position:l,closeMenu:r}=Lo(),{addEntry:a,clone:s,deleteEntry:d,move:u,updateEntry:c}=ii(),g=gt(e=>e.setEditableEntry),m=wo();return e?(0,Je.jsx)(be,{isOpen:!0,onClose:r,items:[{type:"item",label:"Edit...",onClick:()=>g(t),icon:B,disabled:!m.canEditEntries},{type:"divider"},{type:"item",label:i?"Remove flag":"Add flag",onClick:()=>c({id:t,flag:!i}),icon:re,disabled:null===i||!m.canFlag},{type:"divider"},{type:"item",label:"Add event above",onClick:()=>a({type:v.Event,parent:o},{before:t}),icon:W,disabled:!m.canCreateEntries},{type:"item",label:"Add event below",onClick:()=>a({type:v.Event,parent:o},{after:t}),icon:W,disabled:!m.canCreateEntries},{type:"item",label:"Clone event",onClick:()=>s(t),icon:re,disabled:!m.canCreateEntries},{type:"divider"},{type:"item",label:"Move up",onClick:()=>u(t,"up"),icon:Q,disabled:n<1||!m.canEditEntries},{type:"item",label:"Move down",onClick:()=>u(t,"down"),icon:le,disabled:!m.canEditEntries},{type:"divider"},{type:"item",label:"Delete",onClick:()=>d([t]),icon:ee,disabled:!m.canEditEntries}],position:l}):null}function vr(e){return(0,Je.jsx)(K,{style:{transform:"rotate(-45deg)"},...e})}function br(){const{data:e}=ge(),{data:t}=T(),[n,o]=me(),i=n&&e&&t;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(xt,{onClick:o.open,render:(0,Je.jsx)(N,{}),children:[(0,Je.jsx)(vr,{}),"Share..."]}),(0,Je.jsx)(Ve,{isOpen:n,onClose:o.close,title:"Share cuesheet view",size:"wide",showBackdrop:!0,showCloseButton:!0,bodyElements:i?(0,Je.jsx)(Se,{lockedPath:{value:g.Cuesheet,label:"Cuesheet"}}):null})]})}function _r({columns:e,optionsStore:t,handleResetResizing:n,handleResetReordering:o,handleClearToggles:i,insertElement:l,modeControls:r,showShare:a=!1}){const s=wo(e=>e.canChangeMode),d=wo(e=>e.canShare),u=!(r?.isCurrentRundown??1);return(0,Je.jsxs)(_t,{className:Wo.tableSettings,"data-background-rundown":u,children:[(0,Je.jsx)(xr,{optionsStore:t}),(0,Je.jsx)(yr,{columns:e,handleResetResizing:n,handleResetReordering:o,handleClearToggles:i}),r&&s&&(0,Je.jsxs)("div",{className:Wo.apart,children:[l,(0,Je.jsxs)(bt,{value:[r.cuesheetMode],onValueChange:e=>{const t=e.at(0);t&&r&&r.setCuesheetMode(t)},className:Wo.group,disabled:!r.isCurrentRundown,children:[(0,Je.jsx)(xt,{render:(0,Je.jsx)(ft,{}),value:P.Run,className:Wo.radioButton,children:"Run"}),(0,Je.jsx)(xt,{render:(0,Je.jsx)(ft,{}),value:P.Edit,className:Wo.radioButton,children:"Edit"})]})]}),a&&d&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Oe,{orientation:"vertical"}),(0,Je.jsx)(br,{})]})]})}function xr({optionsStore:e}){return(0,Je.jsxs)(ce,{children:[(0,Je.jsx)(ae,{render:(0,Je.jsx)(xt,{render:(0,Je.jsxs)(N,{variant:"ghosted-white",children:[(0,Je.jsx)(B,{})," Settings",(0,Je.jsx)(ne,{})]})})}),(0,Je.jsxs)(de,{align:"start",className:Wo.inline,children:[(0,Je.jsxs)("div",{className:Wo.column,children:[(0,Je.jsx)(Ae,{className:Wo.sectionTitle,children:"Element visibility"}),(0,Je.jsxs)(Ae,{className:Wo.option,children:[(0,Je.jsx)(ue,{defaultChecked:e.hideTableSeconds,onCheckedChange:t=>e.setOption("hideTableSeconds",t)}),"Hide seconds in table"]}),(0,Je.jsxs)(Ae,{className:Wo.option,children:[(0,Je.jsx)(ue,{defaultChecked:e.hideIndexColumn,onCheckedChange:t=>e.setOption("hideIndexColumn",t)}),"Hide index column"]})]}),(0,Je.jsxs)("div",{className:Wo.column,children:[(0,Je.jsx)(Ae,{className:Wo.sectionTitle,children:"Table Behaviour"}),(0,Je.jsxs)(Ae,{className:Wo.option,children:[(0,Je.jsx)(ue,{defaultChecked:e.showDelayedTimes,onCheckedChange:t=>e.setOption("showDelayedTimes",t)}),"Show delayed times"]}),(0,Je.jsxs)(Ae,{className:Wo.option,children:[(0,Je.jsx)(ue,{defaultChecked:e.hideDelays,onCheckedChange:t=>e.setOption("hideDelays",t)}),"Hide delay entries"]})]})]})]})}function yr({columns:e,handleResetResizing:t,handleResetReordering:n,handleClearToggles:o}){return(0,Je.jsxs)(ce,{children:[(0,Je.jsx)(ae,{render:(0,Je.jsx)(xt,{render:(0,Je.jsxs)(N,{variant:"ghosted-white",children:[(0,Je.jsx)(Z,{})," Columns",(0,Je.jsx)(ne,{})]})})}),(0,Je.jsxs)(de,{align:"start",className:Wo.inline,children:[(0,Je.jsxs)("div",{className:Wo.column,children:[(0,Je.jsx)(Ae,{className:Wo.sectionTitle,children:"Column visibility"}),e.map(e=>{const t=e.columnDef.header,n=e.getIsVisible();return(0,Je.jsxs)(Ae,{className:Wo.option,children:[(0,Je.jsx)(ue,{defaultChecked:n,onCheckedChange:e.toggleVisibility}),t]},`${e.id}-${n}`)})]}),(0,Je.jsxs)("div",{className:Wo.column,children:[(0,Je.jsx)(Ae,{className:Wo.sectionTitle,children:"Reset Options"}),(0,Je.jsx)(N,{size:"small",fluid:!0,onClick:o,children:"Show All"}),(0,Je.jsx)(N,{size:"small",fluid:!0,onClick:t,children:"Reset Resizing"}),(0,Je.jsx)(N,{size:"small",fluid:!0,onClick:n,children:"Reset Reordering"})]})]})]})}function wr(e){return e?new Set(e.split(",")):new Set}function Cr(e,t){return{writePermission:t,readKeys:wr(e),writeKeys:wr(t),fullRead:null==e||"full"===e,fullWrite:null==t||"full"===t}}function Sr({initialValue:e,lockedValue:t,delayed:n,onSubmit:o,children:i}){const[l,r]=(0,Ye.useState)(!1),[a,s]=(0,Ye.useState)(e),d=(0,Ye.useRef)(null),u=(0,Ye.useRef)(null);(0,Ye.useEffect)(()=>{l&&d.current&&(d.current.focus(),d.current.select())},[l]),(0,Ye.useEffect)(()=>{l||s(e)},[e,l]);const c=()=>r(!0),g=(0,Ye.useCallback)(()=>{r(!1)},[]),m=(0,Ye.useCallback)(n=>{if(r(!1),""===n)return o(n),void d.current?.focusParentElement();if(n.startsWith("p")||n.startsWith("+"))return o(n),void d.current?.focusParentElement();const i=Ie(n);if(i<0||isNaN(i))return s(e),void setTimeout(()=>u.current?.focusParentElement());i===e&&t?d.current?.focusParentElement():(o(n),s(Number(n)),setTimeout(()=>u.current?.focusParentElement()))},[e,t,o]),f=b(a);return l?(0,Je.jsx)(Xo,{ref:d,initialValue:f,allowSubmitSameValue:!t,submitOnTab:!1,handleUpdate:m,handleCancelUpdate:()=>{r(!1),setTimeout(()=>u.current?.focusParentElement())},handleTabCancel:g}):(0,Je.jsx)(ct,{onClick:c,onFocus:c,muted:!t,offset:n?"over":void 0,ref:u,children:i})}function Rr({initialValue:e,readOnly:t,updateValue:n}){const o=t=>{t!==e&&(""===t||t.startsWith("http"))&&n(t)};return!e&&t?null:e?(0,Je.jsxs)("div",{className:Jo.imageCell,children:[!t&&(0,Je.jsxs)("div",{className:Jo.overlay,children:[(0,Je.jsx)(N,{onClick:()=>{e&&window.open(e,"_blank","noopener,noreferrer")},children:"Preview"}),(0,Je.jsx)(N,{variant:"subtle-destructive",onClick:()=>o(""),children:"Delete"})]}),Boolean(e)&&(0,Je.jsx)("img",{loading:"lazy",src:e,className:Jo.image})]}):(0,Je.jsx)(ze,{variant:"ghosted",className:Jo.imageInput,fluid:!0,placeholder:"Paste image URL",onBlur:e=>o(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&o(e.currentTarget.value)},defaultValue:e})}function kr(){return(0,Je.jsx)("div",{className:Zo.flag,children:(0,Je.jsx)(Le,{})})}function jr({children:e,multiline:t}){return(0,Je.jsx)("div",{className:`${ei.ghostedText} ${t?ei.multiline:""}`,children:e})}function Er({initialValue:e,fieldId:t,fieldLabel:n,handleUpdate:o}){const i=(0,Ye.useRef)(null),{value:l,onChange:r,onBlur:a,onKeyDown:s}=si(e,(0,Ye.useCallback)(e=>o(e),[o]),i,{submitOnCtrlEnter:!0,allowKeyboardNavigation:!0});return(0,Je.jsx)(ai,{inputref:i,variant:"ghosted",fluid:!0,rows:1,value:l,onChange:r,onBlur:a,onKeyDown:s,spellCheck:!1,"data-testid":t?`cuesheet-editor-${t}`:void 0,"aria-label":n?`${n} editor`:void 0})}function Ir({numeric:e,children:t}){return(0,Je.jsx)("span",{className:U([ni.muted,e&&ni.numeric]),children:t})}function Dr({initialValue:e,lockedValue:t,delayed:n,onSubmit:o,children:i}){const[l,a]=(0,Ye.useState)(!1),[s,d]=(0,Ye.useState)(e),u=(0,Ye.useRef)(null),c=(0,Ye.useRef)(null);(0,Ye.useEffect)(()=>{l&&u.current&&(u.current.focus(),u.current.select())},[l]),(0,Ye.useEffect)(()=>{l||d(e)},[e,l]);const g=()=>a(!0),m=(0,Ye.useCallback)(()=>{a(!1)},[]),f=(0,Ye.useCallback)(n=>{if(a(!1),""===n)return o(n),void u.current?.focusParentElement();if(n.startsWith("p")||n.startsWith("+"))return o(n),void u.current?.focusParentElement();const i=Ie(n);if(i<0||isNaN(i))return d(e),void setTimeout(()=>c.current?.focusParentElement());i===e&&t?u.current?.focusParentElement():(o(n),d(Number(n)),setTimeout(()=>c.current?.focusParentElement()))},[e,t,o]),p=r(s);return l?(0,Je.jsx)(Xo,{ref:u,initialValue:p,allowSubmitSameValue:!t,submitOnTab:!1,handleUpdate:f,handleCancelUpdate:()=>{a(!1),setTimeout(()=>c.current?.focusParentElement())},handleTabCancel:m}):(0,Je.jsx)(ct,{onClick:g,onFocus:g,muted:!t,offset:n?"over":void 0,ref:c,children:i})}function Mr(e){return"string"==typeof e.columnDef.header?e.columnDef.header:e.id}function Nr({getValue:e,row:t,table:n,column:o}){if(!n.options.meta)return null;const{showDelayedTimes:i,hideTableSeconds:l}=n.options.meta.options,a=l?{format12:"h:mm a",format24:"HH:mm"}:void 0,s=t.original;if(!f(s))return(0,Je.jsx)(Ir,{numeric:!0,children:r(e(),a)});const{handleUpdateTimer:d}=n.options.meta,u=e(),c=!s.linkStart,g=r(i?u+s.delay:u,a);return o.columnDef.meta?.canWrite?(0,Je.jsxs)(oi,{initialValue:u,onSubmit:e=>d(t.original.id,"timeStart",e),lockedValue:c,delayed:0!==s.delay,children:[g,(0,Je.jsx)(je,{delayValue:s.delay,tooltipPrefix:b(u)})]}):(0,Je.jsxs)(Ir,{numeric:!0,children:[g,(0,Je.jsx)(je,{delayValue:s.delay,tooltipPrefix:b(u)})]})}function Fr({getValue:e,row:t,table:n,column:o}){if(!n.options.meta)return null;const{showDelayedTimes:i,hideTableSeconds:l}=n.options.meta.options,a=l?{format12:"h:mm a",format24:"HH:mm"}:void 0,s=t.original;if(!f(s))return(0,Je.jsx)(Ir,{numeric:!0,children:r(e(),a)});const{handleUpdateTimer:d}=n.options.meta,u=e(),g=s.timeStrategy===c.LockEnd,m=r(i?u+s.delay:u,a);return o.columnDef.meta?.canWrite?(0,Je.jsxs)(oi,{initialValue:u,onSubmit:e=>d(t.original.id,"timeEnd",e),lockedValue:g,delayed:0!==s.delay,children:[m,(0,Je.jsx)(je,{delayValue:s.delay,tooltipPrefix:b(u)})]}):(0,Je.jsxs)(Ir,{numeric:!0,children:[m,(0,Je.jsx)(je,{delayValue:s.delay,tooltipPrefix:b(u)})]})}function zr({getValue:e,row:t,table:n,column:o}){if(!n.options.meta)return null;const{hideTableSeconds:i}=n.options.meta.options,l=t.original;if(!f(l))return(0,Je.jsx)(Ir,{numeric:!0,children:p(e(),i)});const{handleUpdateTimer:r}=n.options.meta,a=e(),s=l.timeStrategy===c.LockDuration,d=p(a,i);return o.columnDef.meta?.canWrite?(0,Je.jsx)(Yo,{initialValue:a,onSubmit:e=>r(t.original.id,"duration",e),lockedValue:s,children:d}):(0,Je.jsx)(Ir,{numeric:!0,children:d})}function Pr({row:e,column:t,table:n}){const o=(0,Ye.useCallback)(o=>{n.options.meta?.handleUpdate(e.index,t.id,o,!1)},[t.id,e.index,n.options.meta]),i=e.original[t.id];return"string"!=typeof i?null:t.columnDef.meta?.canWrite?(0,Je.jsx)(ti,{initialValue:i,fieldId:t.id,fieldLabel:Mr(t),handleUpdate:o}):(0,Je.jsx)(jr,{multiline:!0,children:i})}function Tr({row:e,column:t,table:n}){const o=(0,Ye.useCallback)(o=>{n.options.meta?.handleUpdate(e.index,t.id,o,!0)},[t.id,e.index,n.options.meta]),i=e.original;if(m(i))return null;const l=t.columnDef.meta?.canWrite,r=i.custom[t.id];return(0,Je.jsx)(Qo,{initialValue:r,updateValue:o,readOnly:!l})}function Vr({row:e,column:t,table:n}){const o=(0,Ye.useCallback)(o=>{n.options.meta?.handleUpdate(e.index,t.id,o,!1)},[t.id,e.index,n.options.meta]),i=e.original[t.id];return"string"!=typeof i?null:t.columnDef.meta?.canWrite?(0,Je.jsx)(Xo,{initialValue:i,fieldId:t.id,fieldLabel:Mr(t),handleUpdate:o}):(0,Je.jsx)(jr,{children:i})}function Lr({row:e}){const t=e.original;return f(t)&&t.flag?(0,Je.jsx)(kr,{}):null}function Ar({row:e,column:t,table:n}){const o=(0,Ye.useCallback)(o=>{n.options.meta?.handleUpdate(e.index,t.id,o,!0)},[t.id,e.index,n.options.meta]),i=e.original;if(m(i))return null;const l=i.custom[t.id]??"";return t.columnDef.meta?.canWrite?(0,Je.jsx)(ti,{initialValue:l,fieldId:t.id,fieldLabel:Mr(t),handleUpdate:o}):(0,Je.jsx)(jr,{multiline:!0,children:l})}return e({A:ii,C:vi,D:function(){const{data:e}=Ne(),t=e.loaded||null;return li(t,t)},E:si,O:function(e){const{data:t}=Ne();return li(e,t.loaded||null)},S:xi,a:rr,c:function({columns:e,tableRoot:t="cuesheet",children:n}){const{columnOrder:o,saveColumnOrder:i}=Pl(e,t),l=Ki(Wi(Zt,{activationConstraint:{delay:100,tolerance:50}}),Wi(on,{activationConstraint:{delay:100,tolerance:50}}));return(0,Je.jsx)(Cn,{sensors:l,collisionDetection:Vt,onDragEnd:e=>{const{delta:t,active:n,over:l}=e;if(t.y>200)return;if(null==l?.id)return;const r=o.indexOf(n.id),a=o.indexOf(l.id);if(-1===a)return;const s=[...o],d=s.splice(r,1);s.splice(a,0,d[0]),i(s)},children:n})},f:Wi,i:lr,k:function({children:e,actions:t}){return(0,Je.jsx)(Qe.Provider,{value:t,children:e})},n:function(e,t){if(!e)return{canChangeMode:!0,canCreateEntries:!0,canEditEntries:!0,canFlag:!0,canShare:t};const{writePermission:n,writeKeys:o,fullWrite:i}=Cr(e?.options?.read,e?.options?.write);return{canChangeMode:"-"!==n,canCreateEntries:i,canEditEntries:i,canFlag:i||o.has("flag"),canShare:!1}},p:Ki,r:function({columns:e,cuesheetMode:t,source:n,tableRoot:o,setCuesheetMode:i,isCurrentRundown:l,insertElement:r}){const{flatRundown:a,status:s,selectedEventId:d}=n,{updateEntry:u,updateTimer:c,addEntry:g}=ii(),{getLocalizedString:m}=Pe(),f=wo(e=>e.canCreateEntries)&&t===P.Edit,p=("editor"===o?wt:xe)(),{showDelayedTimes:h,hideTableSeconds:v,hideIndexColumn:b}=p,_=_e(e=>e.cursor),x=_e(e=>e.setScrollHandler),y=(0,Ye.useRef)(null),{listeners:w}=function(e){const t=new Tn(e);return{listeners:{onKeyDown:e=>t.tableKeyDown(e),onKeyUp:()=>t.tableKeyUp()},tableNav:t}}(),S=(0,Ye.useMemo)(()=>({handleUpdate:(e,t,n,o=!1)=>{const i=a[e];i&&i[t]!==n&&u(o?{id:i.id,custom:{[t]:n}}:{id:i.id,[t]:n})},handleUpdateTimer:(e,t,n)=>{c(e,t,n,!0)},options:{showDelayedTimes:h,hideTableSeconds:v,cuesheetMode:t,hideIndexColumn:b}}),[t,a,b,v,h,u,c]),{columnOrder:R,resetColumnOrder:k}=Pl(e,o),{columnSizing:j,setColumnSizing:E}=zl(o),{columnVisibility:I,setColumnVisibility:D}=function(e="cuesheet"){const[t,n]=pe({key:(0,Ye.useMemo)(()=>C(`${e}-table-hidden`),[e]),defaultValue:{}});return{columnVisibility:t,setColumnVisibility:n}}(o),M=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=Ye.useState(()=>({current:Zl(t)})),[o,i]=Ye.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:a,columns:e,columnResizeMode:"onChange",state:{columnOrder:R,columnVisibility:I,columnSizing:j},onColumnVisibilityChange:D,onColumnSizingChange:E,getCoreRowModel:e=>Al(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,i,l){void 0===i&&(i=0);const r=[];for(let s=0;s<t.length;s++){const d=An(e,e._getRowId(t[s],s,l),t[s],s,i,void 0,null==l?void 0:l.id);var a;n.flatRows.push(d),n.rowsById[d.id]=d,r.push(d),e.options.getSubRows&&(d.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=d.originalSubRows)&&a.length&&(d.subRows=o(d.originalSubRows,i+1,d)))}return r};return n.rows=o(t),n},Ol(e.options,"debugTable",0,()=>e._autoResetPageIndex())),meta:S}),N=(0,Ye.useCallback)(()=>{M.toggleAllColumnsVisible(!0)},[M]),F=(0,Ye.useCallback)(()=>{E({})},[E]);(0,Ye.useEffect)(()=>{if(null===y.current||t!==P.Run||!d)return;const e=a.findIndex(e=>e.id===d);-1!==e&&y.current.scrollToIndex({index:e,behavior:"auto",align:"start",offset:-50})},[t,a,d]),(0,Ye.useEffect)(()=>(x(e=>{if(null===y.current)return;const t=a.findIndex(t=>t.id===e);-1!==t&&y.current.scrollToIndex({index:t,behavior:"auto",align:"start",offset:-50})}),()=>{x(null)}),[a,x]);const z=(0,Ye.useMemo)(()=>{const e=M.getFlatHeaders(),t={};for(let n=0;n<e.length;n++){const o=e[n];o&&(t[`--header-${o.id}-size`]=o.getSize(),t[`--col-${o.column.id}-size`]=o.column.getSize())}return t},[M.getState().columnSizingInfo,M.getState().columnSizing]),T=M.getAllLeafColumns(),{rows:V}=M.getRowModel(),L=(0,Ye.useMemo)(()=>({columnSizeVars:z,cursor:_,listeners:w,rows:V,table:M,handleAddNew:f?e=>g({type:e}):void 0}),[z,_,w,V,M,g,f]),A=(0,Ye.useCallback)((e,t)=>t.id,[]),O=(0,Ye.useCallback)(()=>M.getHeaderGroups().map(e=>(0,Je.jsx)(M.getState().columnSizingInfo.isResizingColumn?cr:ur,{cuesheetMode:t,headerGroup:e,hideIndexColumn:b},e.id)),[t,b,M]);return"pending"===s?(0,Je.jsx)(Ee,{text:"Loading…",className:Po.tableLoading}):"error"===s?(0,Je.jsx)(Ee,{text:m("common.no_data"),className:Po.tableLoading}):(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(_r,{columns:T,optionsStore:p,handleResetResizing:F,handleResetReordering:k,handleClearToggles:N,insertElement:r,modeControls:"cuesheet"===o?{cuesheetMode:t,setCuesheetMode:i,isCurrentRundown:l}:void 0,showShare:"cuesheet"===o}),(0,Je.jsx)(Ce,{ref:y,data:a,context:L,style:"editor"===o?{paddingLeft:"1rem"}:void 0,computeItemKey:A,increaseViewportBy:{top:100,bottom:200},components:Ko,fixedHeaderContent:O}),(0,Je.jsx)(qo,{})]})},t:function(e,t,n){const o=[],{canRead:i,canWrite:l}=function(e,t){const{readKeys:n,writeKeys:o,fullRead:i,fullWrite:l}=Cr(e?.options?.read,e?.options?.write),r=t===P.Edit;return{canRead:e=>i||n.has(e),canWrite:e=>r&&(l||o.has(e))}}(n,t);i("flag")&&o.push({accessorKey:"flag",id:"flag",header:"Flag",cell:Lr,size:45,minSize:45,meta:{canWrite:l("flag")}}),i("cue")&&o.push({accessorKey:"cue",id:"cue",header:"Cue",cell:Vr,size:75,minSize:40,meta:{canWrite:l("cue")}}),i("timeStart")&&o.push({accessorKey:"timeStart",id:"timeStart",header:"Start",cell:Nr,size:75,minSize:75,meta:{canWrite:l("timeStart")}}),i("timeEnd")&&o.push({accessorKey:"timeEnd",id:"timeEnd",header:"End",cell:Fr,size:75,minSize:75,meta:{canWrite:l("timeEnd")}}),i("duration")&&o.push({accessorKey:"duration",id:"duration",header:"Duration",cell:zr,size:75,minSize:75,meta:{canWrite:l("duration")}}),i("title")&&o.push({accessorKey:"title",id:"title",header:"Title",cell:Vr,size:250,minSize:75,meta:{canWrite:l("title")}}),i("note")&&o.push({accessorKey:"note",id:"note",header:"Note",cell:Pr,size:250,minSize:75,meta:{canWrite:l("note")}});const r=Object.keys(e);for(let a=0;a<r.length;a++){const t=r[a],n=`custom-${t}`;i(n)&&o.push({accessorKey:t,id:t,header:e[t].label,cell:"text"===e[t].type?Ar:Tr,size:250,minSize:75,meta:{colour:e[t].colour,canWrite:l(n)}})}return o},x:yi}),{setters:[function(e){n=e.a,o=e.n,i=e.r,l=e.t},function(e){r=e.$,a=e.Dt,s=e.Ft,d=e.Ht,u=e.It,c=e.Jt,g=e.Kt,m=e.Nt,f=e.Pt,p=e.Q,e.Tt,h=e.Xt,v=e.Yt,b=e._t,_=e.en,x=e.k,y=e.qt,w=e.rt,C=e.ut,S=e.xt},function(e){R=e.Mn,k=e.Nn,j=e.T,E=e.Tr,I=e._t,D=e.dn,M=e.on,N=e.t,F=e.wn},function(e){z=e.t},function(e){P=e.a,T=e.r},function(e){V=e.P,L=e.a,A=e.o,O=e.t,H=e.z},function(e){G=e.Et,B=e.Gt,U=e.K,q=e.Lt,W=e.Q,K=e.Rt,$=e.Ut,X=e.Vt,Y=e.X,J=e.Z,Q=e.at,Z=e.ct,ee=e.dn,te=e.et,ne=e.ft,oe=e.pn,ie=e.q,le=e.rt,re=e.wt},function(e){ae=e.a,se=e.c,de=e.i,ue=e.l,ce=e.s},function(e){ge=e.i,me=e.v,fe=e.y},function(e){pe=e.t},function(e){he=e.C,ve=e.M,be=e._,_e=e.b,xe=e.d,ye=e.h,we=e.m,Ce=e.p,Se=e.t,Re=e.v},function(e){ke=e.n,je=e.t},function(e){Ee=e.t},function(e){Ie=e.t},function(e){De=e.d,Me=e.s,Ne=e.u},function(e){Fe=e.r,ze=e.t},function(e){Pe=e.t},function(e){Te=e.t},function(e){Ve=e.t},function(e){Le=e.a},function(e){Ae=e.i,Oe=e.o,He=e.s},function(e){Ge=e.n,Be=e.r,Ue=e.t},function(e){qe=e.t},function(e){We=e.r},function(e){Ke=e.t},function(e){$e=e.t}],execute:function(){(Xe=document.createElement("style")).textContent='._blink_1k5qa_1{animation:1s step-start infinite _blink_1k5qa_1}@keyframes _blink_1k5qa_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1k5qa_13{transform:rotate(45deg)}._imageContainer_1k5qa_17{background-color:#202020;place-content:center;width:75px;height:75px;display:grid}._imageOverlay_1k5qa_25{width:100%;height:100%}._blink_11md7_2{animation:1s step-start infinite _blink_11md7_2}@keyframes _blink_11md7_2{0%{opacity:1}50%{opacity:.2}}._fourtyfive_11md7_14{transform:rotate(45deg)}._cuesheetEditor_11md7_18,._rundownEditor_11md7_19{flex-direction:column;height:100%;display:flex;overflow-x:auto}._rundownEditor_11md7_19{min-width:36.5rem}._rundownEditor_11md7_19 ._content_11md7_29{overflow-y:scroll}._content_11md7_29{flex-direction:column;flex:1;gap:1.5rem;padding-bottom:4rem;display:flex}._content_11md7_29: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:1.5rem}._content_11md7_29: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:1.5rem}._content_11md7_29:-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:1.5rem;padding-right:.5rem}._content_11md7_29: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:1.5rem;padding-right:.5rem}._timeSettings_11md7_42,._column_11md7_48{flex-direction:column;gap:1rem;display:flex}._column_11md7_48 h3{margin-bottom:-.5rem}._decorated_11md7_57{color:var(--decorator-color,#f6f6f6);background-color:var(--decorator-bg,#2d2d2d);border-radius:2px;width:fit-content;padding-left:.5rem;padding-right:.5rem}._delayLabel_11md7_65{color:#e69056;font-size:calc(1rem - 3px)}._delayLabel_11md7_65:after{content:""}._switchLabel_11md7_73{cursor:pointer;align-items:center;gap:.5rem;max-width:max-content;height:2rem;margin-bottom:0;display:flex}._inline_11md7_83{align-items:center;gap:1rem;display:flex}._splitTwo_11md7_89{grid-template-columns:1fr 1fr;gap:1rem;display:grid}._splitThree_11md7_96{grid-template-columns:1fr 1fr 1fr;gap:1rem;display:grid}._tooltipIcon_11md7_103{color:#578af4;margin-left:.25em;font-size:1.25em;display:inline-block}._customImage_11md7_110{grid-template-columns:1fr 72px;gap:1rem;display:grid}._textLikeInput_11md7_117{color:#e2e2e2;background:0 0;border:1px solid transparent;border-bottom-color:#2d2d2d;justify-content:start;width:7.5em}._inactive_11md7_126{color:#8a8a8a}._active_11md7_130{color:#77c785}._blink_1h9a0_1{animation:1s step-start infinite _blink_1h9a0_1}@keyframes _blink_1h9a0_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1h9a0_13{transform:rotate(45deg)}._inputGroup_1h9a0_17{border:1px solid transparent;border-radius:3px;align-items:center;width:fit-content;display:flex}._inputGroup_1h9a0_17._delayed_1h9a0_24{border:1px solid #e69056}._inputGroup_1h9a0_17 input{border:none;border-radius:3px 0 0 3px;max-width:fit-content;padding-right:0}._inputGroup_1h9a0_17 button{border:none;border-radius:0 3px 3px 0;width:1.5rem;height:2rem}._blink_1opfk_1{animation:1s step-start infinite _blink_1opfk_1}@keyframes _blink_1opfk_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1opfk_13{transform:rotate(-45deg)}._timerNote_1opfk_21{color:#578af4;flex:0 0 1.25em;width:1.25em;font-size:1.5em}._timerNotePlaceholder_1opfk_28{visibility:hidden}._inactive_1opfk_32{color:#8a8a8a}._active_1opfk_36{color:#77c785}._inputWrapper_1opfk_40{position:relative}._hoverLabel_1opfk_44{color:#101010;opacity:0;pointer-events:none;z-index:100;background-color:#f6f6f6;border-radius:3px;padding:.125rem .5rem;transition:opacity .15s;position:absolute;top:-1.5rem;left:0}._hoverLabel_1opfk_44._visible_1opfk_57{opacity:1;transition:opacity .15s .5s}._blink_z76k3_1{animation:1s step-start infinite _blink_z76k3_1}@keyframes _blink_z76k3_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_z76k3_13{transform:rotate(45deg)}._triggers_z76k3_17{flex-direction:column;gap:.75rem;display:flex}._triggerList_z76k3_23{background-color:rgba(0,0,0,.1);border:1px solid rgba(255,255,255,.1);border-radius:3px;flex-direction:column;display:flex;overflow:hidden}._triggerHeader_z76k3_32{color:#8a8a8a;grid-template-columns:8rem 1fr 2rem;gap:.5rem;padding:.375rem .75rem;font-size:calc(1rem - 3px);display:grid}._trigger_z76k3_17{grid-template-columns:8rem 1fr 2rem;align-items:center;gap:.5rem;min-height:2.5rem;padding:.5rem .75rem;display:grid}._trigger_z76k3_17:not(:first-child){border-top:1px solid rgba(255,255,255,.1)}._trigger_z76k3_17[data-duplicate]>button:not(:last-child){border-color:#ffbc56}._duplicateMessage_z76k3_56{color:#ffbc56;padding-left:.75rem;font-size:calc(1rem - 3px)}._blink_j7a9w_1{animation:1s step-start infinite _blink_j7a9w_1}@keyframes _blink_j7a9w_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_j7a9w_13{transform:rotate(45deg)}._textInput_j7a9w_18{text-wrap:nowrap;white-space:nowrap;letter-spacing:.5px;font-variant-numeric:tabular-nums;background-color:transparent;border-radius:3px;align-items:center;gap:.25rem;height:2rem;font-size:1rem;display:flex;overflow:hidden}._textInput_j7a9w_18._under_j7a9w_32{color:#55b469}._textInput_j7a9w_18._over_j7a9w_35{color:#f57c13}._textInput_j7a9w_18._muted_j7a9w_38{opacity:.4}._textInput_j7a9w_18:hover:not(._disabled_j7a9w_41){cursor:text;background-color:#2d2d2d}._blink_1mv9f_1{animation:1s step-start infinite _blink_1mv9f_1}@keyframes _blink_1mv9f_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1mv9f_13{transform:rotate(45deg)}._emptyContainer_1mv9f_17{color:rgba(255,255,255,.1);width:100%}._emptyContainer_1mv9f_17 ._emptyCell_1mv9f_21{text-align:center;margin-left:auto;margin-right:auto;padding-top:10vh}._emptyContainer_1mv9f_17 ._inline_1mv9f_26{justify-content:center;align-items:center;gap:1rem;margin-top:1em;display:flex}._blink_1j4rg_1{animation:1s step-start infinite _blink_1j4rg_1}@keyframes _blink_1j4rg_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1j4rg_13{transform:rotate(45deg)}._actionColumn_1j4rg_17{background-color:transparent;justify-content:center;align-items:start;padding-left:.5rem;padding-right:.5rem;display:flex;padding-top:.5rem!important}._indexColumn_1j4rg_26{background-color:#1a1a1a;justify-content:end;align-items:start;min-width:3em;font-size:calc(1rem - 2px);font-weight:600;line-height:2rem;display:flex}._tableLoading_1j4rg_37{grid-area:table}._cuesheet_1j4rg_41{color:#f6f6f6;padding-bottom:70vh;font-size:1rem;font-weight:400}[data-target=small-device] ._cuesheet_1j4rg_41{width:max-content;min-width:100%}._cuesheet_1j4rg_41 thead tr:before{content:"";width:4px;height:100%;display:block}._cuesheet_1j4rg_41 tr{display:flex}._cuesheet_1j4rg_41 th{background-color:#1a1a1a;padding-left:.25rem;font-weight:400}._cuesheet_1j4rg_41 th:hover ._resizer_1j4rg_65{width:.5rem}._cuesheet_1j4rg_41 th,._cuesheet_1j4rg_41 td{font-size:inherit;text-align:left;margin:1px;padding:.25rem;position:relative}._cuesheet_1j4rg_41 th:focus,._cuesheet_1j4rg_41 td:focus{outline:2px solid #f6f6f6}._tableHeader_1j4rg_81{z-index:100;background-color:#101010;font-size:calc(1rem - 2px);line-height:2rem;position:sticky;top:0}._tableHeader_1j4rg_81 ._actionColumn_1j4rg_17{background-color:#202020;width:2rem}._tableHeader_1j4rg_81 ._indexColumn_1j4rg_26{width:3.5em}._resizer_1j4rg_65{cursor:col-resize;opacity:.4;user-select:none;touch-action:none;background-color:#578af4;width:0;height:100%;display:inline-block;position:absolute;top:0;right:0}._resizer_1j4rg_65:hover{opacity:1}._blink_19vgy_1{animation:1s step-start infinite _blink_19vgy_1}@keyframes _blink_19vgy_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_19vgy_13{transform:rotate(45deg)}._actionColumn_19vgy_17{background-color:transparent;justify-content:center;align-items:start;padding-left:.5rem;padding-right:.5rem;display:flex;padding-top:.5rem!important}._indexColumn_19vgy_26{background-color:#1a1a1a;justify-content:end;align-items:start;min-width:3em;font-size:calc(1rem - 2px);font-weight:600;line-height:2rem;display:flex}._delayRow_19vgy_37{color:#e69056;border-left:4px solid transparent}._delayRow_19vgy_37[data-cursor=true]{outline-offset:-2px;background:color-mix(in srgb, transparent 80%, var(--user-bg,#9d9d9d) 20%);outline:2px solid #578af4}._delayRow_19vgy_37 td{text-align:center;width:calc(100% - 4px);padding-top:.5rem;padding-bottom:.5rem}._delayRow_19vgy_37 td:first-letter{text-transform:uppercase}._delayRowHidden_19vgy_55{visibility:hidden}._delayRowHidden_19vgy_55 td{height:1px;padding:0;font-size:0;line-height:1px}._blink_1ntx4_1{animation:1s step-start infinite _blink_1ntx4_1}@keyframes _blink_1ntx4_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1ntx4_13{transform:rotate(45deg)}._actionColumn_1ntx4_17{background-color:transparent;justify-content:center;align-items:start;padding-left:.5rem;padding-right:.5rem;display:flex;padding-top:.5rem!important}._indexColumn_1ntx4_26{background-color:#1a1a1a;justify-content:end;align-items:start;min-width:3em;font-size:calc(1rem - 2px);font-weight:600;line-height:2rem;display:flex}._eventRow_1ntx4_37{background:color-mix(in srgb, transparent 92%, var(--user-bg,#9d9d9d) 8%);border-left:4px solid var(--user-bg,#9d9d9d);min-height:2.5rem}._eventRow_1ntx4_37:hover{outline-offset:-1px;background:color-mix(in srgb, transparent 80%, var(--user-bg,#9d9d9d) 20%);outline:1px solid #578af4}._eventRow_1ntx4_37[data-cursor=true]{outline-offset:-2px;background:color-mix(in srgb, transparent 80%, var(--user-bg,#9d9d9d) 20%);outline:2px solid #578af4}._eventRow_1ntx4_37._firstAfterGroup_1ntx4_52{margin-top:2rem}._eventRow_1ntx4_37._skip_1ntx4_55{position:relative}._eventRow_1ntx4_37._skip_1ntx4_55 ._indexColumn_1ntx4_26{opacity:.4;text-decoration:line-through}._eventRow_1ntx4_37._skip_1ntx4_55:after{content:"";pointer-events:none;background:repeating-linear-gradient(-45deg,rgba(255,255,255,.03),rgba(255,255,255,.03) 10px,rgba(255,255,255,.08) 10px,rgba(255,255,255,.08) 20px);position:absolute;top:0;bottom:0;left:0;right:0}._eventRow_1ntx4_37 td{background-color:#262626;border-radius:2px}._blink_1k9ib_1{animation:1s step-start infinite _blink_1k9ib_1}@keyframes _blink_1k9ib_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1k9ib_13{transform:rotate(45deg)}._actionColumn_1k9ib_17{background-color:transparent;justify-content:center;align-items:start;padding-left:.5rem;padding-right:.5rem;display:flex;padding-top:.5rem!important}._indexColumn_1k9ib_26{background-color:#1a1a1a;justify-content:end;align-items:start;min-width:3em;font-size:calc(1rem - 2px);font-weight:600;line-height:2rem;display:flex}._groupRow_1k9ib_37{border-left:4px solid var(--user-bg,#9d9d9d);background-color:#1a1a1a;background:color-mix(in srgb, transparent 90%, var(--user-bg,#9d9d9d) 10%);border-radius:2px 0 0;align-items:start;width:100%;margin-top:2em;font-size:1rem;font-weight:700;line-height:1em;display:flex;position:relative}._groupRow_1k9ib_37[data-cursor=true]{outline-offset:-2px;background:color-mix(in srgb, transparent 80%, var(--user-bg,#9d9d9d) 20%);outline:2px solid #578af4}._groupRow_1k9ib_37 td{min-height:3.5rem;padding-top:.75rem!important}._groupRow_1k9ib_37 ._indexColumn_1k9ib_26{background-color:transparent}._groupRow_1k9ib_37 ._title_1k9ib_63{font-weight:600}._groupRow_1k9ib_37:hover{outline-offset:-1px;background:color-mix(in srgb, transparent 80%, var(--user-bg,#9d9d9d) 20%);outline:1px solid #578af4}._blink_3gpgk_1{animation:1s step-start infinite _blink_3gpgk_1}@keyframes _blink_3gpgk_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_3gpgk_13{transform:rotate(45deg)}._actionColumn_3gpgk_17{background-color:transparent;justify-content:center;align-items:start;padding-left:.5rem;padding-right:.5rem;display:flex;padding-top:.5rem!important}._indexColumn_3gpgk_26{background-color:#1a1a1a;justify-content:end;align-items:start;min-width:3em;font-size:calc(1rem - 2px);font-weight:600;line-height:2rem;display:flex}._milestoneRow_3gpgk_37{background:color-mix(in srgb, transparent 98%, var(--user-bg,#9d9d9d) 2%);border-left:4px solid var(--user-bg,#9d9d9d);font-style:italic}._milestoneRow_3gpgk_37:hover{outline-offset:-1px;background:color-mix(in srgb, transparent 80%, var(--user-bg,#9d9d9d) 20%);outline:1px solid #578af4}._milestoneRow_3gpgk_37[data-cursor=true]{outline-offset:-2px;background:color-mix(in srgb, transparent 80%, var(--user-bg,#9d9d9d) 20%);outline:2px solid #578af4}._milestoneRow_3gpgk_37 td{background-color:#202020;border-radius:2px}._milestoneRow_3gpgk_37 ._indexColumn_3gpgk_26{color:#8a8a8a}._blink_x6cge_1{animation:1s step-start infinite _blink_x6cge_1}@keyframes _blink_x6cge_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_x6cge_13{transform:rotate(45deg)}._tableSettings_x6cge_17{background-color:#202020;border-radius:3px 3px 0 0;grid-area:settings;align-items:center;gap:1rem;margin-top:1rem;padding:.5rem 1rem;font-size:calc(1rem - 2px);transition:background-color .2s ease-in-out;display:flex}._tableSettings_x6cge_17[data-background-rundown=true]{background-color:rgba(255,117,151,.5)}._tableSettings_x6cge_17[data-background-rundown=true] ._apart_x6cge_32:before{content:"BACKGROUND EDIT";color:#f6f6f6;animation:2s ease-in-out infinite _blinker_x6cge_1}@keyframes _blinker_x6cge_1{50%{color:transparent}}._sectionTitle_x6cge_43{text-transform:uppercase}._row_x6cge_47{flex-wrap:wrap;gap:.25em 1rem;display:flex}._option_x6cge_54{cursor:pointer;align-items:center;gap:.5rem;display:flex}._column_x6cge_61{flex-direction:column;align-self:start;gap:.5rem;display:flex}._inline_x6cge_68{align-items:center;gap:1rem;display:flex}._apart_x6cge_32{align-items:center;gap:1rem;margin-left:auto;display:flex}._group_x6cge_82{background:#2d2d2d;border-radius:3px;align-items:center;gap:2px;height:2rem;padding-left:2px;padding-right:2px;display:flex}._radioButton_x6cge_93{box-sizing:border-box;color:#b1b1b1;border:1px solid transparent;border-radius:3px;justify-content:center;align-items:center;height:calc(2rem - 4px);padding-left:1em;padding-right:1em;font-size:calc(1rem - 2px);font-weight:600;display:flex}._radioButton_x6cge_93[data-disabled]{cursor:not-allowed;opacity:.4}._radioButton_x6cge_93:focus-visible{background:0 0;outline:1px solid #578af4}._radioButton_x6cge_93:hover:not([data-disabled]):not(:active){background:#404040}._radioButton_x6cge_93:active{background:#2d2d2d}._radioButton_x6cge_93[data-pressed]{color:#f6f6f6;background:#2b5abc}._radioButton_x6cge_93[data-pressed]:hover:not([data-disabled]):not(:active){background:#3e75e8}._blink_1dtk5_1{animation:1s step-start infinite _blink_1dtk5_1}@keyframes _blink_1dtk5_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1dtk5_13{transform:rotate(45deg)}._imageInput_1dtk5_17:not(:read-only)::placeholder{opacity:.2}._imageInput_1dtk5_17:not(:read-only):hover::placeholder{opacity:1}._imageCell_1dtk5_24{min-height:2rem;position:relative}._imageCell_1dtk5_24:hover ._overlay_1dtk5_28{background-color:rgba(0,0,0,.6);place-content:center;justify-items:center;gap:1rem;display:grid}._overlay_1dtk5_28{display:none;position:absolute;top:0;bottom:0;left:0;right:0}._image_1dtk5_17{background-color:#101010;min-height:2rem}._blink_63fuh_1{animation:1s step-start infinite _blink_63fuh_1}@keyframes _blink_63fuh_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_63fuh_13{transform:rotate(45deg)}._flag_63fuh_17{color:#77c785;width:100%;height:100%;padding-top:.5rem;padding-left:.75rem}._blink_18xqt_1{animation:1s step-start infinite _blink_18xqt_1}@keyframes _blink_18xqt_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_18xqt_13{transform:rotate(45deg)}._ghostedText_18xqt_17{width:100%;min-height:2rem;padding:.25em 0 0}._multiline_18xqt_24{white-space:break-spaces}._blink_1u021_1{animation:1s step-start infinite _blink_1u021_1}@keyframes _blink_1u021_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_1u021_13{transform:rotate(45deg)}._muted_1u021_17{opacity:.4;line-height:2rem}._numeric_1u021_22{font-variant-numeric:tabular-nums;letter-spacing:.5px}\n/*$vite$:1*/',document.head.appendChild(Xe),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]="e5342c6e-42e8-42f9-b687-9d3c9b92c073",e._sentryDebugIdIdentifier="sentry-dbid-e5342c6e-42e8-42f9-b687-9d3c9b92c073")}catch(e){}}(),Ye=n(o(),1),Je=l(),Qe=(0,Ye.createContext)(null),Ze={blink:"_blink_1k5qa_1",fourtyfive:"_fourtyfive_1k5qa_13",imageContainer:"_imageContainer_1k5qa_17",imageOverlay:"_imageOverlay_1k5qa_25"},et=n(i((e,t)=>{!function(n,o){"object"==typeof e&&void 0!==t?t.exports=o():"function"==typeof define&&define.amd?define(o):(n=n||self).autosize=o()}(e,function(){var e=new Map;function t(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!e.has(t)){var n,o=null,i=window.getComputedStyle(t),l=(n=t.value,function(){a({testForHeightReduction:""===n||!t.value.startsWith(n),restoreTextAlign:null}),n=t.value}),r=function(n){t.removeEventListener("autosize:destroy",r),t.removeEventListener("autosize:update",s),t.removeEventListener("input",l),window.removeEventListener("resize",s),Object.keys(n).forEach(function(e){return t.style[e]=n[e]}),e.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,textAlign:t.style.textAlign,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",r),t.addEventListener("autosize:update",s),t.addEventListener("input",l),window.addEventListener("resize",s),t.style.overflowX="hidden",t.style.wordWrap="break-word",e.set(t,{destroy:r,update:s}),s()}function a(e){var n,l,r=e.restoreTextAlign,s=void 0===r?null:r,d=e.testForHeightReduction,u=void 0===d||d,c=i.overflowY;if(0!==t.scrollHeight&&("vertical"===i.resize?t.style.resize="none":"both"===i.resize&&(t.style.resize="horizontal"),u&&(n=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach(function(e){var t=e[0],n=e[1];t.style.scrollBehavior="auto",t.scrollTop=n,t.style.scrollBehavior=null})}}(t),t.style.height=""),l="content-box"===i.boxSizing?t.scrollHeight-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)):t.scrollHeight+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),"none"!==i.maxHeight&&l>parseFloat(i.maxHeight)?("hidden"===i.overflowY&&(t.style.overflow="scroll"),l=parseFloat(i.maxHeight)):"hidden"!==i.overflowY&&(t.style.overflow="hidden"),t.style.height=l+"px",s&&(t.style.textAlign=s),n&&n(),o!==l&&(t.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),o=l),c!==i.overflow&&!s)){var g=i.textAlign;"hidden"===i.overflow&&(t.style.textAlign="start"===g?"end":"start"),a({restoreTextAlign:g,testForHeightReduction:!0})}}function s(){a({testForHeightReduction:!0,restoreTextAlign:null})}}function n(t){var n=e.get(t);n&&n.destroy()}function o(t){var n=e.get(t);n&&n.update()}var i=null;return"undefined"==typeof window?((i=function(e){return e}).destroy=function(e){return e},i.update=function(e){return e}):((i=function(e,n){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return t(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],n),e},i.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e}),i})})(),1),e("T",tt={blink:"_blink_11md7_2",fourtyfive:"_fourtyfive_11md7_14",cuesheetEditor:"_cuesheetEditor_11md7_18",rundownEditor:"_rundownEditor_11md7_19",content:"_content_11md7_29",timeSettings:"_timeSettings_11md7_42",column:"_column_11md7_48",decorated:"_decorated_11md7_57",delayLabel:"_delayLabel_11md7_65",switchLabel:"_switchLabel_11md7_73",inline:"_inline_11md7_83",splitTwo:"_splitTwo_11md7_89",splitThree:"_splitThree_11md7_96",tooltipIcon:"_tooltipIcon_11md7_103",customImage:"_customImage_11md7_110",textLikeInput:"_textLikeInput_11md7_117",inactive:"_inactive_11md7_126",active:"_active_11md7_130"}),nt={blink:"_blink_1h9a0_1",fourtyfive:"_fourtyfive_1h9a0_13",inputGroup:"_inputGroup_1h9a0_17",delayed:"_delayed_1h9a0_24"},ot={blink:"_blink_1opfk_1",fourtyfive:"_fourtyfive_1opfk_13",timerNote:"_timerNote_1opfk_21",timerNotePlaceholder:"_timerNotePlaceholder_1opfk_28",inactive:"_inactive_1opfk_32",active:"_active_1opfk_36",inputWrapper:"_inputWrapper_1opfk_40",hoverLabel:"_hoverLabel_1opfk_44",visible:"_visible_1opfk_57"},e("w",it=(0,Ye.memo)(mi)),lt=(0,Ye.memo)(fi),rt=(0,Ye.memo)(pi),at=[d.onLoad,d.onStart,d.onPause,d.onFinish,d.onWarning,d.onDanger],st={blink:"_blink_z76k3_1",fourtyfive:"_fourtyfive_z76k3_13",triggers:"_triggers_z76k3_17",triggerList:"_triggerList_z76k3_23",triggerHeader:"_triggerHeader_z76k3_32",trigger:"_trigger_z76k3_17",duplicateMessage:"_duplicateMessage_z76k3_56"},dt={blink:"_blink_j7a9w_1",fourtyfive:"_fourtyfive_j7a9w_13",textInput:"_textInput_j7a9w_18",under:"_under_j7a9w_32",over:"_over_j7a9w_35",muted:"_muted_j7a9w_38",disabled:"_disabled_j7a9w_41"},ut=(0,Ye.forwardRef)(({offset:e,muted:t,disabled:n,children:o,className:i,...l},r)=>{const a=(0,Ye.useRef)(null),s=U([dt.textInput,e&&dt[e],t&&dt.muted,n&&dt.disabled,i]);return(0,Ye.useImperativeHandle)(r,()=>({focusParentElement(){a.current?.parentElement?.focus()}})),(0,Je.jsx)("div",{className:s,tabIndex:n?-1:0,...l,ref:a,children:o})}),ut.displayName="TextLikeInput",ct=(0,Ye.memo)(ut),gt=a(e=>({selectedEntryId:null,setEditableEntry:t=>e({selectedEntryId:t}),clearSelection:()=>e({selectedEntryId:null})})),e("b",(0,Ye.memo)(Ci)),mt=Ye.createContext(void 0),e("y",ft=Ye.forwardRef(function(e,t){const{className:n,defaultPressed:o=!1,disabled:i=!1,form:l,onPressedChange:r,pressed:a,render:s,type:d,value:u,nativeButton:c=!0,style:g,...m}=e,f=j(u||void 0),p=function(e=!0){const t=Ye.useContext(mt);if(void 0===t&&!e)throw new Error(E(7));return t}(),h=p?.value??[],v=p?void 0:o,b=(i||p?.disabled)??!1,[_,x]=V({controlled:p?void 0!==f&&h.indexOf(f)>-1:a,default:v,name:"Toggle",state:"pressed"}),{getButtonProps:y,buttonRef:w}=H({disabled:b,native:c}),C={disabled:b,pressed:_},S=[w,t],R=[{"aria-pressed":_,onClick(e){const t=!_,n=D(F,e.nativeEvent);r?.(t,n),n.isCanceled||(f&&p?.setGroupValue?.(f,t,n),n.isCanceled||x(t))}},m,y],k=I("button",e,{enabled:!p,state:C,ref:S,props:R}),M=Ye.useMemo(()=>({disabled:b,focusableWhenDisabled:!1}),[b]);return p?(0,Je.jsx)(Re,{tag:"button",render:s,className:n,style:g,metadata:M,state:C,refs:S,props:R}):k})),pt=Ye.createContext(void 0),ht=function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e}({}),vt={multiple:e=>e?{[ht.multiple]:""}:null},e("v",bt=Ye.forwardRef(function(e,t){const{defaultValue:n,disabled:o=!1,loopFocus:i=!0,onValueChange:l,orientation:r="horizontal",multiple:a=!1,value:s,className:d,render:u,style:c,...g}=e,m=A(!0),f=Si(!0),p=Ye.useMemo(()=>void 0!==s||void 0!==n,[s,n]),h=(m?.disabled??!1)||(f?.disabled??!1)||o,[v,b]=V({controlled:s,default:void 0===s?n??R:void 0,name:"ToggleGroup",state:"value"}),_=M((e,t,n)=>{let o;a?(o=v.slice(),t?o.push(e):o.splice(v.indexOf(e),1)):o=t?[e]:[],l?.(o,n),n.isCanceled||b(o)}),x={disabled:h,multiple:a,orientation:r},y=Ye.useMemo(()=>({disabled:h,orientation:r,setGroupValue:_,value:v,isValueInitialized:p}),[h,r,_,v,p]),w={role:"group"},C=I("div",e,{enabled:Boolean(m),state:x,ref:t,props:[w,g],stateAttributesMapping:vt});return(0,Je.jsx)(mt.Provider,{value:y,children:m?C:(0,Je.jsx)(ye,{render:u,className:d,style:c,state:x,refs:[t],props:[w,g],stateAttributesMapping:vt,loopFocus:i,enableHomeAndEndKeys:!0,orientation:r})})})),e("_",_t=Ye.forwardRef(function(e,t){const{disabled:n=!1,loopFocus:o=!0,orientation:i="horizontal",className:l,render:r,style:a,...s}=e,[d,u]=Ye.useState(()=>new Map),c=Ye.useMemo(()=>{const e=[];for(const t of d.values())null!=t?.index&&t.disabled&&!t.focusableWhenDisabled&&e.push(t.index);return e},[d]),g=Ye.useMemo(()=>({disabled:n,orientation:i,setItemMap:u}),[n,i,u]),m={disabled:n,orientation:i},f={"aria-orientation":i,role:"toolbar"};return(0,Je.jsx)(L.Provider,{value:g,children:(0,Je.jsx)(ye,{render:r,className:l,style:a,state:m,refs:[t],props:[f,s],disabledIndices:c,loopFocus:o,onMapChange:u,orientation:i})})})),e("g",xt=Ye.forwardRef(function(e,t){const{className:n,disabled:o=!1,focusableWhenDisabled:i=!0,render:l,nativeButton:r=!0,style:a,...s}=e,{disabled:d,orientation:u}=A(),c=Si(!0),g=d||(c?.disabled??!1)||o,m=Ye.useMemo(()=>({disabled:g,focusableWhenDisabled:i}),[g,i]),{getButtonProps:f,buttonRef:p}=H({disabled:g,focusableWhenDisabled:i,native:r});return(0,Je.jsx)(Re,{tag:"button",render:l,className:n,style:a,metadata:m,state:{disabled:g,orientation:u,focusable:i},refs:[t,p],props:[s,l?{disabled:g}:k,f]})})),yt={hideTableSeconds:!1,hideIndexColumn:!1,showDelayedTimes:!1,hideDelays:!1},wt=a()(we(e=>({...yt,setOption:(t,n)=>e(e=>({...e,[t]:n})),toggleOption:t=>e(e=>({...e,[t]:!e[t]})),resetOptions:()=>e(yt)}),{name:"editor-options"})),e("h",function(e){return e.List="list",e.Table="table",e}({})),Ct="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,St=Ct?Ye.useLayoutEffect:Ye.useEffect,Rt={},kt=Li(1),jt=Li(-1),e("m",Et=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Et.Translate.toString(e),Et.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}})),It="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]",Dt={display:"none"},Mt=n(_()),Nt=(0,Ye.createContext)(null),Ft={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},zt={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}},function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Pt||(Pt={})),Tt=Object.freeze({x:0,y:0}),e("d",e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=Qi(t,t.left,t.top),l=[];for(const r of o){const{id:e}=r,t=n.get(e);if(t){const n=$i(Qi(t),i);l.push({id:e,data:{droppableContainer:r,value:n}})}}return l.sort(Xi)}),Vt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=Ji(t),l=[];for(const r of o){const{id:e}=r,t=n.get(e);if(t){const n=Ji(t),o=i.reduce((e,t,o)=>e+$i(n[o],t),0),a=Number((o/4).toFixed(4));l.push({id:e,data:{droppableContainer:r,value:a}})}}return l.sort(Xi)},Lt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=[];for(const l of o){const{id:e}=l,o=n.get(e);if(o){const n=Zi(o,t);n>0&&i.push({id:e,data:{droppableContainer:l,value:n}})}}return i.sort(Yi)},At=tl(1),Ot={ignoreTransform:!1},function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Ht||(Ht={})),Gt={x:.2,y:.2},Bt=[["x",["left","right"],pl],["y",["top","bottom"],hl]],Ut=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=il(t),o=fl(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,l,r]of Bt)for(const e of l)Object.defineProperty(this,e,{get:()=>{const t=r(n),l=o[i]-t;return this.rect[e]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},qt=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}},function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Wt||(Wt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Kt||(Kt={})),$t={start:[Kt.Space,Kt.Enter],cancel:[Kt.Esc],end:[Kt.Space,Kt.Enter,Kt.Tab]},Xt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Kt.Right:return{...n,x:n.x+25};case Kt.Left:return{...n,x:n.x-25};case Kt.Down:return{...n,y:n.y+25};case Kt.Up:return{...n,y:n.y-25}}},Yt=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new qt(Mi(t)),this.windowListeners=new qt(ji(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Wt.Resize,this.handleCancel),this.windowListeners.add(Wt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Wt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=nl),!e)return;const{top:n,left:o,bottom:i,right:l}=t(e);ll(e)&&(i<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Tt)}handleKeyDown(e){if(Ai(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:i=$t,coordinateGetter:l=Xt,scrollBehavior:r="smooth"}=o,{code:a}=e;if(i.end.includes(a))return void this.handleEnd(e);if(i.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,d=s?{x:s.left,y:s.top}:Tt;this.referenceCoordinates||(this.referenceCoordinates=d);const u=l(e,{active:t,context:n.current,currentCoordinates:d});if(u){const t=jt(u,d),o={x:0,y:0},{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code,{isTop:l,isRight:a,isLeft:s,isBottom:d,maxScroll:c,minScroll:g}=cl(n),m=ml(n),f={x:Math.min(i===Kt.Right?m.right-m.width/2:m.right,Math.max(i===Kt.Right?m.left:m.left+m.width/2,u.x)),y:Math.min(i===Kt.Down?m.bottom-m.height/2:m.bottom,Math.max(i===Kt.Down?m.top:m.top+m.height/2,u.y))},p=i===Kt.Right&&!a||i===Kt.Left&&!s,h=i===Kt.Down&&!d||i===Kt.Up&&!l;if(p&&f.x!==u.x){const e=n.scrollLeft+t.x,l=i===Kt.Right&&e<=c.x||i===Kt.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:r});o.x=l?n.scrollLeft-e:i===Kt.Right?n.scrollLeft-c.x:n.scrollLeft-g.x,o.x&&n.scrollBy({left:-o.x,behavior:r});break}if(h&&f.y!==u.y){const e=n.scrollTop+t.y,l=i===Kt.Down&&e<=c.y||i===Kt.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:r});o.y=l?n.scrollTop-e:i===Kt.Down?n.scrollTop-c.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:r});break}}this.handleMove(e,kt(jt(u,this.referenceCoordinates),o))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}},Yt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=$t,onActivation:i}=t,{active:l}=n;const{code:r}=e.nativeEvent;if(o.start.includes(r)){const t=l.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),i?.({event:e.nativeEvent}),0))}return!1}}],Jt=class{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=ji(e);return e instanceof t?e:Mi(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:l}=i;this.props=e,this.events=t,this.document=Mi(l),this.documentListeners=new qt(this.document),this.listeners=new qt(n),this.windowListeners=new qt(ji(l)),this.initialCoordinates=null!=(o=Oi(i))?o:Tt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Wt.Resize,this.handleCancel),this.windowListeners.add(Wt.DragStart,bl),this.windowListeners.add(Wt.VisibilityChange,this.handleCancel),this.windowListeners.add(Wt.ContextMenu,bl),this.documentListeners.add(Wt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(yl(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(xl(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:o}=this.props;o(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Wt.Click,_l,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Wt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:l,options:{activationConstraint:r}}=i;if(!o)return;const a=null!=(t=Oi(e))?t:Tt,s=jt(o,a);if(!n&&r){if(xl(r)){if(null!=r.tolerance&&vl(s,r.tolerance))return this.handleCancel();if(vl(s,r.distance))return this.handleStart()}return yl(r)&&vl(s,r.tolerance)?this.handleCancel():void this.handlePending(r,s)}e.cancelable&&e.preventDefault(),l(a)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Kt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}},Qt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},e("u",Zt=class extends Jt{constructor(e){const{event:t}=e,n=Mi(t.target);super(e,Qt,n)}}),Zt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button||(o?.({event:n}),0))}}],en={move:{name:"mousemove"},end:{name:"mouseup"}},function(e){e[e.RightClick=2]="RightClick"}(tn||(tn={})),class extends Jt{constructor(e){super(e,en,Mi(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==tn.RightClick&&(o?.({event:n}),!0)}}],nn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},on=class extends Jt{constructor(e){super(e,nn)}static setup(){return window.addEventListener(nn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(nn.move.name,e)};function e(){}}},on.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:i}=n;return!(i.length>1||(o?.({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(ln||(ln={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(rn||(rn={})),an={x:{[Ht.Backward]:!1,[Ht.Forward]:!1},y:{[Ht.Backward]:!1,[Ht.Forward]:!1}},function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(sn||(sn={})),function(e){e.Optimized="optimized"}(dn||(dn={})),un=new Map,cn=[],gn=[],mn=[{sensor:Zt,options:{}},{sensor:Yt,options:{}}],fn={current:{}},pn={draggable:{measure:ol},droppable:{measure:ol,strategy:sn.WhileDragging,frequency:dn.Optimized},dragOverlay:{measure:nl}},hn=class extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}},vn={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new hn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:qi},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pn,measureDroppableContainers:qi,windowRect:null,measuringScheduled:!1},bn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:qi,draggableNodes:new Map,over:null,measureDroppableContainers:qi},_n=(0,Ye.createContext)(bn),xn=(0,Ye.createContext)(vn),yn=(0,Ye.createContext)({...Tt,scaleX:1,scaleY:1}),function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(wn||(wn={})),e("l",Cn=(0,Ye.memo)(function(e){var t,n,o,i;let{id:l,accessibility:r,autoScroll:a=!0,children:s,sensors:d=mn,collisionDetection:u=Lt,measuring:c,modifiers:g,...m}=e;const[f,p]=(0,Ye.useReducer)(Ml,void 0,Dl),[h,v]=function(){const[e]=(0,Ye.useState)(()=>new Set),t=(0,Ye.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,Ye.useCallback)(t=>{let{type:n,event:o}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)})},[e]),t]}(),[b,_]=(0,Ye.useState)(wn.Uninitialized),x=b===wn.Initialized,{draggable:{active:y,nodes:w,translate:C},droppable:{containers:S}}=f,R=null!=y?w.get(y):null,k=(0,Ye.useRef)({initial:null,translated:null}),j=(0,Ye.useMemo)(()=>{var e;return null!=y?{id:y,data:null!=(e=null==R?void 0:R.data)?e:fn,rect:k}:null},[y,R]),E=(0,Ye.useRef)(null),[I,D]=(0,Ye.useState)(null),[M,N]=(0,Ye.useState)(null),F=Fi(m,Object.values(m)),z=Vi("DndDescribedBy",l),P=(0,Ye.useMemo)(()=>S.getEnabled(),[S]),T=(V=c,(0,Ye.useMemo)(()=>({draggable:{...pn.draggable,...null==V?void 0:V.draggable},droppable:{...pn.droppable,...null==V?void 0:V.droppable},dragOverlay:{...pn.dragOverlay,...null==V?void 0:V.dragOverlay}}),[null==V?void 0:V.draggable,null==V?void 0:V.droppable,null==V?void 0:V.dragOverlay]));var V;const{droppableRects:L,measureDroppableContainers:A,measuringScheduled:O}=function(e,t){let{dragging:n,dependencies:o,config:i}=t;const[l,r]=(0,Ye.useState)(null),{frequency:a,measure:s,strategy:d}=i,u=(0,Ye.useRef)(e),c=function(){switch(d){case sn.Always:return!1;case sn.BeforeDragging:return n;default:return!n}}(),g=Fi(c),m=(0,Ye.useCallback)(function(e){void 0===e&&(e=[]),g.current||r(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[g]),f=(0,Ye.useRef)(null),p=zi(t=>{if(c&&!n)return un;if(!t||t===un||u.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new Ut(s(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,l,n,c,s]);return(0,Ye.useEffect)(()=>{u.current=e},[e]),(0,Ye.useEffect)(()=>{c||m()},[n,c]),(0,Ye.useEffect)(()=>{l&&l.length>0&&r(null)},[JSON.stringify(l)]),(0,Ye.useEffect)(()=>{c||"number"!=typeof a||null!==f.current||(f.current=setTimeout(()=>{m(),f.current=null},a))},[a,c,m,...o]),{droppableRects:p,measureDroppableContainers:m,measuringScheduled:null!=l}}(P,{dragging:x,dependencies:[C.x,C.y],config:T.droppable}),H=function(e,t){const n=null!=t?e.get(t):void 0,o=n?n.node.current:null;return zi(e=>{var n;return null==t?null:null!=(n=null!=o?o:e)?n:null},[o,t])}(w,y),G=(0,Ye.useMemo)(()=>M?Oi(M):null,[M]),B=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=x&&!e&&!t;return"object"==typeof a?{...a,enabled:n}:{enabled:n}}(),U=function(e,t){return Cl(e,t)}(H,T.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:i=!0}=e;const l=(0,Ye.useRef)(!1),{x:r,y:a}="boolean"==typeof i?{x:i,y:i}:i;St(()=>{if(!r&&!a||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const i=el(n(e),o);if(r||(i.x=0),a||(i.y=0),l.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){const t=ll(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,r,a,o,n])}({activeNode:null!=y?w.get(y):null,config:B.layoutShiftCompensation,initialRect:U,measure:T.draggable.measure});const q=kl(H,T.draggable.measure,U),W=kl(H?H.parentElement:null),K=(0,Ye.useRef)({activatorEvent:null,active:null,activeNode:H,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:w,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),$=S.getNodeFor(null==(t=K.current.over)?void 0:t.id),X=Il({measure:T.dragOverlay.measure}),Y=null!=(n=X.nodeRef.current)?n:H,J=x?null!=(o=X.rect)?o:q:null,Q=Boolean(X.nodeRef.current&&X.rect),Z=el(ee=Q?null:q,Cl(ee));var ee;const te=El(Y?ji(Y):null),ne=function(e){const t=(0,Ye.useRef)(e),n=zi(n=>e?n&&n!==cn&&e&&t.current&&e.parentNode===t.current.parentNode?n:il(e):cn,[e]);return(0,Ye.useEffect)(()=>{t.current=e},[e]),n}(x?null!=$?$:H:null),oe=function(e,t){void 0===t&&(t=nl);const[n]=e,o=El(n?ji(n):null),[i,l]=(0,Ye.useState)(gn);function r(){l(()=>e.length?e.map(e=>ul(e)?o:new Ut(t(e),e)):gn)}const a=Sl({callback:r});return St(()=>{a?.disconnect(),r(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),i}(ne),ie=function(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...o}),n):n}(g,{transform:{x:C.x-Z.x,y:C.y-Z.y,scaleX:1,scaleY:1},activatorEvent:M,active:j,activeNodeRect:q,containerNodeRect:W,draggingNodeRect:J,over:K.current.over,overlayNodeRect:X.rect,scrollableAncestors:ne,scrollableAncestorRects:oe,windowRect:te}),le=G?kt(G,C):null,re=function(e){const[t,n]=(0,Ye.useState)(null),o=(0,Ye.useRef)(e),i=(0,Ye.useCallback)(e=>{const t=rl(e.target);t&&n(e=>e?(e.set(t,dl(t)),new Map(e)):null)},[]);return(0,Ye.useEffect)(()=>{const t=o.current;if(e!==t){l(t);const r=e.map(e=>{const t=rl(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,dl(t)]):null}).filter(e=>null!=e);n(r.length?new Map(r):null),o.current=e}return()=>{l(e),l(t)};function l(e){e.forEach(e=>{rl(e)?.removeEventListener("scroll",i)})}},[i,e]),(0,Ye.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>kt(e,t),Tt):fl(e):Tt,[e,t])}(ne),ae=jl(re),se=jl(re,[q]),de=kt(ie,ae),ue=J?At(J,ie):null,ce=j&&ue?u({active:j,collisionRect:ue,droppableRects:L,droppableContainers:P,pointerCoordinates:le}):null,ge=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(ce,"id"),[me,fe]=(0,Ye.useState)(null),pe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Q?ie:kt(ie,se),null!=(i=null==me?void 0:me.rect)?i:null,q),he=(0,Ye.useRef)(null),ve=(0,Ye.useCallback)((e,t)=>{let{sensor:n,options:o}=t;if(null==E.current)return;const i=w.get(E.current);if(!i)return;const l=e.nativeEvent;function r(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:i}=K.current;let r=null;if(t&&i){const{cancelDrop:a}=F.current;r={activatorEvent:l,active:t,collisions:n,delta:i,over:o},e===Pt.DragEnd&&"function"==typeof a&&await Promise.resolve(a(r))&&(e=Pt.DragCancel)}E.current=null,(0,Mt.unstable_batchedUpdates)(()=>{p({type:e}),_(wn.Uninitialized),fe(null),D(null),N(null),he.current=null;const t=e===Pt.DragEnd?"onDragEnd":"onDragCancel";if(r){const e=F.current[t];e?.(r),h({type:t,event:r})}})}}he.current=new n({active:E.current,activeNode:i,event:l,options:o,context:K,onAbort(e){if(!w.get(e))return;const{onDragAbort:t}=F.current,n={id:e};t?.(n),h({type:"onDragAbort",event:n})},onPending(e,t,n,o){if(!w.get(e))return;const{onDragPending:i}=F.current,l={id:e,constraint:t,initialCoordinates:n,offset:o};i?.(l),h({type:"onDragPending",event:l})},onStart(e){const t=E.current;if(null==t)return;const n=w.get(t);if(!n)return;const{onDragStart:o}=F.current,i={activatorEvent:l,active:{id:t,data:n.data,rect:k}};(0,Mt.unstable_batchedUpdates)(()=>{o?.(i),_(wn.Initializing),p({type:Pt.DragStart,initialCoordinates:e,active:t}),h({type:"onDragStart",event:i}),D(he.current),N(l)})},onMove(e){p({type:Pt.DragMove,coordinates:e})},onEnd:r(Pt.DragEnd),onCancel:r(Pt.DragCancel)})},[w]),be=function(e,t){return(0,Ye.useMemo)(()=>e.reduce((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(d,(0,Ye.useCallback)((e,t)=>(n,o)=>{const i=n.nativeEvent,l=w.get(o);if(null!==E.current||!l||i.dndKit||i.defaultPrevented)return;const r={active:l};!0===e(n,t.options,r)&&(i.dndKit={capturedBy:t.sensor},E.current=o,ve(n,t))},[w,ve]));!function(e){(0,Ye.useEffect)(()=>{if(!Ct)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}(d),St(()=>{q&&b===wn.Initializing&&_(wn.Initialized)},[q,b]),(0,Ye.useEffect)(()=>{const{onDragMove:e}=F.current,{active:t,activatorEvent:n,collisions:o,over:i}=K.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:o,delta:{x:de.x,y:de.y},over:i};(0,Mt.unstable_batchedUpdates)(()=>{e?.(l),h({type:"onDragMove",event:l})})},[de.x,de.y]),(0,Ye.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:i}=K.current;if(!e||null==E.current||!t||!i)return;const{onDragOver:l}=F.current,r=o.get(ge),a=r&&r.rect.current?{id:r.id,rect:r.rect.current,data:r.data,disabled:r.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:a};(0,Mt.unstable_batchedUpdates)(()=>{fe(a),l?.(s),h({type:"onDragOver",event:s})})},[ge]),St(()=>{K.current={activatorEvent:M,active:j,activeNode:H,collisionRect:ue,collisions:ce,droppableRects:L,draggableNodes:w,draggingNode:Y,draggingNodeRect:J,droppableContainers:S,over:me,scrollableAncestors:ne,scrollAdjustedTranslate:de},k.current={initial:J,translated:ue}},[j,H,ce,ue,w,Y,J,L,S,me,ne,de]),wl({...B,delta:C,draggingRect:ue,pointerCoordinates:le,scrollableAncestors:ne,scrollableAncestorRects:oe});const _e=(0,Ye.useMemo)(()=>({active:j,activeNode:H,activeNodeRect:q,activatorEvent:M,collisions:ce,containerNodeRect:W,dragOverlay:X,draggableNodes:w,droppableContainers:S,droppableRects:L,over:me,measureDroppableContainers:A,scrollableAncestors:ne,scrollableAncestorRects:oe,measuringConfiguration:T,measuringScheduled:O,windowRect:te}),[j,H,q,M,ce,W,X,w,S,L,me,A,ne,oe,T,O,te]),xe=(0,Ye.useMemo)(()=>({activatorEvent:M,activators:be,active:j,activeNodeRect:q,ariaDescribedById:{draggable:z},dispatch:p,draggableNodes:w,over:me,measureDroppableContainers:A}),[M,be,j,q,p,z,w,me,A]);return Ye.createElement(Nt.Provider,{value:v},Ye.createElement(_n.Provider,{value:xe},Ye.createElement(xn.Provider,{value:_e},Ye.createElement(yn.Provider,{value:pe},s)),Ye.createElement(Nl,{disabled:!1===(null==r?void 0:r.restoreFocus)})),Ye.createElement(Ui,{...r,hiddenTextDescribedById:z}))})),Sn=(0,Ye.createContext)(null),Rn="button",kn="Draggable",jn="Droppable",En={timeout:25},In=Object.defineProperty,Dn=Object.getOwnPropertySymbols,Mn=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable,Fn=(e,t,n)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zn=(e,t)=>{for(var n in t||(t={}))Mn.call(t,n)&&Fn(e,n,t[n]);if(Dn)for(var n of Dn(t))Nn.call(t,n)&&Fn(e,n,t[n]);return e},Pn={Cell:'[role="cell"],[role="gridcell"],[role="columnheader"],[role="rowheader"],td,th',Row:'[role="row"],tr',RowGroup:'[role="rowgroup"],thead,tbody,tfoot',Focusable:'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not([aria-disabled="true"]):not([tabindex="-1"]):not(:disabled),*[tabindex]'},Tn=class{constructor(e={}){this.keys=[],this.debugLog=(e,t)=>{this.debug&&console.info(`[${e}]: ${t}`)};const{selectors:t={},pageUpDown:n,debug:o=!1}=e;this.selectors=zn(zn({},Pn),t),this.pageUpDown=n,this.keys=[],this.debug=o,this.disabled=!1}disable(){this.disabled=!0}enable(){this.disabled=!1}isFocusable(e){return e instanceof HTMLElement||e instanceof SVGElement}tableKeyUp(){this.keys=[]}tableKeyDown(e){var t;if(this.debugLog("tableKeyDown",`Key pressed: ${e.key}`),this.disabled)return void this.debugLog("tableKeyDown","interaction is disabled");if("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.preventDefault(),0!==this.keys.length&&this.keys[this.keys.length-1]===e.key||this.keys.push(e.key),!(e.target instanceof Element))return;const n=null==(t=e.target.parentElement)?void 0:t.closest(`${this.selectors.Cell},${this.selectors.Row}`);n?n.matches(this.selectors.Cell)?(this.debugLog("tableKeyDown","event captured in cell"),this.cellNavigation(e)):(this.debugLog("tableKeyDown","event captured in cell"),this.gridNavigation(e)):this.debugLog("tableKeyDown","cell not found")}cellNavigation(e){if(e.target instanceof Element){if("Escape"===e.key){const t=e.target.closest(this.selectors.Cell);if(t&&this.isFocusable(t))return void t.focus()}if("ArrowRight"===e.key||"ArrowDown"===e.key){const t=e.target.closest(this.selectors.Cell);if(!t)return void this.debugLog("cellNavigation","cell not found");const n=[...t.querySelectorAll(this.selectors.Focusable)],o=n.findIndex(t=>t===e.target),i=n[o===n.length-1?0:o+1];return void(this.isFocusable(i)&&i.focus())}if("ArrowLeft"===e.key||"ArrowUp"===e.key){const t=e.target.closest(this.selectors.Cell);if(!t)return void this.debugLog("cellNavigation","cell not found");const n=[...t.querySelectorAll(this.selectors.Focusable)],o=n.findIndex(t=>t===e.target),i=n[0===o?n.length-1:o-1];return void(this.isFocusable(i)&&i.focus())}}}gridNavigation(e){var t;const{target:n}=e;if(e.target instanceof Element&&n instanceof Element)if(1===this.keys.length){if("Enter"===e.key){const t=e.target.querySelector(this.selectors.Focusable);t&&this.isFocusable(t)&&(t.focus(),e.preventDefault())}if("ArrowLeft"===e.key||"ArrowRight"===e.key){const t="ArrowLeft"===e.key?"prev":"next",n=e.target.closest(this.selectors.Cell);if(n&&n instanceof Element){const e=this.findUntil(t,n,this.selectors.Cell);e&&e.focus()}}if("ArrowDown"===e.key||"ArrowUp"===e.key)return void this.verticalCellNavigation(e);if("PageUp"===e.key||"PageDown"===e.key)return void this.pageCellNavigation(e);if("Home"===e.key||"End"===e.key){const t=e.target.closest(this.selectors.Row),n=[...(null==t?void 0:t.children)||[]];"End"===e.key&&n.reverse(),this.focusOnFirstCell(n)}}else{const[n,o]=this.keys;if("Control"===n&&("Home"===o||"End"===o)){const n=null==(t=e.target.closest(this.selectors.Row).parentElement)?void 0:t.children;if(!n)return void this.debugLog("cellNavigation","siblings not found");const i="Home"===o?n[0]:n[n.length-1],l=[...(null==i?void 0:i.children)||[]];"End"===o&&l.reverse(),this.focusOnFirstCell(l)}}}pageCellNavigation(e){var t;if(!(e.target instanceof Element))return;const n=e.target.closest(this.selectors.Row),o=e.target.closest(this.selectors.Cell);if(n&&o){const i=this.getColumnIndex(o);if(void 0===i)return void this.debugLog("cellNavigation","position not found");const l="PageUp"===e.key?"prev":"next",r=null==(t=n.parentElement)?void 0:t.children;if(!r)return void this.debugLog("cellNavigation","siblings not found");let a;if(this.pageUpDown){const e="prev"===l?"previousSibling":"nextSibling";let t=n[e];if(null===t)return;let o=t;for(let n=0;n<this.pageUpDown-1&&t;n++)t=t[e],t&&(o=t);a=t||o}else a="prev"===l?r[0]:r[r.length-1];if(!(a&&a instanceof Element))return;const s=a.children[i];s&&this.isFocusable(s)&&s.focus()}}verticalCellNavigation(e){var t,n,o,i,l;if(!(e.target instanceof Element))return;const r=e.target.closest(this.selectors.Row),a=e.target.closest(this.selectors.Cell);if(r&&a){const s=this.getColumnIndex(a),d=this.getRowIndex(r);if(this.debugLog("gridNavigation",`Initial row position: ${d}`),this.debugLog("gridNavigation",`Initial cell position: ${s}`),void 0===s||void 0===d)return void this.debugLog("verticalCellNavigation","row or cell position not found");const u="ArrowUp"===e.key?"prev":"next";if(0===d&&"prev"===u){const e=null==(t=r.parentElement)?void 0:t.closest(this.selectors.RowGroup),o=[...(null==(n=null==e?void 0:e.parentElement)?void 0:n.children)||[]],i=o.findIndex(t=>t===e);if(0!==i){const e=[...o[i-1].querySelectorAll(this.selectors.Row)],t=e[e.length-1].children[s];return void(t&&this.isFocusable(t)&&t.focus())}}if(d===[...(null==(o=r.parentElement)?void 0:o.querySelectorAll(this.selectors.Row))||[]].length-1&&"next"===u){const e=null==(i=r.parentElement)?void 0:i.closest(this.selectors.RowGroup),t=[...(null==(l=null==e?void 0:e.parentElement)?void 0:l.children)||[]],n=t.findIndex(t=>t===e);if(n!==t.length-1){const e=[...t[n+1].querySelectorAll(this.selectors.Row)][0].children[s];return void(e&&this.isFocusable(e)&&e.focus())}return}const c=this.findUntil(u,r,this.selectors.Row);if(!c)return;const g=c.children[s];g&&this.isFocusable(g)&&g.focus()}}focusOnFirstCell(e){for(let t=0;t<e.length;t++){const n=e[t];if(this.isFocusable(n))return void n.focus()}}getColumnIndex(e){var t;let n=0;const o=null==(t=null==e?void 0:e.parentNode)?void 0:t.children;if(o){for(;e!==o[n]&&void 0!==o[n];)n++;if(void 0!==o[n])return n;this.debugLog("getColumnIndex","position finding was not successful")}}getRowIndex(e){var t;let n=0;const o=null==(t=null==e?void 0:e.parentNode)?void 0:t.children;if(o){for(;e!==o[n]&&void 0!==o[n];)n++;if(void 0!==o[n])return n;this.debugLog("getRowIndex","position finding was not successful")}}findUntil(e,t,n,o){let i=t;const l="next"===e?"nextSibling":"previousSibling";for(;i[l];){const e=i[l];if(!e)return null;if(o&&e instanceof Element&&e.matches(o))return null;if(e instanceof Element&&e.matches(n))return e;i=e}return null}},Vn="debugHeaders",Ln={createTable:e=>{e.getHeaderGroups=Al(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,i)=>{var l,r;const a=null!=(l=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?l:[],s=null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],d=n.filter(e=>!(null!=o&&o.includes(e.id)||null!=i&&i.includes(e.id)));return Gl(t,[...a,...d,...s],e)},Ol(e.options,Vn)),e.getCenterHeaderGroups=Al(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,i)=>(n=n.filter(e=>!(null!=o&&o.includes(e.id)||null!=i&&i.includes(e.id))),Gl(t,n,e,"center")),Ol(e.options,Vn)),e.getLeftHeaderGroups=Al(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var i;return Gl(t,null!=(i=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],e,"left")},Ol(e.options,Vn)),e.getRightHeaderGroups=Al(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var i;return Gl(t,null!=(i=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],e,"right")},Ol(e.options,Vn)),e.getFooterGroups=Al(()=>[e.getHeaderGroups()],e=>[...e].reverse(),Ol(e.options,Vn)),e.getLeftFooterGroups=Al(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),Ol(e.options,Vn)),e.getCenterFooterGroups=Al(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),Ol(e.options,Vn)),e.getRightFooterGroups=Al(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),Ol(e.options,Vn)),e.getFlatHeaders=Al(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),Ol(e.options,Vn)),e.getLeftFlatHeaders=Al(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),Ol(e.options,Vn)),e.getCenterFlatHeaders=Al(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),Ol(e.options,Vn)),e.getRightFlatHeaders=Al(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),Ol(e.options,Vn)),e.getCenterLeafHeaders=Al(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),Ol(e.options,Vn)),e.getLeftLeafHeaders=Al(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),Ol(e.options,Vn)),e.getRightLeafHeaders=Al(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),Ol(e.options,Vn)),e.getLeafHeaders=Al(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var o,i,l,r,a,s;return[...null!=(o=null==(i=e[0])?void 0:i.headers)?o:[],...null!=(l=null==(r=t[0])?void 0:r.headers)?l:[],...null!=(a=null==(s=n[0])?void 0:s.headers)?a:[]].map(e=>e.getLeafHeaders()).flat()},Ol(e.options,Vn))}},An=(e,t,n,o,i,l,r)=>{let a={id:t,index:o,original:n,depth:i,parentId:r,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(a._valuesCache.hasOwnProperty(t))return a._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(a._valuesCache[t]=n.accessorFn(a.original,o),a._valuesCache[t]):void 0},getUniqueValues:t=>{if(a._uniqueValuesCache.hasOwnProperty(t))return a._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(a._uniqueValuesCache[t]=n.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[t]):(a._uniqueValuesCache[t]=[a.getValue(t)],a._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=a.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=l?l:[],getLeafRows:()=>function(e,t){const n=[],o=e=>{e.forEach(e=>{n.push(e);const i=t(e);null!=i&&i.length&&o(i)})};return o(e),n}(a.subRows,e=>e.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let e=[],t=a;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:Al(()=>[e.getAllLeafColumns()],t=>t.map(t=>function(e,t,n,o){const i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>{var t;return null!=(t=i.getValue())?t:e.options.renderFallbackValue},getContext:Al(()=>[e,n,t,i],(e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue}),Ol(e.options,"debugCells"))};return e._features.forEach(o=>{null==o.createCell||o.createCell(i,n,t,e)},{}),i}(e,a,t,t.id)),Ol(e.options,"debugRows")),_getAllCellsByColumnId:Al(()=>[a.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),Ol(e.options,"debugRows"))};for(let s=0;s<e._features.length;s++){const t=e._features[s];null==t||null==t.createRow||t.createRow(a,e)}return a},On={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Hn=(e,t,n)=>{var o,i;const l=null==n||null==(o=n.toString())?void 0:o.toLowerCase();return Boolean(null==(i=e.getValue(t))||null==(i=i.toString())||null==(i=i.toLowerCase())?void 0:i.includes(l))},Hn.autoRemove=e=>Bl(e),Gn=(e,t,n)=>{var o;return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.includes(n))},Gn.autoRemove=e=>Bl(e),Bn=(e,t,n)=>{var o;return(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.toLowerCase())===(null==n?void 0:n.toLowerCase())},Bn.autoRemove=e=>Bl(e),Un=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)},Un.autoRemove=e=>Bl(e),qn=(e,t,n)=>!n.some(n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))}),qn.autoRemove=e=>Bl(e)||!(null!=e&&e.length),Wn=(e,t,n)=>n.some(n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)}),Wn.autoRemove=e=>Bl(e)||!(null!=e&&e.length),Kn=(e,t,n)=>e.getValue(t)===n,Kn.autoRemove=e=>Bl(e),$n=(e,t,n)=>e.getValue(t)==n,$n.autoRemove=e=>Bl(e),Xn=(e,t,n)=>{let[o,i]=n;const l=e.getValue(t);return l>=o&&l<=i},Xn.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,i="number"!=typeof n?parseFloat(n):n,l=null===t||Number.isNaN(o)?-1/0:o,r=null===n||Number.isNaN(i)?1/0:i;if(l>r){const e=l;l=r,r=e}return[l,r]},Xn.autoRemove=e=>Bl(e)||Bl(e[0])&&Bl(e[1]),Yn={includesString:Hn,includesStringSensitive:Gn,equalsString:Bn,arrIncludes:Un,arrIncludesAll:qn,arrIncludesSome:Wn,equals:Kn,weakEquals:$n,inNumberRange:Xn},Jn={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Vl("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"string"==typeof o?Yn.includesString:"number"==typeof o?Yn.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?Yn.equals:Array.isArray(o)?Yn.arrIncludes:Yn.weakEquals},e.getFilterFn=()=>{var n,o;return Ll(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(o=t.options.filterFns)?void 0:o[e.columnDef.filterFn])?n:Yn[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,i;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(o=t.options.enableColumnFilters)||o)&&(null==(i=t.options.enableFilters)||i)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().columnFilters)?void 0:o.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{const o=e.getFilterFn(),i=null==t?void 0:t.find(t=>t.id===e.id),l=Tl(n,i?i.value:void 0);var r;if(Ul(o,l,e))return null!=(r=null==t?void 0:t.filter(t=>t.id!==e.id))?r:[];const a={id:e.id,value:l};var s;return i?null!=(s=null==t?void 0:t.map(t=>t.id===e.id?a:t))?s:[]:null!=t&&t.length?[...t,a]:[a]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var o;return null==(o=Tl(t,e))?void 0:o.filter(e=>{const t=n.find(t=>t.id===e.id);return!t||!Ul(t.getFilterFn(),e.value,t)})})},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}},Qn=(e,t,n)=>{let o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)}),o},Zn=(e,t,n)=>{let o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)}),o},eo=(e,t,n)=>{let o,i;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=i=n):(o>n&&(o=n),i<n&&(i=n)))}),[o,i]},to=(e,t)=>{let n=0,o=0;if(t.forEach(t=>{let i=t.getValue(e);null!=i&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},no=(e,t)=>{if(!t.length)return;const n=t.map(t=>t.getValue(e));if(o=n,!Array.isArray(o)||!o.every(e=>"number"==typeof e))return;var o;if(1===n.length)return n[0];const i=Math.floor(n.length/2),l=n.sort((e,t)=>e-t);return n.length%2!=0?l[i]:(l[i-1]+l[i])/2},oo={sum:(e,t,n)=>n.reduce((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)},0),min:Qn,max:Zn,extent:eo,mean:to,median:no,unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},io={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Vl("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,o;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(o=t.options.enableGrouping)||o)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?oo.sum:"[object Date]"===Object.prototype.toString.call(o)?oo.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return Ll(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:oo[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return null!=o&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}},lo={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Vl("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Al(e=>[Wl(t,e)],t=>t.findIndex(t=>t.id===e.id),Ol(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var o;return(null==(o=Wl(t,n)[0])?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const i=Wl(t,n);return(null==(o=i[i.length-1])?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=Al(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>o=>{let i=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex(t=>t.id===e);o>-1&&i.push(n.splice(o,1)[0])}i=[...i,...n]}else i=o;return function(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter(e=>!t.includes(e.id));return"remove"===n?o:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...o]}(i,t,n)},Ol(e.options,"debugTable"))}},ro={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:Vl("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,i,l,r,a,s;return"right"===n?{left:(null!=(l=null==e?void 0:e.left)?l:[]).filter(e=>!(null!=o&&o.includes(e))),right:[...(null!=(r=null==e?void 0:e.right)?r:[]).filter(e=>!(null!=o&&o.includes(e))),...o]}:"left"===n?{left:[...(null!=(a=null==e?void 0:e.left)?a:[]).filter(e=>!(null!=o&&o.includes(e))),...o],right:(null!=(s=null==e?void 0:e.right)?s:[]).filter(e=>!(null!=o&&o.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=o&&o.includes(e))),right:(null!=(i=null==e?void 0:e.right)?i:[]).filter(e=>!(null!=o&&o.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,o,i;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(o=null!=(i=t.options.enableColumnPinning)?i:t.options.enablePinning)||o)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(e=>e.id),{left:o,right:i}=t.getState().columnPinning,l=n.some(e=>null==o?void 0:o.includes(e)),r=n.some(e=>null==i?void 0:i.includes(e));return l?"left":!!r&&"right"},e.getPinnedIndex=()=>{var n,o;const i=e.getIsPinned();return i?null!=(n=null==(o=t.getState().columnPinning)||null==(o=o[i])?void 0:o.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Al(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!o.includes(e.column.id))},Ol(t.options,"debugRows")),e.getLeftVisibleCells=Al(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),Ol(t.options,"debugRows")),e.getRightVisibleCells=Al(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),Ol(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(o=e.initialState)?void 0:o.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;var i,l;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(i=o.left)?void 0:i.length)||(null==(l=o.right)?void 0:l.length))},e.getLeftLeafColumns=Al(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),Ol(e.options,"debugColumns")),e.getRightLeafColumns=Al(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),Ol(e.options,"debugColumns")),e.getCenterLeafColumns=Al(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!o.includes(e.id))},Ol(e.options,"debugColumns"))}},ao={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},so={getDefaultColumnDef:()=>ao,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Vl("columnSizing",e),onColumnSizingInfoChange:Vl("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,i;const l=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:ao.minSize,null!=(o=null!=l?l:e.columnDef.size)?o:ao.size),null!=(i=e.columnDef.maxSize)?i:ao.maxSize)},e.getStart=Al(e=>[e,Wl(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),Ol(t.options,"debugColumns")),e.getAfter=Al(e=>[e,Wl(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),Ol(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...o}=t;return o})},e.getCanResize=()=>{var n,o;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(o=t.options.enableColumnResizing)||o)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var o;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(o=e.column.getSize())?o:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),i=null==o?void 0:o.getCanResize();return l=>{if(!o||!i)return;if(null==l.persist||l.persist(),ql(l)&&l.touches&&l.touches.length>1)return;const r=e.getSize(),a=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[o.id,o.getSize()]],s=ql(l)?Math.round(l.touches[0].clientX):l.clientX,d={},u=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var o,i;const l="rtl"===t.options.columnResizeDirection?-1:1,r=(n-(null!=(o=null==e?void 0:e.startOffset)?o:0))*l,a=Math.max(r/(null!=(i=null==e?void 0:e.startSize)?i:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;d[t]=Math.round(100*Math.max(n+n*a,0))/100}),{...e,deltaOffset:r,deltaPercentage:a}}),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing(e=>({...e,...d})))},c=e=>u("move",e),g=e=>{u("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=n||("undefined"!=typeof document?document:null),f={moveHandler:e=>c(e.clientX),upHandler:e=>{m?.removeEventListener("mousemove",f.moveHandler),m?.removeEventListener("mouseup",f.upHandler),g(e.clientX)}},p={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(e.touches[0].clientX),!1),upHandler:e=>{var t;m?.removeEventListener("touchmove",p.moveHandler),m?.removeEventListener("touchend",p.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(null==(t=e.touches[0])?void 0:t.clientX)}},h=!!function(){if("boolean"==typeof uo)return uo;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return uo=e}()&&{passive:!1};ql(l)?(m?.addEventListener("touchmove",p.moveHandler,h),m?.addEventListener("touchend",p.upHandler,h)):(m?.addEventListener("mousemove",f.moveHandler,h),m?.addEventListener("mouseup",f.upHandler,h)),t.setColumnSizingInfo(e=>({...e,startOffset:s,startSize:r,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}},uo=null,co={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Vl("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const i=e.columns;return null==(n=i.length?i.some(e=>e.getIsVisible()):null==(o=t.getState().columnVisibility)?void 0:o[e.id])||n},e.getCanHide=()=>{var n,o;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(o=t.options.enableHiding)||o)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Al(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),Ol(t.options,"debugRows")),e.getVisibleCells=Al(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],Ol(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>Al(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),Ol(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(0,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(0,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(0,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(0,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},go={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Vl("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof o||"number"==typeof o}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,i,l;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(o=t.options.enableGlobalFilter)||o)&&(null==(i=t.options.enableFilters)||i)&&(null==(l=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||l)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Yn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return Ll(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:Yn[o]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},mo={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Vl("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,i;if(t){if(null!=(o=null!=(i=e.options.autoResetAll)?i:e.options.autoResetExpanded)?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}}else e._queue(()=>{t=!0})},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,o;e.setExpanded(t?{}:null!=(n=null==(o=e.initialState)?void 0:o.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some(e=>!e.getIsExpanded())},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{const n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var i;const l=!0===o||!(null==o||!o[e.id]);let r={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach(e=>{r[e]=!0}):r=o,n=null!=(i=n)?i:!l,!l&&n)return{...r,[e.id]:!0};if(l&&!n){const{[e.id]:t,...n}=r;return n}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===o||(null==o?void 0:o[e.id]))},e.getCanExpand=()=>{var n,o,i;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(o=t.options.enableExpanding)||o)&&!(null==(i=e.subRows)||!i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},fo={getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:Vl("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,i)=>{const l=o?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],r=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],a=new Set([...r,e.id,...l]);t.setRowPinning(e=>{var t,o,i,l,r,s;return"bottom"===n?{top:(null!=(i=null==e?void 0:e.top)?i:[]).filter(e=>!(null!=a&&a.has(e))),bottom:[...(null!=(l=null==e?void 0:e.bottom)?l:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)]}:"top"===n?{top:[...(null!=(r=null==e?void 0:e.top)?r:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)],bottom:(null!=(s=null==e?void 0:e.bottom)?s:[]).filter(e=>!(null!=a&&a.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=a&&a.has(e))),bottom:(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=a&&a.has(e)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:i}=t.options;return"function"==typeof o?o(e):null==(n=null!=o?o:i)||n},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:i}=t.getState().rowPinning,l=n.some(e=>null==o?void 0:o.includes(e)),r=n.some(e=>null==i?void 0:i.includes(e));return l?"top":!!r&&"bottom"},e.getPinnedIndex=()=>{var n,o;const i=e.getIsPinned();if(!i)return-1;const l=null==(n="top"===i?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(o=null==l?void 0:l.indexOf(e.id))?o:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(o=e.initialState)?void 0:o.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;var i,l;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(i=o.top)?void 0:i.length)||(null==(l=o.bottom)?void 0:l.length))},e._getPinnedRows=(t,n,o)=>{var i;return(null==(i=e.options.keepPinnedRows)||i?(null!=n?n:[]).map(t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:o}))},e.getTopRows=Al(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Ol(e.options,"debugRows")),e.getBottomRows=Al(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Ol(e.options,"debugRows")),e.getCenterRows=Al(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{const o=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!o.has(e.id))},Ol(e.options,"debugRows"))}},po={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Vl("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const o={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(o[e.id]=!0)}):i.forEach(e=>{delete o[e.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(t=>{ho(i,t.id,o,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Al(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Kl(e,n):{rows:[],flatRows:[],rowsById:{}},Ol(e.options,"debugTable")),e.getFilteredSelectedRowModel=Al(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Kl(e,n):{rows:[],flatRows:[],rowsById:{}},Ol(e.options,"debugTable")),e.getGroupedSelectedRowModel=Al(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Kl(e,n):{rows:[],flatRows:[],rowsById:{}},Ol(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(e=>!n[e.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const i=e.getIsSelected();t.setRowSelection(l=>{var r;if(n=void 0!==n?n:!i,e.getCanSelect()&&i===n)return l;const a={...l};return ho(a,e.id,n,null==(r=null==o?void 0:o.selectChildren)||r,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return $l(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===Xl(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===Xl(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}}},ho=(e,t,n,o,i)=>{var l;const r=i.getRow(t,!0);n?(r.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),r.getCanSelect()&&(e[t]=!0)):delete e[t],o&&null!=(l=r.subRows)&&l.length&&r.getCanSelectSubRows()&&r.subRows.forEach(t=>ho(e,t.id,n,o,i))},vo=/([0-9]+)/gm,bo={alphanumeric:(e,t,n)=>Ql(Jl(e.getValue(n)).toLowerCase(),Jl(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>Ql(Jl(e.getValue(n)),Jl(t.getValue(n))),text:(e,t,n)=>Yl(Jl(e.getValue(n)).toLowerCase(),Jl(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>Yl(Jl(e.getValue(n)),Jl(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),i=t.getValue(n);return o>i?1:o<i?-1:0},basic:(e,t,n)=>Yl(e.getValue(n),t.getValue(n))},_o={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Vl("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return bo.datetime;if("string"==typeof n&&(o=!0,n.split(vo).length>1))return bo.alphanumeric}return o?bo.text:bo.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return Ll(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:bo[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const i=e.getNextSortingOrder(),l=null!=n;t.setSorting(r=>{const a=null==r?void 0:r.find(t=>t.id===e.id),s=null==r?void 0:r.findIndex(t=>t.id===e.id);let d,u=[],c=l?n:"desc"===i;var g;return d=null!=r&&r.length&&e.getCanMultiSort()&&o?a?"toggle":"add":null!=r&&r.length&&s!==r.length-1?"replace":a?"toggle":"replace","toggle"===d&&(l||i||(d="remove")),"add"===d?(u=[...r,{id:e.id,desc:c}],u.splice(0,u.length-(null!=(g=t.options.maxMultiSortColCount)?g:Number.MAX_SAFE_INTEGER))):u="toggle"===d?r.map(t=>t.id===e.id?{...t,desc:c}:t):"remove"===d?r.filter(t=>t.id!==e.id):[{id:e.id,desc:c}],u})},e.getFirstSortDir=()=>{var n,o;return(null!=(n=null!=(o=e.columnDef.sortDescFirst)?o:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var o,i;const l=e.getFirstSortDir(),r=e.getIsSorted();return r?!!(r===l||null!=(o=t.options.enableSortingRemoval)&&!o||n&&null!=(i=t.options.enableMultiRemove)&&!i)&&("desc"===r?"asc":"desc"):l},e.getCanSort=()=>{var n,o;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(o=t.options.enableSorting)||o)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return null!=(n=null!=(o=e.columnDef.enableMultiSort)?o:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!o&&(o.desc?"desc":"asc")},e.getSortIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().sorting)?void 0:o.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},xo=[Ln,co,lo,ro,On,Jn,{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},go,_o,io,mo,{getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Vl("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,i;if(t){if(null!=(o=null!=(i=e.options.autoResetAll)?i:e.options.autoResetPageIndex)?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}}else e._queue(()=>{t=!0})},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>Tl(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination(n=>{let o=Tl(t,n.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...n,pageIndex:o}})},e.resetPageIndex=t=>{var n,o;e.setPageIndex(t?0:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageIndex)?n:0)},e.resetPageSize=t=>{var n,o;e.setPageSize(t?10:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{const n=Math.max(1,Tl(t,e.pageSize)),o=e.pageSize*e.pageIndex,i=Math.floor(o/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var o;let i=Tl(t,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof i&&(i=Math.max(-1,i)),{...n,pageCount:i}}),e.getPageOptions=Al(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map((e,t)=>t)),t},Ol(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},fo,po,so],yo={blink:"_blink_1mv9f_1",fourtyfive:"_fourtyfive_1mv9f_13",emptyContainer:"_emptyContainer_1mv9f_17",emptyCell:"_emptyCell_1mv9f_21",inline:"_inline_1mv9f_26"},e("s",wo=a(e=>({canChangeMode:!1,canCreateEntries:!1,canEditEntries:!1,canFlag:!1,canShare:!1,setPermissions(t){e({canChangeMode:t.canChangeMode,canFlag:t.canFlag,canCreateEntries:t.canCreateEntries,canEditEntries:t.canEditEntries,canShare:t.canShare})}}))),Co={scaleX:1,scaleY:1},So=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:i,overIndex:l,index:r}=e;const a=null!=(t=n[i])?t:o;if(!a)return null;const s=function(e,t,n){const o=e[t],i=e[t-1],l=e[t+1];return o&&(i||l)?n<t?i?o.left-(i.left+i.width):l.left-(o.left+o.width):l?l.left-(o.left+o.width):o.left-(i.left+i.width):0}(n,r,i);if(r===i){const e=n[l];return e?{x:i<l?e.left+e.width-(a.left+a.width):e.left-a.left,y:0,...Co}:null}return r>i&&r<=l?{x:-a.width-s,y:0,...Co}:r<i&&r>=l?{x:a.width+s,y:0,...Co}:{x:0,y:0,...Co}},Ro=e=>{let{rects:t,activeIndex:n,overIndex:o,index:i}=e;const l=nr(t,o,n),r=t[i],a=l[i];return a&&r?{x:a.left-r.left,y:a.top-r.top,scaleX:a.width/r.width,scaleY:a.height/r.height}:null},ko={scaleX:1,scaleY:1},e("o",e=>{var t;let{activeIndex:n,activeNodeRect:o,index:i,rects:l,overIndex:r}=e;const a=null!=(t=l[n])?t:o;if(!a)return null;if(i===n){const e=l[r];return e?{x:0,y:n<r?e.top+e.height-(a.top+a.height):e.top-a.top,...ko}:null}const s=function(e,t,n){const o=e[t],i=e[t-1],l=e[t+1];return o?n<t?i?o.top-(i.top+i.height):l?l.top-(o.top+o.height):0:l?l.top-(o.top+o.height):i?o.top-(i.top+i.height):0:0}(l,i,n);return i>n&&i<=r?{x:0,y:-a.height-s,...ko}:i<n&&i>=r?{x:0,y:a.height+s,...ko}:{x:0,y:0,...ko}}),jo="Sortable",Eo=Ye.createContext({activeIndex:-1,containerId:jo,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ro,disabled:{draggable:!1,droppable:!1}}),Io=e=>{let{id:t,items:n,activeIndex:o,overIndex:i}=e;return nr(n,o,i).indexOf(t)},Do=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:i,items:l,newIndex:r,previousItems:a,previousContainerId:s,transition:d}=e;return!(!d||!o||a!==l&&i===r||!n&&(r===i||t!==s))},Mo={duration:200,easing:"ease"},No="transform",Fo=Et.Transition.toString({property:No,duration:0,easing:"linear"}),zo={roleDescription:"sortable"},Kt.Down,Kt.Right,Kt.Up,Kt.Left,Po={blink:"_blink_1j4rg_1",fourtyfive:"_fourtyfive_1j4rg_13",actionColumn:"_actionColumn_1j4rg_17",indexColumn:"_indexColumn_1j4rg_26",tableLoading:"_tableLoading_1j4rg_37",cuesheet:"_cuesheet_1j4rg_41",resizer:"_resizer_1j4rg_65",tableHeader:"_tableHeader_1j4rg_81"},To={blink:"_blink_19vgy_1",fourtyfive:"_fourtyfive_19vgy_13",actionColumn:"_actionColumn_19vgy_17",indexColumn:"_indexColumn_19vgy_26",delayRow:"_delayRow_19vgy_37",delayRowHidden:"_delayRowHidden_19vgy_55"},Vo=(0,Ye.memo)(gr),Lo=a(e=>({isOpen:!1,entryId:null,entryType:null,entryIndex:null,parentId:null,position:{x:0,y:0},flag:null,openMenu:(t,n,o,i,l,r)=>e({isOpen:!0,position:t,entryId:n,entryType:o,entryIndex:i,parentId:l,flag:r}),closeMenu:()=>e({isOpen:!1})})),Ao={blink:"_blink_1ntx4_1",fourtyfive:"_fourtyfive_1ntx4_13",actionColumn:"_actionColumn_1ntx4_17",indexColumn:"_indexColumn_1ntx4_26",eventRow:"_eventRow_1ntx4_37",firstAfterGroup:"_firstAfterGroup_1ntx4_52",skip:"_skip_1ntx4_55"},Oo=(0,Ye.memo)(mr),Ho={blink:"_blink_1k9ib_1",fourtyfive:"_fourtyfive_1k9ib_13",actionColumn:"_actionColumn_1k9ib_17",indexColumn:"_indexColumn_1k9ib_26",groupRow:"_groupRow_1k9ib_37",title:"_title_1k9ib_63"},Go=(0,Ye.memo)(fr),Bo={blink:"_blink_3gpgk_1",fourtyfive:"_fourtyfive_3gpgk_13",actionColumn:"_actionColumn_3gpgk_17",indexColumn:"_indexColumn_3gpgk_26",milestoneRow:"_milestoneRow_3gpgk_37"},Uo=(0,Ye.memo)(pr),qo=(0,Ye.memo)(hr),Wo={blink:"_blink_x6cge_1",fourtyfive:"_fourtyfive_x6cge_13",tableSettings:"_tableSettings_x6cge_17",apart:"_apart_x6cge_32",blinker:"_blinker_x6cge_1",sectionTitle:"_sectionTitle_x6cge_43",row:"_row_x6cge_47",option:"_option_x6cge_54",column:"_column_x6cge_61",inline:"_inline_x6cge_68",group:"_group_x6cge_82",radioButton:"_radioButton_x6cge_93"},Ko={EmptyPlaceholder:(0,Ye.memo)(function({context:e}){return(0,Je.jsx)(tr,{handleAddNew:e.handleAddNew})}),Table:(0,Ye.memo)(function({style:e,context:t,...n}){return(0,Je.jsx)("table",{className:Po.cuesheet,id:"cuesheet",style:{...e,...t.columnSizeVars},...t.listeners,...n})}),TableHead:(0,Ye.memo)(function({context:e,className:t,...n}){return(0,Je.jsx)("thead",{className:Po.tableHeader,...n})}),TableRow:(0,Ye.memo)(function({item:e,style:t,context:n,...o}){const i=o["data-index"],l=n.rows[i];if(!l)return null;const r=l.original.id,a=l.original,d=a.id===n.cursor;return s(a)?(0,Je.jsx)(Go,{groupId:a.id,colour:a.colour,rowId:l.id,rowIndex:l.index,table:n.table,injectedStyles:t,hasCursor:d,...o},r):m(a)?(0,Je.jsx)(Vo,{duration:a.duration,injectedStyles:t,hasCursor:d,...o},r):u(a)?(0,Je.jsx)(Uo,{entryId:a.id,isPast:a.isPast,parentBgColour:a.groupColour,parentId:a.parent,colour:a.colour,rowId:l.id,rowIndex:i,table:n.table,injectedStyles:t,hasCursor:d,...o},r):(0,Je.jsx)(Oo,{id:a.id,eventIndex:a.eventIndex,colour:a.colour,isFirstAfterGroup:a.isFirstAfterGroup,isLoaded:a.isLoaded,isPast:a.isPast,groupColour:a.groupColour,flag:a.flag,skip:a.skip,parent:a.parent,rowId:l.id,rowIndex:i,table:n.table,injectedStyles:t,hasCursor:d,...o},l.id)})},($o=(0,Ye.forwardRef)(({initialValue:e,fieldId:t,fieldLabel:n,allowSubmitSameValue:o,submitOnTab:i,handleUpdate:l,handleCancelUpdate:r,handleTabCancel:a},s)=>{const d=(0,Ye.useRef)(null),{value:u,onChange:c,onBlur:g,onKeyDown:m}=si(e,(0,Ye.useCallback)(e=>l(e),[l]),d,{allowSubmitSameValue:o,allowKeyboardNavigation:!0,submitOnEnter:!0,submitOnCtrlEnter:!0,submitOnTab:i,onCancelUpdate:r,onTabCancel:a});return(0,Ye.useImperativeHandle)(s,()=>({focus(){d.current?.focus()},select(){d.current?.select()},focusParentElement(){d.current?.parentElement?.focus()}}),[d]),(0,Je.jsx)(ze,{ref:d,variant:"ghosted",fluid:!0,value:u,onChange:c,onBlur:g,onKeyDown:m,"data-testid":t?`cuesheet-editor-${t}`:void 0,"aria-label":n?`${n} editor`:void 0})})).displayName="SingleLineCell",Xo=(0,Ye.memo)($o),Yo=(0,Ye.memo)(Sr),Jo={blink:"_blink_1dtk5_1",fourtyfive:"_fourtyfive_1dtk5_13",imageInput:"_imageInput_1dtk5_17",imageCell:"_imageCell_1dtk5_24",overlay:"_overlay_1dtk5_28",image:"_image_1dtk5_17"},Qo=(0,Ye.memo)(Rr),Zo={blink:"_blink_63fuh_1",fourtyfive:"_fourtyfive_63fuh_13",flag:"_flag_63fuh_17"},ei={blink:"_blink_18xqt_1",fourtyfive:"_fourtyfive_18xqt_13",ghostedText:"_ghostedText_18xqt_17",multiline:"_multiline_18xqt_24"},ti=(0,Ye.memo)(Er),ni={blink:"_blink_1u021_1",fourtyfive:"_fourtyfive_1u021_13",muted:"_muted_1u021_17",numeric:"_numeric_1u021_22"},oi=(0,Ye.memo)(Dr)}}});
//# sourceMappingURL=cuesheetColsFactory-legacy-CAFoIUhW.js.map