UNPKG

@getontime/cli

Version:
3 lines (2 loc) 4.16 kB
import{e as i,k as w,j as s,bq as k,r as C,D as N,o as v,p as D,q as $,t as I,br as g,bs as b,bt as h,bu as m,bv as y,bw as x,bx as j}from"./vendor-DFNUfA2K.js";import{aw as S,aD as E,bv as M,i as A,ai as P}from"./index-BNit4nUw.js";import{s as u,d as T}from"./useProjectData-BfKJevmX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="495b44aa-6378-40ce-915c-35fa2bec96e8",e._sentryDebugIdIdentifier="sentry-dbid-495b44aa-6378-40ce-915c-35fa2bec96e8")}catch{}})();const c=`${S}/automations`;async function F(){return(await i.get(c)).data}async function V(e){return(await i.post(c,e)).data}async function ee(e){return(await i.post(`${c}/trigger`,e)).data}async function se(e,t){return(await i.put(`${c}/trigger/${e}`,t)).data}function te(e){return i.delete(`${c}/trigger/${e}`)}async function ae(e){return(await i.post(`${c}/automation`,e)).data}async function ne(e,t){return(await i.put(`${c}/automation/${e}`,t)).data}function oe(e){return i.delete(`${c}/automation/${e}`)}function re(e){return i.post(`${c}/test`,e)}const O={enabledAutomations:!1,enabledOscIn:!1,oscPortIn:8888,triggers:[],automations:{}};function ie(){const{data:e,status:t,isFetching:r,isError:n,refetch:a}=w({queryKey:M,queryFn:F,placeholderData:(o,p)=>o,retry:5,retryDelay:o=>o*2500,refetchInterval:E,networkMode:"always"});return{data:e??O,status:t,isFetching:r,isError:n,refetch:a}}const q="_tag_1hjkh_17",B={tag:q};function ce({children:e}){return s.jsx("span",{className:B.tag,children:e})}function R(e){const{color:t,isSelected:r,onClick:n}=e,a=()=>{n==null||n(t)},o=A([u.swatch,r&&u.selected,n&&u.selectable]);return t?s.jsx("div",{className:o,style:{backgroundColor:`${t}`},onClick:a}):s.jsx("div",{className:o,onClick:a,children:s.jsx(k,{})})}const f=["","#FFCC78","#FFAB33","#77C785","#339E4E","#779BE7","#3E75E8","#FF7878","#ED3333","#A790F5","#8064E1","#9d9d9d","#ececec"];function le(e){const{value:t,name:r,handleChange:n}=e,a=C.useCallback(o=>{o!==t&&n(r,o)},[n,r,t]);return s.jsxs("div",{className:u.list,children:[f.map(o=>s.jsx(R,{color:o,onClick:a,isSelected:t===o},o)),s.jsx(T,{color:t,onChange:a,isSelected:!f.includes(t)})]})}const Q="_modal_1pr7r_17",U="_backdrop_1pr7r_34",K="_title_1pr7r_44",z="_body_1pr7r_53",G="_footer_1pr7r_61",d={modal:Q,backdrop:U,title:K,body:z,footer:G};function de({isOpen:e,title:t,showCloseButton:r,showBackdrop:n,bodyElements:a,footerElements:o,onClose:p}){return s.jsx(N,{open:e,onOpenChange:_=>{_||p()},dismissible:!1,children:s.jsxs(v,{children:[n&&s.jsx(D,{className:d.backdrop}),s.jsxs($,{className:d.modal,children:[s.jsxs("div",{className:d.title,children:[t,r&&s.jsx(P,{variant:"subtle-white",onClick:p,children:s.jsx(I,{})})]}),s.jsx("div",{className:d.body,children:a}),s.jsx("div",{className:d.footer,children:o})]})]})})}const H="_positioner_1l5gl_17",J="_popup_1l5gl_21",L="_item_1l5gl_39",W="_separator_1l5gl_69",l={positioner:H,popup:J,item:L,separator:W};function ue({items:e,children:t,...r}){return s.jsxs(g,{children:[s.jsx(b,{...r,children:t}),s.jsx(h,{children:s.jsx(m,{className:l.positioner,align:"start",sideOffset:8,children:s.jsx(y,{className:l.popup,children:e.map((n,a)=>n.type==="divider"?s.jsx(x,{className:l.separator},a):s.jsxs(j,{className:l.item,onClick:n.onClick,disabled:n.disabled,children:[n.icon&&s.jsx(n.icon,{}),n.label]},a))})})})]})}function pe({items:e,isOpen:t,position:r,onClose:n}){return s.jsxs(g,{open:t,onOpenChange:a=>{a||n()},children:[s.jsx(b,{style:{position:"fixed",left:r.x,top:r.y},"aria-hidden":!0}),s.jsx(h,{children:s.jsx(m,{className:l.positioner,align:"start",sideOffset:8,alignOffset:8,children:s.jsx(y,{className:l.popup,children:e.map((a,o)=>a.type==="divider"?s.jsx(x,{className:l.separator},o):s.jsxs(j,{className:l.item,onClick:a.onClick,disabled:a.disabled,children:[a.icon&&s.jsx(a.icon,{}),a.label]},o))})})})]})}export{ue as D,de as M,pe as P,le as S,ce as T,ne as a,ae as b,se as c,oe as d,V as e,ee as f,te as g,R as h,re as t,ie as u}; //# sourceMappingURL=DropdownMenu-BV41kjSA.js.map