UNPKG

@getontime/cli

Version:
3 lines (2 loc) 19.9 kB
import{j as e,h as m,bj as Z,bk as oe,am as de,bl as ue,bm as P,bn as U,bo as me,bp as he,ah as xe,b9 as je,bq as be}from"./vendor-q6fv0YT2.js";import{L as b,T as y}from"./EditorUtils-DuKjlUkF.js";import{T as S,A as W,s as ge}from"./TimeInput-C8DQoFXv.js";import{u as T,m as fe}from"./dateConfig-D7xim1t4.js";import{u as J}from"./useCustomFields-k4piRt9n.js";import{T as A,E as G}from"./validateEvent-Do8yE_DJ.js";import{ah as R,aC as ve,e as O,ak as F,s as _e,m as I,T as q,B as pe,ba as ke,x as K,bk as ee}from"./index-B81u4hxi.js";import{S as M}from"./Select-BGGVCKqU.js";import{S as ae}from"./SwatchPicker-Cm5Eicvv.js";import{T as w}from"./Tooltip-B5vsLcFu.js";import{p as ie}from"./parseUserTime-YeFR8t3F.js";import{S as Q,u as re,T as te}from"./Modal-BKx0PDGT.js";import{g as ye}from"./offset-R98EXhWK.js";import{T as Ee}from"./editorSettings-D2f7e1a6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="47edc882-8c7a-4686-b27e-3e8e9e90ec4b",t._sentryDebugIdIdentifier="sentry-dbid-47edc882-8c7a-4686-b27e-3e8e9e90ec4b")}catch{}})();var C=(t=>(t.onLoad="onLoad",t.onStart="onStart",t.onPause="onPause",t.onStop="onStop",t.onClock="onClock",t.onUpdate="onUpdate",t.onFinish="onFinish",t.onWarning="onWarning",t.onDanger="onDanger",t))(C||{});const Ne=Object.keys(C);function Ce(t){return t.replaceAll(" ","").replaceAll(",",".")}const Te="_imageContainer_1k5qa_17",Ie="_imageOverlay_1k5qa_25",ne={imageContainer:Te,imageOverlay:Ie};function we({src:t}){return e.jsxs("div",{className:ne.imageContainer,children:[!!t&&e.jsx("img",{loading:"lazy",src:t}),e.jsx("div",{className:ne.imageOverlay})]})}function Le({value:t,inputref:s,...a}){return m.useEffect(()=>{const n=s.current;return Z(s.current),()=>{Z.destroy(n)}},[s,t]),e.jsx(Ee,{ref:s,value:t,...a})}function le(t,s,a,n){const[o,l]=m.useState(t),i=m.useRef(!1);m.useEffect(()=>{l(typeof t>"u"?"":t)},[t]);const c=m.useCallback(d=>{d!==o&&l(d)},[o]),h=m.useCallback(d=>{var j;if(d===t&&!(n!=null&&n.allowSubmitSameValue))(j=n==null?void 0:n.onCancelUpdate)==null||j.call(n);else{const r=d.trim();s(r),r!==d&&l(r)}setTimeout(()=>{var r,v,_;n!=null&&n.allowKeyboardNavigation?(v=(r=a.current)==null?void 0:r.parentElement)==null||v.focus():(_=a.current)==null||_.blur()})},[t,n,a,s]),x=m.useCallback(()=>{var d;l(t),a.current&&(a.current.value=t),(d=n==null?void 0:n.onCancelUpdate)==null||d.call(n),setTimeout(()=>{var j;return(j=a.current)==null?void 0:j.blur()})},[t,n,a]),g=m.useMemo(()=>{const d=[["Escape",r=>{r.preventDefault(),x()},{preventDefault:!0}]];n!=null&&n.submitOnEnter&&d.push(["Enter",()=>{i.current=!0,h(o),setTimeout(()=>{i.current=!1},0)}]),n!=null&&n.submitOnCtrlEnter&&d.push(["mod + Enter",()=>{i.current=!0,h(o),setTimeout(()=>{i.current=!1},0)}]);const j=oe(d);return r=>{(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown")&&r.stopPropagation(),j(r)}},[x,h,n==null?void 0:n.submitOnCtrlEnter,n==null?void 0:n.submitOnEnter,o]);return{value:o,onChange:d=>c(d.target.value),onBlur:d=>{i.current||h(d.target.value)},onKeyDown:g}}function B({className:t,field:s,label:a,initialValue:n,style:o,submitHandler:l}){const i=m.useRef(null),c=m.useCallback(j=>l(s,j),[s,l]),{value:h,onChange:x,onBlur:g,onKeyDown:d}=le(n,c,i,{submitOnCtrlEnter:!0});return e.jsxs("div",{children:[e.jsx(b,{className:t,htmlFor:s,style:o,children:a}),e.jsx(Le,{id:s,inputref:i,rows:1,"data-testid":"input-textarea",fluid:!0,value:h,onChange:x,onBlur:g,onKeyDown:d})]})}function D({className:t,field:s,label:a,initialValue:n,style:o,submitHandler:l,maxLength:i,placeholder:c}){const h=m.useRef(null),x=m.useCallback(v=>l(s,v),[s,l]),{value:g,onChange:d,onBlur:j,onKeyDown:r}=le(n,x,h,{submitOnEnter:!0});return e.jsxs("div",{children:[e.jsx(b,{className:t,htmlFor:s,style:o,children:a}),e.jsx(R,{id:s,ref:h,maxLength:i,fluid:!0,"data-testid":"input-textfield",value:g,placeholder:c,onChange:d,onBlur:j,onKeyDown:r})]})}const De="_rundownEditor_qkzuc_19",Se="_content_qkzuc_29",Fe="_column_qkzuc_48",Oe="_decorated_qkzuc_57",Ae="_delayLabel_qkzuc_65",qe="_switchLabel_qkzuc_73",ze="_inline_qkzuc_83",He="_splitTwo_qkzuc_89",$e="_splitThree_qkzuc_96",Ve="_tooltipIcon_qkzuc_103",We="_customImage_qkzuc_110",Me="_textLikeInput_qkzuc_117",Re="_inactive_qkzuc_125",Be="_active_qkzuc_129",u={rundownEditor:De,content:Se,column:Fe,decorated:Oe,delayLabel:Ae,switchLabel:qe,inline:ze,splitTwo:He,splitThree:$e,tooltipIcon:Ve,customImage:We,textLikeInput:Me,inactive:Re,active:Be};function X({fields:t,handleSubmit:s,entry:a}){return e.jsx(m.Fragment,{children:Object.keys(t).map(n=>{const o=`${a.id}-${n}`,l=`custom-${n}`,i=a.custom[n]??"",{backgroundColor:c,color:h}=ve(t[n].colour),x=t[n].label;return t[n].type==="text"?e.jsx(B,{field:l,label:x,initialValue:i,submitHandler:s,className:u.decorated,style:{"--decorator-bg":c,"--decorator-color":h}},o):t[n].type==="image"?e.jsxs("div",{className:u.customImage,children:[e.jsx(D,{field:l,label:x,initialValue:i,placeholder:"Paste image URL",submitHandler:s,className:u.decorated,maxLength:255,style:{"--decorator-bg":c,"--decorator-color":h}},o),e.jsx(we,{src:i})]},o):null})})}const Ge="_inputGroup_1e1jq_17",Pe="_delayed_1e1jq_24",se={inputGroup:Ge,delayed:Pe};function $({hasDelay:t,children:s}){return e.jsx("div",{className:O([se.inputGroup,t&&se.delayed]),children:s})}const Ue="_fourtyfive_ezj8b_13",Ke="_timerNote_ezj8b_21",Je="_inactive_ezj8b_27",Qe="_active_ezj8b_31",Xe="_inputWrapper_ezj8b_35",Ye="_hoverLabel_ezj8b_39",k={fourtyfive:Ue,timerNote:Ke,inactive:Je,active:Qe,inputWrapper:Xe,hoverLabel:Ye},Ze=m.memo(et);function et({eventId:t,countToEnd:s,timeStart:a,timeEnd:n,duration:o,timeStrategy:l,linkStart:i,delay:c,showLabels:h}){const{updateEntry:x,updateTimer:g}=T(),d=(N,p)=>{g(t,N,p)},j=N=>{x({id:t,timeStrategy:N})},r=N=>{x({id:t,linkStart:N})},v=[];a+o>_e&&v.push("Over midnight"),s&&v.push("Count to End");const _=c!==0,f=l===A.LockEnd,E=l===A.LockDuration;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:k.inputWrapper,children:[h&&e.jsx(b,{className:k.sectionTitle,children:"Start time"}),e.jsx(b,{className:k.hoverLabel,children:"Start"}),e.jsxs($,{hasDelay:_,children:[e.jsx(S,{name:"timeStart",submitHandler:d,time:a,placeholder:"Start",align:"left",disabled:i}),e.jsx(w,{text:"Link start to previous end",onClick:()=>r(!i),render:e.jsx(F,{variant:"subtle-white",className:i?k.active:k.inactive}),children:e.jsx("span",{className:k.fourtyfive,children:i?e.jsx(de,{}):e.jsx(ue,{})})})]})]}),e.jsxs("div",{className:k.inputWrapper,children:[h&&e.jsx(b,{children:"End time"}),e.jsx(b,{className:k.hoverLabel,children:"End"}),e.jsxs($,{hasDelay:_,children:[e.jsx(S,{name:"timeEnd",submitHandler:d,time:n,placeholder:"End",align:"left",disabled:E}),e.jsx(w,{text:"Lock end",render:e.jsx(F,{variant:"subtle-white",className:f?k.active:k.inactive}),onClick:()=>j(A.LockEnd),"data-testid":"lock__end",children:f?e.jsx(P,{}):e.jsx(U,{})})]})]}),e.jsxs("div",{className:k.inputWrapper,children:[h&&e.jsx(b,{children:"Duration"}),e.jsx(b,{className:k.hoverLabel,children:"Duration"}),e.jsxs($,{hasDelay:_,children:[e.jsx(S,{name:"duration",submitHandler:d,time:o,placeholder:"Duration",align:"left",disabled:f}),e.jsx(w,{text:"Lock duration",render:e.jsx(F,{variant:"subtle-white",className:E?k.active:k.inactive}),onClick:()=>j(A.LockDuration),"data-testid":"lock__duration",children:E?e.jsx(P,{}):e.jsx(U,{})})]})]}),v.length>0&&e.jsx(w,{text:v.join(" - "),className:k.timerNote,"data-testid":"event-warning",render:e.jsx("span",{}),children:e.jsx(me,{})})]})}const tt=m.memo(nt);function nt({eventId:t,timeStart:s,timeEnd:a,duration:n,timeStrategy:o,linkStart:l,countToEnd:i,delay:c,endAction:h,timerType:x,timeWarning:g,timeDanger:d}){const{updateEntry:j}=T(),r=(f,E)=>{if(f==="countToEnd"){j({id:t,countToEnd:E});return}if(f==="timeWarning"||f==="timeDanger"){const N=ie(E);j({id:t,[f]:N});return}if(f==="timerType"||f==="endAction"){j({id:t,[f]:E});return}},_=c!==0?`Event is ${fe(c,"expanded")}. New schedule ${I(s+c)}${I(a+c)}`:"";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:u.column,children:[e.jsx(y,{children:"Event schedule"}),e.jsxs("div",{children:[e.jsx("div",{className:u.inline,children:e.jsx(Ze,{eventId:t,timeStart:s,timeEnd:a,duration:n,timeStrategy:o,linkStart:l,delay:c,countToEnd:i,showLabels:!0})}),e.jsx("div",{className:u.delayLabel,children:_})]})]}),e.jsxs("div",{className:u.column,children:[e.jsx(y,{children:"Event Behaviour"}),e.jsxs("div",{className:u.splitTwo,children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"endAction",children:"End Action"}),e.jsx(M,{value:h,onValueChange:f=>{f!==null&&r("endAction",f)},options:[{value:G.None,label:"None"},{value:G.LoadNext,label:"Load next event"},{value:G.PlayNext,label:"Play next event"}]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"countToEnd",children:"Count to End"}),e.jsxs(b,{className:u.switchLabel,children:[e.jsx(ae,{id:"countToEnd",checked:i,onCheckedChange:f=>r("countToEnd",f)}),i?"On":"Off"]})]})]})]}),e.jsxs("div",{className:u.column,children:[e.jsx(y,{children:e.jsxs(w,{text:"Changes how the timer is displayed in different views. It is not reflected in the rundown",render:e.jsx("span",{}),children:["Display Options",e.jsx(he,{className:u.tooltipIcon})]})}),e.jsxs("div",{className:u.splitTwo,children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"timerType",children:"Timer Type"}),e.jsx(M,{value:x,onValueChange:f=>{f!==null&&r("timerType",f)},options:[{value:q.CountDown,label:"Count down"},{value:q.CountUp,label:"Count up"},{value:q.Clock,label:"Clock"},{value:q.None,label:"None"}]})]}),e.jsxs("div",{className:u.inline,children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"timeWarning",children:"Warning Time"}),e.jsx(S,{id:"timeWarning",name:"timeWarning",submitHandler:r,time:g,placeholder:"Duration"})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"timeDanger",children:"Danger Time"}),e.jsx(S,{id:"timeDanger",name:"timeDanger",submitHandler:r,time:d,placeholder:"Duration"})]})]})]})]})]})}const st=m.memo(at);function at({eventId:t,cue:s,flag:a,title:n,note:o,colour:l}){const{updateEntry:i}=T(),c=(g,d)=>{i({id:t,cue:Ce(d)})},h=g=>{i({id:t,flag:g})},x=(g,d)=>{i({id:t,[g]:d})};return e.jsxs("div",{className:u.column,children:[e.jsx(y,{children:"Event Data"}),e.jsxs("div",{className:u.splitThree,children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"eventId",children:"Event ID (read only)"}),e.jsx(R,{id:"eventId","data-testid":"input-textfield",value:t,readOnly:!0,fluid:!0})]}),e.jsx(D,{field:"cue",label:"Cue",initialValue:s,submitHandler:c,maxLength:10}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"flag",children:"Flag"}),e.jsxs(b,{className:u.switchLabel,children:[e.jsx(ae,{id:"flag",checked:a,onCheckedChange:h}),a?"On":"Off"]})]})]}),e.jsxs("div",{children:[e.jsx(b,{children:"Colour"}),e.jsx(Q,{name:"colour",value:l,handleChange:x})]}),e.jsx(D,{field:"title",label:"Title",initialValue:n,submitHandler:x}),e.jsx(B,{field:"note",label:"Note",initialValue:o,submitHandler:x})]})}const it=[C.onLoad,C.onStart,C.onPause,C.onFinish,C.onWarning,C.onDanger],rt="_triggerForm_l7413_17",lt="_trigger_l7413_17",ct="_errorLabel_l7413_38",ot="_success_l7413_42",V={triggerForm:rt,trigger:lt,errorLabel:ct,success:ot};function dt({triggers:t,eventId:s}){const a=t.length>0;return e.jsxs(e.Fragment,{children:[a&&e.jsx(mt,{triggers:t,eventId:s}),e.jsx(ut,{triggers:t,eventId:s})]})}function ut({eventId:t,triggers:s}){const{data:a}=re(),{updateEntry:n}=T(),[o,l]=m.useState(void 0),[i,c]=m.useState(C.onStart),h=(r,v)=>{const _=s??new Array,f=ke();_.push({id:f,title:"",trigger:r,automationId:v}),n({id:t,triggers:_})},g=((r,v)=>{if(v===void 0)return"Select an automation";if(!Object.keys(a.automations).includes(v))return"This automation does not exist";if(s!==void 0)return Object.values(s).some(_=>_.automationId===v&&_.trigger===r)?"Automation can only be used once":void 0})(i,o),d=m.useMemo(()=>[{value:null,label:"Select Trigger"},...it.map(r=>({value:r,label:r}))],[]),j=m.useMemo(()=>[{value:null,label:"Select Automation"},...Object.values(a.automations).map(({id:r,title:v})=>({value:r,label:v}))],[a.automations]);return e.jsxs("div",{className:V.triggerForm,children:[e.jsx(M,{value:i,onValueChange:r=>{r!==null&&c(r)},options:d}),e.jsx(M,{value:o??null,onValueChange:r=>{r!==null&&l(r)},options:j}),e.jsx(pe,{disabled:g!==void 0,onClick:()=>o&&h(i,o),children:"Add"}),g!==void 0?e.jsx(w,{text:g,render:e.jsx("span",{}),children:e.jsx(je,{className:V.errorLabel})}):e.jsx(be,{className:V.success})]})}function mt({eventId:t,triggers:s}){const{updateEntry:a}=T(),{data:n}=re(),o=m.useCallback(i=>{const c=s.filter(h=>h.id!==i);a({id:t,triggers:c})},[t,s,a]),l={};return Ne.forEach(i=>{const c=s.filter(h=>h.trigger===i);c.length&&Object.assign(l,{[i]:c})}),e.jsx("div",{children:Object.entries(l).map(([i,c])=>e.jsx(m.Fragment,{children:c.map(h=>{var j;const{id:x,automationId:g}=h,d=((j=n.automations[g])==null?void 0:j.title)??"<MISSING AUTOMATION>";return e.jsxs("div",{className:V.trigger,children:[e.jsx(te,{children:i}),e.jsx(te,{children:d}),e.jsx(F,{variant:"ghosted-destructive",onClick:()=>o(x),children:e.jsx(xe,{})})]},x)})},i))})}function qt({event:t}){const{data:s}=J(),{updateEntry:a}=T(),n=window.location.pathname.includes("editor"),o=m.useCallback((l,i)=>{if(l.startsWith("custom-")){const c=l.split("custom-")[1];a({id:t.id,custom:{[c]:i}})}else a({id:t.id,[l]:i})},[t.id,a]);return e.jsxs("div",{className:u.content,children:[e.jsx(tt,{eventId:t.id,timeStart:t.timeStart,timeEnd:t.timeEnd,duration:t.duration,timeStrategy:t.timeStrategy,linkStart:t.linkStart,countToEnd:t.countToEnd,delay:t.delay,endAction:t.endAction,timerType:t.timerType,timeWarning:t.timeWarning,timeDanger:t.timeDanger},`${t.id}-times`),e.jsx(st,{eventId:t.id,cue:t.cue,flag:t.flag,title:t.title,note:t.note,colour:t.colour},`${t.id}-titles`),e.jsxs("div",{className:u.column,children:[e.jsxs(y,{children:["Custom Fields",n&&e.jsx(W,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(X,{fields:s,handleSubmit:o,entry:t})]}),e.jsxs("div",{className:u.column,children:[e.jsxs(y,{children:["Automations",n&&e.jsx(W,{search:"settings=automation",children:"Manage Automations"})]}),e.jsx(dt,{triggers:t.triggers,eventId:t.id})]})]})}const ht="_blink_1qqxl_1",xt="_fourtyfive_1qqxl_13",jt="_textInput_1qqxl_18",bt="_under_1qqxl_31",gt="_over_1qqxl_34",ft="_muted_1qqxl_37",vt="_disabled_1qqxl_40",z={blink:ht,fourtyfive:xt,textInput:jt,under:bt,over:gt,muted:ft,disabled:vt},ce=m.forwardRef(({offset:t,muted:s,disabled:a,children:n,className:o,...l},i)=>{const c=m.useRef(null),h=O([z.textInput,t&&z[t],s&&z.muted,a&&z.disabled,o]);return m.useImperativeHandle(i,()=>({focusParentElement(){var x,g;(g=(x=c.current)==null?void 0:x.parentElement)==null||g.focus()}})),e.jsx("div",{className:h,tabIndex:a?-1:0,...l,ref:c,children:n})});ce.displayName="TextLikeInput";const H=m.memo(ce);function _t({id:t,name:s,submitHandler:a,time:n,emptyDisplay:o,placeholder:l,disabled:i,align:c="center",className:h}){const x=m.useRef(null),[g,d]=m.useState(""),j=m.useRef(!1),r=m.useCallback(()=>{typeof n!="number"||isNaN(n)?d(o):d(I(n))},[o,n]),v=m.useCallback(()=>{var p;(p=x.current)==null||p.select()},[]),_=m.useCallback(p=>{if(p===""&&n===null)return!1;const L=ie(p);return L===n?!1:(a(s,L),!0)},[s,a,n]),f=m.useCallback(p=>{_(p)||r()},[_,r]),E=m.useCallback(p=>{var L,Y;p.key==="Enter"&&((L=x.current)==null||L.blur()),p.key==="Escape"&&(j.current=!0,(Y=x.current)==null||Y.blur(),r())},[r]),N=m.useCallback(p=>{if(j.current){j.current=!1;return}f(p.target.value)},[f]);return m.useEffect(()=>{r()},[r]),e.jsx(R,{id:t,disabled:i,ref:x,"data-testid":`time-input-${s}`,className:O([ge.timeInput,h]),placeholder:l,onFocus:v,onChange:p=>d(p.target.value),onBlur:N,onKeyDown:E,value:g,maxLength:8,autoComplete:"off",style:{textAlign:c}})}function pt({duration:t,targetDuration:s,submitHandler:a}){const n=s!==null;return e.jsxs("div",{children:[e.jsx(b,{htmlFor:"targetDuration",children:"Target duration"}),e.jsxs($,{hasDelay:n&&s!==t,children:[e.jsx(_t,{name:"targetDuration",time:s,submitHandler:a,emptyDisplay:K,className:n?"":u.inactive}),e.jsx(w,{text:"Lock to target duration",className:O([u.timeAction,n&&u.active]),onClick:()=>a("targetDuration",n?null:t),"data-testid":"lock__duration",render:e.jsx(F,{variant:"subtle-white",className:n?u.active:u.inactive}),children:n?e.jsx(P,{}):e.jsx(U,{})})]})]})}function zt({group:t}){const{data:s}=J(),{updateEntry:a}=T(),n=m.useCallback((c,h)=>{if(typeof c=="string"&&c.startsWith("custom-")){const x=c.split("custom-")[1];a({id:t.id,custom:{[x]:h}});return}return a(c==="targetDuration"?{id:t.id,targetDuration:h}:{id:t.id,[c]:h})},[t.id,a]),o=window.location.pathname.includes("editor"),l=t.targetDuration===null?null:t.duration-t.targetDuration,i=l!==null?ye(l):null;return e.jsxs("div",{className:u.content,children:[e.jsxs("div",{className:u.column,children:[e.jsx(y,{children:"Group schedule"}),e.jsxs("div",{className:u.inline,children:[e.jsxs("div",{children:[e.jsx(b,{children:"First event start"}),e.jsx(H,{className:u.textLikeInput,disabled:!0,children:I(t.timeStart,{fallback:ee})})]}),e.jsxs("div",{children:[e.jsx(b,{children:"Last event end"}),e.jsx(H,{className:u.textLikeInput,disabled:!0,children:I(t.timeEnd,{fallback:ee})})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"duration",children:"Scheduled duration"}),e.jsx(H,{className:u.textLikeInput,disabled:!0,children:I(t.duration,{fallback:K})})]})]}),e.jsxs("div",{className:u.inline,children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"eventId",children:"Plan offset"}),e.jsxs(H,{offset:i,className:O([u.textLikeInput,l===null&&u.inactive]),disabled:!0,children:[l!==null&&l>0?"+":"",I(l,{fallback:K})]})]}),e.jsx(pt,{duration:t.duration,targetDuration:t.targetDuration,submitHandler:n})]})]}),e.jsxs("div",{className:u.column,children:[e.jsx(y,{children:"Group data"}),e.jsxs("div",{children:[e.jsx(b,{children:"Colour"}),e.jsx(Q,{name:"colour",value:t.colour,handleChange:n})]}),e.jsx(D,{field:"title",label:"Title",initialValue:t.title,submitHandler:n}),e.jsx(B,{field:"note",label:"Note",initialValue:t.note,submitHandler:n})]}),e.jsxs("div",{className:u.column,children:[e.jsxs(y,{children:["Custom Fields",o&&e.jsx(W,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(X,{fields:s,handleSubmit:n,entry:t})]})]})}function Ht({milestone:t}){const{data:s}=J(),{updateEntry:a}=T(),n=m.useCallback((l,i)=>{if(typeof l=="string"&&l.startsWith("custom-")){const c=l.split("custom-")[1];a({id:t.id,custom:{[c]:i}});return}return a({id:t.id,[l]:i})},[t.id,a]),o=window.location.pathname.includes("editor");return e.jsxs("div",{className:u.content,children:[e.jsxs("div",{className:u.column,children:[e.jsx(y,{children:"Milestone data"}),e.jsxs("div",{className:u.splitTwo,children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"entryId",children:"Milestone ID (read only)"}),e.jsx(R,{id:"entryId","data-testid":"input-textfield",value:t.id,readOnly:!0,fluid:!0})]}),e.jsx(D,{field:"cue",label:"Cue",initialValue:t.cue,submitHandler:n,maxLength:10})]}),e.jsxs("div",{children:[e.jsx(b,{children:"Colour"}),e.jsx(Q,{name:"colour",value:t.colour,handleChange:n})]}),e.jsx(D,{field:"title",label:"Title",initialValue:t.title,submitHandler:n}),e.jsx(B,{field:"note",label:"Note",initialValue:t.note,submitHandler:n})]}),e.jsxs("div",{className:u.column,children:[e.jsxs(y,{children:["Custom Fields",o&&e.jsx(W,{search:"settings=manage__custom",children:"Manage Custom Fields"})]}),e.jsx(X,{fields:s,handleSubmit:n,entry:t})]})]})}export{Le as A,qt as E,zt as G,Ht as M,H as T,Ze as a,u as s,le as u}; //# sourceMappingURL=MilestoneEditor-BA0PVIQh.js.map