mage-ai 0.8.48__py3-none-any.whl → 0.8.49__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mage-ai might be problematic. Click here for more details.

Files changed (71) hide show
  1. mage_ai/api/resources/DataProviderResource.py +12 -1
  2. mage_ai/data_preparation/models/block/sql/__init__.py +5 -7
  3. mage_ai/data_preparation/models/pipeline.py +36 -3
  4. mage_ai/data_preparation/templates/repo/io_config.yaml +6 -0
  5. mage_ai/io/sql.py +4 -1
  6. mage_ai/server/constants.py +1 -1
  7. mage_ai/server/frontend_dist/404.html +2 -2
  8. mage_ai/server/frontend_dist/404.html.html +2 -2
  9. mage_ai/server/frontend_dist/_next/static/{MxJEQAsVYkCzpf7Sf1BKY → I2bRLK9B7Lap2LvCicTKv}/_buildManifest.js +1 -1
  10. mage_ai/server/frontend_dist/_next/static/chunks/{2249-50d2156ae3ce5933.js → 2249-59feb0a0585ef7c1.js} +1 -1
  11. mage_ai/server/frontend_dist/_next/static/chunks/2407-35c362852abff411.js +1 -0
  12. mage_ai/server/frontend_dist/_next/static/chunks/{3014-26ba07eb6a78e31c.js → 3014-a01e16bc067500ad.js} +1 -1
  13. mage_ai/server/frontend_dist/_next/static/chunks/{4506-ce5fa63b65f6fa5f.js → 4506-a3c53b0033972626.js} +1 -1
  14. mage_ai/server/frontend_dist/_next/static/chunks/{4741-a90063795b0eae44.js → 4741-5fbecd08232ba3f9.js} +1 -1
  15. mage_ai/server/frontend_dist/_next/static/chunks/{5477-793cd2120261d023.js → 5477-b439f211b6146a11.js} +1 -1
  16. mage_ai/server/frontend_dist/_next/static/chunks/{5872-103815a4a043489b.js → 5872-1767c45ee6690ae5.js} +1 -1
  17. mage_ai/server/frontend_dist/_next/static/chunks/{5896-f84e336fb8877027.js → 5896-10a676bcc86978cc.js} +1 -1
  18. mage_ai/server/frontend_dist/_next/static/chunks/{7400-acab00d6265bd4dc.js → 7400-033fb12e7c46f62e.js} +1 -1
  19. mage_ai/server/frontend_dist/_next/static/chunks/{9832-c8b8970bb522f302.js → 9832-f97919376d52e3bf.js} +1 -1
  20. mage_ai/server/frontend_dist/_next/static/chunks/pages/{manage-68a4afe10fa0958c.js → manage-8a7b2b707c7038fb.js} +1 -1
  21. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-24c7b51521b5da92.js → [...slug]-c48a45cea6df6192.js} +1 -1
  22. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{backfills-f0f726599529789c.js → backfills-dd637dcb042ff771.js} +1 -1
  23. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-5541c3e13297ddbc.js +1 -0
  24. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{logs-a26b3d2b4806cb75.js → logs-caa9fade2bc783b9.js} +1 -1
  25. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-534e4fdf17255583.js → [run]-5f78885afc7758df.js} +1 -1
  26. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{runs-a9636cb88ec885bd.js → runs-43f2c1658cd3d03d.js} +1 -1
  27. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{settings-3719bc2024f5d031.js → settings-8fb53eb8dd0267e1.js} +1 -1
  28. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{syncs-93f1a008086f516a.js → syncs-c92351b1a81f7a13.js} +1 -1
  29. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-e9c39e78b4406d9b.js → [...slug]-ca76f5938bdff8a7.js} +1 -1
  30. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-57af43cc439b2b43.js → triggers-4e9518882c8730b1.js} +1 -1
  31. mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipelines-3156eaf5f09ebf39.js → pipelines-c46347f0308ab09a.js} +1 -1
  32. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{preferences-25735fdf80f95015.js → preferences-45c40fb24c8a5139.js} +1 -1
  33. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{sync-data-abfaa2b15eef72a0.js → sync-data-6e80afa0c9b90cdf.js} +1 -1
  34. mage_ai/server/frontend_dist/_next/static/chunks/pages/{terminal-24eb5df948cc9a7e.js → terminal-cc54b4d4e5295101.js} +1 -1
  35. mage_ai/server/frontend_dist/index.html +2 -2
  36. mage_ai/server/frontend_dist/manage.html +2 -2
  37. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  38. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  39. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  40. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  41. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  42. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  43. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  44. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  45. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  46. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  47. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
  48. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  49. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  50. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  51. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  52. mage_ai/server/frontend_dist/pipelines.html +2 -2
  53. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  54. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  55. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
  56. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  57. mage_ai/server/frontend_dist/settings.html +2 -2
  58. mage_ai/server/frontend_dist/sign-in.html +2 -2
  59. mage_ai/server/frontend_dist/terminal.html +2 -2
  60. mage_ai/server/frontend_dist/test.html +2 -2
  61. mage_ai/server/frontend_dist/triggers.html +2 -2
  62. {mage_ai-0.8.48.dist-info → mage_ai-0.8.49.dist-info}/METADATA +1 -1
  63. {mage_ai-0.8.48.dist-info → mage_ai-0.8.49.dist-info}/RECORD +69 -69
  64. mage_ai/server/frontend_dist/_next/static/chunks/4538-8a3c3e47be976ede.js +0 -1
  65. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-f68a5f454656d7a4.js +0 -1
  66. /mage_ai/server/frontend_dist/_next/static/{MxJEQAsVYkCzpf7Sf1BKY → I2bRLK9B7Lap2LvCicTKv}/_middlewareManifest.js +0 -0
  67. /mage_ai/server/frontend_dist/_next/static/{MxJEQAsVYkCzpf7Sf1BKY → I2bRLK9B7Lap2LvCicTKv}/_ssgManifest.js +0 -0
  68. {mage_ai-0.8.48.dist-info → mage_ai-0.8.49.dist-info}/LICENSE +0 -0
  69. {mage_ai-0.8.48.dist-info → mage_ai-0.8.49.dist-info}/WHEEL +0 -0
  70. {mage_ai-0.8.48.dist-info → mage_ai-0.8.49.dist-info}/entry_points.txt +0 -0
  71. {mage_ai-0.8.48.dist-info → mage_ai-0.8.49.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7803],{1210:function(e,n,r){"use strict";r.d(n,{Z:function(){return I}});var t=r(82394),i=r(21831),o=r(82684),l=r(47999),c=r(28358),u=r(93461),s=r(57384),d=r(12344),a=r(72454),f=r(28598);function v(e,n){var r=e.children;return(0,f.jsx)(a.HS,{ref:n,children:r})}var p=o.forwardRef(v),m=r(32063),h=r(15270),b=r(82531),j=r(66166),x=r(3055),g=r(49125),Z=r(91427),y=r(24141);function O(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function k(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?O(Object(r),!0).forEach((function(n){(0,t.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var I=function(e){var n,r=e.after,t=e.afterHidden,v=e.afterWidth,O=e.afterWidthOverride,I=e.before,P=e.beforeWidth,_=e.breadcrumbs,w=e.children,N=e.errors,E=e.headerMenuItems,M=e.navigationItems,S=e.setErrors,C=e.subheaderChildren,D=e.title,A=e.uuid,L=(0,y.i)().width,V="dashboard_after_width_".concat(A),R="dashboard_before_width_".concat(A),T=(0,o.useRef)(null),F=(0,o.useState)(O?v:(0,Z.U2)(V,v)),U=F[0],B=F[1],z=(0,o.useState)(!1),W=z[0],G=z[1],H=(0,o.useState)(I?Math.max((0,Z.U2)(R,P),13*g.iI):null),Y=H[0],J=H[1],X=(0,o.useState)(!1),q=X[0],K=X[1],Q=(0,o.useState)(null)[1],$=b.ZP.projects.list({},{revalidateOnFocus:!1}).data,ee=null===$||void 0===$?void 0:$.projects,ne=[];_?ne.push.apply(ne,(0,i.Z)(_)):(null===ee||void 0===ee?void 0:ee.length)>=1&&ne.push.apply(ne,[{label:function(){var e;return null===(e=ee[0])||void 0===e?void 0:e.name},linkProps:{href:"/"}},{bold:!0,label:function(){return D}}]),(0,o.useEffect)((function(){null===T||void 0===T||!T.current||W||q||null===Q||void 0===Q||Q(T.current.getBoundingClientRect().width)}),[W,U,q,Y,T,Q,L]),(0,o.useEffect)((function(){W||(0,Z.t8)(V,U)}),[t,W,U,V]),(0,o.useEffect)((function(){q||(0,Z.t8)(R,Y)}),[q,Y,R]);var re=(0,j.Z)(v);return(0,o.useEffect)((function(){O&&re!==v&&B(v)}),[O,v,re]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s.Z,{title:D}),(0,f.jsx)(d.Z,{breadcrumbs:ne,menuItems:E,project:null===ee||void 0===ee?void 0:ee[0],version:null===ee||void 0===ee||null===(n=ee[0])||void 0===n?void 0:n.version}),(0,f.jsxs)(a.Nk,{children:[0!==(null===M||void 0===M?void 0:M.length)&&(0,f.jsx)(a.lm,{children:(0,f.jsx)(h.Z,{navigationItems:M})}),(0,f.jsx)(u.Z,{flex:1,flexDirection:"column",children:(0,f.jsxs)(m.Z,{after:r,afterHeightOffset:x.Mz,afterHidden:t,afterMousedownActive:W,afterWidth:U,before:I,beforeHeightOffset:x.Mz,beforeMousedownActive:q,beforeWidth:a.k1+(I?Y:0),hideAfterCompletely:!0,leftOffset:I?a.k1:null,mainContainerRef:T,setAfterMousedownActive:G,setAfterWidth:B,setBeforeMousedownActive:K,setBeforeWidth:J,children:[C&&(0,f.jsx)(p,{children:C}),w]})})]}),N&&(0,f.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===S||void 0===S?void 0:S(null)},children:(0,f.jsx)(c.Z,k(k({},N),{},{onClose:function(){return null===S||void 0===S?void 0:S(null)}}))})]})}},60547:function(e,n,r){"use strict";r.d(n,{Z:function(){return I}});var t=r(82394),i=r(21831),o=r(82684),l=r(47999),c=r(1210),u=r(34744),s=r(28358),d=r(67971),a=r(87372),f=r(86673),v=r(82531),p=r(9518),m=r(23831),h=r(73942),b=r(49125),j=p.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1te3pmf-0"})(["border-radius:","px;padding:","px;"," "," ",""],h.n_,3*b.iI,(function(e){return"\n box-shadow: ".concat((e.theme.shadow||m.Z.shadow).small,";\n ")}),(function(e){return e.background&&"\n background: ".concat(e.background,";\n ")}),(function(e){return e.backgroundImage&&'\n background-image: url("'.concat(e.backgroundImage,'");\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n ')})),x=r(3055),g=r(95354),Z=r(24141),y=r(28598);function O(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function k(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?O(Object(r),!0).forEach((function(n){(0,t.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var I=function(e){var n=e.after,r=e.afterHidden,t=e.afterWidth,p=e.before,m=e.beforeWidth,h=e.breadcrumbs,O=e.buildSidekick,I=e.children,P=e.errors,_=e.headline,w=e.pageName,N=e.pipeline,E=e.setErrors,M=e.subheader,S=e.subheaderBackground,C=e.subheaderBackgroundImage,D=e.subheaderButton,A=e.subheaderText,L=e.title,V=e.uuid,R=(0,Z.i)().height,T=N.uuid,F=v.ZP.pipelines.detail(T,{includes_outputs:!1},{revalidateOnFocus:!1}).data,U=null===F||void 0===F?void 0:F.pipeline,B=(0,o.useMemo)((function(){return n||(O?O({height:R,heightOffset:x.Mz,pipeline:U}):null)}),[n,O,R,U]),z=t||(B?50*b.iI:null),W=(0,o.useMemo)((function(){var e=[];return U&&(e.push.apply(e,[{label:function(){return"Pipelines"},linkProps:{href:"/pipelines"}}]),h?(e.push({label:function(){return U.uuid},linkProps:{as:"/pipelines/".concat(T,"/triggers"),href:"/pipelines/[pipeline]/triggers"}}),e.push.apply(e,(0,i.Z)(h)),e[e.length-1].bold=!0):e.push({bold:!0,label:function(){return U.name}})),e}),[h,U,T]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(c.Z,{after:B,afterHidden:r,afterWidth:z,before:p,beforeWidth:m,breadcrumbs:W,navigationItems:(0,g.H)(w,U),subheaderChildren:"undefined"!==typeof M&&M,title:U?L?L(U):U.name:null,uuid:V,children:[(D||A)&&(0,y.jsx)(f.Z,{mb:b.Mq,mt:b.cd,mx:b.cd,children:(0,y.jsx)(j,{background:S,backgroundImage:C,children:(0,y.jsxs)(d.Z,{alignItems:"center",children:[D,A&&(0,y.jsx)(f.Z,{ml:3}),A]})})}),_&&(0,y.jsx)(f.Z,{p:b.cd,children:(0,y.jsxs)(f.Z,{mt:b.cd,px:b.cd,children:[(0,y.jsx)(a.Z,{level:5,children:_}),(0,y.jsx)(u.Z,{light:!0,mt:b.cd,short:!0})]})}),I]}),P&&(0,y.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===E||void 0===E?void 0:E(null)},children:(0,y.jsx)(s.Z,k(k({},P),{},{onClose:function(){return null===E||void 0===E?void 0:E(null)}}))})]})}},66050:function(e,n,r){"use strict";var t;r.d(n,{V:function(){return t}}),function(e){e.CANCELLED="cancelled",e.COMPLETED="completed",e.FAILED="failed",e.INITIAL="initial",e.RUNNING="running"}(t||(t={}))},47409:function(e,n,r){"use strict";r.d(n,{D:function(){return l},V:function(){return o}});var t,i=r(82394),o=r(66050).V,l=(t={},(0,i.Z)(t,o.CANCELLED,"Cancelled"),(0,i.Z)(t,o.COMPLETED,"Done"),(0,i.Z)(t,o.FAILED,"Failed"),(0,i.Z)(t,o.INITIAL,"Ready"),(0,i.Z)(t,o.RUNNING,"Running"),t)},89745:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return oe}});var t=r(77837),i=r(38860),o=r.n(i),l=r(82684),c=r(60547),u=r(41788),s=r(75582),d=r(82394),a=r(93461),f=r(67971),v=r(87372),p=r(47409),m=r(86673),h=r(54283),b=r(19711),j=r(23831),x=r(10503),g=r(9518),Z=r(73942),y=r(2005),O=r(49125),k=r(31012),I=g.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-15svh8z-0"})(["border-radius:","px;margin:","px;overflow:hidden;"," "," "," "," "," "," &:hover{"," "," "," "," ","}"],Z.n_,O.cd*O.iI,(function(e){return"\n background-color: ".concat((e.theme.background||j.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||j.Z.borders).dark,";\n\n &:hover {\n cursor: pointer;\n }\n ")}),(function(e){return e.selected&&e.danger&&"\n border-color: ".concat((e.theme.accent||j.Z.accent).negative,";\n ")}),(function(e){return e.selected&&e.primary&&"\n border-color: ".concat((e.theme.interactive||j.Z.interactive).linkPrimary,";\n ")}),(function(e){return e.selected&&e.default&&"\n border-color: ".concat((e.theme.interactive||j.Z.interactive).focusBackground,";\n ")}),(function(e){return e.selected&&e.success&&"\n border-color: ".concat((e.theme.background||j.Z.background).success,";\n ")}),(function(e){return e.selected&&e.warning&&"\n border-color: ".concat((e.theme.accent||j.Z.accent).warning,";\n ")}),(function(e){return e.danger&&"\n border-color: ".concat((e.theme.accent||j.Z.accent).negative,";\n ")}),(function(e){return e.primary&&"\n border-color: ".concat((e.theme.interactive||j.Z.interactive).linkPrimary,";\n ")}),(function(e){return e.default&&"\n border-color: ".concat((e.theme.interactive||j.Z.interactive).focusBackground,";\n ")}),(function(e){return e.success&&"\n border-color: ".concat((e.theme.background||j.Z.background).success,";\n ")}),(function(e){return e.warning&&"\n border-color: ".concat((e.theme.accent||j.Z.accent).warning,";\n ")})),P=(0,g.css)([""," "," "," "," ",""],(function(e){return e.danger&&"\n background-color: ".concat((e.theme.accent||j.Z.accent).negative,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.interactive||j.Z.interactive).linkPrimary,";\n ")}),(function(e){return e.default&&"\n background-color: ".concat((e.theme.interactive||j.Z.interactive).defaultBackground,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||j.Z.background).success,";\n ")}),(function(e){return e.warning&&"\n background-color: ".concat((e.theme.accent||j.Z.accent).warning,";\n ")})),_=g.default.div.withConfig({displayName:"indexstyle__StatusStyle",componentId:"sc-15svh8z-1"})([""," ",";border-radius:","px;display:inline-block;font-family:",";padding:6px;"," "," "," "," "," ",""],P,k.iD,Z.D7,y.ry,(function(e){return e.danger&&"\n color: ".concat((e.theme.content||j.Z.content).active,";\n ")}),(function(e){return e.primary&&"\n color: ".concat((e.theme.content||j.Z.content).active,";\n ")}),(function(e){return(e.default||e.success)&&"\n "}),(function(e){return e.default&&"\n color: ".concat((e.theme.content||j.Z.content).default,";\n ")}),(function(e){return e.success&&"\n color: ".concat((e.theme.content||j.Z.content).inverted,";\n ")}),(function(e){return e.warning&&"\n color: ".concat((e.theme.content||j.Z.content).inverted,";\n ")})),w=g.default.div.withConfig({displayName:"indexstyle__BarStyle",componentId:"sc-15svh8z-2"})([""," display:flex;height:auto;width:3px;",""],P,(function(e){return e.default&&"\n background-color: ".concat((e.theme.interactive||j.Z.interactive).focusBackground,";\n ")})),N=r(90211),E=r(92083),M=r.n(E),S=r(66050),C=r(24224);function D(e){var n;return Object.keys((null===e||void 0===e||null===(n=e.metrics)||void 0===n?void 0:n.blocks)||{}).sort()}function A(e){var n,r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=null,o=null,l=null,c=null,u={},d=(null===e||void 0===e?void 0:e.block_runs)||[],a=(null===e||void 0===e||null===(n=e.metrics)||void 0===n?void 0:n.blocks)||{},f=(null===e||void 0===e||null===(r=e.metrics)||void 0===r?void 0:r.pipeline)||{},v=L(e);return Object.entries(a).forEach((function(e){var n,r=(0,s.Z)(e,2),d=r[0],a=r[1];if(!t||t===d){var p,m=a||{},h=m.destinations,b=void 0===h?{records_affected:null,records_inserted:null,records_updated:null}:h,j=m.sources,x=void 0===j?{records:null}:j,g=v[d]||[];if(t&&t===d&&g.every((function(e){var n=e.status;return S.V.COMPLETED===n}))&&null===i&&(i=0),null!==f&&void 0!==f&&null!==(n=f[d])&&void 0!==n&&n.record_counts)null===i&&(i=0),i+=Number(null===f||void 0===f||null===(p=f[d])||void 0===p?void 0:p.record_counts);else null!==x&&void 0!==x&&x.records&&(null===i&&(i=0),i+=Number(x.records));null!==b&&void 0!==b&&b.records_updated?(null===l&&(l=0),l+=Number(b.records_updated),null===c&&(c=0),c+=Number(b.records_updated)):null!==b&&void 0!==b&&b.records_inserted?(null===l&&(l=0),l+=Number(b.records_inserted),null===o&&(o=0),o+=Number(b.records_inserted)):null!==b&&void 0!==b&&b.records_affected&&(null===l&&(l=0),l+=Number(b.records_affected)),["destinations","sources"].forEach((function(e){var n=a[e]||{};null!==n&&void 0!==n&&n.error&&(u[d]||(u[d]={}),u[d][e]={error:null===n||void 0===n?void 0:n.error,errors:null===n||void 0===n?void 0:n.errors,message:null===n||void 0===n?void 0:n.message})}))}})),null===d||void 0===d||d.forEach((function(e){var n=e.block_uuid,r=e.metrics,t=e.status;if(S.V.FAILED===t&&null!==r&&void 0!==r&&r.error&&n){var i=n.split(":"),o=(0,s.Z)(i,3),l=(o[0],o[1]);o[2];u[l]||(u[l]={}),u[l][""]=r.error}})),{errors:u,records:i,recordsInserted:o,recordsProcessed:l,recordsUpdated:c}}function L(e){var n=e.block_runs,r={};return null===n||void 0===n||n.forEach((function(e){var n=e.block_uuid.split(":"),t=(0,s.Z)(n,3),i=(t[0],t[1]);t[2];r[i]||(r[i]=[]),r[i].push(e)})),r}function V(e){var n=L(e),r={};return Object.entries(n).forEach((function(e){var n=(0,s.Z)(e,2),t=n[0],i=n[1],o=i.filter((function(e){var n=e.status;return S.V.COMPLETED===n})),l=o.map((function(e){var n=e.completed_at,r=e.started_at,t=M().utc(n),i=M().utc(r);return t.diff(i,"second")})),c=o.length,u=i.length;r[t]={completed:c,runtime:l.length>=1?(0,C.Sm)(l)/l.length:null,total:u}})),r}function R(e){var n=e.block_runs,r=(null===n||void 0===n?void 0:n.length)||1,t=function(e){var n=(null===e||void 0===e?void 0:e.block_runs)||[];return null===n||void 0===n?void 0:n.filter((function(e){var n=e.status;return S.V.COMPLETED===n}))}(e).length||0;return t/r}function T(e){var n=e.completed_at,r=e.block_runs,t=void 0===r?[]:r,i=e.status;if(null===t||void 0===t||!t.length)return 0;var o=M().utc();if(n)o=M().utc(n);else if([p.V.CANCELLED,p.V.FAILED].includes(i)){var l=(0,C.YC)(t,(function(e){return e.started_at}),{ascending:!1})[0];o=M().utc(l.updated_at)}var c=M().utc(e.created_at);return o.diff(c,"second")}function F(e,n){var r,t,i,o,l,c=L(e),u=V(e),s=(null===e||void 0===e?void 0:e.metrics)||{blocks:null,pipeline:null},d=s.blocks||{},a=s.pipeline||{},f=(d[n],a[n],u[n]||{completed:null,total:null}),v=f.completed,p=f.total,m=v&&p?v/p:0,h=c[n]||[],b=h.every((function(e){var n=e.status;return S.V.COMPLETED===n})),j=(0,C.YC)(h,(function(e){return e.updated_at}),{ascending:!1})[0],x=null===(r=(0,C.YC)(h,(function(e){return e.started_at}),{ascending:!0})[0])||void 0===r?void 0:r.started_at;b?t=null===(l=(0,C.YC)(h,(function(e){return e.completed_at}),{ascending:!1})[0])||void 0===l?void 0:l.completed_at:j&&(o=null===j||void 0===j?void 0:j.updated_at);var g=b?M().utc(t||o):M().utc(),Z=M().utc(x);return{completed:v,completedAt:t,done:b,progress:m,runtime:i=g.diff(Z,"second"),startedAt:x,status:null===j||void 0===j?void 0:j.status,timeText:(0,N.zf)(i),total:p,updatedAt:o}}var U=r(28598);function B(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function z(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?B(Object(r),!0).forEach((function(n){(0,d.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var W=function(e){var n=e.onSelect,r=e.pipelineRun,t=e.selected,i=(r.block_runs,r.created_at),o=r.status,c=(0,l.useMemo)((function(){return(null===r||void 0===r?void 0:r.metrics)||{blocks:{},destination:null,pipeline:{},source:null}}),[r]),u=((0,l.useMemo)((function(){return c.blocks||{}}),[c]),(0,l.useMemo)((function(){return c.pipeline||{}}),[c])),d=c.destination,g=c.source,Z=(0,l.useMemo)((function(){return Object.keys(u).length}),[u]),y=(0,l.useMemo)((function(){return A(r)}),[r]),k=y.errors,P=y.records,E=y.recordsProcessed,M=(0,l.useMemo)((function(){return R(r)}),[r]),S=(0,l.useMemo)((function(){return[p.V.COMPLETED].includes(o)}),[o]),C=(0,l.useMemo)((function(){return{danger:p.V.FAILED===o,default:p.V.INITIAL===o,primary:p.V.RUNNING===o,success:S,warning:p.V.CANCELLED===o}}),[S,o]),D=(0,l.useMemo)((function(){if(r){var e=T(r);return(0,N.zf)(e)}}),[r]);return(0,U.jsx)(I,z(z({},C),{},{onClick:function(){return n(t?null:r.id)},selected:t,children:(0,U.jsxs)(f.Z,{fullHeight:!0,justifyContent:"space-between",children:[(0,U.jsx)(w,z({},C)),(0,U.jsx)(a.Z,{flex:1,flexDirection:"column",children:(0,U.jsxs)(m.Z,{ml:3,py:3,children:[(0,U.jsx)(v.Z,{bold:!0,level:5,monospace:!0,children:i}),(0,U.jsx)(m.Z,{fullWidth:!1,mt:2,children:(0,U.jsx)(_,z(z({},C),{},{children:(0,U.jsxs)(f.Z,{alignItems:"center",children:[S&&(0,U.jsx)(x.Jr,{inverted:!0,size:2*O.iI}),[p.V.INITIAL,p.V.RUNNING].includes(o)&&(0,U.jsx)(h.Z,{color:p.V.INITIAL!==o?j.Z.monotone.white:null,inverted:p.V.INITIAL===o,small:!0}),"\xa0",p.V.RUNNING===o&&(0,U.jsxs)(U.Fragment,{children:["\xa0",Math.round(100*M),"%"]}),![p.V.INITIAL,p.V.RUNNING].includes(o)&&p.D[o],p.V.INITIAL===o&&"Starting"]})}))}),Object.values(k).length>=1&&(0,U.jsx)(m.Z,{mt:1,children:Object.entries(k).map((function(e,n){var r=(0,s.Z)(e,2),t=r[0];r[1];return(0,U.jsxs)(b.ZP,{monospace:!0,muted:!0,small:!0,children:[t," stream failed"]},t)}))})]})}),(0,U.jsxs)(a.Z,{flex:1,children:[(0,U.jsx)(a.Z,{flex:1,flexDirection:"column",children:(0,U.jsxs)(m.Z,{ml:3,py:3,children:[(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Rows processed"}),(0,U.jsx)(b.ZP,{monospace:!0,children:E>=1?(0,N.x6)(E):"-"})]}),(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Rows remaining"}),(0,U.jsx)(b.ZP,{monospace:!0,children:P>=1&&P>=E?(0,N.x6)(P-E):"-"})]}),p.V.RUNNING!==o&&(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Runtime"}),(0,U.jsx)(b.ZP,{monospace:!0,children:D})]})]})}),(0,U.jsx)(a.Z,{flex:1,flexDirection:"column",children:(0,U.jsxs)(m.Z,{ml:3,py:3,children:[(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Source"}),(0,U.jsx)(b.ZP,{monospace:!0,children:g||"-"})]}),(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Destination"}),(0,U.jsx)(b.ZP,{monospace:!0,children:d||"-"})]}),(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Streams"}),(0,U.jsx)(b.ZP,{monospace:!0,children:Z>=1?(0,N.x6)(Z):"-"})]})]})})]})]})}))},G=r(89565),H=r.n(G),Y=r(34376),J=r(60328),X=r(10919),q=r(58180),K=g.default.div.withConfig({displayName:"indexstyle__BarStyle",componentId:"sc-1thr560-0"})(["display:flex;flex:1;"," "," ",""],(function(e){return e.even&&e.fill&&"\n background-color: ".concat((e.theme.accent||j.Z.accent).cyan,";\n ")}),(function(e){return e.even&&!e.fill&&"\n background-color: ".concat((e.theme.accent||j.Z.accent).cyanTransparent,";\n ")}),(function(e){return"\n height: ".concat((e.small?1:2)*O.iI,"px;\n ")})),Q=r(66653);var $=function(e){var n=e.onClickRow,r=e.pipelineRun,t=e.selectedStream,i=(0,Y.useRouter)(),o=(0,l.useState)(null),c=o[0],u=o[1],d=(0,l.useState)(null),a=d[0],h=d[1],j=(0,l.useMemo)((function(){return r?L(r):{}}),[r]),g=(0,l.useMemo)((function(){return r?V(r):{}}),[r]),Z=(0,l.useMemo)((function(){var e=0,n=[],r=[];if(Object.entries(g).forEach((function(t){var i=(0,s.Z)(t,2),o=(i[0],i[1]),l=o.completed,c=o.runtime,u=o.total;null===c?r.push(o):(n.push(c),e+=c*(u-l))})),0===n.length)return null;var t=(0,C.Sm)(n)/n.length;return r.forEach((function(n){var r=n.completed,i=n.total;e+=t*(i-r)})),e}),[g]),y=(0,l.useMemo)((function(){return t?g[t]:null}),[g,t]),k=(0,l.useMemo)((function(){if(t&&g){var e=g[t]||{},n=e.completed,i=e.total;if(i>=1)return n/i}else if(r)return R(r);return 0}),[y,r,t]),I=(0,l.useMemo)((function(){return(0,U.jsx)(f.Z,{children:(0,C.w6)(101).map((function(e,n){return(0,U.jsx)(K,{even:n%2===0,fill:k>0&&Math.round(100*k)>=n},n)}))})}),[k]),P=(0,l.useMemo)((function(){if(t){var e=j[t]||[],n=e.every((function(e){var n=e.status;return S.V.COMPLETED===n})),i=(0,C.YC)(e,(function(e){return e.updated_at}),{ascending:!1})[0],o=null===i||void 0===i?void 0:i.status,l=y||{},c=l.completed,u=l.runtime,s=l.total;if(n)return"Sync complete for ".concat(t);if([S.V.CANCELLED,S.V.FAILED].includes(o))return p.D[o];if(u&&s>=1){var d=Math.ceil(u*(s-c)/60);return"".concat((0,N._6)("minute",d,!0)," to completion")}return"Estimating time remaining for stream..."}if(p.V.COMPLETED===(null===r||void 0===r?void 0:r.status))return"Sync complete";if(r){if([p.V.CANCELLED,p.V.FAILED].includes(null===r||void 0===r?void 0:r.status))return p.D[null===r||void 0===r?void 0:r.status];if(p.V.INITIAL===(null===r||void 0===r?void 0:r.status))return"Initializing sync (this can take several minutes)";if(null===Z)return"Estimating time remaining...";var a=Math.ceil(Z/60);return"".concat((0,N._6)("minute",a,!0)," to completion")}return"Select a sync"}),[j,Z,y,r,t]),_=(0,l.useMemo)((function(){return r&&t?F(r,t):{completed:null,completedAt:null,done:null,progress:null,runtime:null,startedAt:null,status:null,timeText:null,total:null,updatedAt:null}}),[r,t]);(0,l.useEffect)((function(){var e;if(r){var n=T(r);u(n),e=setInterval((function(){return u((function(e){return e+1}))}),1e3)}return function(){return clearInterval(e)}}),[r]),(0,l.useEffect)((function(){var e;if(r&&t&&_){var n=(null===_||void 0===_?void 0:_.runtime)||0;h(n),e=setInterval((function(){return h((function(e){return e+1}))}),1e3)}return function(){return clearInterval(e)}}),[r,t,_]);var w=(0,l.useMemo)((function(){if(r){if(t)return null===_||void 0===_?void 0:_.timeText;var e=T(r);return(0,N.zf)(e)}}),[r,t,_]),E=(0,l.useMemo)((function(){var e=Math.floor(c%86400/3600),n=Math.floor(c%3600/60),r=Math.floor(c%60/1);return[e>=10?String(e):"0".concat(e),n>=10?String(n):"0".concat(n),r>=10?String(r):"0".concat(r)].join(":")}),[c]),M=(0,l.useMemo)((function(){var e=Math.floor(a%86400/3600),n=Math.floor(a%3600/60),r=Math.floor(a%60/1);return[e>=10?String(e):"0".concat(e),n>=10?String(n):"0".concat(n),r>=10?String(r):"0".concat(r)].join(":")}),[a]),B=(0,l.useMemo)((function(){return r?A(r):{errors:null,records:null,recordsInserted:null,recordsProcessed:null,recordsUpdated:null}}),[r]),z=B.errors,W=B.records,G=B.recordsInserted,$=B.recordsProcessed,ee=B.recordsUpdated,ne=(0,l.useMemo)((function(){return r&&t?A(r,t):{errors:null,records:null,recordsInserted:null,recordsProcessed:null,recordsUpdated:null}}),[r,t]),re=(0,l.useMemo)((function(){var e=t?null===ne||void 0===ne?void 0:ne.records:W,n=t?null===ne||void 0===ne?void 0:ne.recordsInserted:G,r=t?null===ne||void 0===ne?void 0:ne.recordsProcessed:$,i=t?null===ne||void 0===ne?void 0:ne.recordsUpdated:ee,o=[{label:"Rows fetched",value:null===e?"-":(0,N.x6)(e)}];return null===n&&null===i?o.push({label:"Rows processed",value:null===r?"-":(0,N.x6)(r)}):null!==n?o.push({label:"Rows inserted",value:(0,N.x6)(n)}):null!==i&&o.push({label:"Rows updated",value:(0,N.x6)(i)}),o.map((function(e){var n=e.label,r=e.value;return(0,U.jsxs)("div",{children:[(0,U.jsx)(b.ZP,{bold:!0,large:!0,muted:!0,children:n}),(0,U.jsx)(b.ZP,{headline:!0,children:r})]},n)}))}),[W,ne,G,$,ee,w,E,status]),te=(0,l.useMemo)((function(){if(!r)return(0,U.jsx)("div",{});var e=D(r);return(0,U.jsx)(q.Z,{columnFlex:[null,null,null,null,null,null],columns:[{uuid:"Stream"},{uuid:"Start"},{uuid:"End"},{uuid:"Time"},{uuid:"Progress"},{uuid:"Logs"}],isSelectedRow:function(n){return t&&t===e[n]},onClickRow:n,rows:e.map((function(e){var n=F(r,e),t=(n.completed,n.completedAt),o=n.done,l=n.progress,c=n.startedAt,u=n.status,s=n.timeText,d=(n.total,!!z[e]);return[(0,U.jsx)(b.ZP,{danger:d,default:!d,monospace:!0,children:e},"stream"),(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:c?c.split(".")[0]:"-"},"started_at"),(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:t?t.split(".")[0]:"-"},"completed_at"),(0,U.jsx)(b.ZP,{default:!0,children:[S.V.INITIAL,S.V.RUNNING].includes(u)?"-":s},"runtime"),(0,U.jsxs)("div",{children:[o&&(0,U.jsx)(x.Jr,{default:!0,size:2*O.iI}),!o&&(0,U.jsx)(f.Z,{children:(0,C.w6)(51).map((function(e,n){return(0,U.jsx)(K,{fill:l>0&&Math.round(50*l)>=n,even:n%2===0,small:!0},n)}))})]},"progress"),(0,U.jsx)(J.Z,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(e){i.push("/pipelines/".concat(r.pipeline_uuid,"/logs?pipeline_run_id[]=").concat(r.id)),(0,Q.j)(e)},children:(0,U.jsx)(x.B4,{default:!0,size:2*O.iI})},"logs")]})),uuid:"".concat(null===r||void 0===r?void 0:r.id,"-streams-table")})}),[z,g,r,t]),ie=(0,l.useMemo)((function(){var e,n,i,o,l,c,u,d;if(r&&t){var a=(null===r||void 0===r?void 0:r.metrics)||{blocks:null,destination:null,pipeline:null,source:null},f=null===a||void 0===a||null===(e=a.pipeline)||void 0===e||null===(n=e[t])||void 0===n||null===(i=n.bookmarks)||void 0===i?void 0:i[t],v=null===a||void 0===a||null===(o=a.blocks)||void 0===o||null===(l=o[t])||void 0===l||null===(c=l.destinations)||void 0===c||null===(u=c.state)||void 0===u||null===(d=u.bookmarks)||void 0===d?void 0:d[t];if(f||v){var p=Array.from(new Set(Object.keys(f||{}).concat(Object.keys(v||{})))).sort(),m=[];p.forEach((function(e){var n=[(0,U.jsx)(b.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,children:e},e)];[f,v].forEach((function(r,t){r&&n.push((0,U.jsx)(b.ZP,{monospace:!0,small:!0,children:r[e]},"".concat(e,"-").concat(t)))})),m.push(n)}));var h=[{label:function(){return""},uuid:"column"}];return[[null===a||void 0===a?void 0:a.source,"source",f],[null===a||void 0===a?void 0:a.destination,"destination",v]].forEach((function(e){var n=(0,s.Z)(e,3),r=n[0],t=n[1];n[2]&&h.push({uuid:"".concat(r," (").concat(t,")")})})),(0,U.jsx)(q.Z,{columnFlex:[null,1,1],columns:h,rows:m,uuid:"".concat(t,"-bookmark-table")})}}}),[r,t]),oe=(0,l.useMemo)((function(){var e,n,i,o,l,c;if(r&&t){var u=(null===r||void 0===r?void 0:r.metrics)||{blocks:null,destination:null,pipeline:null,source:null},d=null===u||void 0===u||null===(e=u.blocks)||void 0===e||null===(n=e[t])||void 0===n||null===(i=n.sources)||void 0===i?void 0:i.record,a=null===u||void 0===u||null===(o=u.blocks)||void 0===o||null===(l=o[t])||void 0===l||null===(c=l.destinations)||void 0===c?void 0:c.record;if(d||a){var f=Object.keys(a||d||{}).sort(),v=[];f.forEach((function(e){var n=[(0,U.jsx)(b.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,children:e},e)];[d,a].forEach((function(r,t){if(r){var i=r[e],o="object"===typeof i;n.push((0,U.jsxs)(b.ZP,{monospace:!0,small:!0,textOverflow:!0,whiteSpaceNormal:!0,wordBreak:!0,children:[o&&(0,U.jsx)("pre",{children:JSON.stringify(i,null,2)}),!o&&i]},"".concat(e,"-").concat(t)))}})),v.push(n)}));var p=[{label:function(){return""},uuid:"column"}];return[[null===u||void 0===u?void 0:u.source,"source",d],[null===u||void 0===u?void 0:u.destination,"destination",a]].forEach((function(e){var n=(0,s.Z)(e,3),r=n[0],t=n[1];n[2]&&p.push({uuid:"".concat(r," (").concat(t,")")})})),(0,U.jsx)(q.Z,{columnFlex:[null,1,1],columns:p,rows:v.map((function(e){return e.map((function(e){return(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:e},e)}))})),uuid:"".concat(t,"-bookmark-table")})}}}),[r,t]),le=(0,l.useMemo)((function(){var e,n,i,o,l,c,u=null===r||void 0===r||null===(e=r.metrics)||void 0===e||null===(n=e.blocks)||void 0===n?void 0:n[t];return(null===u||void 0===u||null===(i=u.sources)||void 0===i||null===(o=i.block_tags)||void 0===o?void 0:o.destination_table)||(null===u||void 0===u||null===(l=u.destinations)||void 0===l||null===(c=l.block_tags)||void 0===c?void 0:c.destination_table)}),[r,t]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(m.Z,{p:3,children:[t&&(0,U.jsx)(m.Z,{mb:3,children:(0,U.jsxs)(f.Z,{alignItems:"center",children:[(0,U.jsx)(X.Z,{block:!0,onClick:function(){return i.push("/pipelines/".concat(r.pipeline_uuid,"/syncs?pipeline_run_id=").concat(r.id))},preventDefault:!0,children:(0,U.jsxs)(f.Z,{alignItems:"center",children:[(0,U.jsx)(x.Xd,{default:!0,size:1.5*O.iI}),(0,U.jsx)(m.Z,{mr:1}),(0,U.jsx)(b.ZP,{default:!0,children:"Syncs"})]})}),(0,U.jsx)(m.Z,{mx:1,children:(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:"/"})}),(0,U.jsx)(b.ZP,{bold:!0,monospace:!0,children:t})]})}),(0,U.jsxs)(f.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,U.jsx)(m.Z,{mr:2,my:1,children:(0,U.jsx)(v.Z,{level:5,muted:!r,children:P})}),r&&(0,U.jsx)(J.Z,{onClick:function(){return i.push("/pipelines/".concat(r.pipeline_uuid,"/logs?pipeline_run_id[]=").concat(r.id))},small:!0,children:"Logs"})]}),(0,U.jsx)(m.Z,{mt:2,children:I}),r&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(m.Z,{mt:3,children:(0,U.jsxs)(f.Z,{justifyContent:"space-between",children:[(0,U.jsxs)("div",{children:[(0,U.jsx)(b.ZP,{bold:!0,large:!0,muted:!0,children:"Runtime"}),(0,U.jsxs)(b.ZP,{headline:!0,children:[t&&[S.V.INITIAL,S.V.RUNNING].includes(null===_||void 0===_?void 0:_.status)&&M,t&&![S.V.INITIAL,S.V.RUNNING].includes(null===_||void 0===_?void 0:_.status)&&(null===_||void 0===_?void 0:_.timeText),!t&&[p.V.INITIAL,p.V.RUNNING].includes(null===r||void 0===r?void 0:r.status)&&E,!t&&![p.V.INITIAL,p.V.RUNNING].includes(null===r||void 0===r?void 0:r.status)&&w]})]}),re]})}),Object.values(z).length>=1&&(0,U.jsxs)(m.Z,{mt:3,children:[(0,U.jsx)(v.Z,{level:5,muted:!0,children:"Errors"}),Object.entries(z).map((function(e,n){var r=(0,s.Z)(e,2),i=r[0],o=r[1];return(!t||t===i)&&(0,U.jsx)(m.Z,{mt:n>=1?1:0,children:Object.entries(o).map((function(e){var n=(0,s.Z)(e,2),r=n[0],t=n[1],o=t.error,l=t.errors,c=t.message,u=Array.isArray(o)?o.join(" "):o;return(0,U.jsxs)("div",{children:[(0,U.jsx)(m.Z,{mb:c||(null===l||void 0===l?void 0:l.length)>=1?2:0,children:(0,U.jsxs)(b.ZP,{monospace:!0,preWrap:!0,textOverflow:!0,children:[i,!!r&&(0,U.jsxs)(b.ZP,{inline:!0,monospace:!0,muted:!0,children:["\xa0(",r,")"]}),": ",(0,U.jsx)(b.ZP,{default:!0,inline:!0,monospace:!0,children:u&&(0,U.jsx)(H(),{children:u})})]})}),(0,U.jsx)(b.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:c}),l.map((function(e){return(0,U.jsx)(b.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:e},e)}))]},"".concat(i,"-").concat(r))}))},i)}))]})]})]}),r&&!t&&(0,U.jsx)(m.Z,{my:3,children:te}),r&&t&&(0,U.jsxs)(U.Fragment,{children:[le&&(0,U.jsx)(m.Z,{my:3,children:(0,U.jsxs)(m.Z,{px:3,children:[(0,U.jsx)(v.Z,{level:5,children:"Table name"}),(0,U.jsx)(m.Z,{mt:1,children:(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:le})})]})}),ie&&(0,U.jsxs)(m.Z,{my:3,children:[(0,U.jsx)(m.Z,{px:3,children:(0,U.jsx)(v.Z,{level:5,children:"Bookmarks"})}),(0,U.jsx)(m.Z,{px:1,children:ie})]}),oe&&(0,U.jsxs)(m.Z,{my:3,children:[(0,U.jsx)(m.Z,{px:3,children:(0,U.jsx)(v.Z,{level:5,children:"Sample row"})}),(0,U.jsx)(m.Z,{px:1,children:oe})]})]})]})},ee=r(82531),ne=r(59920),re=r(33766),te=r(59e3);function ie(e){var n=e.pipeline,r=n.uuid,t=ee.ZP.pipeline_runs.list({_limit:20,_offset:0,pipeline_uuid:r},{refreshInterval:5e3}).data,i=(0,l.useMemo)((function(){return(null===t||void 0===t?void 0:t.pipeline_runs)||[]}),[t]),o=(0,te.iV)(),u=(0,l.useState)(null),s=u[0],d=u[1],a=(0,l.useState)(null),f=a[0],v=a[1];(0,l.useEffect)((function(){null!==o&&void 0!==o&&o.pipeline_run_id?v(null===i||void 0===i?void 0:i.find((function(e){return e.id===Number(o.pipeline_run_id)}))):f&&v(null),null!==o&&void 0!==o&&o.stream?d(o.stream):s&&d(null)}),[i,o,f,s]);var p=(0,l.useCallback)((function(){var e=f?D(f):[];return(0,U.jsx)($,{onClickRow:function(n){var r=e[n];(0,re.u7)({stream:s===r?null:r})},pipelineRun:f,selectedStream:s})}),[f,s]),m=(0,l.useMemo)((function(){var e="/pipelines/".concat(r,"/syncs");f&&(e="".concat(e,"?pipeline_run_id=").concat(f.id));var n=[{label:function(){return"Syncs"},linkProps:s?{as:e,href:"/pipelines/[pipeline]/syncs"}:null}];return s&&n.push({label:function(){return s}}),n}),[r,f,s]);return(0,U.jsx)(c.Z,{breadcrumbs:m,buildSidekick:p,pageName:ne.M.SYNCS,pipeline:n,title:function(e){var n=e.name;return"".concat(n," syncs")},uuid:"".concat(ne.M.SYNCS,"_").concat(r),children:i.map((function(e){var n=(null===f||void 0===f?void 0:f.id)===e.id;return(0,U.jsx)(W,{onSelect:function(e){return(0,re.u7)({pipeline_run_id:e,stream:null})},pipelineRun:e,selected:n},e.id)}))})}ie.getInitialProps=function(){var e=(0,t.Z)(o().mark((function e(n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:r}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var oe=(0,u.Z)(ie)},33766:function(e,n,r){"use strict";r.d(n,{g_:function(){return f},u7:function(){return a}});var t=r(75582),i=r(82394),o=r(34376),l=r.n(o),c=r(59e3),u=r(24224);function s(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function d(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?s(Object(r),!0).forEach((function(n){(0,i.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function a(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.replaceParams,o=r.pushHistory,u=i?{}:(0,c.iV)();n=window.location.pathname;var s=o?l().push:l().replace,a=d(d({},u),e);Object.entries(e).forEach((function(e){var n=(0,t.Z)(e,2),r=n[0],i=n[1];"undefined"!==typeof i&&null!==i||delete a[r]}));var f=(0,c.uM)(a);f.length>=1&&(f="?".concat(f));var v="".concat(n.split("?")[0]).concat(f);return s(l().router.pathname,v,{shallow:!0})}function f(e,n,r){var i=r.addingMultipleValues,o=r.isList,l=r.itemsPerPage,c=r.pushHistory,s=void 0!==c&&c,f=r.resetLimitParams,v=d({},e);i?Object.entries(n).forEach((function(e){var n=(0,t.Z)(e,2),r=n[0],i=n[1];if(Array.isArray(i)){var o="".concat(r,"[]");v[o]=i.map(String)}})):o?Object.entries(n).forEach((function(e){var n=(0,t.Z)(e,2),r=n[0],i=n[1],o=String(i),l="".concat(r,"[]"),c=v[l];c&&Array.isArray(c)?(c=c.map(String)).includes(o)?v[l]=(0,u.Od)(c,(function(e){return e===o})):v[l]=c.concat(o):v[l]=[o]})):v=d(d({},v),n),f&&(v._limit=l||20,v._offset=0),a(v,{pushHistory:s})}},59416:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/syncs",function(){return r(89745)}])}},function(e){e.O(0,[3850,5716,9565,2344,4506,6166,8180,6214,9774,2888,179],(function(){return n=59416,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7803],{1210:function(e,n,r){"use strict";r.d(n,{Z:function(){return I}});var t=r(82394),i=r(21831),o=r(82684),l=r(47999),c=r(49894),u=r(93461),s=r(57384),d=r(12344),a=r(72454),f=r(28598);function v(e,n){var r=e.children;return(0,f.jsx)(a.HS,{ref:n,children:r})}var p=o.forwardRef(v),m=r(32063),h=r(15270),b=r(82531),j=r(66166),x=r(3055),g=r(49125),Z=r(91427),y=r(24141);function O(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function k(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?O(Object(r),!0).forEach((function(n){(0,t.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var I=function(e){var n,r=e.after,t=e.afterHidden,v=e.afterWidth,O=e.afterWidthOverride,I=e.before,P=e.beforeWidth,_=e.breadcrumbs,w=e.children,N=e.errors,E=e.headerMenuItems,M=e.navigationItems,S=e.setErrors,C=e.subheaderChildren,D=e.title,A=e.uuid,L=(0,y.i)().width,V="dashboard_after_width_".concat(A),R="dashboard_before_width_".concat(A),T=(0,o.useRef)(null),F=(0,o.useState)(O?v:(0,Z.U2)(V,v)),U=F[0],B=F[1],z=(0,o.useState)(!1),W=z[0],G=z[1],H=(0,o.useState)(I?Math.max((0,Z.U2)(R,P),13*g.iI):null),Y=H[0],J=H[1],X=(0,o.useState)(!1),q=X[0],K=X[1],Q=(0,o.useState)(null)[1],$=b.ZP.projects.list({},{revalidateOnFocus:!1}).data,ee=null===$||void 0===$?void 0:$.projects,ne=[];_?ne.push.apply(ne,(0,i.Z)(_)):(null===ee||void 0===ee?void 0:ee.length)>=1&&ne.push.apply(ne,[{label:function(){var e;return null===(e=ee[0])||void 0===e?void 0:e.name},linkProps:{href:"/"}},{bold:!0,label:function(){return D}}]),(0,o.useEffect)((function(){null===T||void 0===T||!T.current||W||q||null===Q||void 0===Q||Q(T.current.getBoundingClientRect().width)}),[W,U,q,Y,T,Q,L]),(0,o.useEffect)((function(){W||(0,Z.t8)(V,U)}),[t,W,U,V]),(0,o.useEffect)((function(){q||(0,Z.t8)(R,Y)}),[q,Y,R]);var re=(0,j.Z)(v);return(0,o.useEffect)((function(){O&&re!==v&&B(v)}),[O,v,re]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s.Z,{title:D}),(0,f.jsx)(d.Z,{breadcrumbs:ne,menuItems:E,project:null===ee||void 0===ee?void 0:ee[0],version:null===ee||void 0===ee||null===(n=ee[0])||void 0===n?void 0:n.version}),(0,f.jsxs)(a.Nk,{children:[0!==(null===M||void 0===M?void 0:M.length)&&(0,f.jsx)(a.lm,{children:(0,f.jsx)(h.Z,{navigationItems:M})}),(0,f.jsx)(u.Z,{flex:1,flexDirection:"column",children:(0,f.jsxs)(m.Z,{after:r,afterHeightOffset:x.Mz,afterHidden:t,afterMousedownActive:W,afterWidth:U,before:I,beforeHeightOffset:x.Mz,beforeMousedownActive:q,beforeWidth:a.k1+(I?Y:0),hideAfterCompletely:!0,leftOffset:I?a.k1:null,mainContainerRef:T,setAfterMousedownActive:G,setAfterWidth:B,setBeforeMousedownActive:K,setBeforeWidth:J,children:[C&&(0,f.jsx)(p,{children:C}),w]})})]}),N&&(0,f.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===S||void 0===S?void 0:S(null)},children:(0,f.jsx)(c.Z,k(k({},N),{},{onClose:function(){return null===S||void 0===S?void 0:S(null)}}))})]})}},60547:function(e,n,r){"use strict";r.d(n,{Z:function(){return I}});var t=r(82394),i=r(21831),o=r(82684),l=r(47999),c=r(1210),u=r(34744),s=r(49894),d=r(67971),a=r(87372),f=r(86673),v=r(82531),p=r(9518),m=r(23831),h=r(73942),b=r(49125),j=p.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1te3pmf-0"})(["border-radius:","px;padding:","px;"," "," ",""],h.n_,3*b.iI,(function(e){return"\n box-shadow: ".concat((e.theme.shadow||m.Z.shadow).small,";\n ")}),(function(e){return e.background&&"\n background: ".concat(e.background,";\n ")}),(function(e){return e.backgroundImage&&'\n background-image: url("'.concat(e.backgroundImage,'");\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n ')})),x=r(3055),g=r(95354),Z=r(24141),y=r(28598);function O(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function k(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?O(Object(r),!0).forEach((function(n){(0,t.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var I=function(e){var n=e.after,r=e.afterHidden,t=e.afterWidth,p=e.before,m=e.beforeWidth,h=e.breadcrumbs,O=e.buildSidekick,I=e.children,P=e.errors,_=e.headline,w=e.pageName,N=e.pipeline,E=e.setErrors,M=e.subheader,S=e.subheaderBackground,C=e.subheaderBackgroundImage,D=e.subheaderButton,A=e.subheaderText,L=e.title,V=e.uuid,R=(0,Z.i)().height,T=N.uuid,F=v.ZP.pipelines.detail(T,{includes_outputs:!1},{revalidateOnFocus:!1}).data,U=null===F||void 0===F?void 0:F.pipeline,B=(0,o.useMemo)((function(){return n||(O?O({height:R,heightOffset:x.Mz,pipeline:U}):null)}),[n,O,R,U]),z=t||(B?50*b.iI:null),W=(0,o.useMemo)((function(){var e=[];return U&&(e.push.apply(e,[{label:function(){return"Pipelines"},linkProps:{href:"/pipelines"}}]),h?(e.push({label:function(){return U.uuid},linkProps:{as:"/pipelines/".concat(T,"/triggers"),href:"/pipelines/[pipeline]/triggers"}}),e.push.apply(e,(0,i.Z)(h)),e[e.length-1].bold=!0):e.push({bold:!0,label:function(){return U.name}})),e}),[h,U,T]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(c.Z,{after:B,afterHidden:r,afterWidth:z,before:p,beforeWidth:m,breadcrumbs:W,navigationItems:(0,g.H)(w,U),subheaderChildren:"undefined"!==typeof M&&M,title:U?L?L(U):U.name:null,uuid:V,children:[(D||A)&&(0,y.jsx)(f.Z,{mb:b.Mq,mt:b.cd,mx:b.cd,children:(0,y.jsx)(j,{background:S,backgroundImage:C,children:(0,y.jsxs)(d.Z,{alignItems:"center",children:[D,A&&(0,y.jsx)(f.Z,{ml:3}),A]})})}),_&&(0,y.jsx)(f.Z,{p:b.cd,children:(0,y.jsxs)(f.Z,{mt:b.cd,px:b.cd,children:[(0,y.jsx)(a.Z,{level:5,children:_}),(0,y.jsx)(u.Z,{light:!0,mt:b.cd,short:!0})]})}),I]}),P&&(0,y.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===E||void 0===E?void 0:E(null)},children:(0,y.jsx)(s.Z,k(k({},P),{},{onClose:function(){return null===E||void 0===E?void 0:E(null)}}))})]})}},66050:function(e,n,r){"use strict";var t;r.d(n,{V:function(){return t}}),function(e){e.CANCELLED="cancelled",e.COMPLETED="completed",e.FAILED="failed",e.INITIAL="initial",e.RUNNING="running"}(t||(t={}))},47409:function(e,n,r){"use strict";r.d(n,{D:function(){return l},V:function(){return o}});var t,i=r(82394),o=r(66050).V,l=(t={},(0,i.Z)(t,o.CANCELLED,"Cancelled"),(0,i.Z)(t,o.COMPLETED,"Done"),(0,i.Z)(t,o.FAILED,"Failed"),(0,i.Z)(t,o.INITIAL,"Ready"),(0,i.Z)(t,o.RUNNING,"Running"),t)},89745:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return oe}});var t=r(77837),i=r(38860),o=r.n(i),l=r(82684),c=r(60547),u=r(41788),s=r(75582),d=r(82394),a=r(93461),f=r(67971),v=r(87372),p=r(47409),m=r(86673),h=r(54283),b=r(19711),j=r(23831),x=r(10503),g=r(9518),Z=r(73942),y=r(2005),O=r(49125),k=r(31012),I=g.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-15svh8z-0"})(["border-radius:","px;margin:","px;overflow:hidden;"," "," "," "," "," "," &:hover{"," "," "," "," ","}"],Z.n_,O.cd*O.iI,(function(e){return"\n background-color: ".concat((e.theme.background||j.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||j.Z.borders).dark,";\n\n &:hover {\n cursor: pointer;\n }\n ")}),(function(e){return e.selected&&e.danger&&"\n border-color: ".concat((e.theme.accent||j.Z.accent).negative,";\n ")}),(function(e){return e.selected&&e.primary&&"\n border-color: ".concat((e.theme.interactive||j.Z.interactive).linkPrimary,";\n ")}),(function(e){return e.selected&&e.default&&"\n border-color: ".concat((e.theme.interactive||j.Z.interactive).focusBackground,";\n ")}),(function(e){return e.selected&&e.success&&"\n border-color: ".concat((e.theme.background||j.Z.background).success,";\n ")}),(function(e){return e.selected&&e.warning&&"\n border-color: ".concat((e.theme.accent||j.Z.accent).warning,";\n ")}),(function(e){return e.danger&&"\n border-color: ".concat((e.theme.accent||j.Z.accent).negative,";\n ")}),(function(e){return e.primary&&"\n border-color: ".concat((e.theme.interactive||j.Z.interactive).linkPrimary,";\n ")}),(function(e){return e.default&&"\n border-color: ".concat((e.theme.interactive||j.Z.interactive).focusBackground,";\n ")}),(function(e){return e.success&&"\n border-color: ".concat((e.theme.background||j.Z.background).success,";\n ")}),(function(e){return e.warning&&"\n border-color: ".concat((e.theme.accent||j.Z.accent).warning,";\n ")})),P=(0,g.css)([""," "," "," "," ",""],(function(e){return e.danger&&"\n background-color: ".concat((e.theme.accent||j.Z.accent).negative,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.interactive||j.Z.interactive).linkPrimary,";\n ")}),(function(e){return e.default&&"\n background-color: ".concat((e.theme.interactive||j.Z.interactive).defaultBackground,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||j.Z.background).success,";\n ")}),(function(e){return e.warning&&"\n background-color: ".concat((e.theme.accent||j.Z.accent).warning,";\n ")})),_=g.default.div.withConfig({displayName:"indexstyle__StatusStyle",componentId:"sc-15svh8z-1"})([""," ",";border-radius:","px;display:inline-block;font-family:",";padding:6px;"," "," "," "," "," ",""],P,k.iD,Z.D7,y.ry,(function(e){return e.danger&&"\n color: ".concat((e.theme.content||j.Z.content).active,";\n ")}),(function(e){return e.primary&&"\n color: ".concat((e.theme.content||j.Z.content).active,";\n ")}),(function(e){return(e.default||e.success)&&"\n "}),(function(e){return e.default&&"\n color: ".concat((e.theme.content||j.Z.content).default,";\n ")}),(function(e){return e.success&&"\n color: ".concat((e.theme.content||j.Z.content).inverted,";\n ")}),(function(e){return e.warning&&"\n color: ".concat((e.theme.content||j.Z.content).inverted,";\n ")})),w=g.default.div.withConfig({displayName:"indexstyle__BarStyle",componentId:"sc-15svh8z-2"})([""," display:flex;height:auto;width:3px;",""],P,(function(e){return e.default&&"\n background-color: ".concat((e.theme.interactive||j.Z.interactive).focusBackground,";\n ")})),N=r(90211),E=r(92083),M=r.n(E),S=r(66050),C=r(24224);function D(e){var n;return Object.keys((null===e||void 0===e||null===(n=e.metrics)||void 0===n?void 0:n.blocks)||{}).sort()}function A(e){var n,r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=null,o=null,l=null,c=null,u={},d=(null===e||void 0===e?void 0:e.block_runs)||[],a=(null===e||void 0===e||null===(n=e.metrics)||void 0===n?void 0:n.blocks)||{},f=(null===e||void 0===e||null===(r=e.metrics)||void 0===r?void 0:r.pipeline)||{},v=L(e);return Object.entries(a).forEach((function(e){var n,r=(0,s.Z)(e,2),d=r[0],a=r[1];if(!t||t===d){var p,m=a||{},h=m.destinations,b=void 0===h?{records_affected:null,records_inserted:null,records_updated:null}:h,j=m.sources,x=void 0===j?{records:null}:j,g=v[d]||[];if(t&&t===d&&g.every((function(e){var n=e.status;return S.V.COMPLETED===n}))&&null===i&&(i=0),null!==f&&void 0!==f&&null!==(n=f[d])&&void 0!==n&&n.record_counts)null===i&&(i=0),i+=Number(null===f||void 0===f||null===(p=f[d])||void 0===p?void 0:p.record_counts);else null!==x&&void 0!==x&&x.records&&(null===i&&(i=0),i+=Number(x.records));null!==b&&void 0!==b&&b.records_updated?(null===l&&(l=0),l+=Number(b.records_updated),null===c&&(c=0),c+=Number(b.records_updated)):null!==b&&void 0!==b&&b.records_inserted?(null===l&&(l=0),l+=Number(b.records_inserted),null===o&&(o=0),o+=Number(b.records_inserted)):null!==b&&void 0!==b&&b.records_affected&&(null===l&&(l=0),l+=Number(b.records_affected)),["destinations","sources"].forEach((function(e){var n=a[e]||{};null!==n&&void 0!==n&&n.error&&(u[d]||(u[d]={}),u[d][e]={error:null===n||void 0===n?void 0:n.error,errors:null===n||void 0===n?void 0:n.errors,message:null===n||void 0===n?void 0:n.message})}))}})),null===d||void 0===d||d.forEach((function(e){var n=e.block_uuid,r=e.metrics,t=e.status;if(S.V.FAILED===t&&null!==r&&void 0!==r&&r.error&&n){var i=n.split(":"),o=(0,s.Z)(i,3),l=(o[0],o[1]);o[2];u[l]||(u[l]={}),u[l][""]=r.error}})),{errors:u,records:i,recordsInserted:o,recordsProcessed:l,recordsUpdated:c}}function L(e){var n=e.block_runs,r={};return null===n||void 0===n||n.forEach((function(e){var n=e.block_uuid.split(":"),t=(0,s.Z)(n,3),i=(t[0],t[1]);t[2];r[i]||(r[i]=[]),r[i].push(e)})),r}function V(e){var n=L(e),r={};return Object.entries(n).forEach((function(e){var n=(0,s.Z)(e,2),t=n[0],i=n[1],o=i.filter((function(e){var n=e.status;return S.V.COMPLETED===n})),l=o.map((function(e){var n=e.completed_at,r=e.started_at,t=M().utc(n),i=M().utc(r);return t.diff(i,"second")})),c=o.length,u=i.length;r[t]={completed:c,runtime:l.length>=1?(0,C.Sm)(l)/l.length:null,total:u}})),r}function R(e){var n=e.block_runs,r=(null===n||void 0===n?void 0:n.length)||1,t=function(e){var n=(null===e||void 0===e?void 0:e.block_runs)||[];return null===n||void 0===n?void 0:n.filter((function(e){var n=e.status;return S.V.COMPLETED===n}))}(e).length||0;return t/r}function T(e){var n=e.completed_at,r=e.block_runs,t=void 0===r?[]:r,i=e.status;if(null===t||void 0===t||!t.length)return 0;var o=M().utc();if(n)o=M().utc(n);else if([p.V.CANCELLED,p.V.FAILED].includes(i)){var l=(0,C.YC)(t,(function(e){return e.started_at}),{ascending:!1})[0];o=M().utc(l.updated_at)}var c=M().utc(e.created_at);return o.diff(c,"second")}function F(e,n){var r,t,i,o,l,c=L(e),u=V(e),s=(null===e||void 0===e?void 0:e.metrics)||{blocks:null,pipeline:null},d=s.blocks||{},a=s.pipeline||{},f=(d[n],a[n],u[n]||{completed:null,total:null}),v=f.completed,p=f.total,m=v&&p?v/p:0,h=c[n]||[],b=h.every((function(e){var n=e.status;return S.V.COMPLETED===n})),j=(0,C.YC)(h,(function(e){return e.updated_at}),{ascending:!1})[0],x=null===(r=(0,C.YC)(h,(function(e){return e.started_at}),{ascending:!0})[0])||void 0===r?void 0:r.started_at;b?t=null===(l=(0,C.YC)(h,(function(e){return e.completed_at}),{ascending:!1})[0])||void 0===l?void 0:l.completed_at:j&&(o=null===j||void 0===j?void 0:j.updated_at);var g=b?M().utc(t||o):M().utc(),Z=M().utc(x);return{completed:v,completedAt:t,done:b,progress:m,runtime:i=g.diff(Z,"second"),startedAt:x,status:null===j||void 0===j?void 0:j.status,timeText:(0,N.zf)(i),total:p,updatedAt:o}}var U=r(28598);function B(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function z(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?B(Object(r),!0).forEach((function(n){(0,d.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var W=function(e){var n=e.onSelect,r=e.pipelineRun,t=e.selected,i=(r.block_runs,r.created_at),o=r.status,c=(0,l.useMemo)((function(){return(null===r||void 0===r?void 0:r.metrics)||{blocks:{},destination:null,pipeline:{},source:null}}),[r]),u=((0,l.useMemo)((function(){return c.blocks||{}}),[c]),(0,l.useMemo)((function(){return c.pipeline||{}}),[c])),d=c.destination,g=c.source,Z=(0,l.useMemo)((function(){return Object.keys(u).length}),[u]),y=(0,l.useMemo)((function(){return A(r)}),[r]),k=y.errors,P=y.records,E=y.recordsProcessed,M=(0,l.useMemo)((function(){return R(r)}),[r]),S=(0,l.useMemo)((function(){return[p.V.COMPLETED].includes(o)}),[o]),C=(0,l.useMemo)((function(){return{danger:p.V.FAILED===o,default:p.V.INITIAL===o,primary:p.V.RUNNING===o,success:S,warning:p.V.CANCELLED===o}}),[S,o]),D=(0,l.useMemo)((function(){if(r){var e=T(r);return(0,N.zf)(e)}}),[r]);return(0,U.jsx)(I,z(z({},C),{},{onClick:function(){return n(t?null:r.id)},selected:t,children:(0,U.jsxs)(f.Z,{fullHeight:!0,justifyContent:"space-between",children:[(0,U.jsx)(w,z({},C)),(0,U.jsx)(a.Z,{flex:1,flexDirection:"column",children:(0,U.jsxs)(m.Z,{ml:3,py:3,children:[(0,U.jsx)(v.Z,{bold:!0,level:5,monospace:!0,children:i}),(0,U.jsx)(m.Z,{fullWidth:!1,mt:2,children:(0,U.jsx)(_,z(z({},C),{},{children:(0,U.jsxs)(f.Z,{alignItems:"center",children:[S&&(0,U.jsx)(x.Jr,{inverted:!0,size:2*O.iI}),[p.V.INITIAL,p.V.RUNNING].includes(o)&&(0,U.jsx)(h.Z,{color:p.V.INITIAL!==o?j.Z.monotone.white:null,inverted:p.V.INITIAL===o,small:!0}),"\xa0",p.V.RUNNING===o&&(0,U.jsxs)(U.Fragment,{children:["\xa0",Math.round(100*M),"%"]}),![p.V.INITIAL,p.V.RUNNING].includes(o)&&p.D[o],p.V.INITIAL===o&&"Starting"]})}))}),Object.values(k).length>=1&&(0,U.jsx)(m.Z,{mt:1,children:Object.entries(k).map((function(e,n){var r=(0,s.Z)(e,2),t=r[0];r[1];return(0,U.jsxs)(b.ZP,{monospace:!0,muted:!0,small:!0,children:[t," stream failed"]},t)}))})]})}),(0,U.jsxs)(a.Z,{flex:1,children:[(0,U.jsx)(a.Z,{flex:1,flexDirection:"column",children:(0,U.jsxs)(m.Z,{ml:3,py:3,children:[(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Rows processed"}),(0,U.jsx)(b.ZP,{monospace:!0,children:E>=1?(0,N.x6)(E):"-"})]}),(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Rows remaining"}),(0,U.jsx)(b.ZP,{monospace:!0,children:P>=1&&P>=E?(0,N.x6)(P-E):"-"})]}),p.V.RUNNING!==o&&(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Runtime"}),(0,U.jsx)(b.ZP,{monospace:!0,children:D})]})]})}),(0,U.jsx)(a.Z,{flex:1,flexDirection:"column",children:(0,U.jsxs)(m.Z,{ml:3,py:3,children:[(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Source"}),(0,U.jsx)(b.ZP,{monospace:!0,children:g||"-"})]}),(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Destination"}),(0,U.jsx)(b.ZP,{monospace:!0,children:d||"-"})]}),(0,U.jsxs)(m.Z,{mb:1,children:[(0,U.jsx)(b.ZP,{bold:!0,muted:!0,small:!0,children:"Streams"}),(0,U.jsx)(b.ZP,{monospace:!0,children:Z>=1?(0,N.x6)(Z):"-"})]})]})})]})]})}))},G=r(89565),H=r.n(G),Y=r(34376),J=r(60328),X=r(10919),q=r(58180),K=g.default.div.withConfig({displayName:"indexstyle__BarStyle",componentId:"sc-1thr560-0"})(["display:flex;flex:1;"," "," ",""],(function(e){return e.even&&e.fill&&"\n background-color: ".concat((e.theme.accent||j.Z.accent).cyan,";\n ")}),(function(e){return e.even&&!e.fill&&"\n background-color: ".concat((e.theme.accent||j.Z.accent).cyanTransparent,";\n ")}),(function(e){return"\n height: ".concat((e.small?1:2)*O.iI,"px;\n ")})),Q=r(66653);var $=function(e){var n=e.onClickRow,r=e.pipelineRun,t=e.selectedStream,i=(0,Y.useRouter)(),o=(0,l.useState)(null),c=o[0],u=o[1],d=(0,l.useState)(null),a=d[0],h=d[1],j=(0,l.useMemo)((function(){return r?L(r):{}}),[r]),g=(0,l.useMemo)((function(){return r?V(r):{}}),[r]),Z=(0,l.useMemo)((function(){var e=0,n=[],r=[];if(Object.entries(g).forEach((function(t){var i=(0,s.Z)(t,2),o=(i[0],i[1]),l=o.completed,c=o.runtime,u=o.total;null===c?r.push(o):(n.push(c),e+=c*(u-l))})),0===n.length)return null;var t=(0,C.Sm)(n)/n.length;return r.forEach((function(n){var r=n.completed,i=n.total;e+=t*(i-r)})),e}),[g]),y=(0,l.useMemo)((function(){return t?g[t]:null}),[g,t]),k=(0,l.useMemo)((function(){if(t&&g){var e=g[t]||{},n=e.completed,i=e.total;if(i>=1)return n/i}else if(r)return R(r);return 0}),[y,r,t]),I=(0,l.useMemo)((function(){return(0,U.jsx)(f.Z,{children:(0,C.w6)(101).map((function(e,n){return(0,U.jsx)(K,{even:n%2===0,fill:k>0&&Math.round(100*k)>=n},n)}))})}),[k]),P=(0,l.useMemo)((function(){if(t){var e=j[t]||[],n=e.every((function(e){var n=e.status;return S.V.COMPLETED===n})),i=(0,C.YC)(e,(function(e){return e.updated_at}),{ascending:!1})[0],o=null===i||void 0===i?void 0:i.status,l=y||{},c=l.completed,u=l.runtime,s=l.total;if(n)return"Sync complete for ".concat(t);if([S.V.CANCELLED,S.V.FAILED].includes(o))return p.D[o];if(u&&s>=1){var d=Math.ceil(u*(s-c)/60);return"".concat((0,N._6)("minute",d,!0)," to completion")}return"Estimating time remaining for stream..."}if(p.V.COMPLETED===(null===r||void 0===r?void 0:r.status))return"Sync complete";if(r){if([p.V.CANCELLED,p.V.FAILED].includes(null===r||void 0===r?void 0:r.status))return p.D[null===r||void 0===r?void 0:r.status];if(p.V.INITIAL===(null===r||void 0===r?void 0:r.status))return"Initializing sync (this can take several minutes)";if(null===Z)return"Estimating time remaining...";var a=Math.ceil(Z/60);return"".concat((0,N._6)("minute",a,!0)," to completion")}return"Select a sync"}),[j,Z,y,r,t]),_=(0,l.useMemo)((function(){return r&&t?F(r,t):{completed:null,completedAt:null,done:null,progress:null,runtime:null,startedAt:null,status:null,timeText:null,total:null,updatedAt:null}}),[r,t]);(0,l.useEffect)((function(){var e;if(r){var n=T(r);u(n),e=setInterval((function(){return u((function(e){return e+1}))}),1e3)}return function(){return clearInterval(e)}}),[r]),(0,l.useEffect)((function(){var e;if(r&&t&&_){var n=(null===_||void 0===_?void 0:_.runtime)||0;h(n),e=setInterval((function(){return h((function(e){return e+1}))}),1e3)}return function(){return clearInterval(e)}}),[r,t,_]);var w=(0,l.useMemo)((function(){if(r){if(t)return null===_||void 0===_?void 0:_.timeText;var e=T(r);return(0,N.zf)(e)}}),[r,t,_]),E=(0,l.useMemo)((function(){var e=Math.floor(c%86400/3600),n=Math.floor(c%3600/60),r=Math.floor(c%60/1);return[e>=10?String(e):"0".concat(e),n>=10?String(n):"0".concat(n),r>=10?String(r):"0".concat(r)].join(":")}),[c]),M=(0,l.useMemo)((function(){var e=Math.floor(a%86400/3600),n=Math.floor(a%3600/60),r=Math.floor(a%60/1);return[e>=10?String(e):"0".concat(e),n>=10?String(n):"0".concat(n),r>=10?String(r):"0".concat(r)].join(":")}),[a]),B=(0,l.useMemo)((function(){return r?A(r):{errors:null,records:null,recordsInserted:null,recordsProcessed:null,recordsUpdated:null}}),[r]),z=B.errors,W=B.records,G=B.recordsInserted,$=B.recordsProcessed,ee=B.recordsUpdated,ne=(0,l.useMemo)((function(){return r&&t?A(r,t):{errors:null,records:null,recordsInserted:null,recordsProcessed:null,recordsUpdated:null}}),[r,t]),re=(0,l.useMemo)((function(){var e=t?null===ne||void 0===ne?void 0:ne.records:W,n=t?null===ne||void 0===ne?void 0:ne.recordsInserted:G,r=t?null===ne||void 0===ne?void 0:ne.recordsProcessed:$,i=t?null===ne||void 0===ne?void 0:ne.recordsUpdated:ee,o=[{label:"Rows fetched",value:null===e?"-":(0,N.x6)(e)}];return null===n&&null===i?o.push({label:"Rows processed",value:null===r?"-":(0,N.x6)(r)}):null!==n?o.push({label:"Rows inserted",value:(0,N.x6)(n)}):null!==i&&o.push({label:"Rows updated",value:(0,N.x6)(i)}),o.map((function(e){var n=e.label,r=e.value;return(0,U.jsxs)("div",{children:[(0,U.jsx)(b.ZP,{bold:!0,large:!0,muted:!0,children:n}),(0,U.jsx)(b.ZP,{headline:!0,children:r})]},n)}))}),[W,ne,G,$,ee,w,E,status]),te=(0,l.useMemo)((function(){if(!r)return(0,U.jsx)("div",{});var e=D(r);return(0,U.jsx)(q.Z,{columnFlex:[null,null,null,null,null,null],columns:[{uuid:"Stream"},{uuid:"Start"},{uuid:"End"},{uuid:"Time"},{uuid:"Progress"},{uuid:"Logs"}],isSelectedRow:function(n){return t&&t===e[n]},onClickRow:n,rows:e.map((function(e){var n=F(r,e),t=(n.completed,n.completedAt),o=n.done,l=n.progress,c=n.startedAt,u=n.status,s=n.timeText,d=(n.total,!!z[e]);return[(0,U.jsx)(b.ZP,{danger:d,default:!d,monospace:!0,children:e},"stream"),(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:c?c.split(".")[0]:"-"},"started_at"),(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:t?t.split(".")[0]:"-"},"completed_at"),(0,U.jsx)(b.ZP,{default:!0,children:[S.V.INITIAL,S.V.RUNNING].includes(u)?"-":s},"runtime"),(0,U.jsxs)("div",{children:[o&&(0,U.jsx)(x.Jr,{default:!0,size:2*O.iI}),!o&&(0,U.jsx)(f.Z,{children:(0,C.w6)(51).map((function(e,n){return(0,U.jsx)(K,{fill:l>0&&Math.round(50*l)>=n,even:n%2===0,small:!0},n)}))})]},"progress"),(0,U.jsx)(J.Z,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(e){i.push("/pipelines/".concat(r.pipeline_uuid,"/logs?pipeline_run_id[]=").concat(r.id)),(0,Q.j)(e)},children:(0,U.jsx)(x.B4,{default:!0,size:2*O.iI})},"logs")]})),uuid:"".concat(null===r||void 0===r?void 0:r.id,"-streams-table")})}),[z,g,r,t]),ie=(0,l.useMemo)((function(){var e,n,i,o,l,c,u,d;if(r&&t){var a=(null===r||void 0===r?void 0:r.metrics)||{blocks:null,destination:null,pipeline:null,source:null},f=null===a||void 0===a||null===(e=a.pipeline)||void 0===e||null===(n=e[t])||void 0===n||null===(i=n.bookmarks)||void 0===i?void 0:i[t],v=null===a||void 0===a||null===(o=a.blocks)||void 0===o||null===(l=o[t])||void 0===l||null===(c=l.destinations)||void 0===c||null===(u=c.state)||void 0===u||null===(d=u.bookmarks)||void 0===d?void 0:d[t];if(f||v){var p=Array.from(new Set(Object.keys(f||{}).concat(Object.keys(v||{})))).sort(),m=[];p.forEach((function(e){var n=[(0,U.jsx)(b.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,children:e},e)];[f,v].forEach((function(r,t){r&&n.push((0,U.jsx)(b.ZP,{monospace:!0,small:!0,children:r[e]},"".concat(e,"-").concat(t)))})),m.push(n)}));var h=[{label:function(){return""},uuid:"column"}];return[[null===a||void 0===a?void 0:a.source,"source",f],[null===a||void 0===a?void 0:a.destination,"destination",v]].forEach((function(e){var n=(0,s.Z)(e,3),r=n[0],t=n[1];n[2]&&h.push({uuid:"".concat(r," (").concat(t,")")})})),(0,U.jsx)(q.Z,{columnFlex:[null,1,1],columns:h,rows:m,uuid:"".concat(t,"-bookmark-table")})}}}),[r,t]),oe=(0,l.useMemo)((function(){var e,n,i,o,l,c;if(r&&t){var u=(null===r||void 0===r?void 0:r.metrics)||{blocks:null,destination:null,pipeline:null,source:null},d=null===u||void 0===u||null===(e=u.blocks)||void 0===e||null===(n=e[t])||void 0===n||null===(i=n.sources)||void 0===i?void 0:i.record,a=null===u||void 0===u||null===(o=u.blocks)||void 0===o||null===(l=o[t])||void 0===l||null===(c=l.destinations)||void 0===c?void 0:c.record;if(d||a){var f=Object.keys(a||d||{}).sort(),v=[];f.forEach((function(e){var n=[(0,U.jsx)(b.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,children:e},e)];[d,a].forEach((function(r,t){if(r){var i=r[e],o="object"===typeof i;n.push((0,U.jsxs)(b.ZP,{monospace:!0,small:!0,textOverflow:!0,whiteSpaceNormal:!0,wordBreak:!0,children:[o&&(0,U.jsx)("pre",{children:JSON.stringify(i,null,2)}),!o&&i]},"".concat(e,"-").concat(t)))}})),v.push(n)}));var p=[{label:function(){return""},uuid:"column"}];return[[null===u||void 0===u?void 0:u.source,"source",d],[null===u||void 0===u?void 0:u.destination,"destination",a]].forEach((function(e){var n=(0,s.Z)(e,3),r=n[0],t=n[1];n[2]&&p.push({uuid:"".concat(r," (").concat(t,")")})})),(0,U.jsx)(q.Z,{columnFlex:[null,1,1],columns:p,rows:v.map((function(e){return e.map((function(e){return(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:e},e)}))})),uuid:"".concat(t,"-bookmark-table")})}}}),[r,t]),le=(0,l.useMemo)((function(){var e,n,i,o,l,c,u=null===r||void 0===r||null===(e=r.metrics)||void 0===e||null===(n=e.blocks)||void 0===n?void 0:n[t];return(null===u||void 0===u||null===(i=u.sources)||void 0===i||null===(o=i.block_tags)||void 0===o?void 0:o.destination_table)||(null===u||void 0===u||null===(l=u.destinations)||void 0===l||null===(c=l.block_tags)||void 0===c?void 0:c.destination_table)}),[r,t]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(m.Z,{p:3,children:[t&&(0,U.jsx)(m.Z,{mb:3,children:(0,U.jsxs)(f.Z,{alignItems:"center",children:[(0,U.jsx)(X.Z,{block:!0,onClick:function(){return i.push("/pipelines/".concat(r.pipeline_uuid,"/syncs?pipeline_run_id=").concat(r.id))},preventDefault:!0,children:(0,U.jsxs)(f.Z,{alignItems:"center",children:[(0,U.jsx)(x.Xd,{default:!0,size:1.5*O.iI}),(0,U.jsx)(m.Z,{mr:1}),(0,U.jsx)(b.ZP,{default:!0,children:"Syncs"})]})}),(0,U.jsx)(m.Z,{mx:1,children:(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:"/"})}),(0,U.jsx)(b.ZP,{bold:!0,monospace:!0,children:t})]})}),(0,U.jsxs)(f.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,U.jsx)(m.Z,{mr:2,my:1,children:(0,U.jsx)(v.Z,{level:5,muted:!r,children:P})}),r&&(0,U.jsx)(J.Z,{onClick:function(){return i.push("/pipelines/".concat(r.pipeline_uuid,"/logs?pipeline_run_id[]=").concat(r.id))},small:!0,children:"Logs"})]}),(0,U.jsx)(m.Z,{mt:2,children:I}),r&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(m.Z,{mt:3,children:(0,U.jsxs)(f.Z,{justifyContent:"space-between",children:[(0,U.jsxs)("div",{children:[(0,U.jsx)(b.ZP,{bold:!0,large:!0,muted:!0,children:"Runtime"}),(0,U.jsxs)(b.ZP,{headline:!0,children:[t&&[S.V.INITIAL,S.V.RUNNING].includes(null===_||void 0===_?void 0:_.status)&&M,t&&![S.V.INITIAL,S.V.RUNNING].includes(null===_||void 0===_?void 0:_.status)&&(null===_||void 0===_?void 0:_.timeText),!t&&[p.V.INITIAL,p.V.RUNNING].includes(null===r||void 0===r?void 0:r.status)&&E,!t&&![p.V.INITIAL,p.V.RUNNING].includes(null===r||void 0===r?void 0:r.status)&&w]})]}),re]})}),Object.values(z).length>=1&&(0,U.jsxs)(m.Z,{mt:3,children:[(0,U.jsx)(v.Z,{level:5,muted:!0,children:"Errors"}),Object.entries(z).map((function(e,n){var r=(0,s.Z)(e,2),i=r[0],o=r[1];return(!t||t===i)&&(0,U.jsx)(m.Z,{mt:n>=1?1:0,children:Object.entries(o).map((function(e){var n=(0,s.Z)(e,2),r=n[0],t=n[1],o=t.error,l=t.errors,c=t.message,u=Array.isArray(o)?o.join(" "):o;return(0,U.jsxs)("div",{children:[(0,U.jsx)(m.Z,{mb:c||(null===l||void 0===l?void 0:l.length)>=1?2:0,children:(0,U.jsxs)(b.ZP,{monospace:!0,preWrap:!0,textOverflow:!0,children:[i,!!r&&(0,U.jsxs)(b.ZP,{inline:!0,monospace:!0,muted:!0,children:["\xa0(",r,")"]}),": ",(0,U.jsx)(b.ZP,{default:!0,inline:!0,monospace:!0,children:u&&(0,U.jsx)(H(),{children:u})})]})}),(0,U.jsx)(b.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:c}),l.map((function(e){return(0,U.jsx)(b.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:e},e)}))]},"".concat(i,"-").concat(r))}))},i)}))]})]})]}),r&&!t&&(0,U.jsx)(m.Z,{my:3,children:te}),r&&t&&(0,U.jsxs)(U.Fragment,{children:[le&&(0,U.jsx)(m.Z,{my:3,children:(0,U.jsxs)(m.Z,{px:3,children:[(0,U.jsx)(v.Z,{level:5,children:"Table name"}),(0,U.jsx)(m.Z,{mt:1,children:(0,U.jsx)(b.ZP,{default:!0,monospace:!0,children:le})})]})}),ie&&(0,U.jsxs)(m.Z,{my:3,children:[(0,U.jsx)(m.Z,{px:3,children:(0,U.jsx)(v.Z,{level:5,children:"Bookmarks"})}),(0,U.jsx)(m.Z,{px:1,children:ie})]}),oe&&(0,U.jsxs)(m.Z,{my:3,children:[(0,U.jsx)(m.Z,{px:3,children:(0,U.jsx)(v.Z,{level:5,children:"Sample row"})}),(0,U.jsx)(m.Z,{px:1,children:oe})]})]})]})},ee=r(82531),ne=r(59920),re=r(33766),te=r(59e3);function ie(e){var n=e.pipeline,r=n.uuid,t=ee.ZP.pipeline_runs.list({_limit:20,_offset:0,pipeline_uuid:r},{refreshInterval:5e3}).data,i=(0,l.useMemo)((function(){return(null===t||void 0===t?void 0:t.pipeline_runs)||[]}),[t]),o=(0,te.iV)(),u=(0,l.useState)(null),s=u[0],d=u[1],a=(0,l.useState)(null),f=a[0],v=a[1];(0,l.useEffect)((function(){null!==o&&void 0!==o&&o.pipeline_run_id?v(null===i||void 0===i?void 0:i.find((function(e){return e.id===Number(o.pipeline_run_id)}))):f&&v(null),null!==o&&void 0!==o&&o.stream?d(o.stream):s&&d(null)}),[i,o,f,s]);var p=(0,l.useCallback)((function(){var e=f?D(f):[];return(0,U.jsx)($,{onClickRow:function(n){var r=e[n];(0,re.u7)({stream:s===r?null:r})},pipelineRun:f,selectedStream:s})}),[f,s]),m=(0,l.useMemo)((function(){var e="/pipelines/".concat(r,"/syncs");f&&(e="".concat(e,"?pipeline_run_id=").concat(f.id));var n=[{label:function(){return"Syncs"},linkProps:s?{as:e,href:"/pipelines/[pipeline]/syncs"}:null}];return s&&n.push({label:function(){return s}}),n}),[r,f,s]);return(0,U.jsx)(c.Z,{breadcrumbs:m,buildSidekick:p,pageName:ne.M.SYNCS,pipeline:n,title:function(e){var n=e.name;return"".concat(n," syncs")},uuid:"".concat(ne.M.SYNCS,"_").concat(r),children:i.map((function(e){var n=(null===f||void 0===f?void 0:f.id)===e.id;return(0,U.jsx)(W,{onSelect:function(e){return(0,re.u7)({pipeline_run_id:e,stream:null})},pipelineRun:e,selected:n},e.id)}))})}ie.getInitialProps=function(){var e=(0,t.Z)(o().mark((function e(n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:r}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var oe=(0,u.Z)(ie)},33766:function(e,n,r){"use strict";r.d(n,{g_:function(){return f},u7:function(){return a}});var t=r(75582),i=r(82394),o=r(34376),l=r.n(o),c=r(59e3),u=r(24224);function s(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function d(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?s(Object(r),!0).forEach((function(n){(0,i.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function a(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.replaceParams,o=r.pushHistory,u=i?{}:(0,c.iV)();n=window.location.pathname;var s=o?l().push:l().replace,a=d(d({},u),e);Object.entries(e).forEach((function(e){var n=(0,t.Z)(e,2),r=n[0],i=n[1];"undefined"!==typeof i&&null!==i||delete a[r]}));var f=(0,c.uM)(a);f.length>=1&&(f="?".concat(f));var v="".concat(n.split("?")[0]).concat(f);return s(l().router.pathname,v,{shallow:!0})}function f(e,n,r){var i=r.addingMultipleValues,o=r.isList,l=r.itemsPerPage,c=r.pushHistory,s=void 0!==c&&c,f=r.resetLimitParams,v=d({},e);i?Object.entries(n).forEach((function(e){var n=(0,t.Z)(e,2),r=n[0],i=n[1];if(Array.isArray(i)){var o="".concat(r,"[]");v[o]=i.map(String)}})):o?Object.entries(n).forEach((function(e){var n=(0,t.Z)(e,2),r=n[0],i=n[1],o=String(i),l="".concat(r,"[]"),c=v[l];c&&Array.isArray(c)?(c=c.map(String)).includes(o)?v[l]=(0,u.Od)(c,(function(e){return e===o})):v[l]=c.concat(o):v[l]=[o]})):v=d(d({},v),n),f&&(v._limit=l||20,v._offset=0),a(v,{pushHistory:s})}},59416:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/syncs",function(){return r(89745)}])}},function(e){e.O(0,[3850,5716,9565,2344,4506,6166,8180,6214,9774,2888,179],(function(){return n=59416,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[643],{90659:function(e,n,t){"use strict";var r=t(67403),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,n){var t,o,l,c,s,u,a=!1;n||(n={}),t=n.debug||!1;try{if(l=r(),c=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),n.format)if(r.preventDefault(),"undefined"===typeof r.clipboardData){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[n.format]||i.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(n.format,e);n.onCopy&&(r.preventDefault(),n.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),s.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");a=!0}catch(d){t&&console.error("unable to copy using execCommand: ",d),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",e),n.onCopy&&n.onCopy(window.clipboardData),a=!0}catch(d){t&&console.error("unable to copy using clipboardData: ",d),t&&console.error("falling back to prompt"),o=function(e){var n=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,n)}("message"in n?n.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),l()}return a}},11984:function(e,n,t){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.CopyToClipboard=void 0;var i=c(t(82684)),o=c(t(90659)),l=["text","onCopy","options","children"];function c(e){return e&&e.__esModule?e:{default:e}}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){j(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function a(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function d(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function p(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,n){return f=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},f(e,n)}function h(e){var n=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,r=v(e);if(n){var i=v(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return m(this,t)}}function m(e,n){if(n&&("object"===r(n)||"function"===typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function j(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var x=function(e){!function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&f(e,n)}(s,e);var n,t,r,c=h(s);function s(){var e;d(this,s);for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return j(g(e=c.call.apply(c,[this].concat(t))),"onClick",(function(n){var t=e.props,r=t.text,l=t.onCopy,c=t.children,s=t.options,u=i.default.Children.only(c),a=(0,o.default)(r,s);l&&l(r,a),u&&u.props&&"function"===typeof u.props.onClick&&u.props.onClick(n)})),e}return n=s,(t=[{key:"render",value:function(){var e=this.props,n=(e.text,e.onCopy,e.options,e.children),t=a(e,l),r=i.default.Children.only(n);return i.default.cloneElement(r,u(u({},t),{},{onClick:this.onClick}))}}])&&p(n.prototype,t),r&&p(n,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(i.default.PureComponent);n.CopyToClipboard=x,j(x,"defaultProps",{onCopy:void 0,options:void 0})},64866:function(e,n,t){"use strict";var r=t(11984).CopyToClipboard;r.CopyToClipboard=r,e.exports=r},67403:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var n=document.activeElement,t=[],r=0;r<e.rangeCount;r++)t.push(e.getRangeAt(r));switch(n.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":n.blur();break;default:n=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||t.forEach((function(n){e.addRange(n)})),n&&n.focus()}}},2850:function(e,n,t){"use strict";t.d(n,{M:function(){return c},W:function(){return l}});var r=t(9518),i=t(23831),o=t(3055),l=34*t(49125).iI,c=r.default.div.withConfig({displayName:"indexstyle__BeforeStyle",componentId:"sc-12ee2ib-0"})(["min-height:calc(100vh - ","px);",""],o.Mz,(function(e){return"\n border-left: 1px solid ".concat((e.theme.borders||i.Z.borders).medium,";\n ")}))},60547:function(e,n,t){"use strict";t.d(n,{Z:function(){return P}});var r=t(82394),i=t(21831),o=t(82684),l=t(47999),c=t(1210),s=t(34744),u=t(28358),a=t(67971),d=t(87372),p=t(86673),f=t(82531),h=t(9518),m=t(23831),g=t(73942),v=t(49125),j=h.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1te3pmf-0"})(["border-radius:","px;padding:","px;"," "," ",""],g.n_,3*v.iI,(function(e){return"\n box-shadow: ".concat((e.theme.shadow||m.Z.shadow).small,";\n ")}),(function(e){return e.background&&"\n background: ".concat(e.background,";\n ")}),(function(e){return e.backgroundImage&&'\n background-image: url("'.concat(e.backgroundImage,'");\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n ')})),x=t(3055),b=t(95354),y=t(24141),Z=t(28598);function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var P=function(e){var n=e.after,t=e.afterHidden,r=e.afterWidth,h=e.before,m=e.beforeWidth,g=e.breadcrumbs,_=e.buildSidekick,P=e.children,w=e.errors,S=e.headline,k=e.pageName,I=e.pipeline,C=e.setErrors,E=e.subheader,D=e.subheaderBackground,T=e.subheaderBackgroundImage,M=e.subheaderButton,N=e.subheaderText,A=e.title,R=e.uuid,U=(0,y.i)().height,F=I.uuid,H=f.ZP.pipelines.detail(F,{includes_outputs:!1},{revalidateOnFocus:!1}).data,z=null===H||void 0===H?void 0:H.pipeline,W=(0,o.useMemo)((function(){return n||(_?_({height:U,heightOffset:x.Mz,pipeline:z}):null)}),[n,_,U,z]),q=r||(W?50*v.iI:null),L=(0,o.useMemo)((function(){var e=[];return z&&(e.push.apply(e,[{label:function(){return"Pipelines"},linkProps:{href:"/pipelines"}}]),g?(e.push({label:function(){return z.uuid},linkProps:{as:"/pipelines/".concat(F,"/triggers"),href:"/pipelines/[pipeline]/triggers"}}),e.push.apply(e,(0,i.Z)(g)),e[e.length-1].bold=!0):e.push({bold:!0,label:function(){return z.name}})),e}),[g,z,F]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(c.Z,{after:W,afterHidden:t,afterWidth:q,before:h,beforeWidth:m,breadcrumbs:L,navigationItems:(0,b.H)(k,z),subheaderChildren:"undefined"!==typeof E&&E,title:z?A?A(z):z.name:null,uuid:R,children:[(M||N)&&(0,Z.jsx)(p.Z,{mb:v.Mq,mt:v.cd,mx:v.cd,children:(0,Z.jsx)(j,{background:D,backgroundImage:T,children:(0,Z.jsxs)(a.Z,{alignItems:"center",children:[M,N&&(0,Z.jsx)(p.Z,{ml:3}),N]})})}),S&&(0,Z.jsx)(p.Z,{p:v.cd,children:(0,Z.jsxs)(p.Z,{mt:v.cd,px:v.cd,children:[(0,Z.jsx)(d.Z,{level:5,children:S}),(0,Z.jsx)(s.Z,{light:!0,mt:v.cd,short:!0})]})}),P]}),w&&(0,Z.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===C||void 0===C?void 0:C(null)},children:(0,Z.jsx)(u.Z,O(O({},w),{},{onClose:function(){return null===C||void 0===C?void 0:C(null)}}))})]})}},56681:function(e,n,t){"use strict";t.d(n,{G:function(){return b},Z:function(){return y}});var r=t(75582),i=t(82394),o=t(26304),l=t(32316),c=t(22673),s=t(86532),u=t(86673),a=t(19711),d=t(58180),p=t(49125),f=t(19395),h=t(28598),m=["height","heightOffset","pipeline","selectedRun","selectedTab","setSelectedTab"];function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?g(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var j={uuid:"Run details"},x={uuid:"Dependency tree"},b=[x,j];function y(e){var n=e.height,t=e.heightOffset,i=e.pipeline,g=e.selectedRun,y=e.selectedTab,Z=e.setSelectedTab,_=v({},(0,o.Z)(e,m));g?_.blockStatus=(0,f.IJ)(null===g||void 0===g?void 0:g.block_runs):_.noStatus=!0;var O=(null===g||void 0===g?void 0:g.variables)||{};null!==g&&void 0!==g&&g.event_variables&&(O.event=g.event_variables);var P=[];O&&JSON.stringify(O,null,2).split("\n").forEach((function(e){P.push(" ".concat(e))}));var w=g&&[["Run ID",null===g||void 0===g?void 0:g.id],["Variables",(0,h.jsx)(c.Z,{language:"json",small:!0,source:P.join("\n")})]],S=g&&(0,h.jsx)(u.Z,{pb:p.cd,px:p.cd,children:(0,h.jsx)(d.Z,{alignTop:!0,columnFlex:[null,1],columnMaxWidth:function(e){return 1===e?"100px":null},rows:w.map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return[(0,h.jsx)(a.ZP,{monospace:!0,muted:!0,children:t}),(0,h.jsx)(a.ZP,{monospace:!0,textOverflow:!0,children:i})]})),uuid:"LogDetail"})}),k=y&&Z;return(0,h.jsxs)(h.Fragment,{children:[k&&(0,h.jsx)(u.Z,{py:p.cd,children:(0,h.jsx)(l.Z,{onClickTab:Z,selectedTabUUID:null===y||void 0===y?void 0:y.uuid,tabs:b})}),(!k||x.uuid===(null===y||void 0===y?void 0:y.uuid))&&(0,h.jsx)(s.Z,v(v({},_),{},{height:n,heightOffset:(t||0)+(k?76:0),pipeline:i})),j.uuid===(null===y||void 0===y?void 0:y.uuid)&&S]})}},18025:function(e,n,t){"use strict";t.d(n,{J:function(){return s},U:function(){return c}});var r=t(9518),i=t(23831),o=t(73942),l=t(49125),c=r.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-m7tlau-0"})(["border-radius:","px;border-style:solid;border-width:2px;height:","px;margin-right:","px;padding:","px;width:","px;"," ",""],o.TR,14*l.iI,l.cd*l.iI,l.cd*l.iI,40*l.iI,(function(e){return!e.selected&&"\n border-color: ".concat((e.theme.borders||i.Z.borders).light,";\n ")}),(function(e){return e.selected&&"\n border-color: ".concat((e.theme.interactive||i.Z.interactive).linkPrimary,";\n ")})),s=r.default.div.withConfig({displayName:"indexstyle__DateSelectionContainer",componentId:"sc-m7tlau-1"})(["border-radius:","px;padding:","px;"," "," ",""],o.n_,l.tr,(function(e){return"\n background-color: ".concat((e.theme.interactive||i.Z.interactive).defaultBackground,";\n ")}),(function(e){return e.absolute&&"\n position: absolute;\n z-index: 2;\n right: 0;\n top: ".concat(2.5*l.iI,"px;\n ")}),(function(e){return e.topPosition&&"\n top: -".concat(42*l.iI,"px;\n ")}))},2713:function(e,n,t){"use strict";var r=t(82394),i=t(44495),o=t(67971),l=t(55378),c=t(86673),s=t(19711),u=t(18025),a=t(49125),d=t(24224),p=t(28598);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.selectedDate,t=e.selectedTime,r=e.setSelectedDate,f=e.setSelectedTime,m=e.topPosition;return(0,p.jsxs)(u.J,{absolute:!0,topPosition:m,children:[(0,p.jsx)(i.ZP,{onChange:r,value:n}),(0,p.jsx)(c.Z,{mb:2}),(0,p.jsxs)(o.Z,{alignItems:"center",children:[(0,p.jsx)(s.ZP,{default:!0,large:!0,children:"Time (UTC):"}),(0,p.jsx)(c.Z,{pr:2}),(0,p.jsx)(l.Z,{compact:!0,monospace:!0,onChange:function(e){e.preventDefault(),f((function(n){return h(h({},n),{},{hour:e.target.value})}))},paddingRight:5*a.iI,placeholder:"HH",value:null===t||void 0===t?void 0:t.hour,children:(0,d.m5)(24,0).map((function(e){return String(e).padStart(2,"0")})).map((function(e){return(0,p.jsx)("option",{value:e,children:e},"hour_".concat(e))}))}),(0,p.jsx)(c.Z,{px:1,children:(0,p.jsx)(s.ZP,{bold:!0,large:!0,children:":"})}),(0,p.jsx)(l.Z,{compact:!0,monospace:!0,onChange:function(e){e.preventDefault(),f((function(n){return h(h({},n),{},{minute:e.target.value})}))},paddingRight:5*a.iI,placeholder:"MM",value:null===t||void 0===t?void 0:t.minute,children:(0,d.m5)(60,0).map((function(e){return String(e).padStart(2,"0")})).map((function(e){return(0,p.jsx)("option",{value:e,children:e},"minute_".concat(e))}))})]})]})}},54183:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Ie}});var r,i=t(75582),o=t(77837),l=t(82394),c=t(38860),s=t.n(c),u=t(82684),a=t(83455),d=t(34376),p=t(60328),f=t(34744),h=t(67971),m=t(87372),g=t(51099),v=t(60547),j=t(97496),x=t(47409),b=t(93348),y=t(55378),Z=t(86673),_=t(58180),O=t(19711),P=t(46261),w=t(82531),S=t(56681),k=t(2850),I=t(10503),C=t(49125),E=t(59920),D=t(24224);!function(e){e.AWS="aws_event"}(r||(r={}));var T=[{label:function(){return"AWS"},uuid:r.AWS}],M=(0,D.HK)(T,(function(e){return e.uuid})),N=t(66050),A=t(58122),R=t(19395),U=t(33766),F=t(7715),H=t(9736),z=t(96510),W=t(66653),q=t(59e3),L=t(28598);function V(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function X(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?V(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):V(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var B=function(e){var n=e.fetchPipelineSchedule,t=e.pipeline,r=e.pipelineSchedule,o=e.variables,l=(0,d.useRouter)(),c=(0,H.Ct)(),s=(0,u.useState)(null),D=s[0],T=s[1],V=(t||{}).uuid,B=r||{},J=B.id,G=B.event_matchers,K=B.name,Y=B.schedule_interval,Q=B.schedule_type,$=B.settings,ee=B.sla,ne=B.start_time,te=B.status,re=B.variables,ie=void 0===re?{}:re,oe=(0,q.iV)(),le={_limit:30,_offset:30*(null!==oe&&void 0!==oe&&oe.page?oe.page:0)};null!==oe&&void 0!==oe&&oe.status&&(le.status=oe.status);var ce=w.ZP.pipeline_runs.pipeline_schedules.list(J,le,{refreshInterval:3e3,revalidateOnFocus:!0}),se=ce.data,ue=ce.mutate,ae=(0,u.useMemo)((function(){return(null===se||void 0===se?void 0:se.pipeline_runs)||[]}),[se]),de=(0,u.useMemo)((function(){var e;return(null===se||void 0===se||null===(e=se.metadata)||void 0===e?void 0:e.count)||[]}),[se]),pe=(0,u.useState)(null),fe=pe[0],he=pe[1],me=(0,u.useMemo)((function(){var e=null!==oe&&void 0!==oe&&oe.page?oe.page:0;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(j.Z,{fetchPipelineRuns:ue,onClickRow:function(e){return he((function(n){var t=ae[e];return(null===n||void 0===n?void 0:n.id)!==t.id?t:null}))},pipelineRuns:ae,selectedRun:fe}),(0,L.jsx)(Z.Z,{p:2,children:(0,L.jsx)(g.Z,{page:Number(e),maxPages:9,onUpdate:function(e){var n=Number(e),t=X(X({},oe),{},{page:n>=0?n:0});l.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(V,"/triggers/").concat(J,"?").concat((0,q.uM)(t)))},totalPages:Math.ceil(de/30)})})]})}),[ue,t,ae,fe]),ge=(0,u.useState)(S.G[0]),ve=ge[0],je=ge[1],xe=(0,a.Db)((function(e){return w.ZP.pipeline_schedules.useUpdate(e.id)({pipeline_schedule:(0,F.gR)(e,["id"])})}),{onSuccess:function(e){return(0,z.wD)(e,{callback:function(){n()},onErrorCallback:function(e,n){return T({errors:n,response:e})}})}}),be=(0,i.Z)(xe,2),ye=be[0],Ze=be[1].isLoading,_e=(0,u.useMemo)((function(){return b.fq.ACTIVE===te}),[te]),Oe=(0,u.useMemo)((function(){var e,n,t={default:!0,size:1.5*C.iI},r=[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.VW,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Trigger type"})]},"trigger_type_label"),(0,L.jsx)(O.ZP,{monospace:!0,children:null===(e=b.Z4[Q])||void 0===e?void 0:e.call(b.Z4)},"trigger_type")],[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.rs,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Status"})]},"trigger_status_label"),(0,L.jsx)(O.ZP,{danger:!_e,monospace:!0,success:_e,children:te},"trigger_status")]];if(ee){var i=(0,R.gU)(ee),o=i.time,l=i.unit,c=1===o?l:"".concat(l,"s");r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.kI,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"SLA"})]},"trigger_sla_label"),(0,L.jsx)(O.ZP,{monospace:!0,children:"".concat(o," ").concat(c)},"trigger_sla")])}(Y&&r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.Pf,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Frequency"})]},"trigger_frequency_label"),(0,L.jsx)(O.ZP,{monospace:!0,children:Y.replace("@","")},"trigger_frequency")]),ne&&r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.aw,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Start date"})]},"trigger_start_date_label"),(0,L.jsx)(O.ZP,{monospace:!0,children:ne},"trigger_start_date")]),null!==$&&void 0!==$&&$.skip_if_previous_running)&&r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(P.Z,{default:!0,label:"Skip current run if any previous runs are still in progress",size:1.5*C.iI,widthFitContent:!0}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Skip if running"})]},"trigger_skip_if_running"),(0,L.jsx)(O.ZP,{monospace:!0,children:null===(n=$.skip_if_previous_running)||void 0===n?void 0:n.toString()},"trigger_skip_if_running_label")]);return null!==$&&void 0!==$&&$.allow_blocks_to_fail&&r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(P.Z,{default:!0,label:"Trigger runs will continue running blocks if other unrelated blocks fail",size:1.5*C.iI,widthFitContent:!0}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Allow blocks to fail"})]},"trigger_allow_blocks_to_fail"),(0,L.jsx)(O.ZP,{monospace:!0,children:$.allow_blocks_to_fail.toString()},"trigger_allow_blocks_to_fail_label")]),(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:r})}),[_e,Y,$,ee,ne,Q]),Pe=(0,u.useMemo)((function(){return ie||{}}),[ie]),we=(0,u.useMemo)((function(){var e,n=[];return(0,F.Qr)(Pe)?n=(0,A.wx)(o,(function(e){return"global"===e.uuid})):Object.entries(Pe).forEach((function(e){var t=(0,i.Z)(e,2),r=t[0],o=t[1];n.push({uuid:r,value:(0,A.FS)(o)})})),"undefined"!==typeof(n=(0,A.JZ)(n||[],Q))&&null!==(e=n)&&void 0!==e&&e.length?(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:n.map((function(e){var n=e.uuid,t=e.value;return[(0,L.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:n},"settings_variable_label_".concat(n)),(0,L.jsx)(O.ZP,{monospace:!0,small:!0,children:t},"settings_variable_".concat(n))]}))}):null}),[Q,ie,o]),Se=(0,u.useMemo)((function(){return(0,L.jsx)(_.Z,{columnFlex:[null,1],columns:[{uuid:"Provider"},{uuid:"Event"}],rows:null===G||void 0===G?void 0:G.map((function(e,n){var t=e.event_type,r=e.name;return[(0,L.jsx)(O.ZP,{default:!0,monospace:!0,children:M[t].label()},"".concat(t,"_").concat(n,"_label")),(0,L.jsx)(O.ZP,{monospace:!0,children:r},"".concat(t,"_").concat(n,"_name"))]}))})}),[G]);return(0,L.jsxs)(v.Z,{afterHidden:!fe,before:(0,L.jsxs)(k.M,{children:[(0,L.jsxs)(Z.Z,{mb:C.HN,pt:C.cd,px:C.cd,children:[(0,L.jsxs)(Z.Z,{mb:C.cd,children:[b.Xm.TIME===Q&&(0,L.jsx)(I.kO,{size:5*C.iI}),b.Xm.EVENT===Q&&(0,L.jsx)(I.Jp,{size:5*C.iI}),!Q&&(0,L.jsx)(I.VW,{size:5*C.iI})]}),(0,L.jsx)(m.Z,{children:K})]}),(0,L.jsx)(Z.Z,{px:C.cd,children:(0,L.jsx)(m.Z,{level:5,children:"Settings"})}),(0,L.jsx)(f.Z,{light:!0,mt:1,short:!0}),Oe,(null===G||void 0===G?void 0:G.length)>=1&&(0,L.jsxs)(Z.Z,{my:C.HN,children:[(0,L.jsx)(Z.Z,{px:C.cd,children:(0,L.jsx)(m.Z,{level:5,children:"Events"})}),(0,L.jsx)(f.Z,{light:!0,mt:1,short:!0}),Se]}),we&&(0,L.jsxs)(Z.Z,{my:C.HN,children:[(0,L.jsx)(Z.Z,{px:C.cd,children:(0,L.jsx)(m.Z,{level:5,children:"Runtime variables"})}),(0,L.jsx)(f.Z,{light:!0,mt:1,short:!0}),we]})]}),beforeWidth:k.W,breadcrumbs:[{label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(V,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{label:function(){return K},linkProps:{as:"/pipelines/".concat(V,"/triggers/").concat(J),href:"/pipelines/[pipeline]/triggers/[...slug]"}}],buildSidekick:function(e){return(0,S.Z)(X(X({},e),{},{selectedRun:fe,selectedTab:ve,setSelectedTab:je}))},errors:D,pageName:E.M.TRIGGERS,pipeline:t,setErrors:T,subheader:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(p.Z,{beforeIcon:_e?(0,L.jsx)(I.dz,{size:2*C.iI}):(0,L.jsx)(I.Py,{inverted:!c,size:2*C.iI}),danger:_e&&!c,loading:Ze,onClick:function(e){(0,W.j)(e),ye({id:J,status:_e?b.fq.INACTIVE:b.fq.ACTIVE})},outline:!0,success:!_e&&!c,children:_e?"Pause trigger":"Start trigger"}),(0,L.jsx)(Z.Z,{mr:C.cd}),!c&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(p.Z,{linkProps:{as:"/pipelines/".concat(V,"/triggers/").concat(J,"/edit"),href:"/pipelines/[pipeline]/triggers/[...slug]"},noHoverUnderline:!0,outline:!0,sameColorAsText:!0,children:"Edit trigger"}),(0,L.jsx)(Z.Z,{mr:C.cd})]}),(0,L.jsxs)(y.Z,{compact:!0,defaultColor:!0,onChange:function(e){e.preventDefault(),"all"===e.target.value?l.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(V,"/triggers/").concat(J)):(0,U.u7)({page:0,status:e.target.value})},paddingRight:4*C.iI,placeholder:"Select run status",value:(null===oe||void 0===oe?void 0:oe.status)||"all",children:[(0,L.jsx)("option",{value:"all",children:"All statuses"},"all_statuses"),Object.values(N.V).map((function(e){return(0,L.jsx)("option",{value:e,children:x.D[e]},e)}))]})]}),title:function(){return K},uuid:"triggers/detail",children:[(0,L.jsx)(Z.Z,{mt:C.cd,px:C.cd,children:(0,L.jsx)(m.Z,{level:5,children:"Runs for this trigger"})}),(0,L.jsx)(f.Z,{light:!0,mt:C.cd,short:!0}),me]})},J=t(21831),G=t(21764),K=t(2713),Y=t(38341),Q=t(47999),$=t(22673),ee=t(65730),ne=t(93461),te=t(10919),re=t(26304),ie=t(9518),oe=t(23831),le=t(2005),ce=t(31012),se=["children","large","lineHeight","ordered"];function ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ue(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ue(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var de=(0,ie.css)([""," "," "," "," "," "," "," "," "," ",""],(function(e){return!e.muted&&"\n color: ".concat((e.theme.content||oe.Z.content).default,";\n ")}),(function(e){return e.muted&&"\n color: ".concat((e.theme.content||oe.Z.content).muted,";\n ")}),(function(e){return e.inverted&&"\n color: ".concat((e.theme.content||oe.Z.content).inverted,";\n ")}),(function(e){return e.color&&"\n color: ".concat(e.color,";\n ")}),(function(e){return!e.monospace&&"\n font-family: ".concat(le.ry,";\n ")}),(function(e){return e.monospace&&"\n font-family: ".concat(le.Vp,";\n ")}),(function(e){return e.large&&"\n ".concat(ce.x_,"\n ")}),(function(e){return!e.large&&!e.small&&"\n ".concat(ce.i3,"\n ")}),(function(e){return e.small&&"\n ".concat(ce.J5,"\n ")}),(function(e){return e.lineHeight&&"\n line-height: ".concat(e.lineHeight,"px !important;\n ")})),pe=ie.default.ul.withConfig({displayName:"List__UnorderedListStyle",componentId:"sc-1f6yhbi-0"})(["",""],de),fe=ie.default.ol.withConfig({displayName:"List__OrderedListStyle",componentId:"sc-1f6yhbi-1"})(["",""],de),he=ie.default.li.withConfig({displayName:"List__ListItemStyle",componentId:"sc-1f6yhbi-2"})(["",""],(function(e){return e.large&&e.marginTop&&"\n margin-top: ".concat(1*C.iI,"px;\n ")}));var me=function(e){var n=e.children,t=e.large,r=e.lineHeight,i=e.ordered,o=(0,re.Z)(e,se),l=i?fe:pe;return(0,L.jsx)(l,ae(ae({large:t,lineHeight:r},o),{},{children:u.Children.map(n,(function(e,n){return(0,L.jsx)(he,ae(ae({large:t,marginTop:n>=1},o),{},{children:u.cloneElement(e)}),e.props.key)}))}))},ge=t(98781),ve=t(82944),je=t(70902),xe=t(18025);function be(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ye(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?be(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):be(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ze=function(e){var n=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:b.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:b.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:b.Xm.API}];return e?n.slice(0,1):n};var _e=function(e){var n=e.fetchPipelineSchedule,t=e.pipeline,r=e.pipelineSchedule,o=e.variables,c=(0,d.useRouter)(),s=null===t||void 0===t?void 0:t.uuid,g=null===r||void 0===r?void 0:r.id,j=(null===t||void 0===t?void 0:t.type)===ge.qL.STREAMING,x=(0,u.useState)(null),P=x[0],S=x[1],k=(0,u.useState)([]),M=k[0],N=k[1],U=(0,u.useState)(!1),H=U[0],W=U[1],q=(0,u.useState)(!1),V=q[0],X=q[1],B=(0,u.useState)(),re=B[0],ie=B[1],oe=(0,u.useState)({}),le=oe[0],ce=oe[1],se=(0,u.useState)(r),ue=se[0],ae=se[1],de=(0,u.useState)(!1),pe=de[0],fe=de[1],he=(0,u.useState)(null),be=he[0],_e=he[1],Oe=(0,u.useMemo)((function(){return(0,A.wx)(o,(function(e){return"global"===e.uuid}))}),[o]),Pe=ue||{},we=Pe.name,Se=Pe.schedule_interval,ke=Pe.schedule_type,Ie=Pe.settings,Ce=void 0===Ie?{}:Ie,Ee=Pe.sla,De=Pe.start_time,Te=(Pe.token,Pe.variables),Me=void 0===Te?{}:Te;(0,u.useEffect)((function(){Ce&&ie(Ce)}),[Ce]);var Ne=(0,u.useState)(null),Ae=Ne[0],Re=Ne[1],Ue=(0,u.useState)({hour:"00",minute:"00"}),Fe=Ue[0],He=Ue[1],ze=w.ZP.event_rules.detail("aws").data,We=(0,u.useMemo)((function(){var e;return(null===ze||void 0===ze||null===(e=ze.event_rule)||void 0===e?void 0:e.rules)||[]}),[ze]),qe=(0,u.useMemo)((function(){return(0,D.HK)(We,(function(e){return e.name}))}),[We]),Le=(0,a.Db)(w.ZP.pipeline_schedules.useUpdate(g),{onSuccess:function(e){return(0,z.wD)(e,{callback:function(){n(),c.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(s,"/triggers/").concat(g))},onErrorCallback:function(e,n){return S({errors:n,response:e})}})}}),Ve=(0,i.Z)(Le,2),Xe=Ve[0],Be=Ve[1].isLoading,Je=(0,u.useMemo)((function(){return Me||{}}),[Me]);(0,u.useEffect)((function(){if(De){var e=De.split(" ")[1];Re((0,R.eI)(De)),He({hour:e.substring(0,2),minute:e.substring(3,5)})}else{var n=new Date;Re(n),He({hour:String(n.getUTCHours()).padStart(2,"0"),minute:String(n.getUTCMinutes()).padStart(2,"0")})}}),[De]),(0,u.useEffect)((function(){Je&&Object.keys(Je).length>0&&W(!0)}),[Je]),(0,u.useEffect)((function(){ce(H?null===Oe||void 0===Oe?void 0:Oe.reduce((function(e,n){var t=n.uuid,r=n.value;return ye(ye({},e),{},(0,l.Z)({},t,Je[t]||r))}),{}):null)}),[Oe,H]),(0,u.useEffect)((function(){if(r&&(N(r.event_matchers),Ke?(ae(ye(ye({},r),{},{schedule_interval:"custom"})),_e(Se)):ae(j?ye(ye({},r),{},{schedule_interval:b.U5.ONCE}):r),r.sla)){X(!0);var e=(0,R.gU)(Ee),n=e.time,t=e.unit;ae((function(e){return ye(ye({},e),{},{slaAmount:n,slaUnit:t})}))}}),[r]);var Ge=(0,u.useCallback)((function(){var e=ye(ye({},(0,F.GL)(ue,["name","schedule_type"])),{},{event_matchers:[],schedule_interval:null,start_time:null,variables:(0,A.e7)(le)});if(b.Xm.EVENT===ue.schedule_type?e.event_matchers=M:(e.schedule_interval=Ke?be:ue.schedule_interval,e.start_time=Ae&&null!==Fe&&void 0!==Fe&&Fe.hour&&null!==Fe&&void 0!==Fe&&Fe.minute?"".concat(Ae.toISOString().split("T")[0]," ").concat(null===Fe||void 0===Fe?void 0:Fe.hour,":").concat(null===Fe||void 0===Fe?void 0:Fe.minute,":00"):null),V){var n=null===ue||void 0===ue?void 0:ue.slaAmount,t=null===ue||void 0===ue?void 0:ue.slaUnit;if(!n||isNaN(n)||!t)return void G.Am.error("Please enter a valid SLA",{position:G.Am.POSITION.BOTTOM_RIGHT,toastId:"sla_error"});e.sla=(0,R.vJ)(n,t)}else null!==r&&void 0!==r&&r.sla&&(e.sla=0);e.settings=re,Xe({pipeline_schedule:e})}),[be,Ae,V,M,r,le,ue,re,Fe,Xe]),Ke=(0,u.useMemo)((function(){return Se&&!Object.values(b.U5).includes(Se)}),[Se]),Ye=(0,u.useMemo)((function(){var e=[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.KJ,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Trigger name"})]},"trigger_name_detail"),(0,L.jsx)(ve.Z,{monospace:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{name:e.target.value})}))},placeholder:"Name this trigger",value:we},"trigger_name_input_detail")],[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.Pf,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Frequency"})]},"frequency"),(0,L.jsxs)("div",{children:[(0,L.jsxs)(y.Z,{monospace:!0,onChange:function(e){e.preventDefault();var n=e.target.value;ae((function(e){return ye(ye({},e),{},{schedule_interval:n})}))},placeholder:"Choose the frequency to run",value:Se,children:[!Se&&(0,L.jsx)("option",{value:""}),Object.values(b.U5).map((function(e){return(0,L.jsx)("option",{value:e,children:e.substring(1)},e)})),(0,L.jsx)("option",{value:"custom",children:"custom"},"custom")]}),(0,L.jsx)(Z.Z,{mt:1,p:1,children:(0,L.jsxs)(O.ZP,{muted:!0,small:!0,children:["If you don\u2019t see the frequency option you need, select ",(0,L.jsx)(O.ZP,{inline:!0,monospace:!0,small:!0,children:"custom"})," and enter CRON syntax."]})})]},"frequency_input")],[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.aw,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Start date and time"})]},"start_time"),(0,L.jsxs)("div",{style:{minHeight:"".concat(5.75*C.iI,"px")},children:[!pe&&(0,L.jsx)(ve.Z,{monospace:!0,onClick:function(){return fe((function(e){return!e}))},placeholder:"YYYY-MM-DD HH:MM",value:Ae?"".concat(Ae.toISOString().split("T")[0]," ").concat(null===Fe||void 0===Fe?void 0:Fe.hour,":").concat(null===Fe||void 0===Fe?void 0:Fe.minute):""}),(0,L.jsx)("div",{style:{width:"400px"},children:(0,L.jsx)(Q.Z,{disableEscape:!0,onClickOutside:function(){return fe(!1)},open:pe,style:{position:"relative"},children:(0,L.jsx)(K.Z,{selectedDate:Ae,selectedTime:Fe,setSelectedDate:Re,setSelectedTime:He,topPosition:!0})})})]},"start_time_input")]];return j&&e.splice(1,1),Ke&&e.splice(2,0,[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.EK,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Cron expression"})]},"cron_expression"),(0,L.jsxs)("div",{children:[(0,L.jsx)(ve.Z,{monospace:!0,onChange:function(e){e.preventDefault(),_e(e.target.value)},placeholder:"* * * * *",value:be}),(0,L.jsxs)(Z.Z,{mt:1,p:1,children:[(0,L.jsxs)(O.ZP,{muted:!0,small:!0,children:["If you want this pipeline to trigger every 1 minute, the CRON syntax is ",(0,L.jsx)(O.ZP,{inline:!0,monospace:!0,small:!0,children:"*/1 * * * *"}),"."]}),(0,L.jsxs)(O.ZP,{muted:!0,small:!0,children:["For more CRON syntax examples, check out this ",(0,L.jsx)(te.Z,{href:"https://crontab.guru/",openNewWindow:!0,small:!0,children:"resource"}),"."]})]})]},"cron_expression_input")]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z.Z,{mb:2,px:C.cd,children:(0,L.jsx)(m.Z,{children:"Settings"})}),(0,L.jsx)(f.Z,{light:!0,short:!0}),(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:e})]})}),[be,Ae,Ke,j,we,Se,pe,Fe]),Qe=(0,u.useCallback)((function(e,n){N((function(t){return Object.entries(n).forEach((function(n){var r=(0,i.Z)(n,2),o=r[0],l=r[1];t[e][o]=l})),(0,J.Z)(t)}))}),[N]),$e=(0,u.useMemo)((function(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z.Z,{mb:C.cd,px:C.cd,children:(0,L.jsx)(m.Z,{children:"Settings"})}),(0,L.jsx)(f.Z,{light:!0,short:!0}),(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.KJ,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Trigger name"})]},"trigger_name_event"),(0,L.jsx)(ve.Z,{monospace:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{name:e.target.value})}))},placeholder:"Name this trigger",value:we},"trigger_name_input_event")]]}),(0,L.jsxs)(Z.Z,{mb:2,mt:5,px:C.cd,children:[(0,L.jsx)(m.Z,{children:"Events"}),(0,L.jsxs)(O.ZP,{muted:!0,children:["Add 1 or more event that will trigger this pipeline to run.",(0,L.jsx)("br",{}),"If you add more than 1 event, this pipeline will trigger if any of the events are received."]}),(0,L.jsxs)(Z.Z,{mt:C.Mq,children:[(0,L.jsx)(O.ZP,{bold:!0,large:!0,children:"AWS events"}),(0,L.jsxs)(O.ZP,{muted:!0,children:["In order to retrieve all the possible AWS events you can trigger your pipeline from,",(0,L.jsx)("br",{}),"you\u2019ll need to set 3 environment variables (",(0,L.jsx)(te.Z,{href:"https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html",openNewWindow:!0,underline:!0,children:"more info here"}),"):"]}),(0,L.jsx)(Z.Z,{mt:1,children:(0,L.jsxs)(me,{monospace:!0,ordered:!0,children:[(0,L.jsx)(O.ZP,{monospace:!0,children:"AWS_REGION_NAME"}),(0,L.jsx)(O.ZP,{monospace:!0,children:"AWS_ACCESS_KEY_ID"}),(0,L.jsx)(O.ZP,{monospace:!0,children:"AWS_SECRET_ACCESS_KEY"})]})})]})]}),(0,L.jsx)(f.Z,{light:!0,short:!0}),(null===M||void 0===M?void 0:M.length)>=1&&(0,L.jsx)(_.Z,{alignTop:!0,columnFlex:[1,1,2,null],columns:[{uuid:"Provider"},{uuid:"Event"},{uuid:"Pattern"},{label:function(){return""},uuid:"delete"}],rows:null===M||void 0===M?void 0:M.map((function(e,n){var t=e.event_type,r=e.name,i=e.pattern,o=e.id||"".concat(t,"-").concat(r,"-").concat(n,"-").concat(JSON.stringify(i)),l=[];return i&&JSON.stringify(i,null,2).split("\n").forEach((function(e){l.push(" ".concat(e))})),[(0,L.jsxs)(y.Z,{monospace:!0,onChange:function(e){return Qe(n,{event_type:e.target.value})},placeholder:"Event provider",value:t||"",children:[!t&&(0,L.jsx)("option",{value:""}),T.map((function(e){var n=e.label,t=e.uuid;return(0,L.jsx)("option",{value:t,children:n()},t)}))]},"event-provider-".concat(o)),(0,L.jsxs)(y.Z,{monospace:!0,onChange:function(e){var t,r=e.target.value,i=null===(t=qe[r])||void 0===t?void 0:t.event_pattern;Qe(n,{name:r,pattern:i?JSON.parse(i):null})},placeholder:"Event name",value:r,children:[!r&&(0,L.jsx)("option",{value:""}),We.map((function(e){var n=e.name;return(0,L.jsx)("option",{value:n,children:n},n)}))]},"event-name-".concat(o)),i&&(0,L.jsx)($.Z,{language:"json",small:!0,source:l.join("\n")}),(0,L.jsx)(p.Z,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(){return N((function(e){return(0,D.oM)(e,n)}))},children:(0,L.jsx)(I.rF,{default:!0,size:2*C.iI})},"remove_event")]}))}),(0,L.jsx)(Z.Z,{p:C.cd,children:(0,L.jsx)(p.Z,{beforeIcon:(0,L.jsx)(I.mm,{size:2*C.iI}),onClick:function(){return N((function(e){return e.concat({})}))},outline:!0,children:"Add event matcher"})})]})}),[M,We,we]),en=(0,u.useMemo)((function(){var e,n="";return n="".concat(window.origin,"/api/pipeline_schedules/").concat(null===r||void 0===r?void 0:r.id,"/pipeline_runs"),null!==r&&void 0!==r&&r.token&&(n="".concat(n,"/").concat(r.token)),(e=window.location.port)&&(n=n.replace(e,"6789")),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z.Z,{mb:C.cd,px:C.cd,children:(0,L.jsx)(m.Z,{children:"Settings"})}),(0,L.jsx)(f.Z,{light:!0,short:!0}),(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.KJ,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Trigger name"})]},"trigger_name_api"),(0,L.jsx)(ve.Z,{monospace:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{name:e.target.value})}))},placeholder:"Name this trigger",value:we},"trigger_name_input_api")]]}),(0,L.jsxs)(Z.Z,{mb:2,mt:5,px:C.cd,children:[(0,L.jsx)(m.Z,{children:"Endpoint"}),(0,L.jsxs)(O.ZP,{muted:!0,children:["Make a ",(0,L.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:"POST"})," request to the following endpoint:"]}),(0,L.jsx)(Z.Z,{mt:C.Mq,children:(0,L.jsx)(ee.Z,{copiedText:n,linkText:n,monospace:!0,withCopyIcon:!0})})]}),(0,L.jsxs)(Z.Z,{mb:2,mt:5,px:C.cd,children:[(0,L.jsx)(m.Z,{children:"Payload"}),(0,L.jsx)(O.ZP,{muted:!0,children:"You can optionally include runtime variables in your request payload. These runtime variables are accessible from within each pipeline block."}),(0,L.jsx)(Z.Z,{mt:C.Mq,children:(0,L.jsx)(ee.Z,{withCopyIcon:!0,copiedText:'{\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n}\n',children:(0,L.jsx)($.Z,{language:"json",small:!0,source:'\n {\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n }\n'})})})]}),(0,L.jsxs)(Z.Z,{mb:2,mt:5,px:C.cd,children:[(0,L.jsx)(m.Z,{children:"Sample cURL command"}),(0,L.jsx)(Z.Z,{mt:C.Mq,children:(0,L.jsx)($.Z,{language:"bash",small:!0,source:"\n curl -X POST ".concat(n,' \\\n --header \'Content-Type: application/json\' \\\n --data \'\n {\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n }\'\n')})})]})]})}),[we,r,"object"]),nn=!ke||b.Xm.TIME===ke&&!(j&&Ae||!j&&Ae&&Se)||b.Xm.EVENT===ke&&(!(null!==M&&void 0!==M&&M.length)||!M.every((function(e){var n=e.event_type,t=e.name;return n&&t}))),tn=(0,u.useMemo)((function(){return(0,L.jsxs)(Z.Z,{p:C.cd,children:[!(0,F.Qr)(Oe)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(Z.Z,{mr:2,children:(0,L.jsx)(je.Z,{checked:H,onCheck:W})}),(0,L.jsx)(O.ZP,{monospace:!0,muted:!0,children:"Overwrite global variables"})]}),H&&le&&Object.entries(le).length>0&&(0,L.jsx)(Z.Z,{mt:2,children:(0,L.jsx)(_.Z,{columnFlex:[null,1],columns:[{uuid:"Variable"},{uuid:"Value"}],rows:Object.entries(le).map((function(e){var n=(0,i.Z)(e,2),t=n[0],r=n[1];return[(0,L.jsx)(O.ZP,{default:!0,monospace:!0,children:t},"variable_".concat(t)),(0,L.jsx)(ve.Z,{borderless:!0,monospace:!0,onChange:function(e){e.preventDefault(),ce((function(n){return ye(ye({},n),{},(0,l.Z)({},t,e.target.value))}))},paddingHorizontal:0,placeholder:"Variable value",value:r},"variable_uuid_input_".concat(t))]}))})})]}),(0,L.jsxs)(Z.Z,{mt:2,children:[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(Z.Z,{mr:2,children:(0,L.jsx)(je.Z,{checked:V,onCheck:function(e){X(e),e||ae((function(e){return ye(ye({},e),{},{slaAmount:0})}))}})}),(0,L.jsx)(O.ZP,{default:!0,monospace:!0,children:"Configure trigger SLA"})]}),V&&(0,L.jsx)(Z.Z,{mt:2,children:(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.aw,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"SLA"})]},"sla_detail"),(0,L.jsxs)(h.Z,{children:[(0,L.jsx)(ne.Z,{flex:1,children:(0,L.jsx)(ve.Z,{fullWidth:!0,monospace:!0,noBorder:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{slaAmount:e.target.value})}))},placeholder:"Time",value:null===ue||void 0===ue?void 0:ue.slaAmount})}),(0,L.jsx)(ne.Z,{flex:1,children:(0,L.jsx)(y.Z,{fullWidth:!0,monospace:!0,noBorder:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{slaUnit:e.target.value})}))},placeholder:"Select time unit",small:!0,value:null===ue||void 0===ue?void 0:ue.slaUnit,children:Object.keys(R.tL).map((function(e){return(0,L.jsx)("option",{value:e,children:"".concat(e,"(s)")},e)}))})})]},"sla_input_detail")]]})}),(0,L.jsxs)(Z.Z,{mt:2,children:[(0,L.jsx)(m.Z,{level:5,monospace:!0,children:"Additional settings"}),b.Xm.TIME===ke&&(0,L.jsx)(Z.Z,{mt:2,children:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(Y.Z,{checked:null===re||void 0===re?void 0:re.skip_if_previous_running,onClick:function(){return ie((function(e){return ye(ye({},e),{},{skip_if_previous_running:!(null!==re&&void 0!==re&&re.skip_if_previous_running)})}))}}),(0,L.jsx)(Z.Z,{ml:2}),(0,L.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Skip run if previous run still in progress"})]})}),(0,L.jsx)(Z.Z,{mt:2,children:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(Y.Z,{checked:null===re||void 0===re?void 0:re.allow_blocks_to_fail,onClick:function(){return ie((function(e){return ye(ye({},e),{},{allow_blocks_to_fail:!(null!==re&&void 0!==re&&re.allow_blocks_to_fail)})}))}}),(0,L.jsx)(Z.Z,{ml:2}),(0,L.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Keep running pipeline even if blocks fail"})]})})]})]})]})}),[V,Oe,H,le,ue,X,W,re]);return(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(v.Z,{after:tn,breadcrumbs:[{label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(s,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{label:function(){return null===r||void 0===r?void 0:r.name},linkProps:{as:"/pipelines/".concat(s,"/triggers/").concat(g),href:"/pipelines/[pipeline]/triggers/[...slug]"}}],errors:P,pageName:E.M.TRIGGERS,pipeline:t,setErrors:S,subheader:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(p.Z,{disabled:nn,loading:Be,onClick:Ge,outline:!0,primary:!0,children:"Save changes"}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(p.Z,{linkProps:{href:"/pipelines/[pipeline]/triggers/[...slug]",as:"/pipelines/".concat(s,"/triggers/").concat(g)},noHoverUnderline:!0,outline:!0,sameColorAsText:!0,children:"Cancel"})]}),title:function(){return"Edit ".concat(null===r||void 0===r?void 0:r.name)},uuid:"triggers/edit",children:[(0,L.jsxs)(Z.Z,{p:C.cd,children:[(0,L.jsxs)(Z.Z,{mb:2,children:[(0,L.jsx)(m.Z,{children:"Trigger type"}),(0,L.jsx)(O.ZP,{muted:!0,children:"How would you like this pipeline to be triggered?"})]}),(0,L.jsx)(h.Z,{children:Ze(j).map((function(e){var n=e.label,t=e.description,r=e.uuid,i=ke===r,o=ke&&!i;return(0,L.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){b.Xm.EVENT!==r||null!==M&&void 0!==M&&M.length||N([{}]),ae((function(e){return ye(ye({},e),{},{schedule_type:r})}))},children:(0,L.jsx)(xe.U,{selected:i,children:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(ne.Z,{children:(0,L.jsx)("input",{checked:i,type:"radio"})}),(0,L.jsx)(Z.Z,{mr:C.cd}),(0,L.jsxs)(ne.Z,{alignItems:"flex-start",flexDirection:"column",children:[(0,L.jsx)(m.Z,{bold:!0,default:!i&&!o,level:5,muted:!i&&o,children:n()}),(0,L.jsx)(O.ZP,{default:!i&&!o,leftAligned:!0,muted:o,children:t()})]})]})})},r)}))})]}),(0,L.jsxs)(Z.Z,{mt:5,children:[b.Xm.TIME===ke&&Ye,b.Xm.EVENT===ke&&$e,b.Xm.API===ke&&en]})]})})},Oe=t(41788),Pe=t(70543);function we(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?we(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):we(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function ke(e){var n=e.pipelineScheduleId,t=e.pipelineUUID,r=e.subpath,i=w.ZP.variables.pipelines.list(t).data,o=null===i||void 0===i?void 0:i.variables,l=w.ZP.pipeline_schedules.detail(n),c=l.data,s=l.mutate,u=null===c||void 0===c?void 0:c.pipeline_schedule,a=w.ZP.pipelines.detail(t,{includes_content:!1,includes_outputs:!1},{revalidateOnFocus:!1}).data,d=Se(Se({},null===a||void 0===a?void 0:a.pipeline),{},{uuid:t});return Pe.b7===r?(0,L.jsx)(_e,{fetchPipelineSchedule:s,pipeline:d,pipelineSchedule:u,variables:o}):(0,L.jsx)(B,{fetchPipelineSchedule:s,pipeline:d,pipelineSchedule:u,variables:o})}ke.getInitialProps=function(){var e=(0,o.Z)(s().mark((function e(n){var t,r,o,l,c,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.query,r=t.pipeline,o=t.slug,!Array.isArray(o)){e.next=4;break}return l=(0,i.Z)(o,2),c=l[0],u=l[1],e.abrupt("return",{pipelineScheduleId:c,pipelineUUID:r,subpath:u});case 4:return e.abrupt("return",{pipelineUUID:r});case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var Ie=(0,Oe.Z)(ke)},95488:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers/[...slug]",function(){return t(54183)}])}},function(e){e.O(0,[3850,5716,5896,4804,1774,5872,2524,4495,2344,4506,6166,8180,6214,6532,1286,4741,3688,9774,2888,179],(function(){return n=95488,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[643],{90659:function(e,n,t){"use strict";var r=t(67403),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,n){var t,o,l,c,s,u,a=!1;n||(n={}),t=n.debug||!1;try{if(l=r(),c=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),n.format)if(r.preventDefault(),"undefined"===typeof r.clipboardData){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[n.format]||i.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(n.format,e);n.onCopy&&(r.preventDefault(),n.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),s.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");a=!0}catch(d){t&&console.error("unable to copy using execCommand: ",d),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",e),n.onCopy&&n.onCopy(window.clipboardData),a=!0}catch(d){t&&console.error("unable to copy using clipboardData: ",d),t&&console.error("falling back to prompt"),o=function(e){var n=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,n)}("message"in n?n.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),l()}return a}},11984:function(e,n,t){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.CopyToClipboard=void 0;var i=c(t(82684)),o=c(t(90659)),l=["text","onCopy","options","children"];function c(e){return e&&e.__esModule?e:{default:e}}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){j(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function a(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function d(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function p(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,n){return f=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},f(e,n)}function h(e){var n=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,r=v(e);if(n){var i=v(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return m(this,t)}}function m(e,n){if(n&&("object"===r(n)||"function"===typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function j(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var x=function(e){!function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&f(e,n)}(s,e);var n,t,r,c=h(s);function s(){var e;d(this,s);for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return j(g(e=c.call.apply(c,[this].concat(t))),"onClick",(function(n){var t=e.props,r=t.text,l=t.onCopy,c=t.children,s=t.options,u=i.default.Children.only(c),a=(0,o.default)(r,s);l&&l(r,a),u&&u.props&&"function"===typeof u.props.onClick&&u.props.onClick(n)})),e}return n=s,(t=[{key:"render",value:function(){var e=this.props,n=(e.text,e.onCopy,e.options,e.children),t=a(e,l),r=i.default.Children.only(n);return i.default.cloneElement(r,u(u({},t),{},{onClick:this.onClick}))}}])&&p(n.prototype,t),r&&p(n,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(i.default.PureComponent);n.CopyToClipboard=x,j(x,"defaultProps",{onCopy:void 0,options:void 0})},64866:function(e,n,t){"use strict";var r=t(11984).CopyToClipboard;r.CopyToClipboard=r,e.exports=r},67403:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var n=document.activeElement,t=[],r=0;r<e.rangeCount;r++)t.push(e.getRangeAt(r));switch(n.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":n.blur();break;default:n=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||t.forEach((function(n){e.addRange(n)})),n&&n.focus()}}},2850:function(e,n,t){"use strict";t.d(n,{M:function(){return c},W:function(){return l}});var r=t(9518),i=t(23831),o=t(3055),l=34*t(49125).iI,c=r.default.div.withConfig({displayName:"indexstyle__BeforeStyle",componentId:"sc-12ee2ib-0"})(["min-height:calc(100vh - ","px);",""],o.Mz,(function(e){return"\n border-left: 1px solid ".concat((e.theme.borders||i.Z.borders).medium,";\n ")}))},60547:function(e,n,t){"use strict";t.d(n,{Z:function(){return P}});var r=t(82394),i=t(21831),o=t(82684),l=t(47999),c=t(1210),s=t(34744),u=t(49894),a=t(67971),d=t(87372),p=t(86673),f=t(82531),h=t(9518),m=t(23831),g=t(73942),v=t(49125),j=h.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1te3pmf-0"})(["border-radius:","px;padding:","px;"," "," ",""],g.n_,3*v.iI,(function(e){return"\n box-shadow: ".concat((e.theme.shadow||m.Z.shadow).small,";\n ")}),(function(e){return e.background&&"\n background: ".concat(e.background,";\n ")}),(function(e){return e.backgroundImage&&'\n background-image: url("'.concat(e.backgroundImage,'");\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n ')})),x=t(3055),b=t(95354),y=t(24141),Z=t(28598);function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var P=function(e){var n=e.after,t=e.afterHidden,r=e.afterWidth,h=e.before,m=e.beforeWidth,g=e.breadcrumbs,_=e.buildSidekick,P=e.children,w=e.errors,S=e.headline,k=e.pageName,I=e.pipeline,C=e.setErrors,E=e.subheader,D=e.subheaderBackground,T=e.subheaderBackgroundImage,M=e.subheaderButton,N=e.subheaderText,A=e.title,R=e.uuid,U=(0,y.i)().height,F=I.uuid,H=f.ZP.pipelines.detail(F,{includes_outputs:!1},{revalidateOnFocus:!1}).data,z=null===H||void 0===H?void 0:H.pipeline,W=(0,o.useMemo)((function(){return n||(_?_({height:U,heightOffset:x.Mz,pipeline:z}):null)}),[n,_,U,z]),q=r||(W?50*v.iI:null),L=(0,o.useMemo)((function(){var e=[];return z&&(e.push.apply(e,[{label:function(){return"Pipelines"},linkProps:{href:"/pipelines"}}]),g?(e.push({label:function(){return z.uuid},linkProps:{as:"/pipelines/".concat(F,"/triggers"),href:"/pipelines/[pipeline]/triggers"}}),e.push.apply(e,(0,i.Z)(g)),e[e.length-1].bold=!0):e.push({bold:!0,label:function(){return z.name}})),e}),[g,z,F]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(c.Z,{after:W,afterHidden:t,afterWidth:q,before:h,beforeWidth:m,breadcrumbs:L,navigationItems:(0,b.H)(k,z),subheaderChildren:"undefined"!==typeof E&&E,title:z?A?A(z):z.name:null,uuid:R,children:[(M||N)&&(0,Z.jsx)(p.Z,{mb:v.Mq,mt:v.cd,mx:v.cd,children:(0,Z.jsx)(j,{background:D,backgroundImage:T,children:(0,Z.jsxs)(a.Z,{alignItems:"center",children:[M,N&&(0,Z.jsx)(p.Z,{ml:3}),N]})})}),S&&(0,Z.jsx)(p.Z,{p:v.cd,children:(0,Z.jsxs)(p.Z,{mt:v.cd,px:v.cd,children:[(0,Z.jsx)(d.Z,{level:5,children:S}),(0,Z.jsx)(s.Z,{light:!0,mt:v.cd,short:!0})]})}),P]}),w&&(0,Z.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===C||void 0===C?void 0:C(null)},children:(0,Z.jsx)(u.Z,O(O({},w),{},{onClose:function(){return null===C||void 0===C?void 0:C(null)}}))})]})}},56681:function(e,n,t){"use strict";t.d(n,{G:function(){return b},Z:function(){return y}});var r=t(75582),i=t(82394),o=t(26304),l=t(32316),c=t(22673),s=t(86532),u=t(86673),a=t(19711),d=t(58180),p=t(49125),f=t(19395),h=t(28598),m=["height","heightOffset","pipeline","selectedRun","selectedTab","setSelectedTab"];function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?g(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var j={uuid:"Run details"},x={uuid:"Dependency tree"},b=[x,j];function y(e){var n=e.height,t=e.heightOffset,i=e.pipeline,g=e.selectedRun,y=e.selectedTab,Z=e.setSelectedTab,_=v({},(0,o.Z)(e,m));g?_.blockStatus=(0,f.IJ)(null===g||void 0===g?void 0:g.block_runs):_.noStatus=!0;var O=(null===g||void 0===g?void 0:g.variables)||{};null!==g&&void 0!==g&&g.event_variables&&(O.event=g.event_variables);var P=[];O&&JSON.stringify(O,null,2).split("\n").forEach((function(e){P.push(" ".concat(e))}));var w=g&&[["Run ID",null===g||void 0===g?void 0:g.id],["Variables",(0,h.jsx)(c.Z,{language:"json",small:!0,source:P.join("\n")})]],S=g&&(0,h.jsx)(u.Z,{pb:p.cd,px:p.cd,children:(0,h.jsx)(d.Z,{alignTop:!0,columnFlex:[null,1],columnMaxWidth:function(e){return 1===e?"100px":null},rows:w.map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return[(0,h.jsx)(a.ZP,{monospace:!0,muted:!0,children:t}),(0,h.jsx)(a.ZP,{monospace:!0,textOverflow:!0,children:i})]})),uuid:"LogDetail"})}),k=y&&Z;return(0,h.jsxs)(h.Fragment,{children:[k&&(0,h.jsx)(u.Z,{py:p.cd,children:(0,h.jsx)(l.Z,{onClickTab:Z,selectedTabUUID:null===y||void 0===y?void 0:y.uuid,tabs:b})}),(!k||x.uuid===(null===y||void 0===y?void 0:y.uuid))&&(0,h.jsx)(s.Z,v(v({},_),{},{height:n,heightOffset:(t||0)+(k?76:0),pipeline:i})),j.uuid===(null===y||void 0===y?void 0:y.uuid)&&S]})}},18025:function(e,n,t){"use strict";t.d(n,{J:function(){return s},U:function(){return c}});var r=t(9518),i=t(23831),o=t(73942),l=t(49125),c=r.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-m7tlau-0"})(["border-radius:","px;border-style:solid;border-width:2px;height:","px;margin-right:","px;padding:","px;width:","px;"," ",""],o.TR,14*l.iI,l.cd*l.iI,l.cd*l.iI,40*l.iI,(function(e){return!e.selected&&"\n border-color: ".concat((e.theme.borders||i.Z.borders).light,";\n ")}),(function(e){return e.selected&&"\n border-color: ".concat((e.theme.interactive||i.Z.interactive).linkPrimary,";\n ")})),s=r.default.div.withConfig({displayName:"indexstyle__DateSelectionContainer",componentId:"sc-m7tlau-1"})(["border-radius:","px;padding:","px;"," "," ",""],o.n_,l.tr,(function(e){return"\n background-color: ".concat((e.theme.interactive||i.Z.interactive).defaultBackground,";\n ")}),(function(e){return e.absolute&&"\n position: absolute;\n z-index: 2;\n right: 0;\n top: ".concat(2.5*l.iI,"px;\n ")}),(function(e){return e.topPosition&&"\n top: -".concat(42*l.iI,"px;\n ")}))},2713:function(e,n,t){"use strict";var r=t(82394),i=t(44495),o=t(67971),l=t(55378),c=t(86673),s=t(19711),u=t(18025),a=t(49125),d=t(24224),p=t(28598);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.selectedDate,t=e.selectedTime,r=e.setSelectedDate,f=e.setSelectedTime,m=e.topPosition;return(0,p.jsxs)(u.J,{absolute:!0,topPosition:m,children:[(0,p.jsx)(i.ZP,{onChange:r,value:n}),(0,p.jsx)(c.Z,{mb:2}),(0,p.jsxs)(o.Z,{alignItems:"center",children:[(0,p.jsx)(s.ZP,{default:!0,large:!0,children:"Time (UTC):"}),(0,p.jsx)(c.Z,{pr:2}),(0,p.jsx)(l.Z,{compact:!0,monospace:!0,onChange:function(e){e.preventDefault(),f((function(n){return h(h({},n),{},{hour:e.target.value})}))},paddingRight:5*a.iI,placeholder:"HH",value:null===t||void 0===t?void 0:t.hour,children:(0,d.m5)(24,0).map((function(e){return String(e).padStart(2,"0")})).map((function(e){return(0,p.jsx)("option",{value:e,children:e},"hour_".concat(e))}))}),(0,p.jsx)(c.Z,{px:1,children:(0,p.jsx)(s.ZP,{bold:!0,large:!0,children:":"})}),(0,p.jsx)(l.Z,{compact:!0,monospace:!0,onChange:function(e){e.preventDefault(),f((function(n){return h(h({},n),{},{minute:e.target.value})}))},paddingRight:5*a.iI,placeholder:"MM",value:null===t||void 0===t?void 0:t.minute,children:(0,d.m5)(60,0).map((function(e){return String(e).padStart(2,"0")})).map((function(e){return(0,p.jsx)("option",{value:e,children:e},"minute_".concat(e))}))})]})]})}},54183:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Ie}});var r,i=t(75582),o=t(77837),l=t(82394),c=t(38860),s=t.n(c),u=t(82684),a=t(83455),d=t(34376),p=t(60328),f=t(34744),h=t(67971),m=t(87372),g=t(51099),v=t(60547),j=t(97496),x=t(47409),b=t(93348),y=t(55378),Z=t(86673),_=t(58180),O=t(19711),P=t(46261),w=t(82531),S=t(56681),k=t(2850),I=t(10503),C=t(49125),E=t(59920),D=t(24224);!function(e){e.AWS="aws_event"}(r||(r={}));var T=[{label:function(){return"AWS"},uuid:r.AWS}],M=(0,D.HK)(T,(function(e){return e.uuid})),N=t(66050),A=t(58122),R=t(19395),U=t(33766),F=t(7715),H=t(9736),z=t(96510),W=t(66653),q=t(59e3),L=t(28598);function V(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function X(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?V(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):V(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var B=function(e){var n=e.fetchPipelineSchedule,t=e.pipeline,r=e.pipelineSchedule,o=e.variables,l=(0,d.useRouter)(),c=(0,H.Ct)(),s=(0,u.useState)(null),D=s[0],T=s[1],V=(t||{}).uuid,B=r||{},J=B.id,G=B.event_matchers,K=B.name,Y=B.schedule_interval,Q=B.schedule_type,$=B.settings,ee=B.sla,ne=B.start_time,te=B.status,re=B.variables,ie=void 0===re?{}:re,oe=(0,q.iV)(),le={_limit:30,_offset:30*(null!==oe&&void 0!==oe&&oe.page?oe.page:0)};null!==oe&&void 0!==oe&&oe.status&&(le.status=oe.status);var ce=w.ZP.pipeline_runs.pipeline_schedules.list(J,le,{refreshInterval:3e3,revalidateOnFocus:!0}),se=ce.data,ue=ce.mutate,ae=(0,u.useMemo)((function(){return(null===se||void 0===se?void 0:se.pipeline_runs)||[]}),[se]),de=(0,u.useMemo)((function(){var e;return(null===se||void 0===se||null===(e=se.metadata)||void 0===e?void 0:e.count)||[]}),[se]),pe=(0,u.useState)(null),fe=pe[0],he=pe[1],me=(0,u.useMemo)((function(){var e=null!==oe&&void 0!==oe&&oe.page?oe.page:0;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(j.Z,{fetchPipelineRuns:ue,onClickRow:function(e){return he((function(n){var t=ae[e];return(null===n||void 0===n?void 0:n.id)!==t.id?t:null}))},pipelineRuns:ae,selectedRun:fe}),(0,L.jsx)(Z.Z,{p:2,children:(0,L.jsx)(g.Z,{page:Number(e),maxPages:9,onUpdate:function(e){var n=Number(e),t=X(X({},oe),{},{page:n>=0?n:0});l.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(V,"/triggers/").concat(J,"?").concat((0,q.uM)(t)))},totalPages:Math.ceil(de/30)})})]})}),[ue,t,ae,fe]),ge=(0,u.useState)(S.G[0]),ve=ge[0],je=ge[1],xe=(0,a.Db)((function(e){return w.ZP.pipeline_schedules.useUpdate(e.id)({pipeline_schedule:(0,F.gR)(e,["id"])})}),{onSuccess:function(e){return(0,z.wD)(e,{callback:function(){n()},onErrorCallback:function(e,n){return T({errors:n,response:e})}})}}),be=(0,i.Z)(xe,2),ye=be[0],Ze=be[1].isLoading,_e=(0,u.useMemo)((function(){return b.fq.ACTIVE===te}),[te]),Oe=(0,u.useMemo)((function(){var e,n,t={default:!0,size:1.5*C.iI},r=[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.VW,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Trigger type"})]},"trigger_type_label"),(0,L.jsx)(O.ZP,{monospace:!0,children:null===(e=b.Z4[Q])||void 0===e?void 0:e.call(b.Z4)},"trigger_type")],[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.rs,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Status"})]},"trigger_status_label"),(0,L.jsx)(O.ZP,{danger:!_e,monospace:!0,success:_e,children:te},"trigger_status")]];if(ee){var i=(0,R.gU)(ee),o=i.time,l=i.unit,c=1===o?l:"".concat(l,"s");r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.kI,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"SLA"})]},"trigger_sla_label"),(0,L.jsx)(O.ZP,{monospace:!0,children:"".concat(o," ").concat(c)},"trigger_sla")])}(Y&&r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.Pf,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Frequency"})]},"trigger_frequency_label"),(0,L.jsx)(O.ZP,{monospace:!0,children:Y.replace("@","")},"trigger_frequency")]),ne&&r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.aw,X({},t)),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Start date"})]},"trigger_start_date_label"),(0,L.jsx)(O.ZP,{monospace:!0,children:ne},"trigger_start_date")]),null!==$&&void 0!==$&&$.skip_if_previous_running)&&r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(P.Z,{default:!0,label:"Skip current run if any previous runs are still in progress",size:1.5*C.iI,widthFitContent:!0}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Skip if running"})]},"trigger_skip_if_running"),(0,L.jsx)(O.ZP,{monospace:!0,children:null===(n=$.skip_if_previous_running)||void 0===n?void 0:n.toString()},"trigger_skip_if_running_label")]);return null!==$&&void 0!==$&&$.allow_blocks_to_fail&&r.push([(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(P.Z,{default:!0,label:"Trigger runs will continue running blocks if other unrelated blocks fail",size:1.5*C.iI,widthFitContent:!0}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Allow blocks to fail"})]},"trigger_allow_blocks_to_fail"),(0,L.jsx)(O.ZP,{monospace:!0,children:$.allow_blocks_to_fail.toString()},"trigger_allow_blocks_to_fail_label")]),(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:r})}),[_e,Y,$,ee,ne,Q]),Pe=(0,u.useMemo)((function(){return ie||{}}),[ie]),we=(0,u.useMemo)((function(){var e,n=[];return(0,F.Qr)(Pe)?n=(0,A.wx)(o,(function(e){return"global"===e.uuid})):Object.entries(Pe).forEach((function(e){var t=(0,i.Z)(e,2),r=t[0],o=t[1];n.push({uuid:r,value:(0,A.FS)(o)})})),"undefined"!==typeof(n=(0,A.JZ)(n||[],Q))&&null!==(e=n)&&void 0!==e&&e.length?(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:n.map((function(e){var n=e.uuid,t=e.value;return[(0,L.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:n},"settings_variable_label_".concat(n)),(0,L.jsx)(O.ZP,{monospace:!0,small:!0,children:t},"settings_variable_".concat(n))]}))}):null}),[Q,ie,o]),Se=(0,u.useMemo)((function(){return(0,L.jsx)(_.Z,{columnFlex:[null,1],columns:[{uuid:"Provider"},{uuid:"Event"}],rows:null===G||void 0===G?void 0:G.map((function(e,n){var t=e.event_type,r=e.name;return[(0,L.jsx)(O.ZP,{default:!0,monospace:!0,children:M[t].label()},"".concat(t,"_").concat(n,"_label")),(0,L.jsx)(O.ZP,{monospace:!0,children:r},"".concat(t,"_").concat(n,"_name"))]}))})}),[G]);return(0,L.jsxs)(v.Z,{afterHidden:!fe,before:(0,L.jsxs)(k.M,{children:[(0,L.jsxs)(Z.Z,{mb:C.HN,pt:C.cd,px:C.cd,children:[(0,L.jsxs)(Z.Z,{mb:C.cd,children:[b.Xm.TIME===Q&&(0,L.jsx)(I.kO,{size:5*C.iI}),b.Xm.EVENT===Q&&(0,L.jsx)(I.Jp,{size:5*C.iI}),!Q&&(0,L.jsx)(I.VW,{size:5*C.iI})]}),(0,L.jsx)(m.Z,{children:K})]}),(0,L.jsx)(Z.Z,{px:C.cd,children:(0,L.jsx)(m.Z,{level:5,children:"Settings"})}),(0,L.jsx)(f.Z,{light:!0,mt:1,short:!0}),Oe,(null===G||void 0===G?void 0:G.length)>=1&&(0,L.jsxs)(Z.Z,{my:C.HN,children:[(0,L.jsx)(Z.Z,{px:C.cd,children:(0,L.jsx)(m.Z,{level:5,children:"Events"})}),(0,L.jsx)(f.Z,{light:!0,mt:1,short:!0}),Se]}),we&&(0,L.jsxs)(Z.Z,{my:C.HN,children:[(0,L.jsx)(Z.Z,{px:C.cd,children:(0,L.jsx)(m.Z,{level:5,children:"Runtime variables"})}),(0,L.jsx)(f.Z,{light:!0,mt:1,short:!0}),we]})]}),beforeWidth:k.W,breadcrumbs:[{label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(V,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{label:function(){return K},linkProps:{as:"/pipelines/".concat(V,"/triggers/").concat(J),href:"/pipelines/[pipeline]/triggers/[...slug]"}}],buildSidekick:function(e){return(0,S.Z)(X(X({},e),{},{selectedRun:fe,selectedTab:ve,setSelectedTab:je}))},errors:D,pageName:E.M.TRIGGERS,pipeline:t,setErrors:T,subheader:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(p.Z,{beforeIcon:_e?(0,L.jsx)(I.dz,{size:2*C.iI}):(0,L.jsx)(I.Py,{inverted:!c,size:2*C.iI}),danger:_e&&!c,loading:Ze,onClick:function(e){(0,W.j)(e),ye({id:J,status:_e?b.fq.INACTIVE:b.fq.ACTIVE})},outline:!0,success:!_e&&!c,children:_e?"Pause trigger":"Start trigger"}),(0,L.jsx)(Z.Z,{mr:C.cd}),!c&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(p.Z,{linkProps:{as:"/pipelines/".concat(V,"/triggers/").concat(J,"/edit"),href:"/pipelines/[pipeline]/triggers/[...slug]"},noHoverUnderline:!0,outline:!0,sameColorAsText:!0,children:"Edit trigger"}),(0,L.jsx)(Z.Z,{mr:C.cd})]}),(0,L.jsxs)(y.Z,{compact:!0,defaultColor:!0,onChange:function(e){e.preventDefault(),"all"===e.target.value?l.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(V,"/triggers/").concat(J)):(0,U.u7)({page:0,status:e.target.value})},paddingRight:4*C.iI,placeholder:"Select run status",value:(null===oe||void 0===oe?void 0:oe.status)||"all",children:[(0,L.jsx)("option",{value:"all",children:"All statuses"},"all_statuses"),Object.values(N.V).map((function(e){return(0,L.jsx)("option",{value:e,children:x.D[e]},e)}))]})]}),title:function(){return K},uuid:"triggers/detail",children:[(0,L.jsx)(Z.Z,{mt:C.cd,px:C.cd,children:(0,L.jsx)(m.Z,{level:5,children:"Runs for this trigger"})}),(0,L.jsx)(f.Z,{light:!0,mt:C.cd,short:!0}),me]})},J=t(21831),G=t(21764),K=t(2713),Y=t(38341),Q=t(47999),$=t(22673),ee=t(65730),ne=t(93461),te=t(10919),re=t(26304),ie=t(9518),oe=t(23831),le=t(2005),ce=t(31012),se=["children","large","lineHeight","ordered"];function ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ue(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ue(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var de=(0,ie.css)([""," "," "," "," "," "," "," "," "," ",""],(function(e){return!e.muted&&"\n color: ".concat((e.theme.content||oe.Z.content).default,";\n ")}),(function(e){return e.muted&&"\n color: ".concat((e.theme.content||oe.Z.content).muted,";\n ")}),(function(e){return e.inverted&&"\n color: ".concat((e.theme.content||oe.Z.content).inverted,";\n ")}),(function(e){return e.color&&"\n color: ".concat(e.color,";\n ")}),(function(e){return!e.monospace&&"\n font-family: ".concat(le.ry,";\n ")}),(function(e){return e.monospace&&"\n font-family: ".concat(le.Vp,";\n ")}),(function(e){return e.large&&"\n ".concat(ce.x_,"\n ")}),(function(e){return!e.large&&!e.small&&"\n ".concat(ce.i3,"\n ")}),(function(e){return e.small&&"\n ".concat(ce.J5,"\n ")}),(function(e){return e.lineHeight&&"\n line-height: ".concat(e.lineHeight,"px !important;\n ")})),pe=ie.default.ul.withConfig({displayName:"List__UnorderedListStyle",componentId:"sc-1f6yhbi-0"})(["",""],de),fe=ie.default.ol.withConfig({displayName:"List__OrderedListStyle",componentId:"sc-1f6yhbi-1"})(["",""],de),he=ie.default.li.withConfig({displayName:"List__ListItemStyle",componentId:"sc-1f6yhbi-2"})(["",""],(function(e){return e.large&&e.marginTop&&"\n margin-top: ".concat(1*C.iI,"px;\n ")}));var me=function(e){var n=e.children,t=e.large,r=e.lineHeight,i=e.ordered,o=(0,re.Z)(e,se),l=i?fe:pe;return(0,L.jsx)(l,ae(ae({large:t,lineHeight:r},o),{},{children:u.Children.map(n,(function(e,n){return(0,L.jsx)(he,ae(ae({large:t,marginTop:n>=1},o),{},{children:u.cloneElement(e)}),e.props.key)}))}))},ge=t(98781),ve=t(82944),je=t(70902),xe=t(18025);function be(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ye(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?be(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):be(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ze=function(e){var n=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:b.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:b.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:b.Xm.API}];return e?n.slice(0,1):n};var _e=function(e){var n=e.fetchPipelineSchedule,t=e.pipeline,r=e.pipelineSchedule,o=e.variables,c=(0,d.useRouter)(),s=null===t||void 0===t?void 0:t.uuid,g=null===r||void 0===r?void 0:r.id,j=(null===t||void 0===t?void 0:t.type)===ge.qL.STREAMING,x=(0,u.useState)(null),P=x[0],S=x[1],k=(0,u.useState)([]),M=k[0],N=k[1],U=(0,u.useState)(!1),H=U[0],W=U[1],q=(0,u.useState)(!1),V=q[0],X=q[1],B=(0,u.useState)(),re=B[0],ie=B[1],oe=(0,u.useState)({}),le=oe[0],ce=oe[1],se=(0,u.useState)(r),ue=se[0],ae=se[1],de=(0,u.useState)(!1),pe=de[0],fe=de[1],he=(0,u.useState)(null),be=he[0],_e=he[1],Oe=(0,u.useMemo)((function(){return(0,A.wx)(o,(function(e){return"global"===e.uuid}))}),[o]),Pe=ue||{},we=Pe.name,Se=Pe.schedule_interval,ke=Pe.schedule_type,Ie=Pe.settings,Ce=void 0===Ie?{}:Ie,Ee=Pe.sla,De=Pe.start_time,Te=(Pe.token,Pe.variables),Me=void 0===Te?{}:Te;(0,u.useEffect)((function(){Ce&&ie(Ce)}),[Ce]);var Ne=(0,u.useState)(null),Ae=Ne[0],Re=Ne[1],Ue=(0,u.useState)({hour:"00",minute:"00"}),Fe=Ue[0],He=Ue[1],ze=w.ZP.event_rules.detail("aws").data,We=(0,u.useMemo)((function(){var e;return(null===ze||void 0===ze||null===(e=ze.event_rule)||void 0===e?void 0:e.rules)||[]}),[ze]),qe=(0,u.useMemo)((function(){return(0,D.HK)(We,(function(e){return e.name}))}),[We]),Le=(0,a.Db)(w.ZP.pipeline_schedules.useUpdate(g),{onSuccess:function(e){return(0,z.wD)(e,{callback:function(){n(),c.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(s,"/triggers/").concat(g))},onErrorCallback:function(e,n){return S({errors:n,response:e})}})}}),Ve=(0,i.Z)(Le,2),Xe=Ve[0],Be=Ve[1].isLoading,Je=(0,u.useMemo)((function(){return Me||{}}),[Me]);(0,u.useEffect)((function(){if(De){var e=De.split(" ")[1];Re((0,R.eI)(De)),He({hour:e.substring(0,2),minute:e.substring(3,5)})}else{var n=new Date;Re(n),He({hour:String(n.getUTCHours()).padStart(2,"0"),minute:String(n.getUTCMinutes()).padStart(2,"0")})}}),[De]),(0,u.useEffect)((function(){Je&&Object.keys(Je).length>0&&W(!0)}),[Je]),(0,u.useEffect)((function(){ce(H?null===Oe||void 0===Oe?void 0:Oe.reduce((function(e,n){var t=n.uuid,r=n.value;return ye(ye({},e),{},(0,l.Z)({},t,Je[t]||r))}),{}):null)}),[Oe,H]),(0,u.useEffect)((function(){if(r&&(N(r.event_matchers),Ke?(ae(ye(ye({},r),{},{schedule_interval:"custom"})),_e(Se)):ae(j?ye(ye({},r),{},{schedule_interval:b.U5.ONCE}):r),r.sla)){X(!0);var e=(0,R.gU)(Ee),n=e.time,t=e.unit;ae((function(e){return ye(ye({},e),{},{slaAmount:n,slaUnit:t})}))}}),[r]);var Ge=(0,u.useCallback)((function(){var e=ye(ye({},(0,F.GL)(ue,["name","schedule_type"])),{},{event_matchers:[],schedule_interval:null,start_time:null,variables:(0,A.e7)(le)});if(b.Xm.EVENT===ue.schedule_type?e.event_matchers=M:(e.schedule_interval=Ke?be:ue.schedule_interval,e.start_time=Ae&&null!==Fe&&void 0!==Fe&&Fe.hour&&null!==Fe&&void 0!==Fe&&Fe.minute?"".concat(Ae.toISOString().split("T")[0]," ").concat(null===Fe||void 0===Fe?void 0:Fe.hour,":").concat(null===Fe||void 0===Fe?void 0:Fe.minute,":00"):null),V){var n=null===ue||void 0===ue?void 0:ue.slaAmount,t=null===ue||void 0===ue?void 0:ue.slaUnit;if(!n||isNaN(n)||!t)return void G.Am.error("Please enter a valid SLA",{position:G.Am.POSITION.BOTTOM_RIGHT,toastId:"sla_error"});e.sla=(0,R.vJ)(n,t)}else null!==r&&void 0!==r&&r.sla&&(e.sla=0);e.settings=re,Xe({pipeline_schedule:e})}),[be,Ae,V,M,r,le,ue,re,Fe,Xe]),Ke=(0,u.useMemo)((function(){return Se&&!Object.values(b.U5).includes(Se)}),[Se]),Ye=(0,u.useMemo)((function(){var e=[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.KJ,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Trigger name"})]},"trigger_name_detail"),(0,L.jsx)(ve.Z,{monospace:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{name:e.target.value})}))},placeholder:"Name this trigger",value:we},"trigger_name_input_detail")],[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.Pf,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Frequency"})]},"frequency"),(0,L.jsxs)("div",{children:[(0,L.jsxs)(y.Z,{monospace:!0,onChange:function(e){e.preventDefault();var n=e.target.value;ae((function(e){return ye(ye({},e),{},{schedule_interval:n})}))},placeholder:"Choose the frequency to run",value:Se,children:[!Se&&(0,L.jsx)("option",{value:""}),Object.values(b.U5).map((function(e){return(0,L.jsx)("option",{value:e,children:e.substring(1)},e)})),(0,L.jsx)("option",{value:"custom",children:"custom"},"custom")]}),(0,L.jsx)(Z.Z,{mt:1,p:1,children:(0,L.jsxs)(O.ZP,{muted:!0,small:!0,children:["If you don\u2019t see the frequency option you need, select ",(0,L.jsx)(O.ZP,{inline:!0,monospace:!0,small:!0,children:"custom"})," and enter CRON syntax."]})})]},"frequency_input")],[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.aw,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Start date and time"})]},"start_time"),(0,L.jsxs)("div",{style:{minHeight:"".concat(5.75*C.iI,"px")},children:[!pe&&(0,L.jsx)(ve.Z,{monospace:!0,onClick:function(){return fe((function(e){return!e}))},placeholder:"YYYY-MM-DD HH:MM",value:Ae?"".concat(Ae.toISOString().split("T")[0]," ").concat(null===Fe||void 0===Fe?void 0:Fe.hour,":").concat(null===Fe||void 0===Fe?void 0:Fe.minute):""}),(0,L.jsx)("div",{style:{width:"400px"},children:(0,L.jsx)(Q.Z,{disableEscape:!0,onClickOutside:function(){return fe(!1)},open:pe,style:{position:"relative"},children:(0,L.jsx)(K.Z,{selectedDate:Ae,selectedTime:Fe,setSelectedDate:Re,setSelectedTime:He,topPosition:!0})})})]},"start_time_input")]];return j&&e.splice(1,1),Ke&&e.splice(2,0,[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.EK,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Cron expression"})]},"cron_expression"),(0,L.jsxs)("div",{children:[(0,L.jsx)(ve.Z,{monospace:!0,onChange:function(e){e.preventDefault(),_e(e.target.value)},placeholder:"* * * * *",value:be}),(0,L.jsxs)(Z.Z,{mt:1,p:1,children:[(0,L.jsxs)(O.ZP,{muted:!0,small:!0,children:["If you want this pipeline to trigger every 1 minute, the CRON syntax is ",(0,L.jsx)(O.ZP,{inline:!0,monospace:!0,small:!0,children:"*/1 * * * *"}),"."]}),(0,L.jsxs)(O.ZP,{muted:!0,small:!0,children:["For more CRON syntax examples, check out this ",(0,L.jsx)(te.Z,{href:"https://crontab.guru/",openNewWindow:!0,small:!0,children:"resource"}),"."]})]})]},"cron_expression_input")]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z.Z,{mb:2,px:C.cd,children:(0,L.jsx)(m.Z,{children:"Settings"})}),(0,L.jsx)(f.Z,{light:!0,short:!0}),(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:e})]})}),[be,Ae,Ke,j,we,Se,pe,Fe]),Qe=(0,u.useCallback)((function(e,n){N((function(t){return Object.entries(n).forEach((function(n){var r=(0,i.Z)(n,2),o=r[0],l=r[1];t[e][o]=l})),(0,J.Z)(t)}))}),[N]),$e=(0,u.useMemo)((function(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z.Z,{mb:C.cd,px:C.cd,children:(0,L.jsx)(m.Z,{children:"Settings"})}),(0,L.jsx)(f.Z,{light:!0,short:!0}),(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.KJ,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Trigger name"})]},"trigger_name_event"),(0,L.jsx)(ve.Z,{monospace:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{name:e.target.value})}))},placeholder:"Name this trigger",value:we},"trigger_name_input_event")]]}),(0,L.jsxs)(Z.Z,{mb:2,mt:5,px:C.cd,children:[(0,L.jsx)(m.Z,{children:"Events"}),(0,L.jsxs)(O.ZP,{muted:!0,children:["Add 1 or more event that will trigger this pipeline to run.",(0,L.jsx)("br",{}),"If you add more than 1 event, this pipeline will trigger if any of the events are received."]}),(0,L.jsxs)(Z.Z,{mt:C.Mq,children:[(0,L.jsx)(O.ZP,{bold:!0,large:!0,children:"AWS events"}),(0,L.jsxs)(O.ZP,{muted:!0,children:["In order to retrieve all the possible AWS events you can trigger your pipeline from,",(0,L.jsx)("br",{}),"you\u2019ll need to set 3 environment variables (",(0,L.jsx)(te.Z,{href:"https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html",openNewWindow:!0,underline:!0,children:"more info here"}),"):"]}),(0,L.jsx)(Z.Z,{mt:1,children:(0,L.jsxs)(me,{monospace:!0,ordered:!0,children:[(0,L.jsx)(O.ZP,{monospace:!0,children:"AWS_REGION_NAME"}),(0,L.jsx)(O.ZP,{monospace:!0,children:"AWS_ACCESS_KEY_ID"}),(0,L.jsx)(O.ZP,{monospace:!0,children:"AWS_SECRET_ACCESS_KEY"})]})})]})]}),(0,L.jsx)(f.Z,{light:!0,short:!0}),(null===M||void 0===M?void 0:M.length)>=1&&(0,L.jsx)(_.Z,{alignTop:!0,columnFlex:[1,1,2,null],columns:[{uuid:"Provider"},{uuid:"Event"},{uuid:"Pattern"},{label:function(){return""},uuid:"delete"}],rows:null===M||void 0===M?void 0:M.map((function(e,n){var t=e.event_type,r=e.name,i=e.pattern,o=e.id||"".concat(t,"-").concat(r,"-").concat(n,"-").concat(JSON.stringify(i)),l=[];return i&&JSON.stringify(i,null,2).split("\n").forEach((function(e){l.push(" ".concat(e))})),[(0,L.jsxs)(y.Z,{monospace:!0,onChange:function(e){return Qe(n,{event_type:e.target.value})},placeholder:"Event provider",value:t||"",children:[!t&&(0,L.jsx)("option",{value:""}),T.map((function(e){var n=e.label,t=e.uuid;return(0,L.jsx)("option",{value:t,children:n()},t)}))]},"event-provider-".concat(o)),(0,L.jsxs)(y.Z,{monospace:!0,onChange:function(e){var t,r=e.target.value,i=null===(t=qe[r])||void 0===t?void 0:t.event_pattern;Qe(n,{name:r,pattern:i?JSON.parse(i):null})},placeholder:"Event name",value:r,children:[!r&&(0,L.jsx)("option",{value:""}),We.map((function(e){var n=e.name;return(0,L.jsx)("option",{value:n,children:n},n)}))]},"event-name-".concat(o)),i&&(0,L.jsx)($.Z,{language:"json",small:!0,source:l.join("\n")}),(0,L.jsx)(p.Z,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(){return N((function(e){return(0,D.oM)(e,n)}))},children:(0,L.jsx)(I.rF,{default:!0,size:2*C.iI})},"remove_event")]}))}),(0,L.jsx)(Z.Z,{p:C.cd,children:(0,L.jsx)(p.Z,{beforeIcon:(0,L.jsx)(I.mm,{size:2*C.iI}),onClick:function(){return N((function(e){return e.concat({})}))},outline:!0,children:"Add event matcher"})})]})}),[M,We,we]),en=(0,u.useMemo)((function(){var e,n="";return n="".concat(window.origin,"/api/pipeline_schedules/").concat(null===r||void 0===r?void 0:r.id,"/pipeline_runs"),null!==r&&void 0!==r&&r.token&&(n="".concat(n,"/").concat(r.token)),(e=window.location.port)&&(n=n.replace(e,"6789")),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z.Z,{mb:C.cd,px:C.cd,children:(0,L.jsx)(m.Z,{children:"Settings"})}),(0,L.jsx)(f.Z,{light:!0,short:!0}),(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.KJ,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"Trigger name"})]},"trigger_name_api"),(0,L.jsx)(ve.Z,{monospace:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{name:e.target.value})}))},placeholder:"Name this trigger",value:we},"trigger_name_input_api")]]}),(0,L.jsxs)(Z.Z,{mb:2,mt:5,px:C.cd,children:[(0,L.jsx)(m.Z,{children:"Endpoint"}),(0,L.jsxs)(O.ZP,{muted:!0,children:["Make a ",(0,L.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:"POST"})," request to the following endpoint:"]}),(0,L.jsx)(Z.Z,{mt:C.Mq,children:(0,L.jsx)(ee.Z,{copiedText:n,linkText:n,monospace:!0,withCopyIcon:!0})})]}),(0,L.jsxs)(Z.Z,{mb:2,mt:5,px:C.cd,children:[(0,L.jsx)(m.Z,{children:"Payload"}),(0,L.jsx)(O.ZP,{muted:!0,children:"You can optionally include runtime variables in your request payload. These runtime variables are accessible from within each pipeline block."}),(0,L.jsx)(Z.Z,{mt:C.Mq,children:(0,L.jsx)(ee.Z,{withCopyIcon:!0,copiedText:'{\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n}\n',children:(0,L.jsx)($.Z,{language:"json",small:!0,source:'\n {\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n }\n'})})})]}),(0,L.jsxs)(Z.Z,{mb:2,mt:5,px:C.cd,children:[(0,L.jsx)(m.Z,{children:"Sample cURL command"}),(0,L.jsx)(Z.Z,{mt:C.Mq,children:(0,L.jsx)($.Z,{language:"bash",small:!0,source:"\n curl -X POST ".concat(n,' \\\n --header \'Content-Type: application/json\' \\\n --data \'\n {\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n }\'\n')})})]})]})}),[we,r,"object"]),nn=!ke||b.Xm.TIME===ke&&!(j&&Ae||!j&&Ae&&Se)||b.Xm.EVENT===ke&&(!(null!==M&&void 0!==M&&M.length)||!M.every((function(e){var n=e.event_type,t=e.name;return n&&t}))),tn=(0,u.useMemo)((function(){return(0,L.jsxs)(Z.Z,{p:C.cd,children:[!(0,F.Qr)(Oe)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(Z.Z,{mr:2,children:(0,L.jsx)(je.Z,{checked:H,onCheck:W})}),(0,L.jsx)(O.ZP,{monospace:!0,muted:!0,children:"Overwrite global variables"})]}),H&&le&&Object.entries(le).length>0&&(0,L.jsx)(Z.Z,{mt:2,children:(0,L.jsx)(_.Z,{columnFlex:[null,1],columns:[{uuid:"Variable"},{uuid:"Value"}],rows:Object.entries(le).map((function(e){var n=(0,i.Z)(e,2),t=n[0],r=n[1];return[(0,L.jsx)(O.ZP,{default:!0,monospace:!0,children:t},"variable_".concat(t)),(0,L.jsx)(ve.Z,{borderless:!0,monospace:!0,onChange:function(e){e.preventDefault(),ce((function(n){return ye(ye({},n),{},(0,l.Z)({},t,e.target.value))}))},paddingHorizontal:0,placeholder:"Variable value",value:r},"variable_uuid_input_".concat(t))]}))})})]}),(0,L.jsxs)(Z.Z,{mt:2,children:[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(Z.Z,{mr:2,children:(0,L.jsx)(je.Z,{checked:V,onCheck:function(e){X(e),e||ae((function(e){return ye(ye({},e),{},{slaAmount:0})}))}})}),(0,L.jsx)(O.ZP,{default:!0,monospace:!0,children:"Configure trigger SLA"})]}),V&&(0,L.jsx)(Z.Z,{mt:2,children:(0,L.jsx)(_.Z,{columnFlex:[null,1],rows:[[(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(I.aw,{default:!0,size:1.5*C.iI}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(O.ZP,{default:!0,children:"SLA"})]},"sla_detail"),(0,L.jsxs)(h.Z,{children:[(0,L.jsx)(ne.Z,{flex:1,children:(0,L.jsx)(ve.Z,{fullWidth:!0,monospace:!0,noBorder:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{slaAmount:e.target.value})}))},placeholder:"Time",value:null===ue||void 0===ue?void 0:ue.slaAmount})}),(0,L.jsx)(ne.Z,{flex:1,children:(0,L.jsx)(y.Z,{fullWidth:!0,monospace:!0,noBorder:!0,onChange:function(e){e.preventDefault(),ae((function(n){return ye(ye({},n),{},{slaUnit:e.target.value})}))},placeholder:"Select time unit",small:!0,value:null===ue||void 0===ue?void 0:ue.slaUnit,children:Object.keys(R.tL).map((function(e){return(0,L.jsx)("option",{value:e,children:"".concat(e,"(s)")},e)}))})})]},"sla_input_detail")]]})}),(0,L.jsxs)(Z.Z,{mt:2,children:[(0,L.jsx)(m.Z,{level:5,monospace:!0,children:"Additional settings"}),b.Xm.TIME===ke&&(0,L.jsx)(Z.Z,{mt:2,children:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(Y.Z,{checked:null===re||void 0===re?void 0:re.skip_if_previous_running,onClick:function(){return ie((function(e){return ye(ye({},e),{},{skip_if_previous_running:!(null!==re&&void 0!==re&&re.skip_if_previous_running)})}))}}),(0,L.jsx)(Z.Z,{ml:2}),(0,L.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Skip run if previous run still in progress"})]})}),(0,L.jsx)(Z.Z,{mt:2,children:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(Y.Z,{checked:null===re||void 0===re?void 0:re.allow_blocks_to_fail,onClick:function(){return ie((function(e){return ye(ye({},e),{},{allow_blocks_to_fail:!(null!==re&&void 0!==re&&re.allow_blocks_to_fail)})}))}}),(0,L.jsx)(Z.Z,{ml:2}),(0,L.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Keep running pipeline even if blocks fail"})]})})]})]})]})}),[V,Oe,H,le,ue,X,W,re]);return(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(v.Z,{after:tn,breadcrumbs:[{label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(s,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{label:function(){return null===r||void 0===r?void 0:r.name},linkProps:{as:"/pipelines/".concat(s,"/triggers/").concat(g),href:"/pipelines/[pipeline]/triggers/[...slug]"}}],errors:P,pageName:E.M.TRIGGERS,pipeline:t,setErrors:S,subheader:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(p.Z,{disabled:nn,loading:Be,onClick:Ge,outline:!0,primary:!0,children:"Save changes"}),(0,L.jsx)(Z.Z,{mr:1}),(0,L.jsx)(p.Z,{linkProps:{href:"/pipelines/[pipeline]/triggers/[...slug]",as:"/pipelines/".concat(s,"/triggers/").concat(g)},noHoverUnderline:!0,outline:!0,sameColorAsText:!0,children:"Cancel"})]}),title:function(){return"Edit ".concat(null===r||void 0===r?void 0:r.name)},uuid:"triggers/edit",children:[(0,L.jsxs)(Z.Z,{p:C.cd,children:[(0,L.jsxs)(Z.Z,{mb:2,children:[(0,L.jsx)(m.Z,{children:"Trigger type"}),(0,L.jsx)(O.ZP,{muted:!0,children:"How would you like this pipeline to be triggered?"})]}),(0,L.jsx)(h.Z,{children:Ze(j).map((function(e){var n=e.label,t=e.description,r=e.uuid,i=ke===r,o=ke&&!i;return(0,L.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){b.Xm.EVENT!==r||null!==M&&void 0!==M&&M.length||N([{}]),ae((function(e){return ye(ye({},e),{},{schedule_type:r})}))},children:(0,L.jsx)(xe.U,{selected:i,children:(0,L.jsxs)(h.Z,{alignItems:"center",children:[(0,L.jsx)(ne.Z,{children:(0,L.jsx)("input",{checked:i,type:"radio"})}),(0,L.jsx)(Z.Z,{mr:C.cd}),(0,L.jsxs)(ne.Z,{alignItems:"flex-start",flexDirection:"column",children:[(0,L.jsx)(m.Z,{bold:!0,default:!i&&!o,level:5,muted:!i&&o,children:n()}),(0,L.jsx)(O.ZP,{default:!i&&!o,leftAligned:!0,muted:o,children:t()})]})]})})},r)}))})]}),(0,L.jsxs)(Z.Z,{mt:5,children:[b.Xm.TIME===ke&&Ye,b.Xm.EVENT===ke&&$e,b.Xm.API===ke&&en]})]})})},Oe=t(41788),Pe=t(70543);function we(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?we(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):we(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function ke(e){var n=e.pipelineScheduleId,t=e.pipelineUUID,r=e.subpath,i=w.ZP.variables.pipelines.list(t).data,o=null===i||void 0===i?void 0:i.variables,l=w.ZP.pipeline_schedules.detail(n),c=l.data,s=l.mutate,u=null===c||void 0===c?void 0:c.pipeline_schedule,a=w.ZP.pipelines.detail(t,{includes_content:!1,includes_outputs:!1},{revalidateOnFocus:!1}).data,d=Se(Se({},null===a||void 0===a?void 0:a.pipeline),{},{uuid:t});return Pe.b7===r?(0,L.jsx)(_e,{fetchPipelineSchedule:s,pipeline:d,pipelineSchedule:u,variables:o}):(0,L.jsx)(B,{fetchPipelineSchedule:s,pipeline:d,pipelineSchedule:u,variables:o})}ke.getInitialProps=function(){var e=(0,o.Z)(s().mark((function e(n){var t,r,o,l,c,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.query,r=t.pipeline,o=t.slug,!Array.isArray(o)){e.next=4;break}return l=(0,i.Z)(o,2),c=l[0],u=l[1],e.abrupt("return",{pipelineScheduleId:c,pipelineUUID:r,subpath:u});case 4:return e.abrupt("return",{pipelineUUID:r});case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var Ie=(0,Oe.Z)(ke)},95488:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers/[...slug]",function(){return t(54183)}])}},function(e){e.O(0,[3850,5716,5896,4804,1774,5872,2524,4495,2344,4506,6166,8180,6214,6532,1286,4741,3688,9774,2888,179],(function(){return n=95488,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4249],{60547:function(e,n,t){"use strict";t.d(n,{Z:function(){return k}});var r=t(82394),i=t(21831),o=t(82684),c=t(47999),u=t(1210),a=t(34744),l=t(28358),s=t(67971),d=t(87372),p=t(86673),f=t(82531),h=t(9518),b=t(23831),g=t(73942),v=t(49125),m=h.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1te3pmf-0"})(["border-radius:","px;padding:","px;"," "," ",""],g.n_,3*v.iI,(function(e){return"\n box-shadow: ".concat((e.theme.shadow||b.Z.shadow).small,";\n ")}),(function(e){return e.background&&"\n background: ".concat(e.background,";\n ")}),(function(e){return e.backgroundImage&&'\n background-image: url("'.concat(e.backgroundImage,'");\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n ')})),x=t(3055),j=t(95354),y=t(24141),O=t(28598);function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Z(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var k=function(e){var n=e.after,t=e.afterHidden,r=e.afterWidth,h=e.before,b=e.beforeWidth,g=e.breadcrumbs,w=e.buildSidekick,k=e.children,P=e.errors,S=e.headline,_=e.pageName,C=e.pipeline,I=e.setErrors,D=e.subheader,E=e.subheaderBackground,N=e.subheaderBackgroundImage,H=e.subheaderButton,T=e.subheaderText,M=e.title,W=e.uuid,F=(0,y.i)().height,Y=C.uuid,B=f.ZP.pipelines.detail(Y,{includes_outputs:!1},{revalidateOnFocus:!1}).data,V=null===B||void 0===B?void 0:B.pipeline,A=(0,o.useMemo)((function(){return n||(w?w({height:F,heightOffset:x.Mz,pipeline:V}):null)}),[n,w,F,V]),R=r||(A?50*v.iI:null),J=(0,o.useMemo)((function(){var e=[];return V&&(e.push.apply(e,[{label:function(){return"Pipelines"},linkProps:{href:"/pipelines"}}]),g?(e.push({label:function(){return V.uuid},linkProps:{as:"/pipelines/".concat(Y,"/triggers"),href:"/pipelines/[pipeline]/triggers"}}),e.push.apply(e,(0,i.Z)(g)),e[e.length-1].bold=!0):e.push({bold:!0,label:function(){return V.name}})),e}),[g,V,Y]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(u.Z,{after:A,afterHidden:t,afterWidth:R,before:h,beforeWidth:b,breadcrumbs:J,navigationItems:(0,j.H)(_,V),subheaderChildren:"undefined"!==typeof D&&D,title:V?M?M(V):V.name:null,uuid:W,children:[(H||T)&&(0,O.jsx)(p.Z,{mb:v.Mq,mt:v.cd,mx:v.cd,children:(0,O.jsx)(m,{background:E,backgroundImage:N,children:(0,O.jsxs)(s.Z,{alignItems:"center",children:[H,T&&(0,O.jsx)(p.Z,{ml:3}),T]})})}),S&&(0,O.jsx)(p.Z,{p:v.cd,children:(0,O.jsxs)(p.Z,{mt:v.cd,px:v.cd,children:[(0,O.jsx)(d.Z,{level:5,children:S}),(0,O.jsx)(a.Z,{light:!0,mt:v.cd,short:!0})]})}),k]}),P&&(0,O.jsx)(c.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===I||void 0===I?void 0:I(null)},children:(0,O.jsx)(l.Z,Z(Z({},P),{},{onClose:function(){return null===I||void 0===I?void 0:I(null)}}))})]})}},58122:function(e,n,t){"use strict";t.d(n,{CL:function(){return f},FS:function(){return h},JZ:function(){return g},e7:function(){return v},v0:function(){return p},wx:function(){return b}});var r=t(75582),i=t(82394),o=t(43313),c=t(93348),u=t(1286),a=t(90211),l=t(84779);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function p(e){var n=e.statistics,t=Object.keys(n),r=Array(o.Dy.length).fill(0);return 0===t.length?null:(t.forEach((function(e){if(o.Dy.includes(e)){var t=o.CC[e],i=n[e],c=i,u=!1,a=[2,3],s=o.Ub[e],d=o.oH[e],p=o.OD[e];if(o.y_.includes(e))u=!0,a=[2,1,2];else if(e in o.Sq){i=(0,l.Jw)(i,0);var f=o.Sq[e];c=n[f]}var h={columnFlexNumbers:a,name:t,progress:u,rate:c,successDirection:d,warning:p};o.y_.includes(e)||(h.value=i),r[s]=h}})),r)}function f(e){var n=e.columnTypes,t=void 0===n?{}:n,r=e.statistics,i=Object.keys(r);if(0===i.length)return null;var c=Object.values(t),l=c.length,s=[];s.push({name:"Column count",successDirection:o.oH.column_count,value:(0,a.x6)(l)}),i.forEach((function(e){if(o.Zu.includes(e)){var n=o.CC[e],t=r[e],i=o.OD[e];s.push({name:n,successDirection:o.oH[e],value:(0,a.x6)(t),warning:i})}}));var d=(0,u.QO)(c),p=d.countCategory,f=d.countDatetime,h=d.countNumerical;return s.push({name:"Categorical Features",rate:p/l,value:(0,a.x6)(p)},{name:"Numerical Features",rate:h/l,value:(0,a.x6)(h)},{name:"Datetime Features",rate:f/l,value:(0,a.x6)(f)}),s}function h(e){return"string"===typeof e?e:JSON.stringify(e)}function b(e,n){var t,r;return null===e||void 0===e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(r=t.variables)||void 0===r?void 0:r.map((function(e){var n=e.value;return d(d({},e),{},{value:h(n)})}))}function g(e,n){return n===c.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===c.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function v(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,r.Z)(n,2),o=t[0],c=t[1],u=c;try{u=JSON.parse(c)}catch(a){}return d(d({},e),{},(0,i.Z)({},o,u))}),{}):e}},29237:function(e,n,t){"use strict";var r=t(9518),i=t(67971),o=t(86673),c=t(19711),u=t(23831),a=t(73942),l=t(37391),s=t(49125),d=t(28598),p=(0,r.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*s.iI,1.5*s.iI,1.5*s.iI),f=r.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," ",""],a.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return"\n border: 1px solid ".concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return!e.dark&&"\n background-color: ".concat((e.theme.background||u.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||u.Z.background).content,";\n ")}),(function(e){return!e.fullHeight&&"\n height: fit-content;\n "}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")}),(function(e){return e.maxWidth&&"\n max-width: ".concat(e.maxWidth,"px;\n ")}),(function(e){return e.minWidth&&"\n min-width: ".concat(e.minWidth,"px;\n\n @media (max-width: ").concat(e.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(e){return e.borderless&&"\n border: none;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),h=r.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],a.n_,a.n_,(function(e){return"\n background-color: ".concat((e.theme.background||u.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),p,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),b=r.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*s.iI,l.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: calc(".concat(e.maxHeight," - ").concat(15*s.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),g=r.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],a.M8,a.YF,1.75*s.iI);n.Z=function(e){var n=e.borderless,t=e.children,r=e.containerRef,u=e.contentContainerRef,a=e.dark,l=e.footer,s=e.fullHeight,p=void 0===s||s,v=e.fullWidth,m=void 0===v||v,x=e.header,j=e.headerHeight,y=e.headerIcon,O=e.headerPaddingVertical,w=e.headerTitle,Z=e.maxHeight,k=e.maxWidth,P=e.minWidth,S=e.noPadding,_=e.overflowVisible,C=e.subtitle;return(0,d.jsxs)(f,{borderless:n,dark:a,fullHeight:p,fullWidth:m,maxHeight:Z,maxWidth:k,minWidth:P,overflowVisible:_,ref:r,children:[(x||w)&&(0,d.jsxs)(h,{headerPaddingVertical:O,height:j,children:[x&&x,w&&(0,d.jsx)(i.Z,{alignItems:"center",justifyContent:"space-between",children:(0,d.jsxs)(i.Z,{alignItems:"center",children:[y&&y,(0,d.jsx)(o.Z,{ml:y?1:0,children:(0,d.jsx)(c.ZP,{bold:!0,default:!0,children:w})})]})})]}),(0,d.jsxs)(b,{maxHeight:Z,noPadding:S,overflowVisible:_,ref:u,children:[C&&(0,d.jsx)(o.Z,{mb:2,children:(0,d.jsx)(c.ZP,{default:!0,children:C})}),t]}),l&&(0,d.jsx)(g,{children:l})]})}},38435:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=t(82684),c=t(9518),u=t(69898),a=t(28598),l=["rows"];function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var p=c.default.textarea.withConfig({displayName:"TextArea__TextInputStyle",componentId:"sc-112wx63-0"})(["",""],u.p),f=function(e,n){var t=e.rows,r=void 0===t?3:t,o=(0,i.Z)(e,l);return(0,a.jsx)(u.Z,d(d({},o),{},{input:(0,a.jsx)(p,d({rows:r},o)),ref:n}))};n.Z=o.forwardRef(f)},70902:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=t(82684),c=t(9518),u=t(69898),a=t(23831),l=t(28598),s=["checked","disabled","onCheck"];function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function p(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var f=c.default.label.withConfig({displayName:"ToggleSwitch__ToggleSwitchStyle",componentId:"sc-179r5zs-0"})([""," position:relative;display:inline-block;width:","px;min-width:","px;height:",'px;& input[type="checkbox"]{display:none;}& span{position:absolute;cursor:',";background-color:",";border-radius:13px;",';top:0;right:0;bottom:0;left:0;transition:background-color 0.2s ease;}& span::before{position:absolute;content:"";left:2px;top:2px;width:22px;height:22px;background-color:#787A85;border-radius:50%;transition:transform 0.3s ease;}& input[type="checkbox"]:checked + span::before{transform:translateX(20px);}',""],u.p,46,46,26,(function(e){return e.disabled?"not-allowed":"pointer"}),(function(e){return e.disabled?a.Z.monotone.white:a.Z.monotone.black}),(function(e){return e.disabled&&"border: 1px solid ".concat(a.Z.monotone.grey200)}),(function(e){return!e.disabled&&'\n & input[type="checkbox"]:checked + span {\n background-color: #6AA1E0;\n }\n\n & input[type="checkbox"]:checked + span::before {\n background-color: '.concat(a.Z.monotone.white,";\n }\n ")})),h=function(e,n){var t=e.checked,r=e.disabled,o=e.onCheck,c=(0,i.Z)(e,s);return(0,l.jsx)(u.Z,p(p({},c),{},{disabled:r,input:(0,l.jsxs)(f,p(p({},c),{},{disabled:r,noBackground:!0,noBorder:!0,children:[(0,l.jsx)("input",{checked:t,type:"checkbox"}),(0,l.jsx)("span",{onClick:r?null:function(){return null===o||void 0===o?void 0:o((function(e){return!e}))}})]})),noBackground:!0,ref:n}))};n.Z=o.forwardRef(h)},6087:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ue}});var r=t(77837),i=t(82394),o=t(75582),c=t(38860),u=t.n(c),a=t(12691),l=t.n(a),s=t(82684),d=t(83455),p=t(34376),f=t(60328),h=t(86532),b=t(34744),g=t(67971),v=t(87372),m=t(11135),x=t(10919),j=t(60547),y=t(93348),O=t(41788),w=t(29237),Z=t(86673),k=t(58180),P=t(19711),S=t(38435),_=t(82944),C=t(70902),I=t(23831),D=t(9518),E=t(73942),N=t(49125),H=D.default.div.withConfig({displayName:"indexstyle__ToggleStyle",componentId:"sc-f9kt7n-0"})(["padding:","px ","px;border-radius:","px;",""],1.5*N.iI,2*N.iI,E.n_,(function(e){return"\n border: 1px solid ".concat((e.theme||I.Z).borders.light,";\n background-color: ").concat((e.theme||I.Z).background.popup,";\n ")})),T=t(90211),M=t(58122),W=t(28598);function F(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?F(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):F(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var B="".concat(N.iI,"px ").concat(3*N.iI,"px");var V=function(e){var n=e.initialPipelineSchedulePayload,t=e.onCancel,r=e.onSuccess,c=e.variables,u=(0,s.useState)(!1),a=u[0],l=u[1],d=(0,s.useState)({}),p=d[0],h=d[1],b=(0,s.useState)(c||{}),m=b[0],x=b[1],j=(0,s.useMemo)((function(){return Y(Y({},n),{},{name:(0,T.Y6)(),variables:a?(0,M.e7)(m):null})}),[n,a,m]),y=function(e,n){var t={borderless:!0,key:"variable_uuid_input_".concat(e),monospace:!0,onChange:function(n){n.preventDefault(),x((function(t){return Y(Y({},t),{},(0,i.Z)({},e,n.target.value))}))},paddingHorizontal:0,placeholder:"Variable value",value:n};return p[e]?(0,W.jsx)(S.Z,Y(Y({},t),{},{rows:1,value:n})):(0,W.jsx)(_.Z,Y({},t))};return(0,s.useEffect)((function(){var e=Object.entries(m).reduce((function(e,n){var t=(0,o.Z)(n,2),r=t[0],c=t[1],u=(0,T.Pb)(c)&&"object"===typeof JSON.parse(c)&&!Array.isArray(JSON.parse(c))&&null!==JSON.parse(c);return Y(Y({},e),{},(0,i.Z)({},r,u))}),{});h(e)}),[]),(0,W.jsxs)(w.Z,{footer:(0,W.jsxs)(g.Z,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,W.jsx)(f.Z,{onClick:function(){r({pipeline_schedule:j}),t()},padding:B,primaryAlternate:!0,children:"Run now"}),(0,W.jsx)(Z.Z,{mr:1}),(0,W.jsx)(f.Z,{borderColor:I.Z.background.page,onClick:t,padding:B,secondary:!0,children:"Cancel"})]}),header:(0,W.jsx)(v.Z,{level:5,children:"Run pipeline now"}),maxHeight:"90vh",minWidth:85*N.iI,subtitle:"Creates a new trigger and immediately runs the current pipeline once.",children:[(0,W.jsx)(H,{children:(0,W.jsxs)(g.Z,{alignItems:"center",children:[(0,W.jsx)(Z.Z,{mr:2,children:(0,W.jsx)(C.Z,{checked:a,onCheck:l})}),(0,W.jsx)(P.ZP,{bold:!0,large:!0,children:"Overwrite runtime variables"})]})}),a&&m&&Object.entries(m).length>0&&(0,W.jsx)(Z.Z,{mt:2,children:(0,W.jsx)(k.Z,{columnFlex:[null,1],columns:[{uuid:"Variable"},{uuid:"Value"}],rows:Object.entries(m).map((function(e){var n=(0,o.Z)(e,2),t=n[0],r=n[1];return[(0,W.jsx)(P.ZP,{default:!0,monospace:!0,children:t},"variable_".concat(t)),y(t,r)]}))})})]})},A=t(37391),R=D.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1xgfh62-0"})(["border-bottom:1px solid ",";padding:","px;"],I.Z.borders.medium,N.tr),J=D.default.div.withConfig({displayName:"indexstyle__CardsStyle",componentId:"sc-1xgfh62-1"})([""," height:80px;display:flex;overflow-x:scroll;"],A.w5),z=D.default.div.withConfig({displayName:"indexstyle__VariableCardStyle",componentId:"sc-1xgfh62-2"})(["background-color:",";border-radius:","px;flex-shrink:0;margin-right:","px;padding:","px;"],I.Z.background.output,E.n_,N.iI,N.tr),X=t(73899);var q=function(e){var n=e.hasOverride,t=e.scheduleType,r=e.variables,i=e.variablesOverride,c=[];return Object.entries(r).forEach((function(e){var n=(0,o.Z)(e,2),t=n[0],r=n[1],u=null===i||void 0===i?void 0:i[t];c.push({uuid:t,value:(0,M.FS)(u||r)})})),(0,M.JZ)(c,t),(0,W.jsxs)(R,{children:[(0,W.jsx)(Z.Z,{mb:2,children:(0,W.jsxs)(P.ZP,{bold:!0,large:!0,monospace:!0,muted:!0,children:["Runtime variables",n&&" (override)"]})}),(0,W.jsx)(J,{noScrollbarTrackBackground:!0,children:r&&c.map((function(e){var n=e.uuid,t=e.value;return(0,W.jsxs)(z,{children:[(0,W.jsx)(P.ZP,{monospace:!0,small:!0,children:n}),(0,W.jsx)(P.ZP,{color:X.Or,monospace:!0,small:!0,children:(0,M.FS)(t)})]})}))})]})},G=t(46261),Q=t(97225),L=t(82531),U=t(10503),$=t(59920),K=t(42305),ee=t(7715),ne=t(9736),te=t(96510),re=t(83608);function ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ie(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function ce(e){var n=e.pipeline,t=(0,p.useRouter)(),r=(0,ne.Ct)(),c=n.uuid,u=(0,s.useState)(null),a=u[0],O=u[1],w=L.ZP.variables.pipelines.list(c).data,k=null===w||void 0===w?void 0:w.variables,S=L.ZP.pipeline_schedules.pipelines.list(c,{},{refreshInterval:7500}),_=S.data,C=S.mutate,I=(0,s.useMemo)((function(){return(null===_||void 0===_?void 0:_.pipeline_schedules)||[]}),[_]),D=function(e){return(0,d.Db)(L.ZP.pipeline_schedules.pipelines.useCreate(c),{onSuccess:function(n){return(0,te.wD)(n,{callback:function(n){var t=n.pipeline_schedule.id;null===e||void 0===e||e(t)},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}})},E=D((function(e){return t.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(null===n||void 0===n?void 0:n.uuid,"/triggers/").concat(e,"/edit"))})),H=(0,o.Z)(E,2),F=H[0],Y=H[1].isLoading,B=D(C),A=(0,o.Z)(B,2),R=A[0],J=A[1].isLoading,z=(0,s.useMemo)((function(){var e;return null===(e=(0,M.wx)(k,(function(e){return"global"===e.uuid})))||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid,r=n.value;return oe(oe({},e),{},(0,i.Z)({},t,r))}),{})}),[k]),X={name:(0,T.Y6)(),schedule_interval:y.U5.ONCE,schedule_type:y.Xm.TIME,start_time:(0,K.d$)((new Date).toISOString(),{dayAgo:!0,utcFormat:!0}),status:y.fq.ACTIVE},ie=(0,re.dd)((function(){return(0,W.jsx)(V,{initialPipelineSchedulePayload:X,onCancel:ae,onSuccess:R,variables:z})}),{},[k,z],{background:!0,uuid:"run_pipeline_now_popup"}),ce=(0,o.Z)(ie,2),ue=ce[0],ae=ce[1],le=(0,s.useState)(),se=le[0],de=le[1],pe=(0,s.useMemo)((function(){var e=null===se||void 0===se?void 0:se.variables,n=!(0,ee.Qr)(e),t=n?null===se||void 0===se?void 0:se.variables:(0,ee.Qr)(z)?null:z;return function(i){var o=i.height-(t?151:0);return(0,W.jsxs)(W.Fragment,{children:[t&&(0,W.jsx)(q,{hasOverride:n,scheduleType:null===se||void 0===se?void 0:se.schedule_type,variables:z,variablesOverride:e}),!t&&(0,W.jsxs)(Z.Z,{p:N.cd,children:[(0,W.jsx)(P.ZP,{children:"This pipeline has no runtime variables."}),!r&&(0,W.jsxs)(Z.Z,{mt:1,children:[(0,W.jsx)(l(),{as:"/pipelines/".concat(c,"/edit?sideview=variables"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,W.jsx)(x.Z,{primary:!0,children:"Click here"})})," ",(0,W.jsx)(P.ZP,{inline:!0,children:"to add variables to this pipeline."})]})]}),(0,W.jsx)(h.Z,oe(oe({},i),{},{height:o,noStatus:!0}))]})}}),[k,se]);return(0,W.jsxs)(j.Z,{breadcrumbs:[{label:function(){return"Triggers"}}],buildSidekick:pe,errors:a,pageName:$.M.TRIGGERS,pipeline:n,setErrors:O,subheaderBackgroundImage:"/images/banner-shape-purple-peach.jpg",subheaderButton:(0,W.jsx)(m.ZP,{beforeElement:(0,W.jsx)(U.mm,{size:2.5*N.iI}),blackBorder:!0,inline:!0,loading:Y,noHoverUnderline:!0,onClick:function(){return F({pipeline_schedule:{name:(0,T.Y6)()}})},sameColorAsText:!0,uuid:"PipelineDetailPage/add_new_schedule",children:"Create new trigger"}),subheaderText:(0,W.jsx)(P.ZP,{bold:!0,large:!0,children:"Run this pipeline using a schedule, event, or API."}),title:function(e){var n=e.name;return"".concat(n," triggers")},uuid:"".concat($.M.TRIGGERS,"_").concat(c),children:[(0,W.jsx)(Z.Z,{mt:N.cd,px:N.cd,children:(0,W.jsxs)(g.Z,{justifyContent:"space-between",children:[(0,W.jsx)(v.Z,{level:5,children:"Pipeline triggers"}),(0,W.jsx)(G.Z,{appearBefore:!0,default:!0,fullSize:!0,label:"Creates an @once trigger and runs pipeline immediately",widthFitContent:!0,children:(0,W.jsx)(f.Z,{beforeIcon:(0,W.jsx)(U.JM,{inverted:!0,size:2*N.iI}),disabled:r,loading:J,onClick:(0,ee.Qr)(z)?function(){return R({pipeline_schedule:X})}:ue,outline:!0,success:!r,children:"Run pipeline now"})})]})}),(0,W.jsx)(b.Z,{light:!0,mt:N.cd,short:!0}),(0,W.jsx)(Q.Z,{fetchPipelineSchedules:C,pipeline:n,pipelineSchedules:I,selectedSchedule:se,setErrors:O,setSelectedSchedule:de})]})}ce.getInitialProps=function(){var e=(0,r.Z)(u().mark((function e(n){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:t}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var ue=(0,O.Z)(ce)},42305:function(e,n,t){"use strict";t.d(n,{A5:function(){return p},AY:function(){return f},BP:function(){return d},JX:function(){return s},OC:function(){return o},Pc:function(){return h},Tz:function(){return l},d$:function(){return a},lJ:function(){return b},n1:function(){return u}});var r=t(92083),i=t.n(r),o="YYYY-MM-DD HH:mm:ss",c="YYYY-MM-DD HH:mm",u="YYYY-MM-DD";function a(e,n){var t=n.dayAgo,r=n.includeSeconds,u=n.utcFormat,a=i()(e),l=c;return u&&(a=a.utc()),t&&(a=a.subtract(1,"days")),r&&(l=o),a.format(l)}function l(e){var n=a((new Date).toISOString(),{includeSeconds:!0,utcFormat:!0});return null!==e&&void 0!==e&&e.dateObj?new Date(n):n}function s(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i().unix(e).format(null!==n&&void 0!==n&&n.withSeconds?o:c)}function d(e,n,t){return i()(e).utc().hours(+n).minutes(+t).format()}function p(e){return i()(e).unix()}function f(e,n,t,r){var i="".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t);return r?"".concat(i,":").concat(r):i}function h(e){var n=i().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function b(e){return e.padStart(2,"0")}},40183:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers",function(){return t(6087)}])}},function(e){e.O(0,[3850,5716,5896,4804,1774,5872,2344,4506,6166,8180,6214,6532,1286,3014,9774,2888,179],(function(){return n=40183,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4249],{60547:function(e,n,t){"use strict";t.d(n,{Z:function(){return k}});var r=t(82394),i=t(21831),o=t(82684),c=t(47999),u=t(1210),a=t(34744),l=t(49894),s=t(67971),d=t(87372),p=t(86673),f=t(82531),h=t(9518),b=t(23831),g=t(73942),v=t(49125),m=h.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1te3pmf-0"})(["border-radius:","px;padding:","px;"," "," ",""],g.n_,3*v.iI,(function(e){return"\n box-shadow: ".concat((e.theme.shadow||b.Z.shadow).small,";\n ")}),(function(e){return e.background&&"\n background: ".concat(e.background,";\n ")}),(function(e){return e.backgroundImage&&'\n background-image: url("'.concat(e.backgroundImage,'");\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n ')})),x=t(3055),j=t(95354),y=t(24141),O=t(28598);function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Z(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var k=function(e){var n=e.after,t=e.afterHidden,r=e.afterWidth,h=e.before,b=e.beforeWidth,g=e.breadcrumbs,w=e.buildSidekick,k=e.children,P=e.errors,S=e.headline,_=e.pageName,C=e.pipeline,I=e.setErrors,D=e.subheader,E=e.subheaderBackground,N=e.subheaderBackgroundImage,H=e.subheaderButton,T=e.subheaderText,M=e.title,W=e.uuid,F=(0,y.i)().height,Y=C.uuid,B=f.ZP.pipelines.detail(Y,{includes_outputs:!1},{revalidateOnFocus:!1}).data,V=null===B||void 0===B?void 0:B.pipeline,A=(0,o.useMemo)((function(){return n||(w?w({height:F,heightOffset:x.Mz,pipeline:V}):null)}),[n,w,F,V]),R=r||(A?50*v.iI:null),J=(0,o.useMemo)((function(){var e=[];return V&&(e.push.apply(e,[{label:function(){return"Pipelines"},linkProps:{href:"/pipelines"}}]),g?(e.push({label:function(){return V.uuid},linkProps:{as:"/pipelines/".concat(Y,"/triggers"),href:"/pipelines/[pipeline]/triggers"}}),e.push.apply(e,(0,i.Z)(g)),e[e.length-1].bold=!0):e.push({bold:!0,label:function(){return V.name}})),e}),[g,V,Y]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(u.Z,{after:A,afterHidden:t,afterWidth:R,before:h,beforeWidth:b,breadcrumbs:J,navigationItems:(0,j.H)(_,V),subheaderChildren:"undefined"!==typeof D&&D,title:V?M?M(V):V.name:null,uuid:W,children:[(H||T)&&(0,O.jsx)(p.Z,{mb:v.Mq,mt:v.cd,mx:v.cd,children:(0,O.jsx)(m,{background:E,backgroundImage:N,children:(0,O.jsxs)(s.Z,{alignItems:"center",children:[H,T&&(0,O.jsx)(p.Z,{ml:3}),T]})})}),S&&(0,O.jsx)(p.Z,{p:v.cd,children:(0,O.jsxs)(p.Z,{mt:v.cd,px:v.cd,children:[(0,O.jsx)(d.Z,{level:5,children:S}),(0,O.jsx)(a.Z,{light:!0,mt:v.cd,short:!0})]})}),k]}),P&&(0,O.jsx)(c.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===I||void 0===I?void 0:I(null)},children:(0,O.jsx)(l.Z,Z(Z({},P),{},{onClose:function(){return null===I||void 0===I?void 0:I(null)}}))})]})}},58122:function(e,n,t){"use strict";t.d(n,{CL:function(){return f},FS:function(){return h},JZ:function(){return g},e7:function(){return v},v0:function(){return p},wx:function(){return b}});var r=t(75582),i=t(82394),o=t(43313),c=t(93348),u=t(1286),a=t(90211),l=t(84779);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function p(e){var n=e.statistics,t=Object.keys(n),r=Array(o.Dy.length).fill(0);return 0===t.length?null:(t.forEach((function(e){if(o.Dy.includes(e)){var t=o.CC[e],i=n[e],c=i,u=!1,a=[2,3],s=o.Ub[e],d=o.oH[e],p=o.OD[e];if(o.y_.includes(e))u=!0,a=[2,1,2];else if(e in o.Sq){i=(0,l.Jw)(i,0);var f=o.Sq[e];c=n[f]}var h={columnFlexNumbers:a,name:t,progress:u,rate:c,successDirection:d,warning:p};o.y_.includes(e)||(h.value=i),r[s]=h}})),r)}function f(e){var n=e.columnTypes,t=void 0===n?{}:n,r=e.statistics,i=Object.keys(r);if(0===i.length)return null;var c=Object.values(t),l=c.length,s=[];s.push({name:"Column count",successDirection:o.oH.column_count,value:(0,a.x6)(l)}),i.forEach((function(e){if(o.Zu.includes(e)){var n=o.CC[e],t=r[e],i=o.OD[e];s.push({name:n,successDirection:o.oH[e],value:(0,a.x6)(t),warning:i})}}));var d=(0,u.QO)(c),p=d.countCategory,f=d.countDatetime,h=d.countNumerical;return s.push({name:"Categorical Features",rate:p/l,value:(0,a.x6)(p)},{name:"Numerical Features",rate:h/l,value:(0,a.x6)(h)},{name:"Datetime Features",rate:f/l,value:(0,a.x6)(f)}),s}function h(e){return"string"===typeof e?e:JSON.stringify(e)}function b(e,n){var t,r;return null===e||void 0===e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(r=t.variables)||void 0===r?void 0:r.map((function(e){var n=e.value;return d(d({},e),{},{value:h(n)})}))}function g(e,n){return n===c.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===c.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function v(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,r.Z)(n,2),o=t[0],c=t[1],u=c;try{u=JSON.parse(c)}catch(a){}return d(d({},e),{},(0,i.Z)({},o,u))}),{}):e}},29237:function(e,n,t){"use strict";var r=t(9518),i=t(67971),o=t(86673),c=t(19711),u=t(23831),a=t(73942),l=t(37391),s=t(49125),d=t(28598),p=(0,r.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*s.iI,1.5*s.iI,1.5*s.iI),f=r.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," ",""],a.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return"\n border: 1px solid ".concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return!e.dark&&"\n background-color: ".concat((e.theme.background||u.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||u.Z.background).content,";\n ")}),(function(e){return!e.fullHeight&&"\n height: fit-content;\n "}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")}),(function(e){return e.maxWidth&&"\n max-width: ".concat(e.maxWidth,"px;\n ")}),(function(e){return e.minWidth&&"\n min-width: ".concat(e.minWidth,"px;\n\n @media (max-width: ").concat(e.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(e){return e.borderless&&"\n border: none;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),h=r.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],a.n_,a.n_,(function(e){return"\n background-color: ".concat((e.theme.background||u.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),p,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),b=r.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*s.iI,l.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: calc(".concat(e.maxHeight," - ").concat(15*s.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),g=r.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],a.M8,a.YF,1.75*s.iI);n.Z=function(e){var n=e.borderless,t=e.children,r=e.containerRef,u=e.contentContainerRef,a=e.dark,l=e.footer,s=e.fullHeight,p=void 0===s||s,v=e.fullWidth,m=void 0===v||v,x=e.header,j=e.headerHeight,y=e.headerIcon,O=e.headerPaddingVertical,w=e.headerTitle,Z=e.maxHeight,k=e.maxWidth,P=e.minWidth,S=e.noPadding,_=e.overflowVisible,C=e.subtitle;return(0,d.jsxs)(f,{borderless:n,dark:a,fullHeight:p,fullWidth:m,maxHeight:Z,maxWidth:k,minWidth:P,overflowVisible:_,ref:r,children:[(x||w)&&(0,d.jsxs)(h,{headerPaddingVertical:O,height:j,children:[x&&x,w&&(0,d.jsx)(i.Z,{alignItems:"center",justifyContent:"space-between",children:(0,d.jsxs)(i.Z,{alignItems:"center",children:[y&&y,(0,d.jsx)(o.Z,{ml:y?1:0,children:(0,d.jsx)(c.ZP,{bold:!0,default:!0,children:w})})]})})]}),(0,d.jsxs)(b,{maxHeight:Z,noPadding:S,overflowVisible:_,ref:u,children:[C&&(0,d.jsx)(o.Z,{mb:2,children:(0,d.jsx)(c.ZP,{default:!0,children:C})}),t]}),l&&(0,d.jsx)(g,{children:l})]})}},38435:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=t(82684),c=t(9518),u=t(69898),a=t(28598),l=["rows"];function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var p=c.default.textarea.withConfig({displayName:"TextArea__TextInputStyle",componentId:"sc-112wx63-0"})(["",""],u.p),f=function(e,n){var t=e.rows,r=void 0===t?3:t,o=(0,i.Z)(e,l);return(0,a.jsx)(u.Z,d(d({},o),{},{input:(0,a.jsx)(p,d({rows:r},o)),ref:n}))};n.Z=o.forwardRef(f)},70902:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=t(82684),c=t(9518),u=t(69898),a=t(23831),l=t(28598),s=["checked","disabled","onCheck"];function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function p(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var f=c.default.label.withConfig({displayName:"ToggleSwitch__ToggleSwitchStyle",componentId:"sc-179r5zs-0"})([""," position:relative;display:inline-block;width:","px;min-width:","px;height:",'px;& input[type="checkbox"]{display:none;}& span{position:absolute;cursor:',";background-color:",";border-radius:13px;",';top:0;right:0;bottom:0;left:0;transition:background-color 0.2s ease;}& span::before{position:absolute;content:"";left:2px;top:2px;width:22px;height:22px;background-color:#787A85;border-radius:50%;transition:transform 0.3s ease;}& input[type="checkbox"]:checked + span::before{transform:translateX(20px);}',""],u.p,46,46,26,(function(e){return e.disabled?"not-allowed":"pointer"}),(function(e){return e.disabled?a.Z.monotone.white:a.Z.monotone.black}),(function(e){return e.disabled&&"border: 1px solid ".concat(a.Z.monotone.grey200)}),(function(e){return!e.disabled&&'\n & input[type="checkbox"]:checked + span {\n background-color: #6AA1E0;\n }\n\n & input[type="checkbox"]:checked + span::before {\n background-color: '.concat(a.Z.monotone.white,";\n }\n ")})),h=function(e,n){var t=e.checked,r=e.disabled,o=e.onCheck,c=(0,i.Z)(e,s);return(0,l.jsx)(u.Z,p(p({},c),{},{disabled:r,input:(0,l.jsxs)(f,p(p({},c),{},{disabled:r,noBackground:!0,noBorder:!0,children:[(0,l.jsx)("input",{checked:t,type:"checkbox"}),(0,l.jsx)("span",{onClick:r?null:function(){return null===o||void 0===o?void 0:o((function(e){return!e}))}})]})),noBackground:!0,ref:n}))};n.Z=o.forwardRef(h)},6087:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ue}});var r=t(77837),i=t(82394),o=t(75582),c=t(38860),u=t.n(c),a=t(12691),l=t.n(a),s=t(82684),d=t(83455),p=t(34376),f=t(60328),h=t(86532),b=t(34744),g=t(67971),v=t(87372),m=t(11135),x=t(10919),j=t(60547),y=t(93348),O=t(41788),w=t(29237),Z=t(86673),k=t(58180),P=t(19711),S=t(38435),_=t(82944),C=t(70902),I=t(23831),D=t(9518),E=t(73942),N=t(49125),H=D.default.div.withConfig({displayName:"indexstyle__ToggleStyle",componentId:"sc-f9kt7n-0"})(["padding:","px ","px;border-radius:","px;",""],1.5*N.iI,2*N.iI,E.n_,(function(e){return"\n border: 1px solid ".concat((e.theme||I.Z).borders.light,";\n background-color: ").concat((e.theme||I.Z).background.popup,";\n ")})),T=t(90211),M=t(58122),W=t(28598);function F(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?F(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):F(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var B="".concat(N.iI,"px ").concat(3*N.iI,"px");var V=function(e){var n=e.initialPipelineSchedulePayload,t=e.onCancel,r=e.onSuccess,c=e.variables,u=(0,s.useState)(!1),a=u[0],l=u[1],d=(0,s.useState)({}),p=d[0],h=d[1],b=(0,s.useState)(c||{}),m=b[0],x=b[1],j=(0,s.useMemo)((function(){return Y(Y({},n),{},{name:(0,T.Y6)(),variables:a?(0,M.e7)(m):null})}),[n,a,m]),y=function(e,n){var t={borderless:!0,key:"variable_uuid_input_".concat(e),monospace:!0,onChange:function(n){n.preventDefault(),x((function(t){return Y(Y({},t),{},(0,i.Z)({},e,n.target.value))}))},paddingHorizontal:0,placeholder:"Variable value",value:n};return p[e]?(0,W.jsx)(S.Z,Y(Y({},t),{},{rows:1,value:n})):(0,W.jsx)(_.Z,Y({},t))};return(0,s.useEffect)((function(){var e=Object.entries(m).reduce((function(e,n){var t=(0,o.Z)(n,2),r=t[0],c=t[1],u=(0,T.Pb)(c)&&"object"===typeof JSON.parse(c)&&!Array.isArray(JSON.parse(c))&&null!==JSON.parse(c);return Y(Y({},e),{},(0,i.Z)({},r,u))}),{});h(e)}),[]),(0,W.jsxs)(w.Z,{footer:(0,W.jsxs)(g.Z,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,W.jsx)(f.Z,{onClick:function(){r({pipeline_schedule:j}),t()},padding:B,primaryAlternate:!0,children:"Run now"}),(0,W.jsx)(Z.Z,{mr:1}),(0,W.jsx)(f.Z,{borderColor:I.Z.background.page,onClick:t,padding:B,secondary:!0,children:"Cancel"})]}),header:(0,W.jsx)(v.Z,{level:5,children:"Run pipeline now"}),maxHeight:"90vh",minWidth:85*N.iI,subtitle:"Creates a new trigger and immediately runs the current pipeline once.",children:[(0,W.jsx)(H,{children:(0,W.jsxs)(g.Z,{alignItems:"center",children:[(0,W.jsx)(Z.Z,{mr:2,children:(0,W.jsx)(C.Z,{checked:a,onCheck:l})}),(0,W.jsx)(P.ZP,{bold:!0,large:!0,children:"Overwrite runtime variables"})]})}),a&&m&&Object.entries(m).length>0&&(0,W.jsx)(Z.Z,{mt:2,children:(0,W.jsx)(k.Z,{columnFlex:[null,1],columns:[{uuid:"Variable"},{uuid:"Value"}],rows:Object.entries(m).map((function(e){var n=(0,o.Z)(e,2),t=n[0],r=n[1];return[(0,W.jsx)(P.ZP,{default:!0,monospace:!0,children:t},"variable_".concat(t)),y(t,r)]}))})})]})},A=t(37391),R=D.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1xgfh62-0"})(["border-bottom:1px solid ",";padding:","px;"],I.Z.borders.medium,N.tr),J=D.default.div.withConfig({displayName:"indexstyle__CardsStyle",componentId:"sc-1xgfh62-1"})([""," height:80px;display:flex;overflow-x:scroll;"],A.w5),z=D.default.div.withConfig({displayName:"indexstyle__VariableCardStyle",componentId:"sc-1xgfh62-2"})(["background-color:",";border-radius:","px;flex-shrink:0;margin-right:","px;padding:","px;"],I.Z.background.output,E.n_,N.iI,N.tr),X=t(73899);var q=function(e){var n=e.hasOverride,t=e.scheduleType,r=e.variables,i=e.variablesOverride,c=[];return Object.entries(r).forEach((function(e){var n=(0,o.Z)(e,2),t=n[0],r=n[1],u=null===i||void 0===i?void 0:i[t];c.push({uuid:t,value:(0,M.FS)(u||r)})})),(0,M.JZ)(c,t),(0,W.jsxs)(R,{children:[(0,W.jsx)(Z.Z,{mb:2,children:(0,W.jsxs)(P.ZP,{bold:!0,large:!0,monospace:!0,muted:!0,children:["Runtime variables",n&&" (override)"]})}),(0,W.jsx)(J,{noScrollbarTrackBackground:!0,children:r&&c.map((function(e){var n=e.uuid,t=e.value;return(0,W.jsxs)(z,{children:[(0,W.jsx)(P.ZP,{monospace:!0,small:!0,children:n}),(0,W.jsx)(P.ZP,{color:X.Or,monospace:!0,small:!0,children:(0,M.FS)(t)})]})}))})]})},G=t(46261),Q=t(97225),L=t(82531),U=t(10503),$=t(59920),K=t(42305),ee=t(7715),ne=t(9736),te=t(96510),re=t(83608);function ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ie(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function ce(e){var n=e.pipeline,t=(0,p.useRouter)(),r=(0,ne.Ct)(),c=n.uuid,u=(0,s.useState)(null),a=u[0],O=u[1],w=L.ZP.variables.pipelines.list(c).data,k=null===w||void 0===w?void 0:w.variables,S=L.ZP.pipeline_schedules.pipelines.list(c,{},{refreshInterval:7500}),_=S.data,C=S.mutate,I=(0,s.useMemo)((function(){return(null===_||void 0===_?void 0:_.pipeline_schedules)||[]}),[_]),D=function(e){return(0,d.Db)(L.ZP.pipeline_schedules.pipelines.useCreate(c),{onSuccess:function(n){return(0,te.wD)(n,{callback:function(n){var t=n.pipeline_schedule.id;null===e||void 0===e||e(t)},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}})},E=D((function(e){return t.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(null===n||void 0===n?void 0:n.uuid,"/triggers/").concat(e,"/edit"))})),H=(0,o.Z)(E,2),F=H[0],Y=H[1].isLoading,B=D(C),A=(0,o.Z)(B,2),R=A[0],J=A[1].isLoading,z=(0,s.useMemo)((function(){var e;return null===(e=(0,M.wx)(k,(function(e){return"global"===e.uuid})))||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid,r=n.value;return oe(oe({},e),{},(0,i.Z)({},t,r))}),{})}),[k]),X={name:(0,T.Y6)(),schedule_interval:y.U5.ONCE,schedule_type:y.Xm.TIME,start_time:(0,K.d$)((new Date).toISOString(),{dayAgo:!0,utcFormat:!0}),status:y.fq.ACTIVE},ie=(0,re.dd)((function(){return(0,W.jsx)(V,{initialPipelineSchedulePayload:X,onCancel:ae,onSuccess:R,variables:z})}),{},[k,z],{background:!0,uuid:"run_pipeline_now_popup"}),ce=(0,o.Z)(ie,2),ue=ce[0],ae=ce[1],le=(0,s.useState)(),se=le[0],de=le[1],pe=(0,s.useMemo)((function(){var e=null===se||void 0===se?void 0:se.variables,n=!(0,ee.Qr)(e),t=n?null===se||void 0===se?void 0:se.variables:(0,ee.Qr)(z)?null:z;return function(i){var o=i.height-(t?151:0);return(0,W.jsxs)(W.Fragment,{children:[t&&(0,W.jsx)(q,{hasOverride:n,scheduleType:null===se||void 0===se?void 0:se.schedule_type,variables:z,variablesOverride:e}),!t&&(0,W.jsxs)(Z.Z,{p:N.cd,children:[(0,W.jsx)(P.ZP,{children:"This pipeline has no runtime variables."}),!r&&(0,W.jsxs)(Z.Z,{mt:1,children:[(0,W.jsx)(l(),{as:"/pipelines/".concat(c,"/edit?sideview=variables"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,W.jsx)(x.Z,{primary:!0,children:"Click here"})})," ",(0,W.jsx)(P.ZP,{inline:!0,children:"to add variables to this pipeline."})]})]}),(0,W.jsx)(h.Z,oe(oe({},i),{},{height:o,noStatus:!0}))]})}}),[k,se]);return(0,W.jsxs)(j.Z,{breadcrumbs:[{label:function(){return"Triggers"}}],buildSidekick:pe,errors:a,pageName:$.M.TRIGGERS,pipeline:n,setErrors:O,subheaderBackgroundImage:"/images/banner-shape-purple-peach.jpg",subheaderButton:(0,W.jsx)(m.ZP,{beforeElement:(0,W.jsx)(U.mm,{size:2.5*N.iI}),blackBorder:!0,inline:!0,loading:Y,noHoverUnderline:!0,onClick:function(){return F({pipeline_schedule:{name:(0,T.Y6)()}})},sameColorAsText:!0,uuid:"PipelineDetailPage/add_new_schedule",children:"Create new trigger"}),subheaderText:(0,W.jsx)(P.ZP,{bold:!0,large:!0,children:"Run this pipeline using a schedule, event, or API."}),title:function(e){var n=e.name;return"".concat(n," triggers")},uuid:"".concat($.M.TRIGGERS,"_").concat(c),children:[(0,W.jsx)(Z.Z,{mt:N.cd,px:N.cd,children:(0,W.jsxs)(g.Z,{justifyContent:"space-between",children:[(0,W.jsx)(v.Z,{level:5,children:"Pipeline triggers"}),(0,W.jsx)(G.Z,{appearBefore:!0,default:!0,fullSize:!0,label:"Creates an @once trigger and runs pipeline immediately",widthFitContent:!0,children:(0,W.jsx)(f.Z,{beforeIcon:(0,W.jsx)(U.JM,{inverted:!0,size:2*N.iI}),disabled:r,loading:J,onClick:(0,ee.Qr)(z)?function(){return R({pipeline_schedule:X})}:ue,outline:!0,success:!r,children:"Run pipeline now"})})]})}),(0,W.jsx)(b.Z,{light:!0,mt:N.cd,short:!0}),(0,W.jsx)(Q.Z,{fetchPipelineSchedules:C,pipeline:n,pipelineSchedules:I,selectedSchedule:se,setErrors:O,setSelectedSchedule:de})]})}ce.getInitialProps=function(){var e=(0,r.Z)(u().mark((function e(n){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:t}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var ue=(0,O.Z)(ce)},42305:function(e,n,t){"use strict";t.d(n,{A5:function(){return p},AY:function(){return f},BP:function(){return d},JX:function(){return s},OC:function(){return o},Pc:function(){return h},Tz:function(){return l},d$:function(){return a},lJ:function(){return b},n1:function(){return u}});var r=t(92083),i=t.n(r),o="YYYY-MM-DD HH:mm:ss",c="YYYY-MM-DD HH:mm",u="YYYY-MM-DD";function a(e,n){var t=n.dayAgo,r=n.includeSeconds,u=n.utcFormat,a=i()(e),l=c;return u&&(a=a.utc()),t&&(a=a.subtract(1,"days")),r&&(l=o),a.format(l)}function l(e){var n=a((new Date).toISOString(),{includeSeconds:!0,utcFormat:!0});return null!==e&&void 0!==e&&e.dateObj?new Date(n):n}function s(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i().unix(e).format(null!==n&&void 0!==n&&n.withSeconds?o:c)}function d(e,n,t){return i()(e).utc().hours(+n).minutes(+t).format()}function p(e){return i()(e).unix()}function f(e,n,t,r){var i="".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t);return r?"".concat(i,":").concat(r):i}function h(e){var n=i().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function b(e){return e.padStart(2,"0")}},40183:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers",function(){return t(6087)}])}},function(e){e.O(0,[3850,5716,5896,4804,1774,5872,2344,4506,6166,8180,6214,6532,1286,3014,9774,2888,179],(function(){return n=40183,e(e.s=n);var n}));var n=e.O();_N_E=n}]);