mage-ai 0.9.33__py3-none-any.whl → 0.9.34__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.
- mage_ai/api/mixins/__init__.py +0 -0
- mage_ai/api/mixins/result_set.py +65 -0
- mage_ai/api/operations/base.py +8 -3
- mage_ai/api/policies/BasePolicy.py +127 -2
- mage_ai/api/policies/PermissionPolicy.py +5 -0
- mage_ai/api/policies/UserPolicy.py +25 -2
- mage_ai/api/policies/mixins/user_permissions.py +0 -9
- mage_ai/api/presenters/PermissionPresenter.py +2 -0
- mage_ai/api/presenters/RolePresenter.py +15 -0
- mage_ai/api/presenters/UserPresenter.py +9 -15
- mage_ai/api/resources/PermissionResource.py +40 -3
- mage_ai/api/resources/RoleResource.py +1 -0
- mage_ai/api/resources/UserResource.py +35 -4
- mage_ai/orchestration/db/models/oauth.py +126 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/PBVuphyo_muEAj347ZP_b/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{3859-3501cdba0a33f9f2.js → 3859-ba594d21a1260cd2.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7022-a0fb5af2ebd7bb45.js → frontend_dist/_next/static/chunks/7022-80d082a1d7fd1234.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7361-25f211ef377e5958.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8146-941c5155c3bfcc35.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9264-5730e4e059db40a8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-d7fd4857579e2b00.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-1a95628ea8d0d846.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-cb1cdf5f8e5bf9c5.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/[...slug]-5061c073e1c0de07.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-f551c5665bfd3494.js +1 -0
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/files.html +5 -5
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist/global-data-products.html +5 -5
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +5 -5
- mage_ai/server/frontend_dist/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist/manage/users.html +5 -5
- mage_ai/server/frontend_dist/manage.html +5 -5
- mage_ai/server/frontend_dist/overview.html +5 -5
- mage_ai/server/frontend_dist/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +5 -5
- mage_ai/server/frontend_dist/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +10 -10
- mage_ai/server/frontend_dist/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist/templates.html +5 -5
- mage_ai/server/frontend_dist/terminal.html +5 -5
- mage_ai/server/frontend_dist/test.html +4 -4
- mage_ai/server/frontend_dist/triggers.html +5 -5
- mage_ai/server/frontend_dist/version-control.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/L-IKw5_bRZUs-wyjnpN_j/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3859-3501cdba0a33f9f2.js → 3859-ba594d21a1260cd2.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/7022-a0fb5af2ebd7bb45.js → frontend_dist_base_path_template/_next/static/chunks/7022-80d082a1d7fd1234.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-25f211ef377e5958.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-941c5155c3bfcc35.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-5730e4e059db40a8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-d7fd4857579e2b00.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-1a95628ea8d0d846.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-cb1cdf5f8e5bf9c5.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/[...slug]-5061c073e1c0de07.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-f551c5665bfd3494.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +10 -10
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/test.html +4 -4
- mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/METADATA +1 -1
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/RECORD +137 -133
- mage_ai/server/frontend_dist/_next/static/chunks/8146-6f46ffd7cbe2fd07.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9264-11c4f9e79f8a9fd5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-68f1591d3f4262f1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-672599b18c4eb2a6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-b7bc84646325062c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/[...slug]-b7b99c3d2109fdea.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-fe480da25b026bb5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/sGWtg0x8VBmlqQeSOAw9E/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-6f46ffd7cbe2fd07.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-11c4f9e79f8a9fd5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-68f1591d3f4262f1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-672599b18c4eb2a6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-b7bc84646325062c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/[...slug]-b7b99c3d2109fdea.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-fe480da25b026bb5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/dFD_SGZQKSOB83hTxog2E/_buildManifest.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{sGWtg0x8VBmlqQeSOAw9E → PBVuphyo_muEAj347ZP_b}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{dFD_SGZQKSOB83hTxog2E → L-IKw5_bRZUs-wyjnpN_j}/_ssgManifest.js +0 -0
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/top_level.txt +0 -0
mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-11c4f9e79f8a9fd5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9264],{27277:function(e,n,t){var o=t(82394),r=t(21831),i=t(82684),u=t(39643),l=t(44688),c=t(28598);function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.highlightedItemIndexInitial,t=void 0===n?null:n,o=e.itemGroups,a=e.noResultGroups,d=e.onHighlightItemIndexChange,f=e.onMouseEnterItem,p=e.onMouseLeaveItem,m=e.onSelectItem,v=e.renderEmptyState,h=e.searchQuery,b=e.selectedItem,g=e.setItemRefs,x=e.uuid,j=(0,i.useState)(!0),O=j[0],C=j[1],_=(0,i.useMemo)((function(){var e=[],n=o.reduce((function(n,t){var o=t.items.filter((function(e){return!h||function(e,n){return e.searchQueries.filter((function(e){return String(e).toLowerCase().includes(n.toLowerCase())})).length>=1}(e,h)}));return 0===o.length?n:(e.push.apply(e,(0,r.Z)(o)),n.concat(s(s({},t),{},{items:o})))}),[]);return{itemGroups:n,itemsFlattened:e}}),[o,h]),Z=_.itemGroups,E=_.itemsFlattened;a&&0===E.length&&(Z.push.apply(Z,(0,r.Z)(a)),E.push.apply(E,(0,r.Z)(a.reduce((function(e,n){var t=n.items;return e.concat(t)}),[]))));var y=(0,i.useRef)(null);y.current=E.map((function(){return(0,i.createRef)()}));var k=(0,i.useState)(t),T=k[0],I=k[1],S=(0,i.useCallback)((function(e){null===d||void 0===d||d(e),I(e)}),[d,I]),P=E[T],A=(0,l.y)(),R=A.registerOnKeyDown,w=A.unregisterOnKeyDown;(0,i.useEffect)((function(){return function(){return w(x)}}),[w,x]),null===R||void 0===R||R(x,(function(e,n,t){var o,r=!0,i=E.length,l=E.findIndex((function(e,o){var r=e.keyboardShortcutValidation;return null===r||void 0===r?void 0:r({keyHistory:t,keyMapping:n},o)})),c=n[u.Gs]&&!n[u.XR]&&!b;return-1!==l?(e.preventDefault(),m(E[l]),C(r),S(l)):(n[u.Uq]||c)&&E[T]?(c&&e.preventDefault(),m(E[T]),C(r),S(T)):(n[u.Bu]?(r=!1,o=null===T?i-1:T-1):n[u.kD]?(r=!1,o=null===T?0:T+1):n[u.vP]&&S(null),"undefined"!==typeof o&&(o>=i?o=0:o<=-1&&(o=i-1),o>=0&&o<=i-1?(S(o),e.preventDefault()):S(null)),void C(r))}),[T,E,b,S,C]),(0,i.useEffect)((function(){null===g||void 0===g||g(y)}),[y,E,g]),(0,i.useEffect)((function(){var e=null===T||"undefined"===typeof T||T>=E.length;(null===h||void 0===h?void 0:h.length)>=1&&e&&S(0)}),[T,E,h,S]);var D=(0,i.useCallback)((function(){return C(!0)}),[C]);return(0,i.useEffect)((function(){return window.addEventListener("mousemove",D),function(){window.removeEventListener("mousemove",D)}}),[D]),0===Z.length&&v?v():(0,c.jsx)(c.Fragment,{children:Z.map((function(e,n){var t=e.items,o=e.renderItem,r=e.renderGroupHeader,i=e.uuid,u=n>=1?Z.slice(0,n).reduce((function(e,n){return e+n.items.length}),0):0,l=t.map((function(e,n){var t=e.itemObject,r=e.value,i=r===(null===P||void 0===P?void 0:P.value),l=n+u,a=(null===t||void 0===t?void 0:t.id)||(null===t||void 0===t?void 0:t.uuid);return(0,c.jsx)("div",{id:"item-".concat(r,"-").concat(a),onMouseMove:function(){return O&&S(l)},ref:y.current[l],children:o(e,{highlighted:i,onClick:function(){return m(e)},onMouseEnter:function(){return null===f||void 0===f?void 0:f(e)},onMouseLeave:function(){return null===p||void 0===p?void 0:p(e)}},n,l)},"item-".concat(r,"-").concat(a))}));return l.length>=1&&(0,c.jsxs)("div",{children:[null===r||void 0===r?void 0:r(),l]},i||"group-uuid-".concat(n))}))})}},85108:function(e,n,t){t.d(n,{G8:function(){return p},SR:function(){return v},VR:function(){return a},_H:function(){return h},x8:function(){return m}});var o,r,i,u,l,c,a,s=t(82394),d=t(35058);!function(e){e.COLUMNS="columns",e.METRICS="metrics",e.NUMBER="number"}(a||(a={}));var f={noCode:[{label:function(){return"time column"},settings:{maxValues:1},type:a.COLUMNS,uuid:d.eN},{label:function(){return"time interval"},options:[d.aE.ORIGINAL,d.aE.SECOND,d.aE.MINUTE,d.aE.HOUR,d.aE.DAY,d.aE.WEEK,d.aE.MONTH,d.aE.YEAR],uuid:d.Yg},{label:function(){return"metrics"},type:a.METRICS,uuid:d.bE}]},p=(o={},(0,s.Z)(o,d.oV.BAR_CHART,{noCode:[{label:function(){return"group by columns"},type:a.COLUMNS,uuid:d.eN},{label:function(){return"metrics"},type:a.METRICS,uuid:d.bE},{autoRun:!0,label:function(){return"chart style"},options:[d.JT.HORIZONTAL,d.JT.VERTICAL],uuid:d.R8},{autoRun:!0,label:function(){return"sort direction"},options:[null,d.MP.ASCENDING,d.MP.DESCENDING],uuid:d.$1}],code:[{label:function(){return"variable name of x-axis values"},monospace:!0,uuid:d.a3},{label:function(){return"variable name of y-axis values"},monospace:!0,uuid:d.rj}]}),(0,s.Z)(o,d.oV.HISTOGRAM,{noCode:[{label:function(){return"number column for chart"},settings:{maxValues:1},type:a.COLUMNS,uuid:d.eN},{autoRun:!0,label:function(){return"Number of buckets"},type:a.NUMBER,uuid:d.m7}],code:[{label:function(){return"variable name of values"},monospace:!0,uuid:d.a3}]}),(0,s.Z)(o,d.oV.LINE_CHART,{noCode:[{label:function(){return"group by columns"},settings:{maxValues:1},type:a.COLUMNS,uuid:d.eN},{label:function(){return"metrics"},type:a.METRICS,uuid:d.bE}],code:[{label:function(){return"variable name of x-axis values"},monospace:!0,uuid:d.a3},{label:function(){return"variable name of y-axis values"},monospace:!0,uuid:d.rj},{label:function(){return"labels of lines in chart (comma separated)"},uuid:d.e}]}),(0,s.Z)(o,d.oV.PIE_CHART,{noCode:[{label:function(){return"column for chart"},settings:{maxValues:1},type:a.COLUMNS,uuid:d.eN},{autoRun:!0,label:function(){return"Number of slices"},type:a.NUMBER,uuid:d.m7}],code:[{label:function(){return"variable name of values"},monospace:!0,uuid:d.a3}]}),(0,s.Z)(o,d.oV.TABLE,{noCode:[{label:function(){return"columns"},type:a.COLUMNS,uuid:d.eN},{label:function(){return"max number of rows"},type:a.NUMBER,uuid:d.PG}],code:[{label:function(){return"variable name of columns"},monospace:!0,uuid:d.a3},{label:function(){return"variable name of rows"},monospace:!0,uuid:d.rj}]}),(0,s.Z)(o,d.oV.TIME_SERIES_BAR_CHART,f),(0,s.Z)(o,d.oV.TIME_SERIES_LINE_CHART,f),o),m=(r={},(0,s.Z)(r,d.oV.BAR_CHART,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.a3,"x"),(0,s.Z)(n,d.rj,"y"),(0,s.Z)(n,d.R8,d.JT.VERTICAL),n},content:function(e){return"columns = df_1.columns\nx = df_1.columns[:7]\ny = [[v] for v in [len(df_1[col].unique()) for col in x]]\n"}}),(0,s.Z)(r,d.oV.HISTOGRAM,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.m7,10),(0,s.Z)(n,d.a3,"x"),n},content:function(e){return"columns = df_1.columns\ncol = list(filter(lambda x: df_1[x].dtype == float or df_1[x].dtype == int, columns))[0]\nx = df_1[col]\n"}}),(0,s.Z)(r,d.oV.LINE_CHART,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.a3,"x"),(0,s.Z)(n,d.rj,"y"),n},content:function(e){return"columns = df_1.columns\ncols = list(filter(lambda x: df_1[x].dtype == float or df_1[x].dtype == int, columns))\nx = df_1[cols[0]]\ny = [df_1[cols[1]]]\n"}}),(0,s.Z)(r,d.oV.PIE_CHART,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.m7,7),(0,s.Z)(n,d.a3,"x"),n},content:function(e){return"x = df_1[df_1.columns[0]]"}}),(0,s.Z)(r,d.oV.TABLE,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.PG,10),(0,s.Z)(n,d.a3,"x"),(0,s.Z)(n,d.rj,"y"),n},content:function(e){return"x = df_1.columns\ny = df_1.to_numpy()"}}),(0,s.Z)(r,d.oV.TIME_SERIES_BAR_CHART,{configuration:function(e){return(0,s.Z)({},d.Yg,d.aE.ORIGINAL)}}),(0,s.Z)(r,d.oV.TIME_SERIES_LINE_CHART,{configuration:function(e){return(0,s.Z)({},d.Yg,d.aE.ORIGINAL)}}),r),v=(c={},(0,s.Z)(c,d.oV.BAR_CHART,(i={},(0,s.Z)(i,d.a3,(function(){return"must be a list of booleans, dates, integers, floats, or strings."})),(0,s.Z)(i,d.rj,(function(){return"must be a list of lists containing integers or floats."})),i)),(0,s.Z)(c,d.oV.HISTOGRAM,(0,s.Z)({},d.a3,(function(){return"must be a list of integers or floats."}))),(0,s.Z)(c,d.oV.LINE_CHART,(u={},(0,s.Z)(u,d.a3,(function(){return"must be a list of integers or floats."})),(0,s.Z)(u,d.rj,(function(){return"must be a list of lists containing integers or floats. Each list is a single line in the chart."})),u)),(0,s.Z)(c,d.oV.PIE_CHART,(0,s.Z)({},d.a3,(function(){return"must be a list of booleans, dates, integers, floats, or strings."}))),(0,s.Z)(c,d.oV.TABLE,(l={},(0,s.Z)(l,d.a3,(function(){return"must be a list of strings."})),(0,s.Z)(l,d.rj,(function(){return"must be a list of lists containing booleans, dates, integers, floats, or strings."})),l)),c),h=[{label:function(){return"% of missing values"},widgetTemplate:function(e){var n,t=e.block;return{name:"missing values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.a3,"columns_with_mising_values"),(0,s.Z)(n,d.rj,"percentage_of_missing_values"),(0,s.Z)(n,d.R8,d.JT.HORIZONTAL),(0,s.Z)(n,d.$1,d.MP.DESCENDING),(0,s.Z)(n,"chart_type",d.oV.BAR_CHART),n),content:"number_of_rows = len(df_1.index)\ncolumns_with_mising_values = []\npercentage_of_missing_values = []\nfor col in df_1.columns:\n missing = df_1[col].isna().sum()\n if missing > 0:\n columns_with_mising_values.append(col)\n percentage_of_missing_values.append(100 * missing / number_of_rows)\n"}}},{label:function(){return"Unique values"},widgetTemplate:function(e){var n,t=e.block;return{name:"unique values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.a3,"columns"),(0,s.Z)(n,d.rj,"number_of_unique_values"),(0,s.Z)(n,d.R8,d.JT.HORIZONTAL),(0,s.Z)(n,d.$1,d.MP.DESCENDING),(0,s.Z)(n,"chart_type",d.oV.BAR_CHART),n),content:"columns = df_1.columns\nnumber_of_unique_values = [df_1[col].nunique() for col in columns]\n"}}},{label:function(){return"Most frequent values"},widgetTemplate:function(e){var n,t=e.block;return{name:"most frequent values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.JJ,3e3),(0,s.Z)(n,d.ED,"column_index"),(0,s.Z)(n,d.a3,"columns"),(0,s.Z)(n,d.rj,"rows"),(0,s.Z)(n,"chart_type",d.oV.TABLE),n),content:"columns = ['mode value', 'frequency', '% of values']\n\ncolumn_index = []\nrows = []\nfor col in df_1.columns:\n value_counts = df_1[col].value_counts()\n if len(value_counts.index) == 0:\n continue\n column_value = value_counts.index[0]\n value = value_counts[column_value]\n number_of_rows = df_1[col].count()\n column_index.append(col)\n rows.append([\n column_value,\n f'{round(100 * value / number_of_rows, 2)}%',\n value,\n ])\n"}}},{label:function(){return"Summary overview"},widgetTemplate:function(e){var n,t=e.block;return{name:"summary overview for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.JJ,3e3),(0,s.Z)(n,d.ED,"stats"),(0,s.Z)(n,d.a3,"headers"),(0,s.Z)(n,d.rj,"rows"),(0,s.Z)(n,"chart_type",d.oV.TABLE),n),content:"from mage_ai.data_cleaner.column_types.column_type_detector import infer_column_types\n\n\nheaders = ['value']\nstats = ['Columns', 'Rows']\nrows = [[len(df_1.columns)], [len(df_1.index)]]\n\ncol_counts = {}\nfor col, col_type in infer_column_types(df_1).items():\n col_type_name = col_type.value\n if not col_counts.get(col_type_name):\n col_counts[col_type_name] = 0\n col_counts[col_type_name] += 1\n\nfor col_type, count in sorted(col_counts.items()):\n stats.append(f'# of {col_type}')\n rows.append([count])\n"}}},{label:function(){return"Feature profiles"},widgetTemplate:function(e){var n,t=e.block;return{name:"feature profiles for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.JJ,3e3),(0,s.Z)(n,d.ED,"stats"),(0,s.Z)(n,d.a3,"columns"),(0,s.Z)(n,d.rj,"rows"),(0,s.Z)(n,"chart_type",d.oV.TABLE),n),content:"from mage_ai.data_cleaner.column_types.column_type_detector import infer_column_types\nimport statistics\n\n\ncolumns_and_types = infer_column_types(df_1).items()\ncolumns = [t[0] for t in columns_and_types]\nstats = ['Type', 'Missing values', 'Unique values', 'Min', 'Max', 'Mean', 'Median', 'Mode']\nrows = [[] for _ in stats]\n\nfor col, col_type in columns_and_types:\n series = df_1[col]\n min_value = None\n max_value = None\n mean = None\n median = None\n\n not_null = series[series.notnull()]\n\n if col_type.value in ['number', 'number_with_decimals']:\n count = len(not_null.index)\n if count >= 1:\n mean = round(not_null.sum() / count, 2)\n median = sorted(not_null)[int(count / 2)]\n min_value = round(series.min(), 2)\n max_value = round(series.max(), 2)\n else:\n min_value = not_null.astype(str).min()\n max_value = not_null.astype(str).max()\n\n _, mode = sorted(\n [(v, k) for k, v in not_null.value_counts().items()],\n reverse=True,\n )[0]\n\n for idx, value in enumerate([\n col_type.value,\n len(series[series.isna()].index),\n len(series.unique()),\n min_value,\n max_value,\n mean,\n median,\n mode,\n ]):\n rows[idx].append(value)\n"}}}]},88494:function(e,n,t){t.d(n,{MB:function(){return m},Nk:function(){return a},T5:function(){return s},_A:function(){return f},a3:function(){return p},wx:function(){return d}});var o=t(38626),r=t(44897),i=t(55283),u=t(42631),l=t(70515),c=t(30160),a=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-n38rkq-0"})([""," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;overflow:hidden;"," "," ",""],i.Kf,(function(e){return e.addBottomPadding&&"\n padding-bottom: ".concat(2*l.tr,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).table,";\n ")}),(function(e){return!e.executedAndIdle&&"\n border-bottom-left-radius: ".concat(u.n_,"px;\n border-bottom-right-radius: ").concat(u.n_,"px;\n border-bottom-style: solid;\n border-bottom-width: 2px;\n ")})),s=o.default.div.withConfig({displayName:"indexstyle__OutputRowStyle",componentId:"sc-n38rkq-1"})([""," "," ",""],(function(e){return e.first&&"\n padding-top: ".concat(l.iI*l.cd,"px;\n ")}),(function(e){return e.last&&"\n padding-bottom: ".concat(l.iI*l.cd,"px;\n ")}),(function(e){return e.contained&&"\n padding-left: ".concat(i.oh,"px;\n padding-right: ").concat(l.iI*l.cd,"px;\n ")})),d=o.default.div.withConfig({displayName:"indexstyle__HTMLOutputStyle",componentId:"sc-n38rkq-2"})([""," table{"," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;}td,th{padding:0 8px;}a{","}"],c.IH,i.Kf,(function(e){return"\n color: ".concat((e.theme.interactive||r.Z.interactive).linkPrimary,";\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoStyle",componentId:"sc-n38rkq-3"})([""," border-bottom-style:solid;border-bottom-width:2px;border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;",""],i.Kf,(function(e){return"\n background-color: ".concat((e.theme.borders||r.Z.borders).light,";\n border-bottom-left-radius: ").concat(u.n_,"px;\n border-bottom-right-radius: ").concat(u.n_,"px;\n ")})),p=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoContentStyle",componentId:"sc-n38rkq-4"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;"],l.iI,i.oh,l.iI*l.cd,l.iI),m=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoBorderStyle",componentId:"sc-n38rkq-5"})(["height:1px;width:100%;",""],(function(e){return"\n border-top: 1px solid ".concat((e.theme.borders||r.Z.borders).medium,";\n ")}))},12869:function(e,n,t){var o=t(21831),r=t(82394),i=t(75582),u=t(82684),l=t(89565),c=t.n(l),a=t(62302),s=t(69864),d=t(40761),f=t(44425),p=t(71180),m=t(39867),v=t(75810),h=t(93859),b=t(17586),g=t(15338),x=t(97618),j=t(55485),O=t(48339),C=t(57653),_=t(35185),Z=t(38276),E=t(30160),y=t(12468),k=t(35686),T=t(98464),I=t(72473),S=t(88494),P=t(15135),A=t(65044),R=t(70515),w=t(11498),D=t(47041),N=t(41429),M=t(85385),L=t(74052),B=t(81728),U=t(72619),F=t(28598);function G(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function H(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,r.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 z={appearAbove:!0,appearBefore:!0,block:!0,size:null,widthFitContent:!0},Q={basic:!0,iconOnly:!0,noPadding:!0,transparent:!0};n.Z=function(e){var n=e.block,t=e.blockMetadata,r=e.buttonTabs,l=e.collapsed,G=e.contained,K=void 0===G||G,Y=e.dynamicBlock,W=e.dynamicChildBlock,q=e.hasError,V=e.hasOutput,X=e.hideExtraInfo,J=e.isInProgress,$=e.mainContainerWidth,ee=e.messages,ne=e.messagesAll,te=e.openSidekickView,oe=e.pipeline,re=e.runCount,ie=e.runEndTime,ue=e.runStartTime,le=e.selected,ce=e.selectedTab,ae=e.setCollapsed,se=e.setErrors,de=e.setOutputBlocks,fe=e.setSelectedOutputBlock,pe=e.setSelectedTab,me=n||{},ve=me.color,he=me.status,be=me.type,ge=me.uuid,xe=(0,u.useMemo)((function(){return{blockColor:ve,blockType:be,dynamicBlock:Y,dynamicChildBlock:W,hasError:q,selected:le}}),[ve,be,Y,W,q,le]),je=(0,u.useMemo)((function(){return(null===ee||void 0===ee?void 0:ee.length)||0}),[ee]),Oe=f.DA.EXECUTED===he||!J&&0===re&&je>=1||!J&&re>=1&&ie>=ue,Ce=(0,u.useState)(),_e=Ce[0],Ze=Ce[1],Ee=(0,u.useState)(),ye=Ee[0],ke=Ee[1],Te=(0,u.useState)(null),Ie=Te[0],Se=Te[1],Pe=(0,u.useMemo)((function(){var e,n;return null===(e=new d.Z)||void 0===e||null===(n=e.decodedToken)||void 0===n?void 0:n.token}),[]),Ae=(0,s.Db)((function(){return k.ZP.block_outputs.pipelines.downloads.detailAsync(null===oe||void 0===oe?void 0:oe.uuid,ge,{token:Pe},{onDownloadProgress:function(e){return Se((Number((null===e||void 0===e?void 0:e.loaded)||0)/1e6).toFixed(3))},responseType:w.E.BLOB})}),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(e){(0,L.uS)(e,"".concat(ge,".").concat(P.Lu.CSV))},onErrorCallback:function(e,n){return null===se||void 0===se?void 0:se({errors:n,response:e})}})}}),Re=(0,i.Z)(Ae,2),we=Re[0],De=Re[1].isLoading;(0,u.useEffect)((function(){J||ke(100)}),[J]);var Ne=function(e){return Array.isArray(e)?e.join("\n"):e},Me=(0,u.useMemo)((function(){return(null===ee||void 0===ee?void 0:ee.length)>=1?ee.reduce((function(e,n){var t=e.at(-1);if(O.jU.includes(null===t||void 0===t?void 0:t.type)&&(null===t||void 0===t?void 0:t.type)===n.type&&!Ne(null===n||void 0===n?void 0:n.data).match(A.Lz)){if(Array.isArray(t.data))t.data.concat(n.data);else if("string"===typeof t.data){var o=Ne(n.data)||"";t.data=[t.data,o].join("\n")}}else O.jU.includes(null===n||void 0===n?void 0:n.type)&&!Ne(null===n||void 0===n?void 0:n.data).match(A.Lz)?e.push(H(H({},n),{},{data:Ne(n.data)})):e.push(H({},n));return e}),[]):ne||[]}),[ee,ne]),Le=(0,u.useMemo)((function(){return!(null!==ee&&void 0!==ee&&ee.length)&&(null===ne||void 0===ne?void 0:ne.length)>=1}),[ee,ne]),Be=(0,u.useMemo)((function(){return(0,F.jsx)(_.Z,{progress:ye})}),[ye]),Ue=f.tf.DBT===(null===n||void 0===n?void 0:n.type),Fe=(0,T.Z)(q);(0,u.useEffect)((function(){Ue&&!Fe&&q&&pe(N.Rj)}),[q,Fe,Ue,pe]);var Ge=(0,u.useMemo)((function(){var e=function(e,n){var t=e.columns,o=e.index,r=e.rows,i=e.shape,u=n.borderTop,l=n.selected;return i&&Ze(i),r.length>=1&&(0,F.jsx)(h.Z,{columns:t,disableScrolling:!l,index:o,maxHeight:60*R.iI,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!u,rows:r,width:$-(2+R.cd*R.iI*2+2+D.nn)},"data-table-".concat(o))},n=[],t=[],r=[];return null===Me||void 0===Me||Me.forEach((function(i,u){var l,s,d,f=Array.isArray(i);if(Le&&f?(s={columns:["-"],index:0,rows:null===i||void 0===i?void 0:i.map((function(e){return[(0,B.Pb)(e)?JSON.parse(e):e]})),shape:[null===i||void 0===i?void 0:i.length,1]},d=O.Gi.TABLE):"string"===typeof i?(s=i,d=O.Gi.TEXT_PLAIN):(s=null===i||void 0===i?void 0:i.data,d=null===i||void 0===i?void 0:i.type),f||s&&0!==(null===(l=s)||void 0===l?void 0:l.length)){var p=[];p=(p=Array.isArray(s)?s:[s]).filter((function(e){return e}));var m=[];p.forEach((function(e){if(d===O.Gi.TEXT_HTML)m.push(e);else if(e&&"string"===typeof e){var n=e.split("\n");m.push.apply(m,(0,o.Z)(n))}else"object"===typeof m&&m.push(e)}));var v=m.length,h=[];m.forEach((function(n,o){var i,l,s={contained:K,first:0===u&&0===o,last:u===Me.length-1&&o===v-1},f=u>=1;if("string"===typeof n&&n.match(A.Gr)){var p=n.split("\n"),m=[];p.forEach((function(e){if(e.match(A.Gr)){var t=e.split(A.Vc),o=t[t.length-1];(0,B.Pb)(o)&&r.push(JSON.parse(o))}else m.push(e);n=m.length>=1?m.join("\n"):null}))}if(null!==n){if("string"===typeof n&&n.match(A.Lz)){var b=n.split(A.gr),g=b[b.length-1],x=g.split("FloatProgress");if(b.length>=2&&(g=x[0]),(0,B.Pb)(g)){var j=JSON.parse(g),C=j.data,_=j.type;if(O.Gi.TABLE===_){!0;var Z=e(C,{borderTop:f,selected:le});t.push(Z),Ue||(l=Z)}}}else if(d===O.Gi.TABLE){!0;var y=e((0,B.Pb)(n)?JSON.parse(n):n,{borderTop:f,selected:le});t.push(y),Ue||(l=y)}else if(O.jU.includes(d)){var k,T=null===(k=n)||void 0===k?void 0:k.split("\\n");l=(0,F.jsx)(S.T5,H(H({},s),{},{children:T.map((function(e){return(0,F.jsxs)(E.ZP,{monospace:!0,preWrap:!0,children:[(null===e||void 0===e?void 0:e.length)>=1&&(0,F.jsx)(c(),{children:e}),!(null!==e&&void 0!==e&&e.length)&&(0,F.jsx)(F.Fragment,{children:"\xa0"})]},e)}))}))}else if(d===O.Gi.TEXT_HTML)n&&(l=(0,F.jsx)(S.T5,H(H({},s),{},{children:(0,F.jsx)(S.wx,{monospace:!0,children:(0,F.jsx)(a.Z,{html:n})})})));else if(d===O.Gi.IMAGE_PNG&&(null===(i=n)||void 0===i?void 0:i.length)>=1)l=(0,F.jsx)("div",{style:{backgroundColor:"white"},children:(0,F.jsx)("img",{alt:"Image ".concat(u," from code output"),src:"data:image/png;base64, ".concat(n)})});else if(d===O.Gi.PROGRESS){var I=parseInt(n);ke(I>90?90:I)}l&&h.push((0,F.jsx)("div",{children:l},"code-output-".concat(u,"-").concat(o)))}})),h.length>=1&&n.push(h)}})),J&&(null===oe||void 0===oe?void 0:oe.type)===C.qL.PYSPARK&&n.unshift([(0,F.jsx)(S.T5,{contained:!0,children:(0,F.jsx)(Z.Z,{mt:1,children:Be})},"progress_bar")]),{content:n,tableContent:t,testContent:r}}),[Me,K,Ue,J,$,oe,Be,Le,le]),He=Ge.content,ze=Ge.tableContent,Qe=Ge.testContent,Ke=(null===_e||void 0===_e?void 0:_e[1])||0,Ye=Ke>30?" (30 out of ".concat(Ke," columns displayed)"):"",We=(0,u.useMemo)((function(){var e;if(Ue&&ce){var n=ce.uuid;if(N.$m.uuid===n)(null===ze||void 0===ze?void 0:ze.length)>=1?e=ze:J||(e=(0,F.jsx)(Z.Z,{px:2,py:1,children:(0,F.jsx)(E.ZP,{muted:!0,children:q?"Error, check logs.":"No preview to display yet, try running the block."})}));else if(N.Rj.uuid===n)(null===He||void 0===He?void 0:He.length)>=1?e=He:J||(e=(0,F.jsx)(Z.Z,{px:2,py:1,children:(0,F.jsx)(E.ZP,{muted:!0,children:q?"Error, check logs.":"No logs to display yet, try running the block."})}));else if(N.Jt.uuid===n){var o,i=null===t||void 0===t||null===(o=t.dbt)||void 0===o?void 0:o.sql;e=i?(0,F.jsx)(v.Z,{autoHeight:!0,language:P.Lu.SQL,padding:!0,readOnly:!0,value:i,width:"100%"}):null}else if(N.gM.uuid===n){var u,l=null===t||void 0===t||null===(u=t.dbt)||void 0===u?void 0:u.lineage;e=l?(0,F.jsx)(b.Z,{disabled:!0,enablePorts:!1,height:55*R.iI,pannable:le,pipeline:H(H({},oe),{},{blocks:l}),zoomable:le}):null}}else e=He;return(0,F.jsxs)(F.Fragment,{children:[r,e]})}),[t,r,He,q,Ue,J,oe,le,ce,ze]);return r||q||V||Le?(0,F.jsxs)(F.Fragment,{children:[K&&(0,F.jsxs)(S.Nk,H(H({},xe),{},{addBottomPadding:J&&(null===oe||void 0===oe?void 0:oe.type)===C.qL.PYSPARK,blockType:be,dynamicBlock:Y,dynamicChildBlock:W,executedAndIdle:Oe,hasError:q,selected:le,children:[!l&&(null===Qe||void 0===Qe?void 0:Qe.length)>=1&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Z.Z,{py:2,children:(0,F.jsx)(S.T5,{contained:!0,children:Qe.map((function(e,n){var t=e.error,o=e.message,r=e.stacktrace;return(0,F.jsxs)(Z.Z,{mt:n>=1?3:0,children:[(0,F.jsx)(E.ZP,{monospace:!0,preWrap:!0,children:(0,F.jsx)(c(),{children:"".concat(o).concat(t?" "+t:"")})}),null===r||void 0===r?void 0:r.map((function(e){return(0,F.jsx)(E.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:(0,F.jsx)(c(),{children:e})},e)}))]},o)}))})}),(0,F.jsx)(Z.Z,{mb:q?2:0,children:(0,F.jsx)(g.Z,{medium:!0})})]}),!l&&We]})),!K&&We,Oe&&!X&&(0,F.jsxs)(S._A,H(H({},xe),{},{blockType:be,dynamicBlock:Y,dynamicChildBlock:W,hasError:q,selected:le,children:[(0,F.jsx)(S.MB,{}),(0,F.jsxs)(j.ZP,{justifyContent:"space-between",children:[ae&&(0,F.jsx)(x.Z,{alignItems:"center",px:1,children:(0,F.jsx)(p.Z,H(H({},Q),{},{onClick:function(){return ae(!l)},children:l?(0,F.jsxs)(j.ZP,{alignItems:"center",children:[(0,F.jsx)(I._M,{muted:!0,size:2*R.iI}),"\xa0",(0,F.jsx)(E.ZP,{default:!0,children:"Expand output"})]}):(0,F.jsxs)(j.ZP,{alignItems:"center",children:[(0,F.jsx)(I.Kh,{muted:!0,size:2*R.iI}),_e&&(0,F.jsx)(Z.Z,{ml:2,children:(0,F.jsx)(E.ZP,{children:"".concat(_e[0]," rows x ").concat(_e[1]," columns").concat(Ye)})})]})}))}),(0,F.jsx)(S.a3,{children:(0,F.jsxs)(j.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,F.jsx)(y.Z,H(H({},z),{},{label:re>=1&&ue?"Last run at ".concat(new Date(ue.valueOf()).toLocaleString()):q?"Block executed with errors":"Block executed successfully",children:(0,F.jsxs)(j.ZP,{alignItems:"center",children:[re>=1&&Number(ie)>Number(ue)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(E.ZP,{small:!0,children:[(Number(ie)-Number(ue))/1e3,"s"]}),(0,F.jsx)(Z.Z,{mr:1})]}),!q&&(0,F.jsx)(I.Jr,{size:2*R.iI,success:!0}),q&&(0,F.jsx)(m.Z,{danger:!0,size:2*R.iI,children:(0,F.jsx)(E.ZP,{bold:!0,monospace:!0,small:!0,children:"!"})})]})})),!q&&!f.Qj.includes(be)&&(0,F.jsx)(Z.Z,{pl:2,children:(0,F.jsxs)(j.ZP,{alignItems:"center",children:[(0,F.jsx)(y.Z,H(H({},z),{},{label:"Expand table",children:(0,F.jsx)(p.Z,H(H({},Q),{},{onClick:function(){(0,L.OF)(null===oe||void 0===oe?void 0:oe.uuid,ge),null===te||void 0===te||te(M.cH.DATA),null===de||void 0===de||de((function(e){return e.find((function(e){return e.uuid===ge}))?e:(null===fe||void 0===fe||fe(n),e.concat(n))}))},children:(0,F.jsx)(I.M0,{muted:!0,size:1.75*R.iI})}))})),(0,F.jsx)(Z.Z,{pl:2}),(0,F.jsx)(y.Z,H(H({},z),{},{forceVisible:De,label:De?"".concat(Ie||0,"mb downloaded..."):"Save output as CSV file",children:(0,F.jsx)(p.Z,H(H({},Q),{},{compact:!0,loading:De,onClick:function(){Se(null),we()},children:(0,F.jsx)(I.vc,{muted:!0,size:1.75*R.iI})}))}))]})})]})})]})]}))]}):null}},69632:function(e,n,t){t.d(n,{JX:function(){return c},NJ:function(){return s},au:function(){return l},eQ:function(){return a}});var o=t(38626),r=t(44897),i=t(42631),u=t(70515),l=(u.iI,o.default.div.withConfig({displayName:"indexstyle__HeaderSectionStyle",componentId:"sc-nlaveq-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).content,";\n ")}))),c=o.default.div.withConfig({displayName:"indexstyle__StreamSectionStyle",componentId:"sc-nlaveq-1"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;overflow:hidden;",""],i.n_,i.n_,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).content,";\n ")})),a=o.default.div.withConfig({displayName:"indexstyle__EmptyCodeSpace",componentId:"sc-nlaveq-2"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeTextarea,";\n ")})),s=o.default.div.withConfig({displayName:"indexstyle__CalloutStyle",componentId:"sc-nlaveq-3"})(["border-radius:","px;padding:","px;",""],i.n_,u.cd*u.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")}))},41429:function(e,n,t){t.d(n,{$m:function(){return r},C:function(){return a},C4:function(){return p},Jt:function(){return u},Rj:function(){return i},Xy:function(){return c},aj:function(){return f},gM:function(){return l},vT:function(){return s},zr:function(){return d}});var o=t(70515),r={uuid:"Preview results"},i={uuid:"Logs"},u={uuid:"SQL"},l={uuid:"Lineage"},c=function(e){var n,t,o=e.metadata,c=[i,u];return(null===o||void 0===o||null===(n=o.dbt)||void 0===n||null===(t=n.block)||void 0===t?void 0:t.snapshot)||(c.unshift(r),c.push(l)),c},a=2.5*o.iI,s="CodeBlock_HiddenBlock",d={label:function(){return"CODE"},uuid:"code"},f={label:function(){return"INTERACTIONS"},uuid:"interactions"},p=[d,f]},79818:function(e,n,t){t.d(n,{z:function(){return Xe},Z:function(){return $e}});var o=t(21831),r=t(75582),i=t(82394),u=t(12691),l=t.n(u),c=t(82684),a=t(38626),s=t(10975),d=t(14567),f=t(69864),p=t(57271),m=t(79757),v=t(71180),h=t(55485),b=t(38276),g=t(30160),x=t(55283),j=t(28598);var O=function(e){var n=e.blocks,t=e.onClick,o=(0,c.useContext)(a.ThemeContext);return(0,j.jsx)(h.ZP,{alignItems:"center",children:null===n||void 0===n?void 0:n.map((function(e){var n=e.color,r=e.type,i=e.uuid,u=(0,x.qn)(r,{blockColor:n,theme:o}).accentLight;return(0,j.jsx)(b.Z,{ml:1,mt:1,children:(0,j.jsx)(v.Z,{backgroundColor:u,compact:!0,onClick:function(){return t(e)},small:!0,children:(0,j.jsx)(g.ZP,{monospace:!0,small:!0,children:i})})},i)}))})},C=t(97618),_=t(26084),Z=t(85385),E=t(86735);function y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function k(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?y(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var T=function(e){var n=e.block,t=e.blocks,o=e.openSidekickView,i=e.pipeline,u=(0,c.useMemo)((function(){return(0,E.HK)(t,(function(e){return e.uuid}))}),[t]),l=(0,c.useMemo)((function(){var e;return null===n||void 0===n||null===(e=n.callback_blocks)||void 0===e?void 0:e.reduce((function(e,n){var t=null===u||void 0===u?void 0:u[n];return t?e.concat(t):e}),[])}),[n,u]),a=(0,c.useMemo)((function(){var e;return null===n||void 0===n||null===(e=n.conditional_blocks)||void 0===e?void 0:e.reduce((function(e,n){var t=null===u||void 0===u?void 0:u[n];return t?e.concat(t):e}),[])}),[n,u]),s=(0,c.useMemo)((function(){var e,t=[];return null===(e=Object.entries((null===i||void 0===i?void 0:i.extensions)||{}))||void 0===e||e.forEach((function(e){var o=(0,r.Z)(e,2),i=o[0],l=o[1].blocks;null===l||void 0===l||l.forEach((function(e){var o=e.upstream_blocks,r=e.uuid;if(null!==o&&void 0!==o&&o.includes(null===n||void 0===n?void 0:n.uuid)){var l=null===u||void 0===u?void 0:u[r];l&&t.push(k(k({},l),{},{extension_uuid:i}))}}))})),t}),[n,u,i]),d=(0,c.useMemo)((function(){return null===a||void 0===a?void 0:a.length}),[a]),f=(0,c.useMemo)((function(){return null===l||void 0===l?void 0:l.length}),[l]),p=(0,c.useMemo)((function(){return null===s||void 0===s?void 0:s.length}),[s]);return(0,j.jsxs)(b.Z,{pb:d>=1||f>=1||p>=1?1:0,children:[d>=1&&(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(C.Z,{flexDirection:"column",children:[(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{bold:!0,muted:!0,children:"Conditionals"})}),(0,j.jsx)(O,{blocks:a,onClick:function(e){var n=e.uuid;return o(Z.cH.ADDON_BLOCKS,!0,{addon:_.Q.CONDITIONAL,blockUUID:n})}})]})}),f>=1&&(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(C.Z,{flexDirection:"column",children:[(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{bold:!0,muted:!0,children:"Callbacks"})}),(0,j.jsx)(O,{blocks:l,onClick:function(e){var n=e.uuid;return o(Z.cH.ADDON_BLOCKS,!0,{addon:_.Q.CALLBACK,blockUUID:n})}})]})}),p>=1&&(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(C.Z,{flexDirection:"column",children:[(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{bold:!0,muted:!0,children:"Extensions"})}),(0,j.jsx)(O,{blocks:s,onClick:function(e){var n=e.extension_uuid,t=e.uuid;return o(Z.cH.EXTENSIONS,!0,{blockUUID:t,extension:n})}})]})})]})},I=t(81769),S=t(44425),P=t(90299),A=t(70652),R=t(39867),w=t(75810),D=t(12869),N=t(70374),M=t(35058),L=t(85108),B=t(70515),U=t(81728);function F(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function G(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 H=function(e){var n=e.addWidget,t=e.block,r=e.left,i=e.rightOffset,u=e.onClickCallback,l=e.open,a=e.parentRef,s=e.runBlock,d=e.topOffset,f=(0,c.useMemo)((function(){return M.CK.map((function(e){var o,r,i={configuration:{chart_type:e},language:t.language,type:S.tf.CHART,upstream_blocks:t?[t.uuid]:null},u=L.x8[e],l=(null===u||void 0===u||null===(o=u.configuration)||void 0===o?void 0:o.call(u,i))||{},c=S.t6.SQL===(null===t||void 0===t?void 0:t.language)?null:(null===u||void 0===u||null===(r=u.content)||void 0===r?void 0:r.call(u,i))||null,a=e;return t&&(a="".concat(a," for ").concat(t.uuid)),{label:function(){return(0,U.vg)(e)},onClick:function(){return n(G(G({},i),{},{name:"".concat(a," ").concat((0,U.Mp)()),configuration:G(G({},i.configuration),l),content:c}),{onCreateCallback:function(e){t&&S.t6.SQL!==t.language&&([S.DA.EXECUTED,S.DA.UPDATED].includes(t.status)?null===s||void 0===s||s({block:e,code:c,disableReset:!0}):null===s||void 0===s||s({block:t,runDownstream:!0}))}})},uuid:e}}))}),[M.CK,t,s]),p=(0,c.useMemo)((function(){return L._H.map((function(e){var o=e.label,r=G(G({},(0,e.widgetTemplate)({block:t})),{},{language:t.language,type:S.tf.CHART,upstream_blocks:t?[t.uuid]:null});return{label:o,onClick:function(){return n(r,{onCreateCallback:function(e){t&&S.t6.SQL!==t.language&&([S.DA.EXECUTED,S.DA.UPDATED].includes(t.status)?null===s||void 0===s||s({block:e,code:e.content,disableReset:!0}):null===s||void 0===s||s({block:t,runDownstream:!0}))}})},uuid:o()}}))}),[L._H,n,t,s]),m=[{isGroupingTitle:!0,label:function(){return"Custom charts"},uuid:"custom_charts"}].concat((0,o.Z)(f));return S.t6.SQL!==t.language&&m.push.apply(m,[{isGroupingTitle:!0,label:function(){return"Templates"},uuid:"chart_templates"}].concat((0,o.Z)(p))),(0,j.jsx)(N.Z,{items:m,left:r,onClickCallback:u,open:l,parentRef:a,rightOffset:i,topOffset:d,uuid:"CommandButtons/add_charts",width:25*B.iI})},z=t(50724),Q=t(63403),K=a.default.svg.withConfig({displayName:"Convert__SVGStyle",componentId:"sc-fmw0vr-0"})([""]),Y=function(e){var n=e.fill,t=e.opacity,o=e.size,r=void 0===o?Q.C:o,i=e.style,u=e.viewBox,l=void 0===u?"0 0 12 12":u;return(0,j.jsxs)(K,{fill:n,height:r,opacity:t,style:i,viewBox:l,width:r,children:[(0,j.jsx)("path",{clipRule:"evenodd",d:"M2.5 1C1.67157 1 1 1.67157 1 2.5v.0625c0 .27614-.223858.5-.5.5s-.5-.22386-.5-.5V2.5C0 1.11929 1.11929 0 2.5 0h7C10.8807 0 12 1.11929 12 2.5v7c0 1.3807-1.1193 2.5-2.5 2.5h-7C1.11929 12 0 10.8807 0 9.5v-.0625c0-.27614.223858-.5.5-.5s.5.22386.5.5V9.5c0 .8284.67157 1.5 1.5 1.5h7c.8284 0 1.5-.6716 1.5-1.5v-7c0-.82843-.6716-1.5-1.5-1.5h-7z",fill:"url(#paint0_linear_1332_60037)",fillRule:"evenodd"}),(0,j.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.05806 3.55806c.24408-.24408.6398-.24408.88388 0l2 2c.24408.24408.24408.6398 0 .88388l-2 2c-.24408.24408-.6398.24408-.88388 0-.24408-.24408-.24408-.6398 0-.88388l.93306-.93306H1C.654822 6.625.375 6.34518.375 6s.279822-.625.625-.625h5.99112l-.93306-.93306c-.24408-.24408-.24408-.6398 0-.88388z",fill:"#fff"}),(0,j.jsx)("defs",{children:(0,j.jsxs)("linearGradient",{id:"paint0_linear_1332_60037",x1:"-.618557",y1:"-.000001",x2:"10.5709",y2:".83113",gradientUnits:"userSpaceOnUse",children:[(0,j.jsx)("stop",{stopColor:"#FFCC19"}),(0,j.jsx)("stop",{offset:".585938",stopColor:"#2ECDF7"}),(0,j.jsx)("stop",{offset:"1",stopColor:"#9E7BFF"})]})})]})},W=t(46732),q=t(49130),V=t(7267),X=t(48670),J=t(65956),$=t(4190),ee=t(12468),ne=t(35686),te=t(44897),oe=t(48339),re=t(72473),ie=t(41429),ue=t(39643),le=t(57653),ce=t(61709),ae=t(58325),se=t(72619),de=t(23780);function fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fe(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var me=function(e){var n=e.addNewBlock,t=e.addWidget,o=e.block,i=e.blockContent,u=e.blocks,l=e.deleteBlock,s=e.executionState,d=e.fetchFileTree,p=e.fetchPipeline,m=e.hideExtraButtons,O=e.interruptKernel,C=e.isEditingBlock,_=e.openSidekickView,y=e.pipeline,k=e.project,T=e.runBlock,I=e.setBlockContent,P=e.setIsEditingBlock,A=e.savePipelineContent,w=e.setErrors,D=e.setOutputCollapsed,M=e.showConfigureProjectModal,L=(0,de.VI)(null,{},[],{uuid:"CommandButtons/".concat(null===o||void 0===o?void 0:o.uuid)}),U=(0,r.Z)(L,1)[0],F=o.all_upstream_blocks_executed,G=void 0===F||F,Q=o.color,K=o.language,fe=(o.metadata,o.type),me=o.uuid,ve=(0,c.useRef)(null),he=(0,c.useRef)(null),be=(0,c.useRef)(null),ge=(0,c.useRef)(null),xe=(0,c.useRef)(null),je=null===y||void 0===y?void 0:y.type,Oe=(0,c.useState)(!1),Ce=Oe[0],_e=Oe[1],Ze=(0,c.useState)(!1),Ee=Ze[0],ye=Ze[1],ke=(0,c.useState)(!1),Te=ke[0],Ie=ke[1],Se=(0,c.useState)(!1),Pe=Se[0],Ae=Se[1],Re=(0,c.useState)(!1),we=Re[0],De=Re[1],Ne=(0,c.useContext)(a.ThemeContext),Me=oe.uF.IDLE!==s,Le=(0,x.qn)(fe,{blockColor:Q,theme:Ne}).accent,Be=(0,c.useMemo)((function(){return je===le.qL.STREAMING}),[je]),Ue=(0,c.useMemo)((function(){return je===le.qL.INTEGRATION}),[je]),Fe=(0,c.useMemo)((function(){return(0,ce.Ts)(o,u,"CommandButtons",n).map((function(e){return pe(pe({},e),{},{onClick:function(){return A().then((function(){return e.onClick()}))}})}))}),[n,o,u,A]),Ge=(0,c.useMemo)((function(){return(0,E.HK)(u,(function(e){return e.uuid}))}),[u]),He=(0,c.useMemo)((function(){return S.tf.DBT===(null===o||void 0===o?void 0:o.type)}),[o]),ze=(0,c.useMemo)((function(){return S.tf.MARKDOWN===(null===o||void 0===o?void 0:o.type)}),[o]),Qe=(0,f.Db)(ne.ZP.pipelines.useUpdate(null===y||void 0===y?void 0:y.uuid),{onSuccess:function(e){return(0,se.wD)(e,{callback:function(){p()},onErrorCallback:function(e,n){return w({errors:n,response:e})}})}}),Ke=(0,r.Z)(Qe,2),Ye=Ke[0],We=Ke[1].isLoading,qe=(0,f.Db)(ne.ZP.llms.useCreate(),{onSuccess:function(e){return(0,se.wD)(e,{callback:function(e){var n=e.llm;null!==n&&void 0!==n&&n.response&&I&&(null===I||void 0===I||I(null===n||void 0===n?void 0:n.response))},onErrorCallback:function(e,n){return U({errors:n,response:e})}})}}),Ve=(0,r.Z)(qe,2),Xe=Ve[0],Je=(Ve[1].isLoading,(0,c.useMemo)((function(){var e=!(null!==k&&void 0!==k&&k.openai_api_key),n=function(e){null===M||void 0===M||M({header:(0,j.jsx)(b.Z,{mb:B.HN,children:(0,j.jsxs)(J.Z,{children:[(0,j.jsx)(g.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate blocks using AI."}),(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(g.ZP,{warning:!0,children:["Read ",(0,j.jsx)(X.Z,{href:"https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key",openNewWindow:!0,children:"OpenAI\u2019s documentation"})," to get your API key."]})})]})}),onSaveSuccess:function(n){null!==n&&void 0!==n&&n.openai_api_key&&Ye({pipeline:{llm:e}})}})},t={request:{block_uuid:null===o||void 0===o?void 0:o.uuid,pipeline_uuid:null===y||void 0===y?void 0:y.uuid}};return[{label:function(){return"Document block (beta)"},onClick:function(){t.use_case=V.z.GENERATE_DOC_FOR_BLOCK,e?n(t):Ye({pipeline:{llm:t}})},uuid:"Document block"},{label:function(){return"Document pipeline and all blocks (beta)"},onClick:function(){t.use_case=V.z.GENERATE_DOC_FOR_PIPELINE,e?n(t):Ye({pipeline:{llm:t}})},uuid:"Document pipeline and all blocks"},{label:function(){return"Add comments in code (beta)"},onClick:function(){e?n(t):Xe({llm:{request:{block_code:i},use_case:V.z.GENERATE_COMMENT_FOR_CODE}})},uuid:"Add comments in code"}]}),[o,i,Xe,y,k,M,Ye]));return(0,j.jsxs)(h.ZP,{alignItems:"center",children:[oe.uF.QUEUED===s&&(0,j.jsx)($.Z,{color:(Ne||te.Z).content.active,type:"cylon"}),oe.uF.BUSY===s&&(0,j.jsx)($.Z,{color:(Ne||te.Z).content.active}),T&&!Me&&!Be&&(0,j.jsxs)(j.Fragment,{children:[!He&&(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsxs)(g.ZP,{children:["Run block \xa0 \xa0",(0,j.jsx)(q.Z,{inline:!0,keyTextGroups:[[(0,ae.V5)()?ue.RJ:ue.hE,ue.Lz]],monospace:!0,uuidForKey:me})]}),size:3*B.iI,widthFitContent:!0,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){G?T({block:o}):Ie(!0)},children:(0,j.jsx)(R.Z,{color:Le,size:3*B.iI,children:(0,j.jsx)(re.Py,{black:!0,size:1.5*B.iI})})})}),He&&(0,j.jsx)(v.Z,{backgroundColor:Le,beforeIcon:(0,j.jsx)(re.Py,{size:1.5*B.iI}),compact:!0,onClick:function(){G?T({block:o}):Ie(!0)},small:!0,children:K===S.t6.YAML?"Run command":"Compile & preview"}),(0,j.jsx)(z.Z,{disableEscape:!0,onClickOutside:function(){return Ie(!1)},open:Te,children:(0,j.jsx)(N.Z,{items:[{label:function(){return"Execute block"},onClick:function(){return T({block:o})},uuid:"execute_block"},{label:function(){return"Execute with upstream blocks"},onClick:function(){return T({block:o,runUpstream:!0})},uuid:"execute_upstream"}],onClickCallback:function(){return Ie(!1)},open:Te,parentRef:be,rightOffset:13.25*B.iI,topOffset:4.5*B.iI,uuid:"execute_actions",width:25*B.iI})})]}),Me&&(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsxs)(g.ZP,{children:["Interrupt kernel \xa0 \xa0",(0,j.jsx)(q.Z,{inline:!0,keyTextGroups:[[ue.kA],[ue.kA]],monospace:!0,uuidForKey:me})]}),size:ie.C,widthFitContent:!0,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return O()},children:(0,j.jsx)(R.Z,{borderSize:1.5,size:ie.C,children:(0,j.jsx)(re.x8,{size:1*B.iI})})})})}),!m&&S.tf.SCRATCHPAD===o.type&&!Be&&(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(W.Z,{items:Fe,onClickCallback:function(){return ye(!1)},onClickOutside:function(){return ye(!1)},open:Ee,parentRef:he,rightOffset:0,topOffset:4,uuid:"CommandButtons/convert_block",children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsx)(g.ZP,{children:"Convert block"}),size:ie.C,widthFitContent:!0,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return ye(!Ee)},ref:he,children:(0,j.jsx)(Y,{size:ie.C})})})})}),!m&&[S.tf.DATA_LOADER,S.tf.TRANSFORMER].includes(o.type)&&!Be&&!Ue&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{ml:B.cd,ref:ve,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:"Add chart",size:2.25*B.iI,widthFitContent:!0,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return _e((function(e){return!e}))},children:(0,j.jsx)(re.GQ,{size:2.25*B.iI})})})}),t&&(0,j.jsx)(z.Z,{disableEscape:!0,onClickOutside:function(){return _e(!1)},open:Ce,children:(0,j.jsx)(H,{addWidget:t,block:o,onClickCallback:function(){return _e(!1)},open:Ce,parentRef:ve,rightOffset:9*B.iI,runBlock:T,topOffset:2*B.iI})})]}),!m&&ze&&(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:C?"Close editor":"Edit",size:ie.C,widthFitContent:!0,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return P((function(e){return!e}))},children:C?(0,j.jsx)(re.Jr,{size:ie.C,success:!0}):(0,j.jsx)(re.I8,{size:ie.C})})})}),!m&&S.tf.GLOBAL_DATA_PRODUCT!==(null===o||void 0===o?void 0:o.type)&&(0,j.jsx)("div",{ref:xe,children:(0,j.jsxs)(b.Z,{ml:B.cd,children:[We&&(0,j.jsx)($.Z,{inverted:!0,small:!0}),!We&&(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsx)(g.ZP,{children:"AI actions"}),size:ie.C,widthFitContent:!0,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return De((function(e){return!e}))},children:(0,j.jsx)(re.xq,{default:!0,size:ie.C})})})]})}),!m&&(0,j.jsx)(z.Z,{disableEscape:!0,onClickOutside:function(){return De(!1)},open:we,children:(0,j.jsx)(N.Z,{items:Je,onClickCallback:function(){return De(!1)},open:we,parentRef:xe,rightOffset:4.75*B.iI,topOffset:2*B.iI,uuid:"FileHeaderMenu/AI_actions"})}),!m&&(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:"View and edit settings for this block",size:ie.C,widthFitContent:!0,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return null===_||void 0===_?void 0:_(Z.cH.BLOCK_SETTINGS)},children:(0,j.jsx)(re.JG,{default:!0,size:ie.C})})})}),!m&&(0,j.jsx)("div",{ref:ge,children:(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsx)(g.ZP,{children:"More actions"}),size:ie.C,widthFitContent:!0,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return Ae((function(e){return!e}))},children:(0,j.jsx)(R.Z,{borderSize:1.5,default:!0,size:ie.C,children:(0,j.jsx)(re.mH,{default:!0,size:B.iI})})})})})}),!m&&(0,j.jsx)(z.Z,{disableEscape:!0,onClickOutside:function(){return Ae(!1)},open:Pe,children:(0,j.jsx)(N.Z,{items:(0,ce.J8)(o,T,l,D,Be||Ue,{addNewBlock:n,blocksMapping:Ge,fetchFileTree:d,fetchPipeline:p,openSidekickView:_,project:k,savePipelineContent:A,updatePipeline:Ye}),onClickCallback:function(){return Ae(!1)},open:Pe,parentRef:ge,rightOffset:4.75*B.iI,topOffset:2*B.iI,uuid:"FileHeaderMenu/file_items"})})]})},ve=t(15338),he=t(85854),be=t(99236),ge=t(75499),xe=t(69632),je=t(37443),Oe=t(53405);function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ce(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ze,Ee=function(e){var n=e.block,t=e.blockContent,o=e.blocksMapping,r=e.codeEditor,i=e.callbackEl,u=e.onChangeBlock,l=(e.openSidekickView,e.showDataIntegrationModal),a=(n.catalog,n.language),s=n.metadata,d=n.type,f=n.upstream_blocks,p=n.uuid,m=((null===s||void 0===s?void 0:s.data_integration)||{}).name,O=(0,c.useMemo)((function(){return(0,Oe.Uc)(n,{getAll:!0})}),[n]),_=(0,c.useMemo)((function(){return null===O||void 0===O?void 0:O.filter(Oe.Z5)}),[O]),Z=(0,c.useMemo)((function(){return(null===O||void 0===O?void 0:O.length)||0}),[O]),y=(0,c.useMemo)((function(){return(null===_||void 0===_?void 0:_.length)||0}),[_]),k=S.tf.DATA_LOADER===d,T=k?"source":"destination",I=(0,c.useMemo)((function(){var e=[1,1,1,null],o=[{uuid:"Stream"},{center:!0,uuid:"Columns"},{center:!0,uuid:"Sync method"},{uuid:"Parallel"}];return k||(e=(0,E.Hk)(1,1,e),o=(0,E.Hk)({uuid:"Table name"},1,o)),(0,j.jsx)(ge.Z,{columnFlex:e,columns:o,rows:null===_||void 0===_?void 0:_.map((function(e){var o,r,i,c=e||{},s=c.destination_table,d=c.replication_method,f=c.run_in_parallel,p=(c.tap_stream_id,(0,Oe.M$)(e)),m=(0,Oe.Qu)(e),v=(0,Oe.WD)(e),b=(0,Oe.JN)(e),x=b.allColumns,O=b.selectedColumns,C=(null===(o=Object.keys(x||[]))||void 0===o?void 0:o.length)||0,_=(null===(r=Object.keys(O||[]))||void 0===r?void 0:r.length)||0,Z=S.t6.YAML===a&&!_,y=(0,j.jsxs)(X.Z,{danger:Z,monospace:!0,onClick:function(){return l({block:_e(_e({},n),{},{content:t}),defaultMainNavigationTab:p,defaultMainNavigationTabSub:m,defaultSubTab:Z?je.tw.SETTINGS:je.tw.OVERVIEW,onChangeBlock:u})},preventDefault:!0,sameColorAsText:!Z,children:[p," ",Z&&(0,j.jsx)(g.ZP,{inline:!0,default:!0,monospace:!0,children:"will fail if no columns selected"})]},"".concat(v,"-stream"));i=_>=1||S.t6.PYTHON===a?(0,j.jsxs)(g.ZP,{center:!0,default:!0,monospace:!0,children:[_," ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",C]}):(0,j.jsx)(g.ZP,{center:!0,danger:!0,children:"No columns selected"});var T=[y,(0,j.jsx)(X.Z,{danger:Z,monospace:!0,onClick:function(){return l({block:_e(_e({},n),{},{content:t}),defaultMainNavigationTab:p,defaultMainNavigationTabSub:m,defaultSubTab:je.tw.SETTINGS,onChangeBlock:u})},preventDefault:!0,sameColorAsText:!Z,children:i},"".concat(v,"-columns")),(0,j.jsx)(g.ZP,{center:!0,default:!0,children:d&&(0,U.vg)(d)},"".concat(v,"-replicationMethod")),(0,j.jsx)(h.ZP,{justifyContent:"flex-end",children:f?(0,j.jsx)(re.Jr,{size:2*B.iI,success:!0}):(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:"-"})},"".concat(v,"-runInParallel"))];return k||(T=(0,E.Hk)((0,j.jsx)(g.ZP,{default:!0,monospace:!0,children:s||p},"".concat(v,"-tableName")),1,T)),T}))})}),[n,a,k,l,_]),P=(0,c.useMemo)((function(){var e,t;return(0,Oe.Wi)(null===n||void 0===n||null===(e=n.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null===o||void 0===o?void 0:o[e]})),null===n||void 0===n||null===(t=n.configuration)||void 0===t?void 0:t.data_integration)}),[n,o]);return(0,j.jsxs)(j.Fragment,{children:[S.t6.YAML===a&&(0,j.jsxs)(xe.au,{children:[(0,j.jsx)(ve.Z,{light:!0}),(0,j.jsx)(b.Z,{p:B.cd,children:(0,j.jsxs)(h.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,j.jsxs)(C.Z,{flex:1,flexDirection:"column",children:[(0,j.jsx)(g.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,uppercase:!0,children:T}),(0,j.jsx)(he.Z,{default:!0,children:m})]}),(0,j.jsxs)(v.Z,{compact:!0,onClick:function(){return l({block:_e(_e({},n),{},{content:t}),defaultMainNavigationTab:je.uK.CONFIGURATION,onChangeBlock:u})},secondary:!0,children:["Configure ",T]})]})}),(0,j.jsx)(ve.Z,{light:!0})]}),S.t6.PYTHON===a&&(0,j.jsxs)(xe.au,{children:[(0,j.jsx)(ve.Z,{light:!0}),(0,j.jsx)(b.Z,{p:B.cd,children:(0,j.jsxs)(h.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,j.jsxs)(C.Z,{flex:1,flexDirection:"column",children:[(0,j.jsx)(g.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,uppercase:!0,children:T}),(0,j.jsx)(he.Z,{default:!0,children:m})]}),(0,j.jsxs)(v.Z,{compact:!0,onClick:function(){return l({block:_e(_e({},n),{},{content:t}),defaultMainNavigationTab:je.uK.CONFIGURATION,onChangeBlock:u})},secondary:!0,children:["Configure ",T," documentation"]})]})}),(0,j.jsx)(ve.Z,{light:!0}),(null===f||void 0===f?void 0:f.length)>=1&&(0,j.jsx)(b.Z,{p:B.cd,children:(0,j.jsxs)(h.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,j.jsxs)(C.Z,{flex:4,flexDirection:"column",children:[(0,j.jsx)(g.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,uppercase:!0,children:"Inputs"}),(0,j.jsxs)(b.Z,{mt:1,children:[(null===P||void 0===P?void 0:P.length)>=1&&(0,j.jsx)(g.ZP,{default:!0,children:"The output of these upstream blocks are used as positional arguments for decorated functions."}),!(null!==P&&void 0!==P&&P.length)&&(0,j.jsxs)(g.ZP,{default:!0,children:["There are currently no positional arguments for decorated functions.",(0,j.jsx)("br",{}),"To use the output of 1 or more upstream blocks as positional arguments for decorated functions, add and configure 1 or more inputs."]})]})]}),(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsx)(C.Z,{flex:1,justifyContent:"flex-end",children:(0,j.jsx)(v.Z,{compact:!0,onClick:function(){return l({block:_e(_e({},n),{},{content:t}),defaultMainNavigationTab:je.uK.CONFIGURATION,defaultSubTab:je.tw.UPSTREAM_BLOCK_SETTINGS,onChangeBlock:u})},secondary:!0,children:(null===P||void 0===P?void 0:P.length)>=1?"Configure inputs":"Add inputs"})})]})}),(null===P||void 0===P?void 0:P.length)>=1&&(0,j.jsx)(be.Z,{inputsBlocks:P})]}),(0,j.jsxs)(xe.JX,{children:[(0,j.jsx)(b.Z,{p:B.cd,children:(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[y>=1&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(C.Z,{flex:1,flexDirection:"column",children:(0,j.jsxs)(g.ZP,{bold:!0,default:!0,large:!0,children:[y," ",(0,j.jsx)(g.ZP,{bold:!0,inline:!0,monospace:!0,muted:!0,children:"/"})," ",Z," ",(0,U._6)("stream",Z,!1,!0)," selected"]})}),(0,j.jsx)(b.Z,{mr:1})]}),(0,j.jsxs)(v.Z,{beforeIcon:!y&&(0,j.jsx)(re.Zr,{size:2*B.iI}),compact:y>=1,onClick:function(){return l({block:_e(_e({},n),{},{content:t}),defaultMainNavigationTab:je.uK.STREAMS,onChangeBlock:u})},primary:!y,secondary:y>=1,children:[y>=1&&"Edit streams",!y&&"Set up streams"]})]})}),y>=1&&I,y>=1&&(0,j.jsx)(b.Z,{mb:B.cd})]}),S.t6.PYTHON===a&&(0,j.jsxs)(j.Fragment,{children:[y>=1&&(0,j.jsx)(xe.au,{children:(0,j.jsx)(b.Z,{pb:B.cd,px:B.cd,children:(0,j.jsx)(xe.NJ,{children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(C.Z,{children:(0,j.jsx)(re.uy,{size:2*B.iI,warning:!0})}),(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsxs)(g.ZP,{muted:!0,children:["The decorated function ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,default:!0,children:"@selected_streams"})," and ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,default:!0,children:"@catalog"})," will override any stream settings configured for ",(0,j.jsx)(g.ZP,{bold:!0,color:(0,x.qn)(null===n||void 0===n?void 0:n.type,{blockColor:null===n||void 0===n?void 0:n.color}).accent,inline:!0,monospace:!0,children:p}),"."]})]})})})}),(0,j.jsx)(xe.eQ,{children:(0,j.jsx)(b.Z,{pb:B.cd})}),r,i]})]})};!function(e){e.APPEND="append",e.FAIL="fail",e.REPLACE="replace"}(Ze||(Ze={}));var ye,ke=[Ze.APPEND,Ze.FAIL,Ze.REPLACE];!function(e){e.BIGQUERY="bigquery",e.CLICKHOUSE="clickhouse",e.DRUID="druid",e.MYSQL="mysql",e.POSTGRES="postgres",e.REDSHIFT="redshift",e.SNOWFLAKE="snowflake",e.TRINO="trino"}(ye||(ye={}));var Te=t(56747),Ie=t(82359),Se=t(44085),Pe=t(17488),Ae=t(3314);function Re(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function we(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Re(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Re(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var De=function(e){var n=e.block,t=e.blockConfiguration,o=e.blockRefs,r=e.blocks,u=e.updateBlockConfiguration,l=(0,c.useContext)(a.ThemeContext),s=S.t6.R===(null===n||void 0===n?void 0:n.language),d=S.t6.SQL===(null===n||void 0===n?void 0:n.language),f=null===r||void 0===r?void 0:r.find((function(e){var n=e.language;return S.t6.PYTHON===n})),p=(0,c.useMemo)((function(){var e=[null];return d&&f?e.push.apply(e,[null,1]):e.push(1),e}),[f,d]),m=(0,c.useMemo)((function(){var e=[{tooltipMessage:null,uuid:"Variable"},{tooltipMessage:null,uuid:"Block"}];return d&&f&&e.push({tooltipMessage:"Customize the full table name that this block gets created in. Include database, schema, and table name where applicable.",uuid:"Table name"}),e}),[f,d]),v=(0,c.useMemo)((function(){return null===r||void 0===r?void 0:r.map((function(e,n){var r,c=e.color,a=e.language,p=e.type,m=e.uuid,v=(0,x.qn)(p,{blockColor:c,theme:l}).accent,h=S.t6.PYTHON===a;r=d?"{{ df_".concat(n+1," }}"):s?"df".concat(n+1):"data".concat(n>=1?"_".concat(n+1):null);var b=[(0,j.jsx)(g.ZP,{default:!0,monospace:!0,small:!0,children:r},"variable-".concat(m)),(0,j.jsx)(X.Z,{color:v,onClick:function(){var e,n,t=null===o||void 0===o||null===(e=o.current)||void 0===e?void 0:e["".concat(p,"s/").concat(m,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,j.jsx)(g.ZP,{color:v,monospace:!0,small:!0,children:m})},"block-".concat(m))];if(d){var O="table-name-input-".concat(m),C=(null===t||void 0===t?void 0:t[M.Yf])||{},_=(null===C||void 0===C?void 0:C[m])||{};h?b.push((0,j.jsx)(Pe.Z,{borderless:!0,compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;u((0,i.Z)({},M.Yf,we(we({},C),{},(0,i.Z)({},m,we(we({},_),{},(0,i.Z)({},M.aZ,n))))))},onClick:Ae.j,placeholder:"[database_optional].[schema_optional].[table]",small:!0,value:(null===_||void 0===_?void 0:_[M.aZ])||""},O)):f&&b.push((0,j.jsx)(g.ZP,{italic:!0,muted:!0,small:!0,children:"Table name is defined in upstream block."},O))}return b}))}),[f,t,o,r,s,d,l,u]);return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(ge.Z,{columnFlex:p,columns:m,compact:!0,noBorder:!0,rows:v,uuid:"CodeBlock/UpstreamBlockSettings/".concat(null===n||void 0===n?void 0:n.uuid)})})},Ne=t(84820),Me=t(98464),Le=t(84438),Be=t(89678),Ue=t(38399),Fe=t(22286),Ge=t(37529),He=t(53808),ze=t(44375),Qe=t(74052),Ke=t(42041),Ye=t(42122),We=t(44688);function qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ve(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qe(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xe=1e3;function Je(e,n){var t,u,O,_,y=e.addNewBlock,k=e.addNewBlockMenuOpenIdx,N=e.addWidget,L=e.allBlocks,F=e.allowCodeBlockShortcuts,G=e.autocompleteItems,H=e.block,z=e.blockIdx,Q=e.blockInteractions,K=e.blockRefs,Y=e.blockTemplates,q=e.blocks,V=void 0===q?[]:q,J=e.containerRef,$=e.dataProviders,te=e.defaultValue,ae=void 0===te?"":te,de=e.deleteBlock,fe=e.disableDrag,pe=e.disableShortcuts,he=e.executionState,be=e.extraContent,ge=e.fetchFileTree,xe=e.fetchPipeline,je=e.globalDataProducts,Ce=e.height,_e=e.hideExtraCommandButtons,Re=e.hideExtraConfiguration,we=e.hideHeaderInteractiveInformation,qe=e.hideRunButton,Je=e.interactionsMapping,$e=e.interruptKernel,en=e.mainContainerRef,nn=e.mainContainerWidth,tn=e.messages,on=void 0===tn?[]:tn,rn=e.noDivider,un=e.onCallbackChange,ln=e.onChange,cn=e.onClickAddSingleDBTModel,an=e.onDrop,sn=e.openSidekickView,dn=e.pipeline,fn=e.project,pn=e.runBlock,mn=e.runningBlocks,vn=e.savePipelineContent,hn=e.selected,bn=e.setAddNewBlockMenuOpenIdx,gn=e.setAnyInputFocused,xn=e.setCreatingNewDBTModel,jn=e.setEditingBlock,On=e.setErrors,Cn=e.setOutputBlocks,_n=e.setSelected,Zn=e.setSelectedBlock,En=e.setSelectedOutputBlock,yn=e.setTextareaFocused,kn=e.showBrowseTemplates,Tn=e.showConfigureProjectModal,In=e.showDataIntegrationModal,Sn=e.showGlobalDataProducts,Pn=e.showUpdateBlockModal,An=e.textareaFocused,Rn=e.widgets,wn=(0,c.useContext)(a.ThemeContext),Dn=(0,c.useMemo)((function(){var e;return!(null===fn||void 0===fn||null===(e=fn.features)||void 0===e||!e[Ie.d.INTERACTIONS])}),[null===fn||void 0===fn?void 0:fn.features]),Nn=H||{},Mn=Nn.callback_content,Ln=Nn.configuration,Bn=void 0===Ln?{}:Ln,Un=Nn.color,Fn=Nn.error,Gn=Nn.has_callback,Hn=Nn.language,zn=Nn.name,Qn=Nn.pipelines,Kn=Nn.replicated_block,Yn=Nn.type,Wn=Nn.upstream_blocks,qn=void 0===Wn?[]:Wn,Vn=Nn.uuid,Xn=(0,c.useMemo)((function(){return Bn}),[Bn]),Jn=(0,c.useMemo)((function(){var e;return(null===(e=Object.values(Qn||{}))||void 0===e?void 0:e.length)||1}),[Qn]),$n=(0,c.useMemo)((function(){return null===Xn||void 0===Xn?void 0:Xn.global_data_product}),[Xn]),et=(0,c.useMemo)((function(){return(0,E.HK)(je||[],(function(e){return e.uuid}))}),[je]),nt=(0,c.useState)(!1),tt=nt[0],ot=nt[1],rt=(0,c.useState)(null),it=rt[0],ut=rt[1],lt=(0,c.useState)(!1),ct=lt[0],at=lt[1],st=(0,c.useState)(!1),dt=st[0],ft=st[1],pt=(0,c.useState)(ae),mt=pt[0],vt=pt[1],ht=(0,c.useState)(null),bt=ht[0],gt=ht[1],xt=(0,c.useState)(ie.C4[0].uuid),jt=xt[0],Ot=xt[1],Ct=(0,c.useState)(null),_t=Ct[0],Zt=Ct[1],Et=dn||{},yt=Et.type,kt=Et.uuid,Tt=(0,c.useMemo)((function(){return le.qL.STREAMING===yt}),[yt]),It=S.tf.DBT===Yn,St=S.t6.SQL===Hn,Pt=S.t6.R===Hn,At=S.tf.MARKDOWN===Yn,Rt=(0,c.useMemo)((function(){return(0,Oe.jO)(H,dn)}),[H,dn]),wt=Xn[M.mW];St&&void 0===wt&&(wt=Xe);var Dt=(0,c.useState)(Ve(Ve({},Xn),{},(t={},(0,i.Z)(t,M.cH,Xn[M.cH]),(0,i.Z)(t,M.Sv,Xn[M.Sv]),(0,i.Z)(t,M.sc,Xn[M.sc]),(0,i.Z)(t,M.BD,Xn[M.BD]),(0,i.Z)(t,M.m$,Xn[M.m$]),(0,i.Z)(t,M.Pi,Xn[M.Pi]||{}),(0,i.Z)(t,M.Mv,Xn[M.Mv]),(0,i.Z)(t,M.eW,Xn[M.eW]),(0,i.Z)(t,M.nq,Xn[M.nq]||Ze.APPEND),(0,i.Z)(t,M.mW,wt),(0,i.Z)(t,M.bk,Xn[M.bk]),(0,i.Z)(t,M.Mi,!!Xn[M.Mi]),t))),Nt=Dt[0],Mt=Dt[1],Lt=(0,c.useState)(null),Bt=Lt[0],Ut=Lt[1],Ft=(0,c.useState)(At),Gt=Ft[0],Ht=Ft[1],zt=(0,c.useState)(!1),Qt=zt[0],Kt=zt[1],Yt=(0,c.useState)(0),Wt=Yt[0],qt=Yt[1],Vt=(0,c.useState)(null),Xt=Vt[0],Jt=Vt[1],$t=(0,c.useState)(null),eo=$t[0],no=$t[1],to=(0,c.useState)(on),oo=to[0],ro=to[1],io=(0,c.useState)((0,ie.Xy)(H)[0]),uo=io[0],lo=io[1],co=(0,s.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:H,type:ie.vT}}),[H]),ao=(0,r.Z)(co,2),so=ao[0],fo=ao[1],po=(0,d.L)((function(){return{accept:ie.vT,drop:function(e){return null===an||void 0===an?void 0:an(H,e)}}}),[H]),mo=(0,r.Z)(po,2)[1],vo=(0,c.useMemo)((function(){var e;return(null===H||void 0===H||null===(e=H.metadata)||void 0===e?void 0:e.dbt)||{project:null,projects:{}}}),[H]),ho=(0,c.useMemo)((function(){return vo.projects||{}}),[vo]),bo=(0,c.useMemo)((function(){return vo.project||Nt[M.eW]}),[Nt,vo]),go=(0,c.useMemo)((function(){return ho[bo]||{target:null,targets:[]}}),[bo,ho]),xo=(0,c.useMemo)((function(){return go.targets||[]}),[go]),jo=(0,c.useMemo)((function(){return Nt[M.Mv]}),[Nt]),Oo=bo?null!==go&&void 0!==go&&go.target?(0,E.sE)(xo,(function(e){return e===go.target})):"Select target":"Select project first",Co=(0,c.useState)(jo&&!(null!==xo&&void 0!==xo&&xo.includes(jo))),_o=Co[0],Zo=Co[1],Eo=(0,c.useState)(null),yo=Eo[0],ko=Eo[1];(0,c.useEffect)((function(){Mn!==yo&&ko(Mn)}),[yo,Mn]);var To=(0,Me.Z)(H);(0,c.useEffect)((function(){if(JSON.stringify(H)!=JSON.stringify(To)){var e,n=(0,Qe.Rt)([H]).messages,t=null===n||void 0===n||null===(e=n[Yn])||void 0===e?void 0:e[Vn];(null===t||void 0===t?void 0:t.length)>=1&&ro(t)}}),[H,Yn,Vn,To,ro]);var Io=(0,Me.Z)(on);(0,c.useEffect)((function(){"undefined"!==typeof on&&on.length!==(null===Io||void 0===Io?void 0:Io.length)&&ro(on)}),[on,Io,ro]);var So=(0,c.useMemo)((function(){var e=new Set;return null===$||void 0===$||$.forEach((function(n){var t=n.profiles;e=new Set([].concat((0,o.Z)(e),(0,o.Z)(t)))})),(0,o.Z)(e)}),[$]),Po=(0,c.useMemo)((function(){return"".concat(kt,"/").concat(Vn,"/codeCollapsed")}),[kt,Vn]),Ao=(0,c.useMemo)((function(){return"".concat(kt,"/").concat(Vn,"/outputCollapsed")}),[kt,Vn]);(0,c.useEffect)((function(){ft((0,He.U2)(Po,!1)),Kt((0,He.U2)(Ao,!1))}),[Po,Ao]);var Ro=(0,c.useRef)(null),wo=(0,c.useMemo)((function(){return(0,E.HK)(V,(function(e){return e.uuid}))}),[V]),Do=(0,c.useMemo)((function(){return!(null===Rn||void 0===Rn||!Rn.find((function(e){return e.upstream_blocks.includes(Vn)})))}),[Vn,Rn]),No=(0,c.useCallback)((function(e){var n=e||{},t=n.block,o=n.code,i=n.disableReset,u=n.runDownstream,l=n.runIncompleteUpstream,c=n.runSettings,a=n.runUpstream,s=n.runTests,d=n.variables,f=s;if(null===f||"undefined"===typeof f){var p=(t||{}).type;f=[S.tf.DATA_LOADER,S.tf.DATA_EXPORTER,S.tf.TRANSFORMER].includes(p)}It&&ie.Rj!==uo&&lo(ie.Rj);var m=Ve({},d||_t);(null===Q||void 0===Q?void 0:Q.length)>=1&&(null===Q||void 0===Q||Q.forEach((function(e){var n=e.uuid,t=null===Je||void 0===Je?void 0:Je[n];Object.entries((null===t||void 0===t?void 0:t.variables)||{}).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],o=n[1].types;m&&t in m&&(m[t]=(0,Fe.M)(m[t],o))}))}))),null===pn||void 0===pn||pn({block:t,code:o||mt,runDownstream:u||Do,runIncompleteUpstream:l||!1,runSettings:c,runTests:f||!1,runUpstream:a||!1,variables:m}),i||(qt(1+Number(Wt)),Jt(null),Kt(!1))}),[Q,mt,Do,Je,It,pn,Wt,uo,qt,Jt,lo,_t]),Mo=!(null===mn||void 0===mn||!mn.find((function(e){return e.uuid===Vn})))||(null===oo||void 0===oo?void 0:oo.length)>=1&&he!==oe.uF.IDLE;(0,c.useEffect)((function(){Mo&&no(Number(new Date))}),[Mo,no]);var Lo=(0,Me.Z)(he);(0,c.useEffect)((function(){he===oe.uF.IDLE&&he!==Lo&&Jt(Number(new Date))}),[he,Lo,Jt]);var Bo=(0,c.useCallback)((function(e){var n=e.editorRect.top,t=e.position.lineNumberTop;if(null!==en&&void 0!==en&&en.current){var o=en.current.getBoundingClientRect().height;if(n+t>o){var r=en.current.scrollTop+(t-o+n);en.current.scrollTo(0,r)}else if(t+n<Be.aU){var i=en.current.scrollTop+(t+n-Be.aU);en.current.scrollTo(0,i)}}}),[en]),Uo=(0,c.useMemo)((function(){return(0,ce.h5)(oo,Bt)}),[Bt,oo]),Fo=(0,ce.oI)(Uo),Go=Fo.hasError,Ho=Fo.hasOutput,zo=(0,c.useMemo)((function(){return Ho||(null===oo||void 0===oo?void 0:oo.length)>=1}),[Ho,oo]),Qo=(0,x.qn)(Yn,{blockColor:Un,theme:wn}).accent,Ko=(null===qn||void 0===qn?void 0:qn.length)||0,Yo=(0,Oe.cU)([H],V)[0],Wo=Yo.dynamic,qo=Yo.dynamicUpstreamBlock,Vo=Yo.reduceOutput,Xo=Yo.reduceOutputUpstreamBlock,Jo=(0,c.useMemo)((function(){return(0,ce._o)({block:H,dynamic:Wo,dynamicUpstreamBlock:qo,hasError:Go,reduceOutput:Vo,reduceOutputUpstreamBlock:Xo,selected:hn})}),[H,Wo,qo,Go,Vo,Xo,hn]),$o=Jo.borderColorShareProps,er=Jo.tags,nr=(0,c.useCallback)((function(){hn||(null===gn||void 0===gn||gn(!1),null===_n||void 0===_n||_n(!0))}),[hn,gn,_n]),tr=ne.ZP.blocks.pipelines.detail(kt,ie.gM.uuid===(null===uo||void 0===uo?void 0:uo.uuid)||ie.Jt.uuid===(null===uo||void 0===uo?void 0:uo.uuid)?encodeURIComponent(Vn):null,{_format:"dbt"},{revalidateOnFocus:!0}),or=tr.data,rr=tr.mutate,ir=(0,c.useMemo)((function(){var e;return(null===or||void 0===or||null===(e=or.block)||void 0===e?void 0:e.metadata)||{}}),[or]),ur=(0,f.Db)(ne.ZP.blocks.pipelines.useUpdate(kt,Vn),{onError:function(e){var n=(0,se.qQ)(e).messages;Ut(n)},onSuccess:function(e){return(0,se.wD)(e,{callback:function(e){xe(),ge(),vt(mt),null!==e&&void 0!==e&&e.block&&Zn(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return On({errors:n,response:e})}})}}),lr=(0,r.Z)(ur,1)[0],cr="CodeBlock/".concat(Vn),ar=(0,We.y)(),sr=ar.registerOnKeyDown,dr=ar.unregisterOnKeyDown;(0,c.useEffect)((function(){return function(){dr(cr)}}),[dr,cr]),sr(cr,(function(e,n){pe&&!F||hn&&!qe&&((0,Ke.y)([ue.zX,ue.Uq],n)||(0,Ke.y)([ue.PQ,ue.Uq],n)?No({block:H}):(0,Ke.y)([ue.XR,ue.Uq],n)&&y&&(e.preventDefault(),y({language:Hn,type:Yn,upstream_blocks:[Vn]}),No({block:H})))}),[y,H,qe,No,hn,lr]),(0,c.useEffect)((function(){var e;return eo&&(e=setInterval((function(){return gt(Number(new Date))}),1e3)),bt&&!Mo&&clearInterval(e),function(){return clearInterval(e)}}),[bt,Mo,eo]);var fr=(0,c.useCallback)((function(e){var n,t=(n={},(0,i.Z)(n,S.tf.CUSTOM,Object.values(S.Lq).reduce((function(n,t){return(null===e||void 0===e?void 0:e.color)!==t&&n.push({label:function(){return(0,j.jsx)(C.Z,{alignItems:"center",children:(0,j.jsxs)(g.ZP,{noWrapping:!0,children:["Change color to ",(0,j.jsx)(g.ZP,{color:(0,x.qn)(S.tf.CUSTOM,{blockColor:t}).accent,inline:!0,children:t})]})})},onClick:function(){lr({block:Ve(Ve({},e),{},{color:t})})},uuid:t}),n}),[])),(0,i.Z)(n,S.tf.SCRATCHPAD,(0,o.Z)((0,ce.Ts)(e,V,"block_menu/scratchpad",y)).map((function(e){return Ve(Ve({},e),{},{onClick:function(){return vn().then((function(){return e.onClick()}))}})}))),n);return t[e.type]}),[y,V,vn,lr]),pr=(0,c.useMemo)((function(){return Kn&&(null===wo||void 0===wo?void 0:wo[Kn])}),[wo,Kn]),mr=(0,c.useMemo)((function(){if(Kn&&!Rt)return null;if(S.tf.GLOBAL_DATA_PRODUCT===Yn){var e=null===et||void 0===et?void 0:et[null===$n||void 0===$n?void 0:$n.uuid];return(0,j.jsxs)(x.y9,{children:[(0,j.jsxs)(b.Z,{mb:B.cd,mt:1,children:[(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"UUID"}),(0,j.jsx)(g.ZP,{monospace:!0,children:null===e||void 0===e?void 0:e.uuid})]}),(0,j.jsxs)(b.Z,{mb:B.cd,children:[(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:(0,U.kC)((null===e||void 0===e?void 0:e.object_type)||"")}),(0,j.jsx)(l(),{as:"/pipelines/".concat(null===e||void 0===e?void 0:e.object_uuid,"/edit"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,j.jsx)(X.Z,{monospace:!0,openNewWindow:!0,children:null===e||void 0===e?void 0:e.object_uuid})})]}),(0,j.jsxs)(b.Z,{mb:1,children:[(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Override global data product settings"}),(0,j.jsx)(X.Z,{monospace:!0,onClick:function(){return sn(Z.cH.BLOCK_SETTINGS)},children:"Customize block settings"})]})]})}var n,t;return Rt&&S.t6.PYTHON!==Hn||(n=(0,j.jsx)(w.Z,{autoHeight:!0,autocompleteProviders:it,block:H,height:Ce,language:Hn,onChange:function(e){vt(e),null===ln||void 0===ln||ln(e)},onDidChangeCursorPosition:Bo,placeholder:S.tf.DBT===Yn&&S.t6.YAML===Hn?"e.g. --select ".concat(bo||"project","/models --exclude ").concat(bo||"project","/models/some_dir"):"Start typing here...",selected:hn,setSelected:_n,setTextareaFocused:yn,shortcuts:qe?[]:[function(e,n){return(0,Ge.Q)(e,(function(){qe||No({block:H,code:n.getValue()})}))}],textareaFocused:An,value:mt,width:"100%"}),t=Gn&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ve.Z,{}),(0,j.jsxs)(b.Z,{mt:1,children:[(0,j.jsxs)(x.y9,{normalPadding:!0,children:[(0,j.jsx)(g.ZP,{small:!0,children:"Callback block: define @on_success or @on_failure callbacks for this block."}),(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:["kwargs",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:" \u2192 "}),"global variables"]})]}),(0,j.jsx)(w.Z,{autoHeight:!0,autocompleteProviders:it,language:"python",onChange:function(e){ko(e),null===un||void 0===un||un(e)},onDidChangeCursorPosition:Bo,placeholder:"Start typing here...",selected:hn,setSelected:_n,setTextareaFocused:yn,textareaFocused:An,value:yo,width:"100%"})]})]})),Rt?(0,j.jsx)(Ee,{block:H,blocksMapping:wo,blockContent:mt,callbackEl:t,codeEditor:n,onChangeBlock:function(e){return lr({block:e})},openSidekickView:sn,savePipelineContent:vn,showDataIntegrationModal:In}):(0,j.jsxs)(j.Fragment,{children:[n,t]})}),[it,H,Hn,Yn,wo,yo,mt,bo,$n,et,Gn,Ce,qe,Rt,un,ln,Bo,sn,Kn,No,hn,vt,_n,yn,An]);(0,c.useEffect)((function(){G&&ut({python:(0,Ne.Z)({autocompleteItems:G,block:H,blocks:V,pipeline:dn})})}),[G,H,V,dn]);var vr=(0,c.useMemo)((function(){return It?(0,j.jsx)(b.Z,{py:1,children:(0,j.jsx)(P.Z,{onClickTab:function(e){lo(e),ie.gM.uuid!==e.uuid&&ie.Jt.uuid!==e.uuid||rr()},selectedTabUUID:null===uo||void 0===uo?void 0:uo.uuid,small:!0,tabs:(0,ie.Xy)(H)})}):null}),[H,rr,It,uo]),hr=(0,c.useMemo)((function(){return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(D.Z,Ve(Ve({},$o),{},{block:H,blockMetadata:ir,buttonTabs:vr,collapsed:Qt,hasOutput:zo,isInProgress:Mo,mainContainerWidth:nn,messages:Uo,messagesAll:oo,openSidekickView:sn,pipeline:dn,runCount:Wt,runEndTime:Xt,runStartTime:eo,selected:hn,selectedTab:uo,setCollapsed:function(e){Kt((function(){return(0,He.t8)(Ao,e),e}))},setErrors:On,setOutputBlocks:Cn,setSelectedOutputBlock:En,setSelectedTab:lo}))})}),[H,ir,$o,vr,zo,Mo,nn,oo,Uo,sn,Qt,Ao,dn,Wt,Xt,eo,hn,uo,On,Cn,Kt,En]),br=(0,c.useCallback)((function(){return at(!1)}),[]),gr=(0,c.useRef)(null),xr=(0,c.useCallback)((function(e){clearTimeout(gr.current),Mt((function(n){return Ve(Ve({},n),e)})),gr.current=setTimeout((function(){var n=Ve(Ve({},Nt),e);("undefined"!==typeof n[M.cH]&&"undefined"!==n[M.sc]||"undefined"!==typeof n[M.Mv]||"undefined"!==typeof n[M.eW]||"undefined"!==typeof n[M.mW])&&vn({block:{configuration:n,uuid:Vn}})}),1e3)}),[Vn,Nt,vn]),jr=Le.zJ.BIGQUERY===Nt[M.cH]||Le.zJ.SNOWFLAKE===Nt[M.cH],Or=(0,c.useMemo)((function(){return(null===V||void 0===V?void 0:V.length)||0}),[V]),Cr=(0,c.useMemo)((function(){return mt?(0,j.jsx)(Te.Z,{children:mt}):(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:"Double-click to edit"})})}),[mt]);(0,c.useEffect)((function(){At&&Gt&&!hn&&Ht(!1)}),[Gt,At,hn]);var _r=(0,c.useMemo)((function(){return(0,j.jsx)(Pe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){gn(!1)}),300)},onChange:function(e){gn(!0),xr((0,i.Z)({},M.mW,+e.target.value)),e.preventDefault()},onClick:Ae.j,onFocus:function(){gn(!0)},small:!0,type:"number",value:Nt[M.mW]||"",width:11*B.iI})}),[Nt,gn,xr]),Zr=(0,c.useMemo)((function(){if(Dn)return null===Q||void 0===Q?void 0:Q.map((function(e,n){return(0,j.jsx)("div",{children:(0,j.jsx)(I.Z,{blockInteraction:e,contained:!0,containerRef:J,containerWidth:nn,interaction:null===Je||void 0===Je?void 0:Je[null===e||void 0===e?void 0:e.uuid],setVariables:Zt,showVariableUUID:!0,variables:_t})},"".concat(null===e||void 0===e?void 0:e.uuid,"-").concat(n))}))}),[Q,J,Je,Dn,nn,Zt,_t]),Er=(0,c.useMemo)((function(){return Dn&&null!==Q&&void 0!==Q&&Q.length?(0,j.jsx)(x.HS,{children:(0,j.jsx)(b.Z,{px:B.cd,children:(0,j.jsx)(P.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return Ot(n)},selectedTabUUID:jt,tabs:ie.C4,underlineColor:(0,x.qn)(null===H||void 0===H?void 0:H.type,{blockColor:null===H||void 0===H?void 0:H.color,theme:wn}).accent,underlineStyle:!0})})}):null}),[H,Q,Dn,jt,Ot,wn]),yr=(0,c.useMemo)((function(){if(!Dn)return null;var e=[],n={};if(null===Q||void 0===Q||Q.forEach((function(t){var o=t.uuid,r=null===Je||void 0===Je?void 0:Je[o],i=null===r||void 0===r?void 0:r.variables;Object.keys(i||{}).forEach((function(t){null!==n&&void 0!==n&&n[t]||(e.push(t),n[t]=!0)}))})),null===e||void 0===e||!e.length)return null;var t=(null===e||void 0===e?void 0:e.length)||0;return(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Interaction variables:"}),(0,j.jsx)(b.Z,{mr:B.cd}),null===e||void 0===e?void 0:e.map((function(e,n){return(0,j.jsx)(b.Z,{mr:1,children:(0,j.jsxs)(g.ZP,{default:!0,monospace:!0,small:!0,children:[e,t>=2&&n<t-1&&(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:","})]})},e)}))]})}),[Q,Je,Dn]);return(0,j.jsx)("div",{ref:mo,children:(0,j.jsxs)("div",{ref:n,style:{position:"relative",zIndex:z===k?Or+9:null},children:[(0,j.jsxs)("div",{style:{position:"relative"},children:[(0,j.jsx)(x.nz,Ve(Ve({},Ve(Ve({},$o),so)),{},{onClick:function(){return nr()},ref:fe?null:fo,zIndex:Or+1-(z||0),children:(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,j.jsxs)(C.Z,{alignItems:"center",flex:1,children:[(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(m.Z,{monospace:!0,children:S.tf.GLOBAL_DATA_PRODUCT===(null===H||void 0===H?void 0:H.type)?"GDP":S.dO[Hn]}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(R.Z,{color:Qo,size:1.5*B.iI,square:!0}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(W.Z,{items:fr(H),onClickCallback:br,onClickOutside:br,open:ct,parentRef:Ro,uuid:"CodeBlock/block_menu",children:(0,j.jsx)(g.ZP,{color:Qo,monospace:!0,noWrapping:!0,children:null===(u=It?S.tf.DBT:S.V4[Yn])||void 0===u?void 0:u.toUpperCase()})}),!we&&[S.tf.CUSTOM,S.tf.SCRATCHPAD].includes(Yn)&&(0,j.jsxs)(j.Fragment,{children:["\xa0",(0,j.jsx)(v.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return at(!0)},transparent:!0,children:(0,j.jsx)(re.K5,{muted:!0})})]})]}),!we&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsx)(re.iU,{size:1.5*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsxs)(h.ZP,{alignItems:"center",children:[It&&S.t6.YAML!==Hn&&(0,j.jsx)(ee.Z,{block:!0,label:(0,ze.$1)(H,{fullPath:!0}),size:null,children:(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:(0,ze.$1)(H)})}),(!It||S.t6.YAML===Hn)&&(0,j.jsx)(X.Z,{default:!0,monospace:!0,noWrapping:!0,onClick:function(){return Pn(H,zn)},preventDefault:!0,sameColorAsText:!0,children:Vn})]}),(0,j.jsx)(b.Z,{mr:2}),!S.iZ.includes(Yn)&&nn>800&&(0,j.jsx)(ee.Z,{appearBefore:!0,block:!0,label:"\n ".concat((0,U._6)("parent block",Ko),". ").concat(0===Ko?"Click to select 1 or more blocks to depend on.":"Edit parent blocks.","\n "),size:null,widthFitContent:Ko>=1,children:(0,j.jsx)(v.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){_n(!0),jn({upstreamBlocks:{block:H,values:null===qn||void 0===qn?void 0:qn.map((function(e){return{uuid:e}}))}})},children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[0===Ko&&(0,j.jsx)(re.Jj,{size:3*B.iI}),Ko>=1&&(0,j.jsx)(re.eV,{size:3*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsxs)(g.ZP,{default:!0,monospace:Ko>=1,noWrapping:!0,small:!0,underline:0===Ko,children:[0===Ko&&"Edit parents",Ko>=1&&(0,U._6)("parent",Ko)]})]})})}),Jn>=2&&nn>725&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{ml:2}),(0,j.jsx)(ee.Z,{block:!0,label:"This block is used in ".concat(Jn," pipelines."),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(re.BG,{size:14}),(0,j.jsx)(b.Z,{ml:1}),(0,j.jsxs)(X.Z,{default:!0,monospace:!0,noWrapping:!0,onClick:function(){return sn(Z.cH.BLOCK_SETTINGS)},preventDefault:!0,small:!0,children:[Jn," pipelines"]})]})})]})]})]}),pn&&(0,j.jsx)(me,{addNewBlock:y,addWidget:N,block:H,blockContent:mt,blocks:V,deleteBlock:de,executionState:he,fetchFileTree:ge,fetchPipeline:xe,hideExtraButtons:_e,interruptKernel:$e,isEditingBlock:Gt,openSidekickView:sn,pipeline:dn,project:fn,runBlock:qe?null:No,savePipelineContent:vn,setBlockContent:function(e){vt(e),null===ln||void 0===ln||ln(e)},setErrors:On,setIsEditingBlock:Ht,setOutputCollapsed:Kt,showConfigureProjectModal:Tn}),!_e&&(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(v.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){ft((function(e){return(0,He.t8)(Po,!e),!e})),dt||Kt((function(){return(0,He.t8)(Ao,!0),!0}))},transparent:!0,children:dt?(0,j.jsx)(re._M,{muted:!0,size:2*B.iI}):(0,j.jsx)(re.Kh,{muted:!0,size:2*B.iI})})})]})})),(0,j.jsxs)(x.Nk,{onClick:function(){return nr()},children:[(0,j.jsxs)(x.jv,Ve(Ve({},$o),{},{className:hn&&An?"selected":null,hasOutput:!!vr||zo,lightBackground:At&&!Gt,noPadding:!0,onClick:nr,onDoubleClick:function(){At&&!Gt&&Ht(!0)},children:[(0,j.jsx)(x.PB,{}),!Re&&S.tf.DBT===Yn&&!dt&&(0,j.jsxs)(x.y9,{normalPadding:!0,children:[(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,j.jsxs)(C.Z,{alignItems:"center",children:[S.t6.YAML===Hn&&(0,j.jsx)(Se.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){gn(!1)}),300)},onChange:function(e){var n;xr((n={},(0,i.Z)(n,M.Mv,""),(0,i.Z)(n,M.eW,e.target.value),n)),e.preventDefault()},onClick:Ae.j,onFocus:function(){gn(!0)},placeholder:"Project",small:!0,value:Nt[M.eW]||"",children:Object.keys(ho||{}).map((function(e){return(0,j.jsx)("option",{value:e,children:e},e)}))}),S.t6.YAML!==Hn&&(0,j.jsx)(g.ZP,{monospace:!0,small:!0,children:bo}),(0,j.jsx)(b.Z,{mr:2}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Target"}),(0,j.jsx)("span",{children:"\xa0"}),!_o&&(0,j.jsx)(Se.Z,{compact:!0,disabled:!bo,monospace:!0,onBlur:function(){return setTimeout((function(){gn(!1)}),300)},onChange:function(e){xr((0,i.Z)({},M.Mv,e.target.value)),e.preventDefault()},onClick:Ae.j,onFocus:function(){gn(!0)},placeholder:Oo,small:!0,value:jo||"",children:null===xo||void 0===xo?void 0:xo.map((function(e){return(0,j.jsx)("option",{value:e,children:e},e)}))}),_o&&(0,j.jsx)(Pe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){gn(!1)}),300)},onChange:function(e){xr((0,i.Z)({},M.Mv,e.target.value)),e.preventDefault()},onClick:Ae.j,onFocus:function(){gn(!0)},placeholder:bo?(null===go||void 0===go?void 0:go.target)||"Enter target":"Select project first",small:!0,value:jo||"",width:21*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["Manually type the name of the target you want to use in the profile.",(0,j.jsx)("br",{}),"Interpolate environment variables and global variables using the following syntax:",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:"{{ env_var('NAME') }}"})," or ",(0,j.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:"{{ variables('NAME') }}"})]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(A.Z,{checked:_o,label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Manually enter target"}),onClick:function(e){(0,Ae.j)(e),Zo(!_o),_o&&xr((0,i.Z)({},M.Mv,null))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(re.kI,{muted:!0})]})})})]}),S.t6.YAML!==Hn&&!(null!==vo&&void 0!==vo&&null!==(O=vo.block)&&void 0!==O&&O.snapshot)&&(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(ee.Z,{appearBefore:!0,block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["Limit the number of results that are returned",(0,j.jsx)("br",{}),"when running this block in the notebook.",(0,j.jsx)("br",{}),"This limit won\u2019t affect the number of results",(0,j.jsx)("br",{}),"returned when running the pipeline end-to-end."]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(re.kI,{muted:!0}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Sample limit"}),(0,j.jsx)("span",{children:"\xa0"})]})}),_r,(0,j.jsx)(b.Z,{mr:1})]})]}),S.t6.YAML===Hn&&(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsxs)(C.Z,{alignItems:"center",flex:1,children:[(0,j.jsx)(g.ZP,{default:!0,monospace:!0,small:!0,children:"dbt"}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(Pe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){gn(!1)}),300)},onChange:function(e){xr((0,i.Z)({},M.Pi,Ve(Ve({},null===Nt||void 0===Nt?void 0:Nt[M.Pi]),{},(0,i.Z)({},M.pA,e.target.value)))),e.preventDefault()},onClick:Ae.j,onFocus:function(){gn(!0)},placeholder:"command",small:!0,value:(null===Nt||void 0===Nt||null===(_=Nt[M.Pi])||void 0===_?void 0:_[M.pA])||"",width:10*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(g.ZP,{monospace:!0,small:!0,children:"[type your --select and --exclude syntax below]"}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:["(paths start from ",(null===Nt||void 0===Nt?void 0:Nt[M.eW])||"project"," folder)"]})]}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:(0,j.jsx)(X.Z,{href:"https://docs.getdbt.com/reference/node-selection/syntax#examples",openNewWindow:!0,small:!0,children:"Examples"})}),(0,j.jsx)(b.Z,{mr:1})]})})]}),!Re&&St&&!dt&&S.tf.DBT!==Yn&&(0,j.jsx)(x.y9,{normalPadding:!0,children:(0,j.jsxs)(h.ZP,{flexWrap:"wrap",style:{marginTop:"-8px"},children:[(0,j.jsxs)(h.ZP,{style:{marginTop:"8px"},children:[(0,j.jsx)(Se.Z,{compact:!0,label:"Connection",onChange:function(e){return xr((0,i.Z)({},M.cH,e.target.value))},onClick:Ae.j,small:!0,value:Nt[M.cH],children:null===$||void 0===$?void 0:$.map((function(e){var n=e.id,t=e.value;return(0,j.jsx)("option",{value:t,children:n},n)}))}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(Se.Z,{compact:!0,label:"Profile",onChange:function(e){return xr((0,i.Z)({},M.sc,e.target.value))},onClick:Ae.j,small:!0,value:Nt[M.sc],children:null===So||void 0===So?void 0:So.map((function(e){return(0,j.jsx)("option",{value:e,children:e},e)}))}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["If checked, you\u2019ll have to write your own custom",(0,j.jsx)("br",{}),"CREATE TABLE commands and INSERT commands.",(0,j.jsx)("br",{}),"Separate your commands using a semi-colon: ",(0,j.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:";"})]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(A.Z,{checked:Nt[M.Mi],label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Use raw SQL"}),onClick:function(e){(0,Ae.j)(e),xr((0,i.Z)({},M.Mi,!Nt[M.Mi]))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(re.kI,{muted:!0})]})})}),!Nt[M.Mi]&&(0,j.jsxs)(j.Fragment,{children:[jr&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(Pe.Z,{compact:!0,label:"Database",monospace:!0,onBlur:function(){return setTimeout((function(){gn(!1)}),300)},onChange:function(e){xr((0,i.Z)({},M.Sv,e.target.value)),e.preventDefault()},onClick:Ae.j,onFocus:function(){gn(!0)},small:!0,value:Nt[M.Sv],width:10*B.iI})})]}),(0,j.jsx)(b.Z,{mr:1}),![ye.CLICKHOUSE,ye.MYSQL].includes(Nt[M.cH])&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["Schema that is used when creating a table and inserting values.",(0,j.jsx)("br",{}),"This field is required."]}),size:null,widthFitContent:!0,children:(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(Pe.Z,{compact:!0,label:"Schema",monospace:!0,onBlur:function(){return setTimeout((function(){gn(!1)}),300)},onChange:function(e){xr((0,i.Z)({},M.BD,e.target.value)),e.preventDefault()},onClick:Ae.j,onFocus:function(){gn(!0)},small:!0,value:Nt[M.BD],width:10*B.iI})})}),(0,j.jsx)(b.Z,{mr:1})]}),(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["This value will be used as the table name.",(0,j.jsx)("br",{}),"If blank, the default table name will be:",(0,j.jsx)("br",{}),(0,j.jsxs)(g.ZP,{inline:!0,monospace:!0,children:[kt,"_",Vn]}),(0,j.jsx)("br",{}),"This field is optional."]}),size:null,widthFitContent:!0,children:(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(Pe.Z,{compact:!0,label:"Table (optional)",monospace:!0,onBlur:function(){return setTimeout((function(){gn(!1)}),300)},onChange:function(e){xr((0,i.Z)({},M.m$,e.target.value)),e.preventDefault()},onClick:Ae.j,onFocus:function(){gn(!0)},small:!0,value:Nt[M.m$],width:20*B.iI})})})]}),(0,j.jsx)(b.Z,{mr:1})]}),!Nt[M.Mi]&&(0,j.jsxs)(h.ZP,{alignItems:"center",style:{marginTop:"8px"},children:[(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["Limit the number of results that are returned",(0,j.jsx)("br",{}),"when running this block in the notebook.",(0,j.jsx)("br",{}),"This limit won\u2019t affect the number of results",(0,j.jsx)("br",{}),"returned when running the pipeline end-to-end."]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(re.kI,{muted:!0}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Limit"}),(0,j.jsx)("span",{children:"\xa0"})]})}),_r,(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(ee.Z,{autoWidth:!0,block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["How do you want to handle existing data with the same",jr?" database,":""," schema, and table name?",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{bold:!0,inline:!0,monospace:!0,children:"Append"}),": add rows to the existing table.",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{bold:!0,inline:!0,monospace:!0,children:"Replace"}),": delete the existing data.",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{bold:!0,inline:!0,monospace:!0,children:"Fail"}),": raise an error during execution."]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(re.kI,{muted:!0}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Write policy:"}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(Se.Z,{compact:!0,label:"strategy",onChange:function(e){return xr((0,i.Z)({},M.nq,e.target.value))},onClick:Ae.j,small:!0,value:Nt[M.nq],children:null===ke||void 0===ke?void 0:ke.map((function(e){return(0,j.jsx)("option",{value:e,children:(0,U.kC)(e)},e)}))})]})}),(0,j.jsx)(b.Z,{mr:1})]}),(null===Nt||void 0===Nt?void 0:Nt[M.cH])===ye.TRINO&&qn.length>=1&&(0,j.jsxs)(h.ZP,{alignItems:"center",style:{marginTop:"8px"},children:[(0,j.jsx)(ee.Z,{appearBefore:!0,block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["If checked, upstream blocks that aren\u2019t SQL blocks",(0,j.jsx)("br",{}),"will have their data exported into a table that is",(0,j.jsx)("br",{}),"uniquely named upon each block run. For example,",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:"[pipeline_uuid]_[block_uuid]_[unique_timestamp]"}),"."]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(A.Z,{checked:Nt[M.bk],label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Unique upstream table names"}),onClick:function(e){(0,Ae.j)(e),xr((0,i.Z)({},M.bk,!Nt[M.bk]))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(re.kI,{muted:!0})]})}),(0,j.jsx)(b.Z,{mr:1})]})]})}),er.length>=1&&(0,j.jsx)(x.HS,{children:(0,j.jsx)(b.Z,{p:1,children:(0,j.jsx)(h.ZP,{children:er.map((function(e,n){var t=e.description,o=e.title;return(0,j.jsx)(b.Z,{ml:n>=1?1:0,children:(0,j.jsx)(ee.Z,{block:!0,description:t,size:null,widthFitContent:!0,children:(0,j.jsx)(m.Z,{children:o})})},o)}))})})}),Er,qn.length>=1&&!dt&&S.f2.includes(Yn)&&!Tt&&!Kn&&!Rt&&(!jt||jt===ie.zr.uuid)&&(0,j.jsxs)(x.y9,{noMargin:!0,normalPadding:!0,children:[(0,j.jsx)(b.Z,{mr:1,pt:1,children:(0,j.jsxs)(g.ZP,{muted:!0,small:!0,children:[!St&&"Positional arguments for ".concat(Pt?"":"decorated ","function:"),St&&(0,j.jsxs)(j.Fragment,{children:["The interpolated tables below are available in queries from upstream blocks.",(0,j.jsx)("br",{}),"Example: ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,small:!0,children:"SELECT * FROM {{ df_1 }}"})," to insert all rows from ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,small:!0,children:null===qn||void 0===qn?void 0:qn[0]})," into a table."]})]})}),(0,j.jsxs)(b.Z,{mt:1,children:[!St&&!Pt&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:[S.tf.DATA_EXPORTER===Yn&&"@data_exporter",S.tf.DATA_LOADER===Yn&&"@data_loader",S.tf.TRANSFORMER===Yn&&"@transformer",S.tf.CUSTOM===Yn&&"@custom"]}),(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:["def ",(S.tf.DATA_EXPORTER===Yn?"export_data":S.tf.DATA_LOADER===Yn&&"load_data")||S.tf.TRANSFORMER===Yn&&"transform"||S.tf.CUSTOM===Yn&&"transform_custom","(",qn.map((function(e,n){return n>=1?"data_".concat(n+1):"data"})).join(", "),"):"]})]}),Pt&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:[S.tf.DATA_EXPORTER===Yn?"export_data":S.tf.TRANSFORMER===Yn&&"transform","\xa0\u2190 function(",qn.map((function(e,n){return"df_".concat(n+1)})).join(", "),"):"]})}),St&&(null===qn||void 0===qn?void 0:qn.length)>=1&&(0,j.jsx)(De,{block:H,blockConfiguration:Nt,blockRefs:K,blocks:null===qn||void 0===qn?void 0:qn.map((function(e){return null===wo||void 0===wo?void 0:wo[e]})),updateBlockConfiguration:xr}),!St&&qn.map((function(e,n){var t=wo[e],o=(0,x.qn)(null===t||void 0===t?void 0:t.type,{blockColor:null===t||void 0===t?void 0:t.color,theme:wn}).accent,r="{{ df_".concat(n+1," }}");return(0,j.jsxs)("div",{children:[!St&&!Pt&&(0,j.jsxs)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0data",n>=1?"_".concat(n+1):null]}),St&&(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:r}),Pt&&(0,j.jsxs)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0","df".concat(n+1)]})," ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"\u2192"})," ",(0,j.jsx)(X.Z,{color:o,onClick:function(){var e,n,o=null===K||void 0===K||null===(e=K.current)||void 0===e?void 0:e["".concat(null===t||void 0===t?void 0:t.type,"s/").concat(null===t||void 0===t?void 0:t.uuid,".py")];null===o||void 0===o||null===(n=o.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,j.jsx)(g.ZP,{color:o,inline:!0,monospace:!0,small:!0,children:e})})]},e)}))]})]}),(!jt||!(null!==Q&&void 0!==Q&&Q.length)||jt===ie.zr.uuid)&&!dt&&yr&&(0,j.jsx)(x.HS,{darkBorder:!0,noBackground:!0,children:(0,j.jsx)(b.Z,{p:1,children:yr})}),ie.aj.uuid===jt&&(null===Q||void 0===Q?void 0:Q.length)>=1&&!dt&&(0,j.jsx)(j.Fragment,{children:Zr}),!Fn&&(!jt||!(null!==Q&&void 0!==Q&&Q.length)||ie.zr.uuid===jt)&&(0,j.jsx)(j.Fragment,{children:dt?(0,j.jsx)(b.Z,{p:1,children:(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,children:["(",(0,U._6)("line",null===mt||void 0===mt?void 0:mt.split(/\r\n|\r|\n/).length)," collapsed)"]})}):!At||Gt?pr&&!Rt?(0,j.jsx)(b.Z,{px:1,children:(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,children:["Replicated from block ",(0,j.jsx)(X.Z,{color:(0,x.qn)(null===pr||void 0===pr?void 0:pr.type,{blockColor:null===pr||void 0===pr?void 0:pr.color,theme:wn}).accent,onClick:function(e){var n,t;(0,Ae.j)(e);var o=null===K||void 0===K||null===(n=K.current)||void 0===n?void 0:n["".concat(null===pr||void 0===pr?void 0:pr.type,"s/").concat(null===pr||void 0===pr?void 0:pr.uuid,".py")];null===o||void 0===o||null===(t=o.current)||void 0===t||t.scrollIntoView()},preventDefault:!0,children:(0,j.jsx)(g.ZP,{color:(0,x.qn)(null===pr||void 0===pr?void 0:pr.type,{blockColor:null===pr||void 0===pr?void 0:pr.color,theme:wn}).accent,inline:!0,monospace:!0,children:null===pr||void 0===pr?void 0:pr.uuid})})]})}):(0,j.jsx)(b.Z,{py:B.cd,children:mr}):Cr}),be&&c.cloneElement(be,{runBlockAndTrack:No}),Fn&&(0,j.jsxs)(b.Z,{p:B.cd,children:[(0,j.jsx)(g.ZP,{bold:!0,danger:!0,children:null===Fn||void 0===Fn?void 0:Fn.error}),(0,j.jsx)(g.ZP,{muted:!0,children:null===Fn||void 0===Fn?void 0:Fn.message})]}),Mo&&bt&&bt>eo&&(0,j.jsx)(x.HC,{children:(0,j.jsxs)(g.ZP,{muted:!0,children:["".concat(Math.round((bt-eo)/1e3)),"s"]})}),!dt&&![S.tf.CALLBACK,S.tf.CONDITIONAL,S.tf.EXTENSION].includes(Yn)&&(0,j.jsx)(T,{block:H,blocks:L,openSidekickView:sn,pipeline:dn})]})),hr]})]}),!rn&&(0,j.jsxs)(x.gE,{additionalZIndex:Or-z,onMouseEnter:function(){return ot(!0)},onMouseLeave:function(){ot(!1),null===bn||void 0===bn||bn(null)},children:[tt&&y&&(0,j.jsx)(b.Z,{mt:2,mx:2,style:{width:"100%"},children:(0,j.jsx)(p.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,o=(0,ce.eY)(H,e),r=(0,ce.fA)(dn,H,e).map((function(e){var n=Ve({},wo[e]||{}),t=n.upstream_blocks;return t&&(n.upstream_blocks=t.filter((function(e){return e!==Vn}))),n}));return[S.tf.DATA_LOADER,S.tf.TRANSFORMER].includes(Yn)&&S.tf.SCRATCHPAD===e.type&&(n="from mage_ai.data_preparation.variable_manager import get_variable\n\n\n df = get_variable('".concat(kt,"', '").concat(Vn,"', 'output_0')")),n=(0,Ue.X7)(e,n),S.t6.SQL===Hn&&(t=Ve(Ve({},(0,Ye.GL)(Xn,[M.cH,M.Sv,M.sc,M.BD,M.nq])),t)),S.t6.SQL===e.language&&(n=(0,Ue.SF)(n)),y(Ve(Ve({},e),{},{configuration:t,content:n,upstream_blocks:o}),r)},blockIdx:z,blockTemplates:Y,compact:!0,hideCustom:Tt,hideDbt:Tt,onClickAddSingleDBTModel:cn,pipeline:dn,project:fn,setAddNewBlockMenuOpenIdx:bn,setCreatingNewDBTModel:xn,showBrowseTemplates:kn,showConfigureProjectModal:Tn,showGlobalDataProducts:Sn})}),(0,j.jsx)(x.t1,{className:"block-divider-inner"})]})]})})}var $e=c.forwardRef(Je)},84820:function(e,n,t){t.d(n,{Z:function(){return h}});var o,r=t(21831),i=t(44425),u=t(82394),l=t(75582),c=t(17717);!function(e){e.DATA_EXPORTER="data_exporter",e.DATA_LOADER="data_loader",e.MAGE_LIBRARY="mage_library",e.TRANSFORMER="transformer",e.USER_LIBRARY="user_library"}(o||(o={}));var a=t(89209);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}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,u.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 f=t(86735);function p(e,n){var t=e;t.includes("__init__")||t.push("__init__");var o,r=t.length;return(0,f.w6)(r).forEach((function(e,i){if(o)return o;var u=t.slice(0,r-i).join(c.sep);o=n["".concat(u,".py")]})),o}function m(e,n,t){var o,r,i;return((null===(o=t.outputs)||void 0===o||null===(r=o[0])||void 0===r||null===(i=r.sample_data)||void 0===i?void 0:i.columns)||[]).map((function(t){return{label:"".concat(t," column"),kind:e.languages.CompletionItemKind.Variable,insertText:"'".concat(t,"'"),range:n}}))}function v(e,n){var t=e.word.split(""),o=new RegExp(t.reduce((function(e,n,o){var r=t[o+1],i=r?"^".concat(r):"";return e+"".concat(n,"[w ").concat(i,"]*")}),""));return n.reduce((function(e,n){return n.label.match(o)?e.concat(n):e}),[])}function h(e){var n=e.autocompleteItems,t=e.block,u=e.blocks,s=e.pipeline,h=t.type,b=t.upstream_blocks,g=(0,f.HK)(n,(function(e){return e.id}));return function(t){return function(x,j){var O=[],C=x.getValueInRange({endColumn:j.column,endLineNumber:j.lineNumber,startColumn:1,startLineNumber:1}),_=x.getWordUntilPosition(j),Z=_.endColumn,E=_.startColumn,y={endColumn:Z,endLineNumber:j.lineNumber,startColumn:E,startLineNumber:j.lineNumber},k=function(e,n,t){var o=(0,a.Yn)(e),r=(0,a.M4)(e,n),i=o.find((function(e){var n=e.variableName;return r.match(new RegExp(n))}));if(i){var u=i.assignmentValue,l=(0,a.S0)(e)[u];if(l){var c,s=p(l.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t),d=(0,a.rW)(l,u);return null===s||void 0===s||null===(c=s.methods_for_class)||void 0===c?void 0:c[d]}}return[]}(C,y,g);if((null===k||void 0===k?void 0:k.length)>=1){var T=v(_,k.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Method,label:e,range:y}})));if(T.length>=1)return{suggestions:T}}var I=function(e,n,t){var o=(0,a.M4)(e,n);if(o=o.match(/([\w_]+)./)){var r=(0,a.S0)(e)[o[1]];if(r){var i=p(r.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t);if(null!==i&&void 0!==i&&i.functions)return null===i||void 0===i?void 0:i.functions}}return[]}(C,y,g);if((null===I||void 0===I?void 0:I.length)>=1){var S=v(_,I.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Function,label:e,range:y}})));if(S.length>=1)return{suggestions:S}}if((null===b||void 0===b?void 0:b.length)>=1){var P=new RegExp("\n@".concat(h));C.match(P)&&O.push.apply(O,(0,r.Z)(v(_,function(e,n,t){var o=t.block,r=t.blocks,i=o.upstream_blocks,u=(0,f.HK)(r,(function(e){return e.uuid}));return i.map((function(t,o){var r=u[t].type,i=0===o?"output_0":"args[".concat(o-1,"]");return{label:"df ".concat(t," ").concat(r," block"),kind:e.languages.CompletionItemKind.Variable,documentation:"Variable for ".concat(r," ").concat(t," data."),insertText:i,range:n}}))}(t,y,e))))}if(_.word.match(/i|f/)){var A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,t=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,u=(arguments.length>2?arguments[2]:void 0).word,s=new Set,f={};e.forEach((function(e){var n=e.group,t=e.id,r=e.imports;if([o.MAGE_LIBRARY,o.USER_LIBRARY].includes(n)){var i=t;i.match(/__init__.py/)&&(i=i.replace(/\/__init__.py/,"")),i=i.split(".py")[0].replaceAll(c.sep,"."),f[i]=e}var u=t.replace(".py","").replace("/__init__","").split(c.sep);if(1===u.length)s.add("import ".concat(u[0]));else if(u.length>=2){var l=u.slice(0,u.length-1).join(".");s.add("from ".concat(l," import ").concat(u[u.length-1]))}r.forEach((function(e){return s.add(e)}))}));var p,m="i"===u,v="f"===u,h=m?"import":v?"from":"",b=(0,a.M4)(n,i);if(m&&b.match(/from/)&&(p=b.match(/from ([A-Za-z0-9_.]+) /)[1]),p&&f[p]){var g=f[p],x=g.classes,j=g.constants,O=g.files,C=g.functions,_=[];return[[j,t.languages.CompletionItemKind.Constant],[x,t.languages.CompletionItemKind.Class],[C,t.languages.CompletionItemKind.Function]].forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],o=n[1];t.forEach((function(e){_.push({filterText:"import ".concat(e),insertText:"import ".concat(e),kind:o,label:e,range:i})}))})),O.forEach((function(e){var n=e.split(c.sep),o=n[n.length-1].split(".py")[0];_.push({filterText:"import ".concat(o),insertText:"import ".concat(o),kind:t.languages.CompletionItemKind.Variable,label:o,range:i})})),_}return(0,r.Z)(s).map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.File,label:e,range:i}})).concat(Object.entries(f).map((function(e){var n=(0,l.Z)(e,2),o=n[0];return n[1],{filterText:"".concat(h," ").concat(o),insertText:"".concat(h," ").concat(o," "),kind:t.languages.CompletionItemKind.File,label:"".concat(o),range:d({},i)}})))}(n,C,_,t,y,e);O.push.apply(O,(0,r.Z)(A))}if(i.tf.CHART===h||i.tf.SCRATCHPAD===h){var R=[];if(i.tf.CHART===h?b.forEach((function(e,n){R.push({block:u.find((function(n){var t=n.uuid;return e===t})),matchIndex:0,variableName:"df_".concat(n+1)})})):i.tf.SCRATCHPAD===h&&function(e,n){return e.map((function(e){return{block:e,regex:new RegExp("([\\w_]+)[ ]*=[ ]*get_variable\\('".concat(n.uuid,"', '").concat(e.uuid,"', 'output_0'\\)"),"g")}}))}(u,s).forEach((function(e){var n=e.block,t=e.regex,o=C.matchAll(t);(0,r.Z)(o).forEach((function(e){var t=null===e||void 0===e?void 0:e.index,o=null===e||void 0===e?void 0:e[1];o&&R.push({block:n,matchIndex:t,variableName:o})}))})),R.length>=1){var w,D=null===(w=C.split("\n")[j.lineNumber-1])||void 0===w?void 0:w.slice(0,_.startColumn-1);if(D){var N=[];if(R.forEach((function(e){var n=e.block,o=e.matchIndex,r=e.variableName,i=new RegExp("".concat(r,"\\["));D.match(i)&&N.push({items:m(t,y,n),matchIndex:o})})),N.length>=1)return{suggestions:v(_,(0,f.YC)(N,"matchIndex",{ascending:!1})[0].items)}}}1===E&&(i.tf.CHART===h?O.push.apply(O,(0,r.Z)(v(_,b.map((function(e,n){var o="df_".concat(n+1);return{label:"".concat(o," ").concat(e," block"),kind:t.languages.CompletionItemKind.Snippet,insertText:o,range:y}}))))):i.tf.SCRATCHPAD===h&&O.push.apply(O,(0,r.Z)(v(_,function(e,n,t){var o=t.block,r=t.blocks,u=t.pipeline;return r.reduce((function(t,r){var l=r.type,c=r.uuid;return o.uuid!==c&&[i.tf.DATA_LOADER,i.tf.TRANSFORMER].includes(l)?t.concat({label:"df ".concat(c," ").concat(l," block"),kind:e.languages.CompletionItemKind.Snippet,documentation:"Get the data from ".concat(l," block ").concat(c,"."),insertText:"from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(u.uuid,"', '").concat(c,"', 'output_0')\n"),range:n}):t}),[])}(t,y,e)))))}var M=new Set;u.concat({content:C}).forEach((function(e){var n=e.content;(0,r.Z)(n.matchAll("([A-Za-z_0-9]+)","g")).forEach((function(e){return M.add(e[1])}))}));var L=(0,r.Z)(M);if(L.length){var B=L.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Variable,label:e,range:y}}));O.push.apply(O,(0,r.Z)(v(_,B)))}return{suggestions:O}}}}},32929:function(e,n,t){t.d(n,{A2:function(){return h},dP:function(){return b},hS:function(){return j},iK:function(){return g},n9:function(){return v},qy:function(){return x}});var o,r=t(26304),i=t(82394),u=t(13507),l=t(44425),c=t(72473),a=t(57653),s=t(55283),d=["uuid"],f=["uuid"];function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var v={uuid:"Blocks"},h={uuid:"Pipelines"},b=[v,h],g=(o={},(0,i.Z)(o,l.tf.CALLBACK,c.AQ),(0,i.Z)(o,l.tf.CHART,c.GQ),(0,i.Z)(o,l.tf.CONDITIONAL,c.hW),(0,i.Z)(o,l.tf.CUSTOM,c.VS),(0,i.Z)(o,l.tf.DATA_EXPORTER,c.zS),(0,i.Z)(o,l.tf.DATA_LOADER,c.rH),(0,i.Z)(o,l.tf.DBT,c.xE),(0,i.Z)(o,l.tf.EXTENSION,c.Bf),(0,i.Z)(o,l.tf.MARKDOWN,c.$B),(0,i.Z)(o,l.tf.SENSOR,c.LM),(0,i.Z)(o,l.tf.TRANSFORMER,c.Sv),o),x=[{Icon:c.zQ,uuid:"All templates"}].concat([{uuid:l.tf.DATA_LOADER},{uuid:l.tf.TRANSFORMER},{selectedIconProps:{inverted:!0},uuid:l.tf.DATA_EXPORTER},{uuid:l.tf.SENSOR},{selectedIconProps:{inverted:!0},uuid:l.tf.CUSTOM},{uuid:l.tf.CHART},{selectedIconProps:{inverted:!0},uuid:l.tf.CALLBACK},{selectedIconProps:{inverted:!0},uuid:l.tf.CONDITIONAL},{uuid:l.tf.EXTENSION},{selectedBackgroundColor:null,uuid:l.tf.DBT},{selectedIconProps:{inverted:!0},uuid:l.tf.MARKDOWN}].map((function(e){var n=e.uuid,t=(0,r.Z)(e,d);return m({Icon:g[n],filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){return e.block_type===n}))},label:function(){return l.V4[n]},selectedBackgroundColor:function(e){return(0,s.qn)(n,{theme:e}).accent},uuid:n},t)}))),j=[{Icon:c.zQ,uuid:"All templates"}].concat([{Icon:c.X5,uuid:a.qL.PYTHON},{Icon:c.ZG,uuid:a.qL.INTEGRATION},{Icon:u.Z,uuid:a.qL.STREAMING}].map((function(e){var n=e.uuid,t=(0,r.Z)(e,f);return m({filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){var t;return(null===e||void 0===e||null===(t=e.pipeline)||void 0===t?void 0:t.type)===n}))},label:function(){return a.G7[n]},uuid:n},t)})))},84649:function(e,n,t){t.d(n,{EN:function(){return y},FX:function(){return k},HS:function(){return O},Nk:function(){return m},Rd:function(){return p},SL:function(){return E},Tj:function(){return Z},UE:function(){return _},Yf:function(){return h},ZG:function(){return s},bC:function(){return v},n5:function(){return f},n8:function(){return C},w5:function(){return j},wj:function(){return g},wl:function(){return b},ze:function(){return x}});var o=t(38626),r=t(44897),i=t(42631),u=t(46684),l=t(70515),c=t(91437),a=t(47041),s=2.5*l.iI,d=40*l.iI,f=10*l.iI,p=o.default.div.withConfig({displayName:"indexstyle__ContainedStyle",componentId:"sc-8sk2qr-0"})([""," overflow:auto;"," "," ",""],a.w5,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).page,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-f,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width-f,"px;\n ")})),m=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-8sk2qr-1"})(["height:100%;position:relative;"]),v=o.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-8sk2qr-2"})(["position:fixed;width:","px;z-index:1;"," "," ",""],d,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-right: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-f,"px;\n ")}),(function(e){return!e.height&&"\n height: 100%;\n "})),h=o.default.div.withConfig({displayName:"indexstyle__TabsStyle",componentId:"sc-8sk2qr-3"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;",""],1*l.iI,l.cd*l.iI,l.cd*l.iI,1*l.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||r.Z.borders).light,";\n ")})),b=o.default.div.withConfig({displayName:"indexstyle__LinksContainerStyle",componentId:"sc-8sk2qr-4"})([""," overflow:auto;position:fixed;width:","px;",""],a.w5,d,(function(e){return"\n height: calc(100% - ".concat(55+(null!==e&&void 0!==e&&e.contained?f:u.Mz)+((null===e||void 0===e?void 0:e.heightOffset)||0),"px);\n ")})),g=o.default.div.withConfig({displayName:"indexstyle__NavLinkStyle",componentId:"sc-8sk2qr-5"})([""," padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;&:hover{cursor:pointer;}",""],(0,c.eR)(),1*l.iI,l.cd*l.iI,l.cd*l.iI,1*l.iI,(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||r.Z.background).codeTextarea,";\n ")})),x=o.default.div.withConfig({displayName:"indexstyle__IconStyle",componentId:"sc-8sk2qr-6"})([""," border-radius:","px;height:","px;margin-right:","px;padding:","px;width:","px;"," ",""],(0,c.eR)(),i.n_,5*l.iI,1.25*l.iI,1.25*l.iI,5*l.iI,(function(e){return!e.backgroundColor&&"\n background-color: ".concat((e.theme.background||r.Z.background).chartBlock,";\n ")}),(function(e){return e.backgroundColor&&"\n background-color: ".concat(e.backgroundColor,";\n ")})),j=o.default.div.withConfig({displayName:"indexstyle__ContentStyle",componentId:"sc-8sk2qr-7"})(["margin-left:","px;"],d),O=o.default.div.withConfig({displayName:"indexstyle__SubheaderStyle",componentId:"sc-8sk2qr-8"})(["padding:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")})),C=o.default.div.withConfig({displayName:"indexstyle__CardsStyle",componentId:"sc-8sk2qr-9"})(["display:flex;flex-wrap:wrap;padding:","px;"],.75*l.iI),_=o.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-8sk2qr-10"})(["border-radius:","px;margin:","px;padding:","px;width:","px;&:hover{cursor:pointer;}",""],i.n_,.75*l.iI,2.5*l.iI,50*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border: 1px solid ").concat((e.theme.background||r.Z.background).chartBlock,";\n box-shadow: ").concat((e.theme.shadow||r.Z.shadow).frame,";\n ")})),Z=o.default.div.withConfig({displayName:"indexstyle__CardTitleStyle",componentId:"sc-8sk2qr-11"})(["height:","px;"],2.5*l.iI),E=o.default.div.withConfig({displayName:"indexstyle__CardDescriptionStyle",componentId:"sc-8sk2qr-12"})(["height:","px;margin-top:","px;"],2.5*l.iI*2,1*l.iI),y=o.default.div.withConfig({displayName:"indexstyle__TagsStyle",componentId:"sc-8sk2qr-13"})(["height:","px;margin-top:","px;overflow:hidden;"],3.5*l.iI,.5*l.iI),k=o.default.div.withConfig({displayName:"indexstyle__BreadcrumbsStyle",componentId:"sc-8sk2qr-14"})(["padding-bottom:","px;padding-top:","px;",""],1*l.iI,1*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")}))},88328:function(e,n,t){t.d(n,{Z:function(){return B}});var o=t(82394),r=t(75582),i=t(12691),u=t.n(i),l=t(21764),c=t(82684),a=t(69864),s=t(34376),d=t(71180),f=t(90299),p=t(44898),m=t(17586),v=t(97618),h=t(55485),b=t(48670),g=t(38276),x=t(30160),j=t(35576),O=t(17488),C=t(62547),_=t(35686),Z=t(94777),E=t(98464),y=t(46684),k={uuid:"Define"},T={uuid:"Document"},I=[k,T],S=t(70515),P=t(11302),A=t(68899),R=t(72619),w=t(23780),D=t(19183),N=t(28598);function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function L(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?M(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):M(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var B=function(e){var n=e.defaultTab,t=e.onMutateSuccess,o=e.pipelineUUID,i=e.template,M=e.templateAttributes,B=e.templateUUID,U=(0,D.i)().height,F=(y.Mz,(0,s.useRouter)()),G=(0,w.VI)(null,{},[],{uuid:"CustomTemplates/PipelineTemplateDetail"}),H=(0,r.Z)(G,1)[0],z=(0,c.useState)(!1),Q=z[0],K=z[1],Y=(0,c.useState)(!1),W=Y[0],q=Y[1],V=(0,c.useState)(M),X=V[0],J=V[1],$=(0,c.useCallback)((function(e){q(!0),J(e)}),[]),ee=(0,E.Z)(i);(0,c.useEffect)((function(){(null===ee||void 0===ee?void 0:ee.template_uuid)!==(null===i||void 0===i?void 0:i.template_uuid)&&J(i)}),[i,ee]);var ne=_.ZP.pipelines.detail(o).data,te=(0,c.useMemo)((function(){return(null===i||void 0===i?void 0:i.pipeline)||(null===ne||void 0===ne?void 0:ne.pipeline)}),[ne,i]),oe=(0,c.useMemo)((function(){return(null===te||void 0===te?void 0:te.blocks)||[]}),[te]),re=(0,c.useMemo)((function(){return!i&&!B}),[i,B]),ie=(0,c.useState)(n?I.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.uuid)})):I[0]),ue=ie[0],le=ie[1],ce=(0,c.useMemo)((function(){return!!re&&!(null!==X&&void 0!==X&&X.template_uuid)}),[re,X]),ae=(0,c.useState)(!1),se=ae[0],de=ae[1],fe=(0,c.useState)(re?400:300),pe=fe[0],me=fe[1],ve=(0,a.Db)(_.ZP.custom_templates.useCreate(),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.custom_template;t&&(null===t||void 0===t||t()),K(!0),setTimeout((function(){F.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid),"?object_type=").concat(p.R))}),1)},onErrorCallback:function(e,n){return H({errors:n,response:e})}})}}),he=(0,r.Z)(ve,2),be=he[0],ge=he[1].isLoading,xe=(0,a.Db)(_.ZP.custom_templates.useUpdate(i?encodeURIComponent(null===i||void 0===i?void 0:i.template_uuid):B&&encodeURIComponent(B),{object_type:p.R}),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.custom_template;t&&(null===t||void 0===t||t()),null!==i&&void 0!==i&&i.template_uuid&&(null===n||void 0===n?void 0:n.template_uuid)!==(null===i||void 0===i?void 0:i.template_uuid)||B&&(null===n||void 0===n?void 0:n.template_uuid)!==B?F.replace("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid),"?object_type=").concat(p.R)):(J(n),q(!1),l.Am.success("Template successfully saved.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:"custom_pipeline_template"}))},onErrorCallback:function(e,n){return H({errors:n,response:e})}})}}),je=(0,r.Z)(xe,2),Oe=je[0],Ce=je[1].isLoading,_e=(0,c.useCallback)((function(){var e={custom_template:L(L({},X),{},{object_type:p.R})};re?be(L(L({},e),{},{custom_template:L(L({},null===e||void 0===e?void 0:e.custom_template),{},{pipeline_uuid:o})})):Oe(e)}),[be,re,o,X,Oe]),Ze=(0,c.useMemo)((function(){return(0,N.jsxs)(h.ZP,{flexDirection:"column",fullHeight:!0,children:[(0,N.jsx)(P.Yf,{children:(0,N.jsx)(f.Z,{noPadding:!0,onClickTab:function(e){le(e)},selectedTabUUID:null===ue||void 0===ue?void 0:ue.uuid,tabs:I})}),(0,N.jsxs)(v.Z,{flexDirection:"column",children:[k.uuid===(null===ue||void 0===ue?void 0:ue.uuid)&&(0,N.jsxs)(N.Fragment,{children:[o&&(0,N.jsx)(g.Z,{mt:S.cd,px:S.cd,children:(0,N.jsxs)(x.ZP,{default:!0,children:["This pipeline template will be based off the pipeline ",(0,N.jsx)(u(),{as:"/pipelines/".concat(o),href:"/pipelines/[pipeline]",passHref:!0,children:(0,N.jsx)(b.Z,{bold:!0,default:!0,inline:!0,monospace:!0,openNewWindow:!0,children:o})}),"."]})}),(0,N.jsxs)(g.Z,{mt:S.cd,px:S.cd,children:[(0,N.jsxs)(g.Z,{mb:1,children:[(0,N.jsx)(x.ZP,{bold:!0,children:"Template UUID"}),(0,N.jsx)(x.ZP,{muted:!0,small:!0,children:"Unique identifier for custom template. The UUID will also determine where the custom template file is stored in the project. You can use nested folder names in the template\u2019s UUID."})]}),(0,N.jsx)(O.Z,{monospace:!0,onChange:function(e){return $((function(n){return L(L({},n),{},{template_uuid:e.target.value})}))},placeholder:"e.g. some_template_name",primary:!0,setContentOnMount:!0,value:(null===X||void 0===X?void 0:X.template_uuid)||""})]})]}),T.uuid===(null===ue||void 0===ue?void 0:ue.uuid)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(g.Z,{mt:S.cd,px:S.cd,children:[(0,N.jsxs)(g.Z,{mb:1,children:[(0,N.jsx)(x.ZP,{bold:!0,children:"Name"}),(0,N.jsx)(x.ZP,{muted:!0,small:!0,children:"A human readable name for your template."})]}),(0,N.jsx)(O.Z,{onChange:function(e){return $((function(n){return L(L({},n),{},{name:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===X||void 0===X?void 0:X.name)||""})]}),(0,N.jsx)(g.Z,{mt:S.cd,px:S.cd,children:(0,N.jsx)(j.Z,{label:"Description",onChange:function(e){return $((function(n){return L(L({},n),{},{description:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===X||void 0===X?void 0:X.description)||""})})]})]}),(0,N.jsx)(P.ig,{children:(0,N.jsx)(g.Z,{p:S.cd,children:(0,N.jsx)(h.ZP,{children:(0,N.jsxs)(d.Z,{disabled:ce,fullWidth:!0,loading:ge||Ce,onClick:function(){return _e()},primary:!0,children:[!re&&"Save template",re&&"Create new template"]})})})})]})}),[ce,ge,Ce,re,o,_e,null===ue||void 0===ue?void 0:ue.uuid,$,X]),Ee=(0,Z.Z)({shouldWarn:!Q&&W,warningMessage:"You have unsaved changes. Are you sure you want to leave?"}).ConfirmLeaveModal;return(0,N.jsxs)(C.Z,{before:Ze,beforeHidden:se,beforeWidth:pe,leftOffset:A.k1,setBeforeHidden:de,setBeforeWidth:me,children:[(0,N.jsx)(Ee,{}),(0,N.jsx)(m.Z,{blocks:oe,height:U,heightOffset:y.Mz,noStatus:!0,pipeline:te})]})}},11302:function(e,n,t){t.d(n,{Nk:function(){return c},Yf:function(){return s},bC:function(){return a},ig:function(){return d},w5:function(){return f}});var o=t(38626),r=t(44897),i=t(70515),u=t(84649),l=(i.iI,40*i.iI),c=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-axgvn9-0"})(["height:100%;position:relative;"]),a=o.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-axgvn9-1"})(["overflow:auto;position:fixed;width:","px;z-index:1;"," "," ",""],l,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-right: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-u.n5,"px;\n ")}),(function(e){return!e.height&&"\n height: 100%;\n "})),s=o.default.div.withConfig({displayName:"indexstyle__TabsStyle",componentId:"sc-axgvn9-2"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;width:100%;",""],1*i.iI,i.cd*i.iI,i.cd*i.iI,1*i.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||r.Z.borders).light,";\n ")})),d=o.default.div.withConfig({displayName:"indexstyle__ButtonsStyle",componentId:"sc-axgvn9-3"})(["margin-top:","px;width:100%;",""],i.cd*i.iI,(function(e){return"\n border-top: 1px solid ".concat((e.theme.borders||r.Z.borders).light,";\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__ContentStyle",componentId:"sc-axgvn9-4"})(["margin-left:","px;"],l)},5755:function(e,n,t){t.d(n,{Z:function(){return K}});var o=t(82394),r=t(75582),i=t(56085),u=t(82684),l=t(65701),c=t(1254),a=t(21764),s=t(69864),d=t(34376),f=t(40761),p=t(71180),m=t(90299),v=t(79818),h=t(44898),b=t(97618),g=t(55485),x=t(38276),j=t(44085),O=t(30160),C=t(35576),_=t(17488),Z=t(35686),E=t(94777),y=t(98464),k=t(44425),T=t(11302),I=t(48339),S=t(39643),P={uuid:"Define"},A={uuid:"Document"},R=[P,A],w=t(11498),D=t(70515),N=t(57653),M=t(4383),L=t(72619),B=t(42041),U=t(23780),F=t(44688),G=t(19183),H=t(28598);function z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Q(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?z(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var K=function(e){var n=e.contained,t=e.defaultTab,z=e.heightOffset,K=e.onCancel,Y=e.onCreateCustomTemplate,W=e.onMutateSuccess,q=e.template,V=e.templateAttributes,X=e.templateUUID,J=(0,G.i)().height,$=(0,d.useRouter)(),ee=(0,U.VI)(null,{},[],{uuid:"CustomTemplates/TemplateDetail"}),ne=(0,r.Z)(ee,1)[0],te=(0,u.useState)(Number(new Date)),oe=te[0],re=te[1],ie=(0,u.useState)(!1),ue=ie[0],le=ie[1],ce=(0,u.useState)(!1),ae=ce[0],se=ce[1],de=(0,u.useState)(t?R.find((function(e){return e.uuid===(null===t||void 0===t?void 0:t.uuid)})):R[0]),fe=de[0],pe=de[1],me=(0,u.useState)(!1),ve=me[0],he=me[1],be=(0,u.useState)(V),ge=be[0],xe=be[1],je=(0,u.useCallback)((function(e){he(!0),xe(e)}),[]),Oe=Z.ZP.custom_templates.detail(!q&&X&&encodeURIComponent(X),{object_type:h.Z}).data,Ce=(0,u.useMemo)((function(){return q||(null===Oe||void 0===Oe?void 0:Oe.custom_template)}),[Oe,q]),_e=(0,y.Z)(Ce);(0,u.useEffect)((function(){(null===_e||void 0===_e?void 0:_e.template_uuid)!==(null===Ce||void 0===Ce?void 0:Ce.template_uuid)&&(re(Number(new Date)),xe(Ce),se(!0))}),[Ce,_e]);var Ze=(0,s.Db)(Z.ZP.custom_templates.useCreate(),{onSuccess:function(e){return(0,L.wD)(e,{callback:function(e){var n=e.custom_template;W&&(null===W||void 0===W||W()),Y?null===Y||void 0===Y||Y(n):(le(!0),setTimeout((function(){$.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid)))}),1))},onErrorCallback:function(e,n){return ne({errors:n,response:e})}})}}),Ee=(0,r.Z)(Ze,2),ye=Ee[0],ke=Ee[1].isLoading,Te=(0,s.Db)(Z.ZP.custom_templates.useUpdate(q?encodeURIComponent(null===q||void 0===q?void 0:q.template_uuid):X&&encodeURIComponent(X),{object_type:h.Z}),{onSuccess:function(e){return(0,L.wD)(e,{callback:function(e){var n=e.custom_template;W&&(null===W||void 0===W||W()),xe(n),he(!1),a.Am.success("Template successfully saved.",{position:a.Am.POSITION.BOTTOM_RIGHT,toastId:"custom_block_template"})},onErrorCallback:function(e,n){return ne({errors:n,response:e})}})}}),Ie=(0,r.Z)(Te,2),Se=Ie[0],Pe=Ie[1].isLoading,Ae=(0,u.useMemo)((function(){return k.tf.MARKDOWN===(null===ge||void 0===ge?void 0:ge.block_type)}),[null===ge||void 0===ge?void 0:ge.block_type]),Re=!q&&!X,we=(0,u.useMemo)((function(){return!!Re&&(!(null!==ge&&void 0!==ge&&ge.template_uuid)||!(null!==ge&&void 0!==ge&&ge.block_type)||!Ae&&!(null!==ge&&void 0!==ge&&ge.language))}),[Ae,Re,ge]),De=Z.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),Ne=De.data,Me=De.mutate,Le=null===Ne||void 0===Ne?void 0:Ne.kernels,Be=(null===Le||void 0===Le?void 0:Le.find((function(e){return e.name===N.a_[N.qL.PYTHON]})))||(null===Le||void 0===Le?void 0:Le[0]),Ue=(0,s.Db)(Z.ZP.kernels.useUpdate(null===Be||void 0===Be?void 0:Be.id),{onSuccess:function(e){return(0,L.wD)(e,{callback:function(){return Me()},onErrorCallback:function(e,n){return ne({errors:n,response:e})}})}}),Fe=(0,r.Z)(Ue,1)[0],Ge=(0,u.useCallback)((function(){Fe({kernel:{action_type:"interrupt"}}),We([])}),[Fe]),He=(0,u.useState)({}),ze=He[0],Qe=He[1],Ke=(0,u.useState)([]),Ye=Ke[0],We=Ke[1],qe=(0,u.useMemo)((function(){return{language:null===ge||void 0===ge?void 0:ge.language,name:null===ge||void 0===ge?void 0:ge.name,type:null===ge||void 0===ge?void 0:ge.block_type,uuid:null===ge||void 0===ge?void 0:ge.template_uuid}}),[ge]),Ve=(0,u.useMemo)((function(){return new f.Z}),[]),Xe=(0,u.useMemo)((function(){return{api_key:w.l,token:Ve.decodedToken.token}}),[Ve]),Je=(0,i.ZP)((0,M.Ib)(),{onClose:function(){return console.log("socketUrlPublish closed")},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.execution_state,r=n.uuid;if(!r)return;Qe((function(e){var t=e[r]||[];return Q(Q({},e),{},(0,o.Z)({},r,t.concat(n)))})),I.uF.BUSY===t?We((function(e){return e.find((function(e){var n=e.uuid;return r===n}))||!qe?e:e.concat(qe)})):I.uF.IDLE===t&&We((function(e){return e.filter((function(e){var n=e.uuid;return r!==n}))}))}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,$e=(0,u.useCallback)((function(e){var n=e.block,t=e.code,o=e.ignoreAlreadyRunning,r=e.runDownstream,i=void 0!==r&&r,u=e.runIncompleteUpstream,l=void 0!==u&&u,c=e.runSettings,a=void 0===c?{}:c,s=e.runTests,d=void 0!==s&&s,f=e.runUpstream,p=n.extension_uuid,m=n.upstream_blocks,v=n.uuid;Ye.find((function(e){var n=e.uuid;return v===n}))&&!o||(Je(JSON.stringify(Q(Q({},Xe),{},{code:t,extension_uuid:p,run_downstream:i,run_incomplete_upstream:l,run_settings:a,run_tests:d,run_upstream:f,type:n.type,upstream_blocks:m,uuid:v}))),Qe((function(e){return delete e[v],e})),We((function(e){return e.find((function(e){var n=e.uuid;return v===n}))?e:e.concat(n)})))}),[Ye,Je,Qe,We,Xe]),en=(0,u.useMemo)((function(){return Ye.reduce((function(e,n,t){return Q(Q({},e),{},(0,o.Z)({},n.uuid,Q(Q({},n),{},{priority:t})))}),{})}),[Ye]),nn=(0,u.useMemo)((function(){if(!ae)return(0,H.jsx)("div",{});var e=en[null===qe||void 0===qe?void 0:qe.uuid],n=e?0===e.priority?I.uF.BUSY:I.uF.QUEUED:I.uF.IDLE;return(0,H.jsx)(v.Z,{block:qe,defaultValue:null===ge||void 0===ge?void 0:ge.content,disableDrag:!0,executionState:n,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,interruptKernel:Ge,messages:null===ze||void 0===ze?void 0:ze[null===qe||void 0===qe?void 0:qe.uuid],noDivider:!0,onChange:function(e){return je((function(n){return Q(Q({},n),{},{content:e})}))},runBlock:$e,runningBlocks:Ye,selected:!0,setErrors:ne,textareaFocused:!0},String(oe))}),[qe,oe,Ge,ze,ae,$e,Ye,en,je,ne,ge]),tn=(0,u.useCallback)((function(){var e={custom_template:Q(Q({},ge),{},{language:Ae?k.t6.MARKDOWN:null===ge||void 0===ge?void 0:ge.language,object_type:h.Z})};Re?ye(e):Se(e)}),[ye,Ae,Re,ge,Se]),on="CustomTemplates/TemplateDetail",rn=(0,F.y)(),un=rn.registerOnKeyDown,ln=rn.unregisterOnKeyDown;(0,u.useEffect)((function(){return function(){ln(on)}}),[ln,on]),un(on,(function(e,n){if(ve&&(0,B.y)([S.zX,S.hS],n)){e.preventDefault();"undefined"!==typeof location&&window.confirm("You have changes that are unsaved. Click cancel and save your changes before reloading page.")&&location.reload()}else((0,B.y)([S.zX,S.Um],n)||(0,B.y)([S.PQ,S.Um],n))&&(e.preventDefault(),tn())}),[tn,ve]);var cn=(0,u.useMemo)((function(){return J-z}),[J,z]),an=(0,E.Z)({shouldWarn:!ue&&ve,warningMessage:"You have unsaved changes. Are you sure you want to leave?"}).ConfirmLeaveModal;return(0,H.jsxs)(T.Nk,{children:[(0,H.jsx)(an,{}),(0,H.jsx)(T.bC,{height:n?cn:null,children:(0,H.jsxs)(g.ZP,{flexDirection:"column",fullHeight:!0,children:[(0,H.jsx)(T.Yf,{children:(0,H.jsx)(m.Z,{noPadding:!0,onClickTab:function(e){pe(e)},selectedTabUUID:null===fe||void 0===fe?void 0:fe.uuid,tabs:Re?R.slice(0,1):R})}),(0,H.jsxs)(b.Z,{flexDirection:"column",children:[P.uuid===(null===fe||void 0===fe?void 0:fe.uuid)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(x.Z,{mt:D.cd,px:D.cd,children:[(0,H.jsxs)(x.Z,{mb:1,children:[(0,H.jsx)(O.ZP,{bold:!0,children:"Template UUID"}),(0,H.jsx)(O.ZP,{muted:!0,small:!0,children:"Unique identifier for custom template. The UUID will also determine where the custom template file is stored in the project. You can use nested folder names in the template\u2019s UUID."})]}),(0,H.jsx)(_.Z,{monospace:!0,onChange:function(e){return je((function(n){return Q(Q({},n),{},{template_uuid:e.target.value})}))},placeholder:"e.g. some_template_name",primary:!0,setContentOnMount:!0,value:(null===ge||void 0===ge?void 0:ge.template_uuid)||""})]}),(0,H.jsx)(x.Z,{mt:D.cd,px:D.cd,children:(0,H.jsx)(j.Z,{label:"Block type",onChange:function(e){return je((function(n){return Q(Q({},n),{},{block_type:e.target.value,language:k.tf.MARKDOWN===e.target.value?k.t6.MARKDOWN:null===n||void 0===n?void 0:n.language})}))},primary:!0,value:(null===ge||void 0===ge?void 0:ge.block_type)||"",children:Object.values(k.tf).map((function(e){return(0,H.jsx)("option",{value:e,children:k.V4[e]},e)}))})}),!Ae&&(0,H.jsx)(x.Z,{mt:D.cd,px:D.cd,children:(0,H.jsx)(j.Z,{label:"Language",onChange:function(e){return je((function(n){return Q(Q({},n),{},{language:e.target.value})}))},primary:!0,value:(null===ge||void 0===ge?void 0:ge.language)||"",children:Object.values(k.t6).map((function(e){return(0,H.jsx)("option",{value:e,children:k.LE[e]},e)}))})})]}),A.uuid===(null===fe||void 0===fe?void 0:fe.uuid)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(x.Z,{mt:D.cd,px:D.cd,children:[(0,H.jsxs)(x.Z,{mb:1,children:[(0,H.jsx)(O.ZP,{bold:!0,children:"Name"}),(0,H.jsx)(O.ZP,{muted:!0,small:!0,children:"A human readable name for your template."})]}),(0,H.jsx)(_.Z,{onChange:function(e){return je((function(n){return Q(Q({},n),{},{name:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===ge||void 0===ge?void 0:ge.name)||""})]}),(0,H.jsx)(x.Z,{mt:D.cd,px:D.cd,children:(0,H.jsx)(C.Z,{label:"Description",onChange:function(e){return je((function(n){return Q(Q({},n),{},{description:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===ge||void 0===ge?void 0:ge.description)||""})})]})]}),(0,H.jsx)(T.ig,{children:(0,H.jsx)(x.Z,{p:D.cd,children:(0,H.jsxs)(g.ZP,{children:[(0,H.jsxs)(p.Z,{disabled:we,fullWidth:!0,loading:ke||Pe,onClick:function(){return tn()},primary:!0,children:[!Re&&"Save template",Re&&"Create new template"]}),K&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(x.Z,{mr:1}),(0,H.jsx)(p.Z,{onClick:K,secondary:!0,children:"Cancel"})]})]})})})]})}),(0,H.jsx)(T.w5,{children:(0,H.jsx)(x.Z,{p:D.cd,children:(0,H.jsx)(l.W,{backend:c.PD,children:nn})})})]})}},99236:function(e,n,t){var o=t(55485),r=t(75499),i=t(30160),u=t(72473),l=t(55283),c=t(28598);n.Z=function(e){var n=e.inputsBlocks;return(0,c.jsx)(r.Z,{columnFlex:[null,1,null,1,null],columns:[{uuid:"Position"},{uuid:"Block"},{center:!0,uuid:"Catalog"},{center:!0,uuid:"Streams"},{center:!0,uuid:"Argument shape"}],rows:null===n||void 0===n?void 0:n.map((function(e,n){var t=e.block,r=t.color,a=t.type,s=t.uuid,d=e.input,f=d.catalog,p=d.streams,m=(null===p||void 0===p?void 0:p.length)>=1,v=(0,l.qn)(a,{blockColor:r}).accent;return[(0,c.jsx)(i.ZP,{default:!0,monospace:!0,children:n},"position-".concat(s)),(0,c.jsx)(i.ZP,{color:v,monospace:!0,children:s},"block-".concat(s)),(0,c.jsx)(o.ZP,{justifyContent:"center",children:f?(0,c.jsx)(u.Jr,{success:!0}):(0,c.jsx)(u.x8,{muted:!0})},"catalog-".concat(s)),(0,c.jsxs)(o.ZP,{justifyContent:"center",children:[!m&&(0,c.jsx)(u.x8,{muted:!0},"catalog-".concat(s)),m&&null!==p&&void 0!==p&&p.includes(s)?(0,c.jsx)(u.Jr,{success:!0}):(0,c.jsx)(i.ZP,{center:!0,default:!0,monospace:!0,small:!0,children:null===p||void 0===p?void 0:p.join(", ")})]},"selected-streams-".concat(s)),(0,c.jsxs)(i.ZP,{center:!0,default:!0,monospace:!0,children:[f&&!m&&"Dict",!f&&m&&"Union[Dict, pd.DataFrame]",f&&m&&"Tuple[Union[Dict, pd.DataFrame], Dict]"]},"shape-".concat(s))]}))})}},37443:function(e,n,t){t.d(n,{C0:function(){return m},Pf:function(){return f},TD:function(){return d},mU:function(){return s},oI:function(){return u},tw:function(){return a},uK:function(){return l}});var o,r,i,u,l,c=t(82394);!function(e){e.CHECKBOX="checkbox",e.CUSTOM="custom",e.SELECT="select",e.TOGGLE="toggle"}(u||(u={})),function(e){e.CONFIGURATION="configuration",e.OVERVIEW="overview",e.STREAMS="streams",e.SYNC="sync"}(l||(l={}));var a,s=(o={},(0,c.Z)(o,l.CONFIGURATION,l.CONFIGURATION),(0,c.Z)(o,l.OVERVIEW,l.OVERVIEW),(0,c.Z)(o,l.STREAMS,l.STREAMS),(0,c.Z)(o,l.SYNC,l.SYNC),o),d=(r={},(0,c.Z)(r,l.CONFIGURATION,"Configuration"),(0,c.Z)(r,l.OVERVIEW,"Overview"),(0,c.Z)(r,l.STREAMS,"Streams"),(0,c.Z)(r,l.SYNC,"Sync"),r);!function(e){e.BOOKMARKS="bookmarks",e.CREDENTIALS="credentials",e.OVERVIEW="overview",e.SAMPLE_DATA="sample_data",e.SETTINGS="settings",e.STREAM_CONFLICTS="stream_conflicts",e.UPSTREAM_BLOCK_SETTINGS="upstream_block_settings"}(a||(a={}));var f=(i={},(0,c.Z)(i,l.CONFIGURATION,[{label:function(){return"Credentials"},uuid:a.CREDENTIALS},{label:function(){return"Upstream block settings"},uuid:a.UPSTREAM_BLOCK_SETTINGS}]),(0,c.Z)(i,l.SYNC,[{label:function(){return"Bookmarks"},uuid:a.BOOKMARKS}]),(0,c.Z)(i,l.STREAMS,[]),(0,c.Z)(i,l.OVERVIEW,[]),i),p={label:function(){return"Schema property conflicts"},uuid:a.STREAM_CONFLICTS};function m(e){var n=[{label:function(){return"Overview"},uuid:a.OVERVIEW},{label:function(){return"Schema properties"},uuid:a.SETTINGS}];return null!==e&&void 0!==e&&e.addStreamConflicts&&n.push(p),n.push({label:function(){return"Sample data"},uuid:a.SAMPLE_DATA}),n}},75634:function(e,n,t){t.d(n,{W4:function(){return d},Wx:function(){return s},ZG:function(){return a}});var o=t(38626),r=t(44897),i=t(44425),u=t(42631),l=t(70515),c=t(55283),a=l.cd*l.iI,s=o.default.div.withConfig({displayName:"indexstyle__IconContainerStyle",componentId:"sc-oyfjzc-0"})(["align-items:center;border-radius:","px;border:1px solid transparent;display:flex;justify-content:center;"," "," "," "," "," "," "," "," "," ",""],u.BG,(function(e){return e.border&&"\n border: 1px dotted ".concat((e.theme.content||r.Z.content).active,";\n ")}),(function(e){return e.grey&&"\n background-color: ".concat((0,c.qn)(i.tf.SCRATCHPAD,e).accent,";\n ")}),(function(e){return e.blue&&"\n background-color: ".concat((0,c.qn)(i.tf.DATA_LOADER,e).accent,";\n ")}),(function(e){return e.purple&&"\n background-color: ".concat((0,c.qn)(i.tf.TRANSFORMER,e).accent,";\n ")}),(function(e){return e.sky&&"\n background-color: ".concat((0,c.qn)(i.tf.MARKDOWN,e).accent,";\n ")}),(function(e){return e.teal&&"\n background-color: ".concat((0,c.qn)(i.tf.EXTENSION,e).accent,";\n ")}),(function(e){return e.rose&&"\n background-color: ".concat((0,c.qn)(i.tf.CALLBACK,e).accent,";\n ")}),(function(e){return e.yellow&&"\n background-color: ".concat((0,c.qn)(i.tf.DATA_EXPORTER,e).accent,";\n ")}),(function(e){return!e.compact&&"\n height: ".concat(a+l.iI/2,"px;\n width: ").concat(a+l.iI/2,"px;\n ")}),(function(e){return e.compact&&"\n height: ".concat(a/2+l.iI,"px;\n width: ").concat(a/2+l.iI,"px;\n ")})),d=o.default.div.withConfig({displayName:"indexstyle__ButtonWrapper",componentId:"sc-oyfjzc-1"})(["position:relative;margin-bottom:","px;margin-right:","px;",""],l.iI,l.iI,(function(e){return e.increasedZIndex&&"\n z-index: 3;\n "}))},57271:function(e,n,t){t.d(n,{Z:function(){return ge}});var o=t(82394),r=t(21831),i=t(82684),u=t(75582),l=t(69864),c=t(27277),a=t(2548),s=t(71180),d=t(50724),f=t(97618),p=t(55485),m=t(46732),v=t(49130),h=t(48670),b=t(28598);var g=function(e){var n=e.fill,t=void 0===n?"white":n,o=e.size;return(0,b.jsxs)("svg",{fill:"none",height:o,viewBox:"0 0 20 21",width:o,xmlns:"http://www.w3.org/2000/svg",children:[(0,b.jsx)("g",{clipPath:"url(#clip0_11802_82284)",children:(0,b.jsx)("path",{clipRule:"evenodd",d:"M10 20.0024C15.5228 20.0024 20 15.5253 20 10.0024C20 4.47959 15.5228 0.00244141 10 0.00244141C4.47715 0.00244141 0 4.47959 0 10.0024C0 15.5253 4.47715 20.0024 10 20.0024ZM10 18.5024C11.5782 18.5024 13.0559 18.0723 14.3224 17.323C14.3144 17.3061 14.307 17.2888 14.3002 17.2712L11.5045 10.0024H8.49587L5.70021 17.2712C5.69339 17.2889 5.68596 17.3062 5.67796 17.3231C6.94434 18.0724 8.42195 18.5024 10 18.5024ZM11.6336 6.15938L15.5784 16.416C17.3685 14.8577 18.5 12.5622 18.5 10.0024C18.5 5.30802 14.6944 1.50244 10 1.50244C5.30558 1.50244 1.5 5.30802 1.5 10.0024C1.5 12.5623 2.63162 14.8579 4.4219 16.4163L8.36685 6.15939C8.94212 4.66367 11.0583 4.66367 11.6336 6.15938Z",fill:t,fillRule:"evenodd"})}),(0,b.jsx)("defs",{children:(0,b.jsx)("clipPath",{id:"clip0_11802_82284",children:(0,b.jsx)("rect",{fill:t,height:"20",transform:"translate(0 0.00244141)",width:"20"})})})]})},x=t(65956),j=t(91835),O=t(45373),C=t(63403),_=t(72473);function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var y,k=function(e){var n=(0,j.Z)({},e),t=(null===n||void 0===n?void 0:n.size)||C.C,o=(0,_.J_)([{clipRule:"evenodd",d:"M15.4697 1.47202C16.3149 0.62684 17.6852 0.62684 18.5304 1.47202C19.3756 2.3172 19.3756 3.6875 18.5304 4.53268L10.7445 12.3186C10.5002 12.5629 10.1891 12.7294 9.85027 12.7972L9.11804 12.9436C7.89353 13.1885 6.81392 12.1089 7.05882 10.8844L7.20527 10.1522C7.27302 9.81337 7.43954 9.50222 7.68384 9.25792L15.4697 1.47202ZM17.4697 2.53268C17.2104 2.27329 16.7898 2.27329 16.5304 2.53268L14.7522 4.31085L15.6916 5.25019L17.4697 3.47202C17.7291 3.21263 17.7291 2.79207 17.4697 2.53268ZM14.6309 6.31085L13.6916 5.37151L8.7445 10.3186C8.7096 10.3535 8.68582 10.3979 8.67614 10.4463L8.52969 11.1786C8.4947 11.3535 8.64893 11.5077 8.82386 11.4727L9.5561 11.3263C9.60449 11.3166 9.64894 11.2928 9.68384 11.2579L14.6309 6.31085Z",fillRule:"evenodd"},{clipRule:"evenodd",d:"M2.12221 16.4212C1.89178 16.7635 1.42775 16.8555 1.08405 16.6264C0.739408 16.3966 0.646278 15.931 0.876042 15.5863L1.50008 16.0023C0.876042 15.5863 0.87632 15.5859 0.876609 15.5855L0.877248 15.5845L0.878742 15.5823L0.882593 15.5766L0.893746 15.5605C0.902714 15.5476 0.914758 15.5306 0.929868 15.51C0.96007 15.4687 1.00264 15.4126 1.05749 15.345C1.16699 15.2102 1.32669 15.0283 1.53609 14.8278C1.95274 14.4289 2.58034 13.9427 3.41428 13.6164C5.14688 12.9384 7.5533 13.0314 10.475 15.4219C13.0533 17.5314 14.8969 17.4384 16.0393 16.9914C16.6428 16.7552 17.109 16.3976 17.4267 16.0934C17.5845 15.9424 17.7021 15.8078 17.7782 15.7142C17.8161 15.6675 17.8434 15.6313 17.8598 15.6089C17.868 15.5977 17.8735 15.5899 17.8762 15.586C17.8769 15.585 17.8774 15.5843 17.8777 15.5838L17.877 15.5849C18.1069 15.2409 18.5717 15.1487 18.9161 15.3783C19.2608 15.6081 19.3539 16.0737 19.1241 16.4184L18.5001 16.0023C19.1241 16.4184 19.1238 16.4188 19.1236 16.4192L19.1229 16.4202L19.1214 16.4224L19.1176 16.4281L19.1064 16.4442C19.0974 16.4571 19.0854 16.4741 19.0703 16.4947C19.0401 16.536 18.9975 16.5921 18.9427 16.6597C18.8332 16.7945 18.6735 16.9764 18.4641 17.1769C18.0474 17.5758 17.4198 18.062 16.5859 18.3883C14.8533 19.0663 12.4469 18.9733 9.52515 16.5828C6.94686 14.4733 5.10328 14.5663 3.96088 15.0133C3.35732 15.2495 2.89117 15.6071 2.57345 15.9113C2.41566 16.0623 2.29802 16.1969 2.22197 16.2905C2.18405 16.3372 2.15679 16.3734 2.14036 16.3958C2.13215 16.407 2.12668 16.4148 2.12396 16.4187C2.12332 16.4196 2.12254 16.4207 2.12221 16.4212ZM2.12221 16.4212C2.1222 16.4212 2.12221 16.4212 2.12221 16.4212V16.4212Z",fillRule:"evenodd"}],{viewBox:"0 0 20 21"});return(0,b.jsxs)(O.ZP,E(E({},n),{},{size:t,viewBox:null,children:[(0,b.jsx)("g",{clipPath:"url(#clip0_11826_796)",id:"Type / Scratchpad",children:(0,b.jsx)("g",{id:"Vector",children:o(E(E({},n),{},{size:t}))})}),(0,b.jsx)("defs",{children:(0,b.jsx)("clipPath",{id:"clip0_11826_796",children:(0,b.jsx)("rect",{fill:"white",height:"20",transform:"translate(0 0.00244141)",width:"20"})})})]}))};!function(e){e.BLOCK_ACTION_OBJECTS="block_action_objects"}(y||(y={}));var T=t(38276),I=t(30160),S=t(17488),P=t(12468),A=t(35686),R=t(44425),w=t(32929),D=t(38626),N=t(44897),M=t(42631),L=t(70515),B=t(47041),U=t(91437),F=L.cd*L.iI,G=D.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1mqygp5-0"})([""," border-radius:","px;"," "," "," "," ",""],(0,U.eR)(),M.n_,(function(e){return"\n background-color: ".concat((e.theme.background||N.Z.background).dashboard,";\n box-shadow: ").concat((e.theme.shadow||N.Z.shadow).frame,";\n ")}),(function(e){return!e.focused&&"\n border: 1px solid ".concat((e.theme.interactive||N.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.focused&&"\n border: 1px solid ".concat((e.theme.interactive||N.Z.interactive).hoverBorder,";\n ")}),(function(e){return!e.compact&&"\n padding-left: ".concat(2.5*L.iI,"px;\n padding-right: ").concat(2.5*L.iI,"px;\n ")}),(function(e){return e.compact&&"\n padding-left: ".concat(1.5*L.iI,"px;\n padding-right: ").concat(1.5*L.iI,"px;\n ")})),H=D.default.div.withConfig({displayName:"indexstyle__DividerStyle",componentId:"sc-1mqygp5-1"})(["height:","px;width:1px;",""],F,(function(e){return"\n background-color: ".concat((e.theme.interactive||N.Z.interactive).defaultBorder,";\n ")})),z=D.default.div.withConfig({displayName:"indexstyle__ButtonWrapper",componentId:"sc-1mqygp5-2"})(["position:relative;"," "," ",""],(function(e){return e.increasedZIndex&&"\n z-index: 3;\n "}),(function(e){return!e.compact&&"\n margin-bottom: ".concat(2.5*L.iI,"px;\n margin-top: ").concat(2.5*L.iI,"px;\n ")}),(function(e){return e.compact&&"\n margin-bottom: ".concat(1.5*L.iI,"px;\n margin-top: ").concat(1.5*L.iI,"px;\n ")})),Q=D.default.div.withConfig({displayName:"indexstyle__TextInputFocusAreaStyle",componentId:"sc-1mqygp5-3"})(["width:100%;&:hover{cursor:text;}"," ",""],(function(e){return!e.compact&&"\n height: ".concat(2.5*L.iI,"px;\n ")}),(function(e){return e.compact&&"\n height: ".concat(1.5*L.iI,"px;\n ")})),K=D.default.div.withConfig({displayName:"indexstyle__SearchStyle",componentId:"sc-1mqygp5-4"})(["position:relative;width:100%;"]),Y=D.default.div.withConfig({displayName:"indexstyle__DropdownStyle",componentId:"sc-1mqygp5-5"})([""," border-radius:","px;max-height:","px;overflow:auto;position:absolute;width:100%;z-index:1;"," ",""],B.w5,M.BG,40*L.iI,(function(e){return"\n background-color: ".concat((e.theme.background||N.Z.background).popup,";\n box-shadow: ").concat((e.theme.shadow||N.Z.shadow).popup,";\n ")}),(function(e){return e.topOffset&&"\n top: ".concat(e.topOffset,"px;\n ")})),W=D.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-1mqygp5-6"})(["align-items:center;display:flex;justify-content:space-between;padding:","px ","px;position:relative;z-index:2;&:hover{cursor:pointer;}",""],1.5*L.iI,2.5*L.iI,(function(e){return e.highlighted&&"\n background-color: ".concat((e.theme.interactive||N.Z.interactive).hoverBackground,";\n ")})),q=t(39643),V=t(78419),X=t(13803),J=t(81728),$=t(53808),ee=t(55283),ne=t(38399),te=t(72619),oe=t(3314),re=t(23780),ie=t(44688);function ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function le(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,o.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 ce=function(e){var n,t=e.addNewBlock,o=e.blockIdx,r=e.blockTemplatesByBlockType,j=e.compact,O=e.focused,C=e.itemsDBT,Z=e.pipelineType,E=e.project,D=e.searchTextInputRef,N=e.setAddNewBlockMenuOpenIdx,M=e.setFocused,B=e.showBrowseTemplates,U=e.showConfigureProjectModal,ue=e.showGlobalDataProducts,ce=(0,i.useRef)(null),ae=(0,i.useRef)(null),se=(0,i.useRef)(null),de=(0,i.useRef)(null),fe="undefined"!==typeof D?D:de,pe=(0,i.useMemo)((function(){return"AddNewBlocksV2/".concat(o)}),[o]),me=(0,re.VI)(null,{},[],{uuid:"AddNewBlocksV2/".concat(o)}),ve=(0,u.Z)(me,1)[0],he=(0,i.useState)(null),be=he[0],ge=he[1],xe=(0,i.useState)(!1),je=xe[0],Oe=xe[1],Ce=(0,i.useState)(null),_e=Ce[0],Ze=Ce[1],Ee=(0,i.useState)(null),ye=Ee[0],ke=Ee[1],Te=(0,i.useState)(null),Ie=Te[0],Se=Te[1],Pe=(0,i.useCallback)((function(e){Se(e),(0,$.t8)(V.Ch,e)}),[]);(0,i.useEffect)((function(){if(null===Ie){var e=(0,$.U2)(V.Ch,!1);Pe(e)}}),[Pe,Ie]);var Ae=(0,i.useMemo)((function(){return"undefined"!==typeof O?O:je}),[O,je]),Re=(0,i.useCallback)((function(e){return"undefined"!==typeof M?M(e):Oe(e)}),[M,Oe]),we=(0,ie.y)(),De=we.registerOnKeyDown,Ne=we.unregisterOnKeyDown;(0,i.useEffect)((function(){return function(){return Ne(pe)}}),[Ne,pe]),null===De||void 0===De||De(pe,(function(e,n){var t;Ae&&(n[q.vP]&&(Re(!1),null===fe||void 0===fe||null===(t=fe.current)||void 0===t||t.blur()))}),[Ae,fe]);var Me=(0,i.useCallback)((function(){return ge(null)}),[]),Le=(0,i.useCallback)((function(e){return null===N||void 0===N?void 0:N((function(n){return null===n||be!==e?o:null}))}),[o,be,N]),Be=(0,i.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(t,R.tf.DATA_LOADER,Z,{blockTemplatesByBlockType:r,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.DATA_LOADER,"/").concat(R.t6.PYTHON)})))||void 0===n?void 0:n.items}),[t,r,Z]),Ue=(0,i.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(t,R.tf.DATA_LOADER,Z,{blockTemplatesByBlockType:r,dataIntegrationType:X.O.SOURCES,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.DATA_LOADER,"/").concat(X.O.SOURCES)})))||void 0===n?void 0:n.items}),[t,r,Z]),Fe=(0,i.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(t,R.tf.DATA_EXPORTER,Z,{blockTemplatesByBlockType:r,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.DATA_EXPORTER,"/").concat(R.t6.PYTHON)})))||void 0===n?void 0:n.items}),[t,r,Z]),Ge=(0,i.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(t,R.tf.DATA_EXPORTER,Z,{blockTemplatesByBlockType:r,dataIntegrationType:X.O.DESTINATIONS,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.DATA_EXPORTER,"/").concat(X.O.DESTINATIONS)})))||void 0===n?void 0:n.items}),[t,r,Z]),He=(0,i.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(t,R.tf.TRANSFORMER,Z,{blockTemplatesByBlockType:r,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.TRANSFORMER,"/").concat(R.t6.PYTHON)})))||void 0===n?void 0:n.items}),[t,r,Z]),ze=(0,i.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(t,R.tf.SENSOR,Z,{blockTemplatesByBlockType:r,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.SENSOR,"/").concat(R.t6.PYTHON)})))||void 0===n?void 0:n.items}),[t,r,Z]),Qe=(0,i.useCallback)((function(e){return[{isGroupingTitle:!0,label:function(){return"SQL"},uuid:"".concat(R.t6.SQL,"/").concat(e,"/group")},{label:function(){return"Base template (generic)"},onClick:function(){t({language:R.t6.SQL,type:e})},uuid:"".concat(R.t6.SQL,"/").concat(e,"/Base template (generic)")},{isGroupingTitle:!0,label:function(){return"R"},uuid:"".concat(R.t6.R,"/").concat(e,"/group")},{label:function(){return"Base template (generic)"},onClick:function(){t({language:R.t6.R,type:e})},uuid:"".concat(R.t6.R,"/").concat(e,"/Base template (generic)")}]}),[t]),Ke=(0,i.useMemo)((function(){var e=[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(R.t6.PYTHON).concat(R.tf.DATA_LOADER,"/group")}].concat(Be).concat(Qe(R.tf.DATA_LOADER));Ue&&e.push.apply(e,[{isGroupingTitle:!0,label:function(){return"Data integrations"},uuid:"".concat(R.tf.DATA_LOADER,"/Data integrations/group")},{items:Ue,label:function(){return(0,J.kC)(X.O.SOURCES)},uuid:"".concat(R.tf.DATA_LOADER,"/Data integrations/").concat(X.O.SOURCES)}]);var n=[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(R.t6.PYTHON).concat(R.tf.DATA_EXPORTER,"/group")}].concat(Fe).concat(Qe(R.tf.DATA_EXPORTER));return Ge&&n.push.apply(n,[{isGroupingTitle:!0,label:function(){return"Data integrations"},uuid:"".concat(R.tf.DATA_EXPORTER,"/Data integrations/group")},{items:Ge,label:function(){return(0,J.kC)(X.O.DESTINATIONS)},uuid:"".concat(R.tf.DATA_EXPORTER,"/Data integrations/").concat(X.O.DESTINATIONS)}]),[{beforeIcon:(0,b.jsx)(_.rH,{fill:(0,ee.qn)(R.tf.DATA_LOADER).accent,size:F}),items:e,label:function(){return R.V4[R.tf.DATA_LOADER]},uuid:"".concat(R.tf.DATA_LOADER,"/").concat(R.t6.PYTHON)},{beforeIcon:(0,b.jsx)(_.Sv,{fill:(0,ee.qn)(R.tf.TRANSFORMER).accent,size:F}),items:[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(R.t6.PYTHON).concat(R.tf.TRANSFORMER,"/group")}].concat(He).concat(Qe(R.tf.TRANSFORMER)),label:function(){return R.V4[R.tf.TRANSFORMER]},uuid:"".concat(R.tf.TRANSFORMER,"/").concat(R.t6.PYTHON)},{beforeIcon:(0,b.jsx)(_.zS,{fill:(0,ee.qn)(R.tf.DATA_EXPORTER).accent,size:F}),items:n,label:function(){return R.V4[R.tf.DATA_EXPORTER]},uuid:"".concat(R.tf.DATA_EXPORTER,"/").concat(R.t6.PYTHON)},{beforeIcon:(0,b.jsx)(_.LM,{fill:(0,ee.qn)(R.tf.SENSOR).accent,size:F}),items:[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(R.t6.PYTHON).concat(R.tf.SENSOR,"/group")}].concat(ze),label:function(){return R.V4[R.tf.SENSOR]},uuid:"".concat(R.tf.SENSOR,"/").concat(R.t6.PYTHON)},{beforeIcon:(0,b.jsx)(_.xE,{fill:(0,ee.qn)(R.tf.DBT).accent,size:F}),items:C,label:function(){return R.V4[R.tf.DBT]},uuid:R.tf.DBT},{beforeIcon:(0,b.jsx)(_.ie,{size:F}),label:function(){return R.V4[R.tf.GLOBAL_DATA_PRODUCT]},onClick:function(){return ue({addNewBlock:t})},uuid:R.tf.GLOBAL_DATA_PRODUCT},{isGroupingTitle:!0,label:function(){return"Custom templates"},uuid:"custom_templates"},{beforeIcon:(0,b.jsx)(_.zQ,{default:!0,size:F}),label:function(){return"Browse templates"},onClick:function(){return B({addNewBlock:t})},uuid:"browse_templates"},{beforeIcon:(0,b.jsx)(_.o0,{default:!0,size:F}),label:function(){return"Create new template"},onClick:function(){return B({addNew:!0,addNewBlock:t})},uuid:"create_template"}]}),[t,Qe,Fe,Ge,Be,Ue,C,ze,He,B,ue]),Ye=(0,i.useMemo)((function(){return[{beforeIcon:(0,b.jsx)(_.VS,{default:!0,size:F}),label:function(){return"Python block"},onClick:function(){t({language:R.t6.PYTHON,type:R.tf.CUSTOM})},uuid:"Python"},{beforeIcon:(0,b.jsx)(_.VS,{default:!0,size:F}),label:function(){return"SQL block"},onClick:function(){t({language:R.t6.SQL,type:R.tf.CUSTOM})},uuid:"SQL"},{beforeIcon:(0,b.jsx)(_.VS,{default:!0,size:F}),label:function(){return"R block"},onClick:function(){t({language:R.t6.R,type:R.tf.CUSTOM})},uuid:"R"},{beforeIcon:(0,b.jsx)(k,{default:!0,size:F}),label:function(){return"Scratchpad"},onClick:function(){t({language:R.t6.PYTHON,type:R.tf.SCRATCHPAD})},uuid:"scratchpad"}]}),[t]),We=(0,l.Db)(A.ZP.search_results.useCreate(),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var n=e.search_result;ke(n)},onErrorCallback:function(e,n){return ve({errors:n,response:e})}})}}),qe=(0,u.Z)(We,1)[0],Ve=(0,i.useCallback)((function(e){clearTimeout(se.current);var n=e.target.value;Ze(n),n?se.current=setTimeout((function(){qe({search_result:{pipeline_type:Z,query:n,ratio:70,type:y.BLOCK_ACTION_OBJECTS}})}),500):ke(null)}),[qe,Z,se]),Xe=(0,i.useMemo)((function(){return(null===ye||void 0===ye?void 0:ye.results)||[]}),[ye]),Je=(0,i.useMemo)((function(){var e=null===ye||void 0===ye?void 0:ye.uuid,n=null===Xe||void 0===Xe?void 0:Xe.map((function(n){return{itemObject:n,searchQueries:[e],value:null===n||void 0===n?void 0:n.uuid}}));if(e){var t={itemObject:{description:e,object_type:a.L.GENERATE_BLOCK,title:"Generate block using AI (beta)"},searchQueries:[e],value:"generate_block"};Ie?n.push(t):n.unshift(t)}return n}),[Xe,ye,Ie]),$e=(0,i.useMemo)((function(){return(0,b.jsx)(Q,{compact:j,onClick:function(){var e;return null===fe||void 0===fe||null===(e=fe.current)||void 0===e?void 0:e.focus()}})}),[j,fe]),en=(0,i.useMemo)((function(){return!(null===E||void 0===E||!E.openai_api_key)}),[E]);return(0,b.jsx)(d.Z,{onClickOutside:Me,open:!0,children:(0,b.jsx)(G,{compact:j,focused:Ae,children:(0,b.jsxs)(p.ZP,{alignItems:"center",children:[(0,b.jsx)(z,{compact:j,increasedZIndex:0===be,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:Ke,onClickCallback:Me,open:0===be,parentRef:ce,uuid:"button_templates",children:(0,b.jsx)(P.Z,{block:!0,label:"Add a block from a template",size:null,widthFitContent:!0,children:(0,b.jsx)(s.Z,{beforeIcon:(0,b.jsx)(_.zQ,{secondary:0===be,size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),ge((function(e){return 0===e?null:0})),Le(0)},children:"Templates"})})})}),(0,b.jsx)(T.Z,{mr:3}),(0,b.jsx)(z,{compact:j,increasedZIndex:1===be,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:Ye,onClickCallback:Me,open:1===be,parentRef:ae,uuid:"button_custom",children:(0,b.jsx)(P.Z,{block:!0,label:"Add a blank custom block or scratchpad block",size:null,widthFitContent:!0,children:(0,b.jsx)(s.Z,{beforeIcon:(0,b.jsx)(_.cW,{secondary:1===be,size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),ge((function(e){return 1===e?null:1})),Le(1)},children:"Custom"})})})}),(0,b.jsx)(T.Z,{mr:3}),(0,b.jsx)(z,{compact:j,increasedZIndex:0===be,children:(0,b.jsx)(P.Z,{block:!0,label:"Add a markdown block for documentation",size:null,widthFitContent:!0,children:(0,b.jsx)(s.Z,{beforeIcon:(0,b.jsx)(g,{size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),t({language:R.t6.MARKDOWN,type:R.tf.MARKDOWN})},children:"Markdown"})})}),(0,b.jsx)(T.Z,{mr:3}),(0,b.jsx)(H,{}),(0,b.jsx)(T.Z,{mr:3}),(0,b.jsxs)(K,{children:[$e,(0,b.jsxs)(p.ZP,{alignItems:"center",fullWidth:!0,children:[(0,b.jsx)(S.Z,{fullWidth:!0,noBackground:!0,noBorder:!0,onBlur:function(){return setTimeout((function(){return Re(!1)}),150)},onChange:Ve,onFocus:function(){return Re(!0)},paddingHorizontal:0,paddingVertical:0,placeholder:"Search for a block...",ref:fe,value:_e||""}),(0,b.jsx)(v.Z,{addPlusSignBetweenKeys:!0,disabled:!0,keyTextGroups:[[q.RJ,q.ZS]]})]}),$e,(0,b.jsx)(Y,{topOffset:(null===fe||void 0===fe||null===(n=fe.current)||void 0===n?void 0:n.getBoundingClientRect().height)+(j?1.5*L.iI:2.5*L.iI),children:(0,b.jsx)(c.Z,{itemGroups:[{items:Ae?Je:[],renderItem:function(e,n){var t=e.itemObject,o=t.block_type,r=t.description,i=t.language,u=t.object_type,l=t.title,c={fill:(0,ee.qn)(o).accent,size:F},s=w.iK[o],d=a.L.GENERATE_BLOCK===u;d&&(s=_.xq,c.default=!1,c.fill=null,c.warning=!0);var p="".concat(l).concat(r?": "+r:"").slice(0,80);return(0,b.jsxs)(W,le(le({},n),{},{onClick:function(e){var t;(0,oe.j)(e),null===n||void 0===n||null===(t=n.onClick)||void 0===t||t.call(n,e)},children:[(0,b.jsxs)(f.Z,{alignItems:"center",flex:1,children:[s&&(0,b.jsx)(s,le({default:!(null!==c&&void 0!==c&&c.fill)},c)),(0,b.jsx)(T.Z,{mr:2}),(0,b.jsx)(I.ZP,{default:!0,overflowWrap:!0,textOverflow:!0,children:p})]}),(0,b.jsx)(T.Z,{mr:1}),(0,b.jsx)(I.ZP,{monospace:!0,muted:!0,uppercase:!0,children:d?"AI":R.dO[i]}),(0,b.jsx)(T.Z,{mr:1}),a.L.BLOCK_FILE===u&&(0,b.jsx)(_.$B,{muted:!0,size:F}),a.L.CUSTOM_BLOCK_TEMPLATE===u&&(0,b.jsx)(_.zQ,{muted:!0,size:F}),a.L.MAGE_TEMPLATE===u&&(0,b.jsx)(_.m1,{muted:!0,size:F}),d&&en&&(0,b.jsx)(_.xq,{muted:!0,size:F}),d&&!en&&(0,b.jsx)(_.uy,{muted:!0,size:F})]}))}}],onSelectItem:function(e){var n=e.itemObject,o=n.object_type;a.L.GENERATE_BLOCK!==o||en?(t({block_action_object:n,require_unique_name:!1}),Ze(null),ke(null)):null===U||void 0===U||U({cancelButtonText:"Set this up later",header:(0,b.jsx)(T.Z,{mb:L.HN,children:(0,b.jsxs)(x.Z,{children:[(0,b.jsx)(I.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate blocks using AI."}),(0,b.jsx)(T.Z,{mt:1,children:(0,b.jsxs)(I.ZP,{warning:!0,children:["Read ",(0,b.jsx)(h.Z,{href:"https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key",openNewWindow:!0,children:"OpenAI\u2019s documentation"})," to get your API key."]})})]})}),onCancel:function(){Pe(!0)},onSaveSuccess:function(e){null!==e&&void 0!==e&&e.openai_api_key&&(t({block_action_object:n}),Ze(null),ke(null))}})},uuid:pe})})]})]})})})};var ae=function(e){var n=e.size;return(0,b.jsx)("svg",{fill:"none",height:n,preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",width:n,xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("path",{d:"M245.121138,10.6473813 C251.139129,16.4340053 255.074133,24.0723342 256,32.4050489 C256,35.8769778 255.074133,38.1917867 252.990862,42.5895822 C250.907876,46.9873778 225.215147,91.4286933 217.57696,103.696213 C213.179164,110.871609 210.864356,119.435947 210.864356,127.768462 C210.864356,136.3328 213.179164,144.6656 217.57696,151.840996 C225.215147,164.108516 250.907876,208.781084 252.990862,213.179164 C255.074133,217.57696 256,219.659947 256,223.131876 C255.074133,231.464676 251.370667,239.103147 245.352676,244.658347 C239.565938,250.676338 231.927751,254.611342 223.826489,255.305671 C220.35456,255.305671 218.039751,254.379804 213.873493,252.296533 C209.706951,250.213262 164.340053,225.215147 152.072249,217.57696 C151.146382,217.113884 150.220516,216.419556 149.063396,215.95648 L88.4195556,180.079502 C89.8082133,191.652693 94.9006222,202.763093 103.233138,210.864356 C104.853618,212.484551 106.473813,213.873493 108.325547,215.262151 C106.936604,215.95648 105.316409,216.651093 103.927751,217.57696 C91.6599467,225.215147 46.9873778,250.907876 42.5895822,252.990862 C38.1917867,255.074133 36.1085156,256 32.4050489,256 C24.0723342,255.074133 16.4340053,251.370667 10.8788338,245.352676 C4.86075733,239.565938 0.925858133,231.927751 0,223.594951 C0.231464676,220.123022 1.1573248,216.651093 3.00905244,213.641956 C5.09223822,209.24416 30.7848533,164.571307 38.42304,152.303787 C42.82112,145.128391 45.1356444,136.795591 45.1356444,128.231538 C45.1356444,119.6672 42.82112,111.3344 38.42304,104.159004 C30.7848533,91.4286933 4.86075733,46.75584 3.00905244,42.3580444 C1.1573248,39.3489067 0.231464676,35.8769778 0,32.4050489 C0.925858133,24.0723342 4.62930489,16.4340053 10.6473813,10.6473813 C16.4340053,4.62930489 24.0723342,0.925858133 32.4050489,0 C35.8769778,0.231464676 39.3489067,1.1573248 42.5895822,3.00905244 C46.2930489,4.62930489 78.9293511,23.6094009 96.28928,33.7939911 L100.224284,36.1085156 C101.612942,37.0343822 102.770347,37.7287111 103.696213,38.1917867 L105.547947,39.3489067 L167.348907,75.9204978 C165.960249,62.0324978 158.784853,49.3019022 147.674453,40.7378489 C149.063396,40.04352 150.683591,39.3489067 152.072249,38.42304 C164.340053,30.7848533 209.012622,4.86075733 213.410418,3.00905244 C216.419556,1.1573248 219.891484,0.231464676 223.594951,0 C231.696213,0.925858133 239.334684,4.62930489 245.121138,10.6473813 Z M131.240391,144.434062 L144.434062,131.240391 C146.285796,129.388658 146.285796,126.611342 144.434062,124.759609 L131.240391,111.565938 C129.388658,109.714204 126.611342,109.714204 124.759609,111.565938 L111.565938,124.759609 C109.714204,126.611342 109.714204,129.388658 111.565938,131.240391 L124.759609,144.434062 C126.379804,146.054258 129.388658,146.054258 131.240391,144.434062 Z",fill:"#FF694A"})})},se=t(93369),de=t(57653),fe=t(82359),pe=t(8454),me=t(75634),ve=t(5677);function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function be(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?he(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):he(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ge=function(e){var n=e.addNewBlock,t=e.blockIdx,o=e.blockTemplates,u=e.compact,l=e.focusedAddNewBlockSearch,c=e.hideCustom,a=e.hideDataExporter,s=(e.hideDataLoader,e.hideDbt),f=e.hideMarkdown,v=e.hideScratchpad,h=e.hideSensor,g=e.hideTransformer,x=e.hideTransformerDataSources,j=e.onClickAddSingleDBTModel,O=e.pipeline,C=e.project,Z=e.searchTextInputRef,E=e.setAddNewBlockMenuOpenIdx,y=e.setCreatingNewDBTModel,k=e.setFocusedAddNewBlockSearch,T=e.showBrowseTemplates,I=e.showConfigureProjectModal,S=e.showGlobalDataProducts,A=(0,i.useState)(null),w=A[0],D=A[1],N=(0,i.useRef)(null),M=(0,i.useRef)(null),B=(0,i.useRef)(null),U=(0,i.useRef)(null),F=(0,i.useRef)(null),G=(0,i.useRef)(null),H=(0,i.useRef)(null),z={compact:u,inline:!0},Q=null===O||void 0===O?void 0:O.type,K=Q===de.qL.STREAMING,Y=u?me.ZG/2:me.ZG,W=25*L.iI,q=(0,i.useMemo)((function(){return(0,ne.q_)(ve.c1,pe.qs.COLUMN,n)}),[n]),V=(0,i.useMemo)((function(){return(0,ne.q_)(ve.Wt,pe.qs.ROW,n)}),[n]),X=(0,i.useMemo)((function(){var e=[{label:function(){return"Generic (no template)"},onClick:function(){n({language:R.t6.PYTHON,type:R.tf.TRANSFORMER})},uuid:"generic_transformer_action"},{bold:!0,items:V,label:function(){return"Row actions"},uuid:"row_actions_grouping"},{isGroupingTitle:!0,label:function(){return"Column actions"},uuid:"column_actions_grouping"}].concat((0,r.Z)(q));return x||e.splice(1,0,{bold:!0,items:(0,ne.hr)(n,R.tf.TRANSFORMER,Q),label:function(){return"Data sources"},uuid:"data_sources_grouping"}),e}),[n,q,x,Q,V]),J=(0,i.useCallback)((function(){return D(null)}),[]),$=(0,i.useCallback)((function(e){return null===E||void 0===E?void 0:E((function(n){return null===n||w!==e?t:null}))}),[t,w,E]),ee=de.qL.PYSPARK===Q,te=(0,i.useMemo)((function(){return(0,ne.oM)(o,n)}),[n,o]),oe=(0,i.useMemo)((function(){return(0,ne.hr)(n,R.tf.DATA_LOADER,Q,{blockTemplatesByBlockType:te,showBrowseTemplates:T})}),[n,te,Q,T]),re=(0,i.useMemo)((function(){return(0,ne.hr)(n,R.tf.DATA_EXPORTER,Q,{blockTemplatesByBlockType:te,showBrowseTemplates:T})}),[n,te,Q,T]),ie=(0,i.useMemo)((function(){return ee||de.qL.INTEGRATION===Q?X:K?[{items:(0,ne.hr)(n,R.tf.TRANSFORMER,Q),label:function(){return"Python"},uuid:"transformers/python"}].concat((0,r.Z)((0,ne.hr)(n,R.tf.TRANSFORMER,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:T}))):[{items:X,label:function(){return"Python"},uuid:"transformers/python_all"}].concat((0,r.Z)((0,ne.qs)(n,R.tf.TRANSFORMER)),(0,r.Z)((0,ne.hr)(n,R.tf.TRANSFORMER,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:T})))}),[n,X,te,ee,K,Q,T]),ue=(0,i.useMemo)((function(){return[{label:function(){return"New model"},onClick:function(){null===y||void 0===y||y(!0),null===j||void 0===j||j(t)},uuid:"dbt/new_model"},{label:function(){return"Single model or snapshot (from file)"},onClick:function(){return null===j||void 0===j?void 0:j(t)},uuid:"dbt/single_model"},{label:function(){return"All models (w/ optional exclusion)"},onClick:function(){return n({configuration:{dbt:{command:"run"}},language:R.t6.YAML,type:R.tf.DBT})},uuid:"dbt/all_models"},{label:function(){return"Generic dbt command"},onClick:function(){return n({configuration:{dbt:{command:null}},language:R.t6.YAML,type:R.tf.DBT})},uuid:"dbt/generic_command"}]}),[n,t,j,y]);return(0,i.useMemo)((function(){var e;return de.qL.PYTHON===Q&&!ee&&(null===C||void 0===C||null===(e=C.features)||void 0===e?void 0:e[fe.d.ADD_NEW_BLOCK_V2])}),[ee,Q,C])?(0,b.jsx)(ce,{addNewBlock:n,blockIdx:t,blockTemplatesByBlockType:te,compact:u,focused:l,itemsDBT:ue,pipelineType:Q,project:C,searchTextInputRef:Z,setAddNewBlockMenuOpenIdx:E,setFocused:k,showBrowseTemplates:T,showConfigureProjectModal:I,showGlobalDataProducts:S}):(0,b.jsx)(p.ZP,{flexWrap:"wrap",inline:!0,children:(0,b.jsx)(d.Z,{onClickOutside:J,open:!0,children:(0,b.jsxs)(p.ZP,{flexWrap:"wrap",children:[!a&&(0,b.jsx)(me.W4,{increasedZIndex:0===w,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:oe,onClickCallback:J,open:0===w,parentRef:N,uuid:"data_loader_button",children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(me.Wx,{blue:!0,compact:u,children:(0,b.jsx)(_.mm,{size:Y})}),onClick:function(e){e.preventDefault(),D((function(e){return 0===e?null:0})),$(0)},uuid:"AddNewBlocks/Data_loader",children:"Data loader"}))})}),!g&&(0,b.jsx)(me.W4,{increasedZIndex:1===w,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:ie,onClickCallback:J,open:1===w,parentRef:M,uuid:"transformer_button",children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(me.Wx,{compact:u,purple:!0,children:(0,b.jsx)(_.mm,{size:Y})}),onClick:function(e){e.preventDefault(),D((function(e){return 1===e?null:1})),$(1)},uuid:"AddNewBlocks/Transformer",children:"Transformer"}))})}),!a&&(0,b.jsx)(me.W4,{increasedZIndex:2===w,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:re,onClickCallback:J,open:2===w,parentRef:B,uuid:"data_exporter_button",children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(me.Wx,{compact:u,yellow:!0,children:(0,b.jsx)(_.mm,{inverted:!0,size:Y})}),onClick:function(e){e.preventDefault(),D((function(e){return 2===e?null:2})),$(2)},uuid:"AddNewBlocks/Data_exporter",children:"Data exporter"}))})}),!s&&(0,b.jsx)(me.W4,{increasedZIndex:3===w,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:[].concat((0,r.Z)(ue),(0,r.Z)((0,ne.hr)(n,R.tf.DBT,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:T}))),onClickCallback:J,open:3===w,parentRef:U,uuid:"dbt_button",children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ae,{size:me.ZG*(u?.75:1.25)}),onClick:function(e){e.preventDefault(),D((function(e){return 3===e?null:3})),$(3)},uuid:"AddNewBlocks/DBT",children:"DBT model"}))})}),!c&&(0,b.jsx)(me.W4,{increasedZIndex:4===w,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:[{items:(0,ne.Bd)(n,R.tf.CUSTOM,R.t6.PYTHON),label:function(){return"Python"},uuid:"custom_block_python"},{items:(0,ne.Bd)(n,R.tf.CUSTOM,R.t6.SQL),label:function(){return"SQL"},uuid:"custom_block_sql"}].concat((0,r.Z)((0,ne.hr)(n,R.tf.CUSTOM,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:T}))),onClickCallback:J,open:4===w,parentRef:F,uuid:"custom_block_button",children:(0,b.jsx)(P.Z,{block:!0,label:"Add a custom code block with a designated color.",maxWidth:W,size:null,children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(me.Wx,{compact:u,grey:!0,children:(0,b.jsx)(_.mm,{inverted:!0,size:Y})}),onClick:function(e){e.preventDefault(),D((function(e){return 4===e?null:4})),$(4)},uuid:"AddNewBlocks/Scratchpad",children:"Custom"}))})})}),!v&&(0,b.jsx)(me.W4,{children:(0,b.jsx)(P.Z,{block:!0,label:"Write experimental code that doesn\u2019t get executed when you run your pipeline.",maxWidth:W,size:null,children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(me.Wx,{border:!0,compact:u,children:(0,b.jsx)(_.mm,{size:Y})}),onClick:function(e){e.preventDefault(),n({type:R.tf.SCRATCHPAD})},uuid:"AddNewBlocks/Scratchpad",children:"Scratchpad"}))})}),!v&&(0,b.jsx)(me.W4,{children:(0,b.jsx)(P.Z,{block:!0,label:"Add a global data product block",maxWidth:W,size:null,children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(me.Wx,{compact:u,children:(0,b.jsx)(_.ie,{size:Y})}),onClick:function(e){e.preventDefault(),S({addNewBlock:n})},uuid:"AddNewBlocks/GlobalDataProducts",children:"Global data product"}))})}),!K&&!h&&(0,b.jsx)(me.W4,{increasedZIndex:6===w,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:[].concat((0,r.Z)((0,ne.hr)(n,R.tf.SENSOR,Q)),(0,r.Z)((0,ne.hr)(n,R.tf.SENSOR,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:T}))),onClickCallback:J,open:6===w,parentRef:G,uuid:"sensor_button",children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(me.Wx,{compact:u,children:(0,b.jsx)(_.LM,{pink:!0,size:me.ZG*(u?.75:1.25)})}),onClick:function(e){e.preventDefault(),D((function(e){return 6===e?null:6})),$(6)},uuid:"AddNewBlocks/Sensor",children:"Sensor"}))})}),!f&&(0,b.jsx)(me.W4,{increasedZIndex:7===w,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:[{label:function(){return"Generic (no template)"},onClick:function(){n({language:R.t6.MARKDOWN,type:R.tf.MARKDOWN})},uuid:"generic_markdown"}].concat((0,r.Z)((0,ne.hr)(n,R.tf.MARKDOWN,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:T}))),onClickCallback:J,open:7===w,parentRef:H,uuid:"markdown_button",children:(0,b.jsx)(se.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(me.Wx,{compact:u,sky:!0,children:(0,b.jsx)(_.mm,{inverted:!0,size:Y})}),onClick:function(e){e.preventDefault(),D((function(e){return 7===e?null:7})),$(7)},uuid:"AddNewBlocks/Markdown",children:"Markdown"}))})})]})})})}},38399:function(e,n,t){t.d(n,{Bd:function(){return E},SF:function(){return y},X7:function(){return k},hr:function(){return C},oM:function(){return O},q_:function(){return Z},qs:function(){return j}});var o=t(21831),r=t(82394),i=t(55485),u=t(30160),l=t(5677),c=t(72473),a=t(44425),s=t(84438),d=t(57653),f=t(81728),p=t(55283),m=t(86735),v=t(28598);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var b=function(e,n,t){var o=t===d.qL.STREAMING&&(e===a.tf.DATA_LOADER||e===a.tf.DATA_EXPORTER);return(function(e){var n;return e===d.qL.STREAMING?(n={},(0,r.Z)(n,a.tf.DATA_LOADER,[s.ZP.AMAZON_SQS,s.ZP.AZURE_EVENT_HUB,s.ZP.GOOGLE_CLOUD_PUBSUB,s.ZP.INFLUXDB,s.ZP.KAFKA,s.ZP.KINESIS,s.ZP.RABBITMQ]),(0,r.Z)(n,a.tf.DATA_EXPORTER,[s.ZP.AZURE_DATA_LAKE,s.ZP.BIGQUERY,s.ZP.CLICKHOUSE,s.ZP.DUCKDB,s.ZP.DUMMY,s.ZP.ELASTICSEARCH,s.ZP.GOOGLE_CLOUD_PUBSUB,s.ZP.INFLUXDB,s.ZP.S3,s.ZP.KAFKA,s.ZP.KINESIS,s.ZP.MONGODB,s.ZP.MSSQL,s.ZP.MYSQL,s.ZP.OPENSEARCH,s.ZP.POSTGRES,s.ZP.REDSHIFT,s.ZP.SNOWFLAKE,s.ZP.TRINO]),(0,r.Z)(n,a.tf.TRANSFORMER,[s.ZP.GENERIC]),n):s.cp}(t)[e]||[]).map((function(t){return{indent:e===a.tf.TRANSFORMER,label:function(){return s.MV[t]},onClick:function(){n({config:{data_source:t===s.ZP.GENERIC?null:t},language:o?a.t6.YAML:a.t6.PYTHON,type:e})},uuid:"".concat(e,"/").concat(t)}}))};function g(e,n){return{label:function(){return"SQL"},onClick:function(){return e({language:a.t6.SQL,type:n})},uuid:"".concat(n,"/sql")}}function x(e,n){return{label:function(){return"R"},onClick:function(){return e({language:a.t6.R,type:n})},uuid:"".concat(n,"/r")}}var j=function(e,n){return[g(e,n),x(e,n)]};function O(e,n){var t={};return null===e||void 0===e||e.forEach((function(e){var o=e.block_type,i=e.configuration,u=e.defaults,l=e.description,c=e.groups,a=e.language,s=e.name,d=e.path,f=e.template_type,p=e.template_variables;t[o]||(t[o]={}),t[o][a]||(t[o][a]={items:[],label:function(){return a},uuid:"".concat(o,"/").concat(a)});var m={label:function(){return s},onClick:function(){return n({config:{template_path:d,template_type:f,template_variables:p},configuration:i,defaults:u,language:a,type:o})},tooltip:function(){return l},uuid:d};if((null===c||void 0===c?void 0:c.length)>=1){var v=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({},t[o][a]),b=[null],g=[v];c.forEach((function(e,n){var t="".concat(o,"/").concat(a,"/").concat(c.slice(0,n+1).join("/")),r=g[n],i=r.items.findIndex((function(e){var n=e.uuid;return t===n})),u=i>=0?r.items[i]:null;u||(u={items:[],label:function(){return e},uuid:t}),b.push(i),g.push(u)})),b.push(-1),g.push(m);var x=g.length;t[o][a]=g.reduce((function(e,n,t){var o=x-t,r=g[o-2],i=g[o-1],u=b[o-1];return r?(u>=0?r.items[u]=i:r.items.push(i),r):i}),{})}else t[o][a].items.push(m)})),t}var C=function(e,n,t,o){var r=o||{},i=r.blockTemplatesByBlockType,u=r.dataIntegrationType,l=r.languages,c=r.onlyCustomTemplate,s=r.showBrowseTemplates,f={};null!==o&&void 0!==o&&o.v2||(f=Object.fromEntries(a.Ut.map((function(n){return[n,b(n,e,t)]}))));var p={label:function(){return"Custom template"},onClick:function(){return s({addNewBlock:e,blockType:n,language:a.t6.SQL})},uuid:"".concat(n,"/custom_template")};if(c)return[p];if(t===d.qL.PYSPARK||t===d.qL.STREAMING)return f[n];if(u&&null!==o&&void 0!==o&&o.v2){var v,h,j=(null===i||void 0===i||null===(v=i[n])||void 0===v||null===(h=v[u])||void 0===h?void 0:h.items)||[];return[{items:(0,m.YC)(j,(function(e){return(0,e.label)()})),uuid:"".concat(n,"/").concat(u)}]}var O,C,_=(null===i||void 0===i||null===(O=i[n])||void 0===O||null===(C=O[a.t6.PYTHON])||void 0===C?void 0:C.items)||[],Z=[{items:(0,m.YC)((f[n]||[]).concat(_),(function(e){return(0,e.label)()})),label:function(){return"Python"},uuid:"".concat(n,"/").concat(a.t6.PYTHON)}];return(!l||null!==l&&void 0!==l&&l.includes(a.t6.SQL))&&Z.push(g(e,n)),(!l||null!==l&&void 0!==l&&l.includes(a.t6.R))&&Z.push(x(e,n)),![a.tf.MARKDOWN,a.tf.SCRATCHPAD].includes(n)&&s&&Z.push(p),Z};function _(e,n,t){return e.map((function(e){return{indent:!0,label:function(){return l.NX[n][e]},onClick:function(){t({config:{action_type:e,axis:n},language:a.t6.PYTHON,type:a.tf.TRANSFORMER})},uuid:"".concat(n,"_").concat(e)}})).sort((function(e,n){return e.label().localeCompare(n.label())}))}function Z(e,n,t){var r=[];return e.forEach((function(e){if(e!==l._G.MISC)r.push({indent:!0,items:_(l.d9[n][e],n,t),label:function(){return e},uuid:"".concat(n,"_grouping_").concat((0,f.RA)(e))});else{var i=_(l.d9[n][e],n,t);r.push.apply(r,(0,o.Z)(i))}})),r}var E=function(e,n,t){return Object.values(a.Lq).map((function(o){return{label:function(){return(0,v.jsxs)(i.ZP,{alignItems:"center",children:[(0,v.jsx)(c.mm,{fill:(0,p.qn)(a.tf.CUSTOM,{blockColor:o}).accent,size:16}),"\xa0",(0,v.jsx)(u.ZP,{children:(0,f.kC)(o)})]})},leftAligned:!0,onClick:function(){e({color:o,language:t,type:n})},uuid:"".concat(t,"_").concat(o)}}))},y=function(e){return"-- Docs: https://docs.mage.ai/guides/sql-blocks\n"+(e||"")};function k(e,n){var t=n;return a.tf.SCRATCHPAD===e.type&&(t='"""\nNOTE: Scratchpad blocks are used only for experimentation and testing out code.\nThe code written here will not be executed as part of the pipeline.\n"""\n'+(n||"")),t}},74052:function(e,n,t){t.d(n,{Dp:function(){return h},OF:function(){return b},Q9:function(){return x},Rt:function(){return p},Rz:function(){return O},h8:function(){return g},k1:function(){return m},uS:function(){return j}});var o=t(21831),r=t(82394),i=t(48339),u=t(53808),l=t(3917),c=t(86735),a=t(81728),s=t(70320);function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function f(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}function p(e){var n={},t={};return null===e||void 0===e||e.forEach((function(e){var o=e.content,r=e.outputs,u=e.type,l=e.uuid;(null===r||void 0===r?void 0:r.length)>=1&&(n[l]=r.map((function(e){if("object"===typeof e){var n=e||{},t=n.sample_data,o=n.shape,r=n.text_data,u=n.type;return t?{data:f({shape:o},t),type:u}:r&&(0,a.Pb)(r)?JSON.parse(r):r}return{data:String(e),type:i.Gi.TEXT}}))),t[u]||(t[u]={}),t[u][l]=o})),{content:t,messages:n}}function m(e,n,t){e.forEach((function(e){(0,u.t8)("".concat(t,"/").concat(e.uuid,"/codeCollapsed"),(0,u.Od)("".concat(n,"/").concat(e.uuid,"/codeCollapsed"))),(0,u.t8)("".concat(t,"/").concat(e.uuid,"/outputCollapsed"),(0,u.Od)("".concat(n,"/").concat(e.uuid,"/outputCollapsed")))}))}function v(e){return"".concat(e,"/").concat(u.kP)}function h(e){return(0,u.U2)(v(e),[])}function b(e,n){var t=h(e);t.includes(n)||(0,u.t8)(v(e),[].concat((0,o.Z)(t),[n]))}function g(e,n){var t=h(e).filter((function(e){return e!==n}));(0,u.t8)(v(e),t)}function x(e,n){var t=(0,c.HK)(n,(function(e){return e.uuid}));return e.map((function(e){return t[e]})).filter((function(e){return!!e}))}var j=function(e,n){var t=window.URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=n,document.body.appendChild(o),o.click(),o.remove()};function O(e,n){var t,o=(0,s.q)(),r=null===n||void 0===n?void 0:n.isPipelineUpdating,i=null===n||void 0===n?void 0:n.pipelineContentTouched,u=null===n||void 0===n?void 0:n.pipelineLastSaved;if(i)t="Unsaved changes";else if(r)t="Saving changes...";else if(u){var c=(0,l.JX)(Number(u)/1e3);null!==e&&void 0!==e&&e.updated_at&&(c=(0,l.XG)(null===e||void 0===e?void 0:e.updated_at,o)),t="Last saved ".concat(c)}else t="All changes saved";return t}},8454:function(e,n,t){var o,r,i,u;t.d(n,{Q0:function(){return o},qs:function(){return r}}),function(e){e.ADD="add",e.AVERAGE="average",e.CLEAN_COLUMN_NAME="clean_column_name",e.COUNT="count",e.COUNT_DISTINCT="count_distinct",e.CUSTOM="custom",e.DIFF="diff",e.DROP_DUPLICATE="drop_duplicate",e.EXPAND_COLUMN="expand_column",e.EXPLODE="explode",e.FILTER="filter",e.FIRST="first",e.FIX_SYNTAX_ERRORS="fix_syntax_errors",e.GROUP="group",e.IMPUTE="impute",e.JOIN="join",e.LAST="last",e.LIMIT="limit",e.MAX="max",e.MEDIAN="median",e.MIN="min",e.MODE="mode",e.NORMALIZE="normalize",e.REFORMAT="reformat",e.REMOVE="remove",e.REMOVE_OUTLIERS="remove_outliers",e.SCALE="scale",e.SELECT="select",e.SHIFT_DOWN="shift_down",e.SHIFT_UP="shift_up",e.SORT="sort",e.STANDARDIZE="standardize",e.SUM="sum",e.UNION="union",e.UPDATE_TYPE="update_type",e.UPDATE_VALUE="update_value"}(o||(o={})),function(e){e.COLUMN="column",e.ROW="row"}(r||(r={})),function(e){e.NOT_APPLIED="not_applied",e.COMPLETED="completed"}(i||(i={})),function(e){e.FEATURE="feature"}(u||(u={}))},26084:function(e,n,t){var o;t.d(n,{Q:function(){return o}}),function(e){e.CALLBACK="callbacks",e.CONDITIONAL="conditionals"}(o||(o={}))},2548:function(e,n,t){var o;t.d(n,{L:function(){return o}}),function(e){e.BLOCK_FILE="block_file",e.CUSTOM_BLOCK_TEMPLATE="custom_block_template",e.GENERATE_BLOCK="generate_block",e.MAGE_TEMPLATE="mage_template"}(o||(o={}))},13803:function(e,n,t){var o,r;t.d(n,{I:function(){return r},O:function(){return o}}),function(e){e.DESTINATIONS="destinations",e.SOURCES="sources"}(o||(o={})),function(e){e.DATA_INTEGRATION="data_integration"}(r||(r={}))},35058:function(e,n,t){t.d(n,{$1:function(){return h},BD:function(){return j},CK:function(){return D},ED:function(){return c},JJ:function(){return l},JT:function(){return R},MP:function(){return N},Mi:function(){return I},Mv:function(){return C},PG:function(){return s},Pi:function(){return S},R8:function(){return i},Sv:function(){return g},Tv:function(){return A},Yf:function(){return k},Yg:function(){return f},a3:function(){return m},aE:function(){return M},aZ:function(){return T},bE:function(){return d},bk:function(){return y},bn:function(){return L},c0:function(){return B},cH:function(){return b},e:function(){return a},eN:function(){return u},eW:function(){return _},m$:function(){return O},m7:function(){return r},mW:function(){return E},nq:function(){return Z},oV:function(){return o},os:function(){return w},pA:function(){return P},rj:function(){return v},sc:function(){return x},v8:function(){return p}});var o,r="buckets",i="chart_style",u="group_by",l="height",c="index",a="legend_labels",s="limit",d="metrics",f="time_interval",p="width_percentage",m="x",v="y",h="y_sort_order",b="data_provider",g="data_provider_database",x="data_provider_profile",j="data_provider_schema",O="data_provider_table",C="dbt_profile_target",_="dbt_project_name",Z="export_write_policy",E="limit",y="unique_upstream_table_name",k="upstream_block_configuration",T="table_name",I="use_raw_sql",S="dbt",P="command",A=[m,v];!function(e){e.BAR_CHART="bar chart",e.CUSTOM="custom",e.HISTOGRAM="histogram",e.LINE_CHART="line chart",e.PIE_CHART="pie chart",e.TABLE="table",e.TIME_SERIES_BAR_CHART="time series bar chart",e.TIME_SERIES_LINE_CHART="time series line chart"}(o||(o={}));var R,w,D=[o.BAR_CHART,o.HISTOGRAM,o.LINE_CHART,o.PIE_CHART,o.TABLE,o.TIME_SERIES_BAR_CHART,o.TIME_SERIES_LINE_CHART];!function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(R||(R={})),function(e){e.AVERAGE="average",e.COUNT="count",e.COUNT_DISTINCT="count_distinct",e.MAX="max",e.MEDIAN="median",e.MIN="min",e.MODE="mode",e.SUM="sum"}(w||(w={}));var N,M,L=[w.AVERAGE,w.COUNT,w.COUNT_DISTINCT,w.MAX,w.MEDIAN,w.MIN,w.MODE,w.SUM];function B(e){return"".concat(e.aggregation,"(").concat(e.column,")")}!function(e){e.ASCENDING="ascending",e.DESCENDING="descending"}(N||(N={})),function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.MONTH="month",e.ORIGINAL="original",e.SECOND="second",e.WEEK="week",e.YEAR="year"}(M||(M={}))},44898:function(e,n,t){t.d(n,{R:function(){return r},Z:function(){return o}});var o="blocks",r="pipelines"},84438:function(e,n,t){t.d(n,{MV:function(){return c},cp:function(){return a},zJ:function(){return i}});var o,r,i,u=t(82394),l=t(44425);!function(e){e.AMAZON_SQS="amazon_sqs",e.API="api",e.AZURE_BLOB_STORAGE="azure_blob_storage",e.AZURE_DATA_LAKE="azure_data_lake",e.AZURE_EVENT_HUB="azure_event_hub",e.BIGQUERY="bigquery",e.CLICKHOUSE="clickhouse",e.DRUID="druid",e.DUCKDB="duckdb",e.DUMMY="dummy",e.ELASTICSEARCH="elasticsearch",e.FILE="file",e.GENERIC="generic",e.GOOGLE_CLOUD_PUBSUB="google_cloud_pubsub",e.GOOGLE_CLOUD_STORAGE="google_cloud_storage",e.INFLUXDB="influxdb",e.KAFKA="kafka",e.KINESIS="kinesis",e.MONGODB="mongodb",e.MSSQL="mssql",e.MYSQL="mysql",e.OPENSEARCH="opensearch",e.ORACLEDB="oracledb",e.POSTGRES="postgres",e.RABBITMQ="rabbitmq",e.REDSHIFT="redshift",e.S3="s3",e.SNOWFLAKE="snowflake",e.TRINO="trino"}(i||(i={}));var c=(o={},(0,u.Z)(o,i.AMAZON_SQS,"Amazon SQS"),(0,u.Z)(o,i.API,"API"),(0,u.Z)(o,i.AZURE_BLOB_STORAGE,"Azure Blob Storage"),(0,u.Z)(o,i.AZURE_DATA_LAKE,"Azure Data Lake"),(0,u.Z)(o,i.AZURE_EVENT_HUB,"Azure Event Hub"),(0,u.Z)(o,i.BIGQUERY,"Google BigQuery"),(0,u.Z)(o,i.CLICKHOUSE,"ClickHouse"),(0,u.Z)(o,i.DRUID,"Druid"),(0,u.Z)(o,i.DUCKDB,"DuckDB"),(0,u.Z)(o,i.DUMMY,"Dummy"),(0,u.Z)(o,i.ELASTICSEARCH,"ElasticSearch"),(0,u.Z)(o,i.FILE,"Local file"),(0,u.Z)(o,i.GENERIC,"Generic (no template)"),(0,u.Z)(o,i.GOOGLE_CLOUD_PUBSUB,"Google Cloud PubSub"),(0,u.Z)(o,i.GOOGLE_CLOUD_STORAGE,"Google Cloud Storage"),(0,u.Z)(o,i.INFLUXDB,"InfluxDB"),(0,u.Z)(o,i.KAFKA,"Kafka"),(0,u.Z)(o,i.KINESIS,"Kinesis"),(0,u.Z)(o,i.MONGODB,"MongoDB"),(0,u.Z)(o,i.MSSQL,"Microsoft SQL Server"),(0,u.Z)(o,i.MYSQL,"MySQL"),(0,u.Z)(o,i.OPENSEARCH,"OpenSearch"),(0,u.Z)(o,i.ORACLEDB,"OracleDB"),(0,u.Z)(o,i.POSTGRES,"PostgreSQL"),(0,u.Z)(o,i.RABBITMQ,"RabbitMQ"),(0,u.Z)(o,i.REDSHIFT,"Amazon Redshift"),(0,u.Z)(o,i.S3,"Amazon S3"),(0,u.Z)(o,i.SNOWFLAKE,"Snowflake"),(0,u.Z)(o,i.TRINO,"Trino"),o),a=(r={},(0,u.Z)(r,l.tf.DATA_LOADER,[i.GENERIC,i.FILE,i.API,i.AZURE_BLOB_STORAGE,i.BIGQUERY,i.DRUID,i.GOOGLE_CLOUD_STORAGE,i.MYSQL,i.ORACLEDB,i.POSTGRES,i.REDSHIFT,i.S3,i.SNOWFLAKE]),(0,u.Z)(r,l.tf.DATA_EXPORTER,[i.GENERIC,i.FILE,i.S3,i.AZURE_BLOB_STORAGE,i.GOOGLE_CLOUD_STORAGE,i.REDSHIFT,i.BIGQUERY,i.SNOWFLAKE,i.MYSQL,i.POSTGRES]),(0,u.Z)(r,l.tf.TRANSFORMER,[i.REDSHIFT,i.BIGQUERY,i.SNOWFLAKE,i.POSTGRES]),(0,u.Z)(r,l.tf.SENSOR,[i.GENERIC,i.S3,i.GOOGLE_CLOUD_STORAGE,i.REDSHIFT,i.BIGQUERY,i.SNOWFLAKE,i.MYSQL,i.POSTGRES]),r);n.ZP=i},15135:function(e,n,t){t.d(n,{JD:function(){return v},Lu:function(){return i},PF:function(){return f},dT:function(){return u},n6:function(){return a},nB:function(){return m},oy:function(){return p},xF:function(){return d}});var o,r,i,u,l=t(82394),c=t(44425);!function(e){e.CSV="csv",e.JSON="json",e.MD="md",e.PY="py",e.R="r",e.SQL="sql",e.TXT="txt",e.YAML="yaml",e.YML="yml"}(i||(i={})),function(e){e.INIT_PY="__init__.py",e.METADATA_YAML="metadata.yaml",e.REQS_TXT="requirements.txt"}(u||(u={}));var a=[i.PY,i.SQL],s=[i.JSON,i.MD,i.PY,i.R,i.SQL,i.TXT,i.YAML,i.YML],d=new RegExp(s.map((function(e){return".".concat(e,"$")})).join("|")),f=(new RegExp(s.map((function(e){return".".concat(e,"$")})).join("|")),"charts"),p="pipelines",m=(o={},(0,l.Z)(o,i.MD,c.t6.MARKDOWN),(0,l.Z)(o,i.JSON,i.JSON),(0,l.Z)(o,i.PY,c.t6.PYTHON),(0,l.Z)(o,i.R,c.t6.R),(0,l.Z)(o,i.SQL,c.t6.SQL),(0,l.Z)(o,i.TXT,"text"),(0,l.Z)(o,i.YAML,c.t6.YAML),(0,l.Z)(o,i.YML,c.t6.YAML),o),v=(r={},(0,l.Z)(r,c.t6.MARKDOWN,i.MD),(0,l.Z)(r,c.t6.PYTHON,i.PY),(0,l.Z)(r,c.t6.R,i.R),(0,l.Z)(r,c.t6.SQL,i.SQL),(0,l.Z)(r,c.t6.YAML,i.YAML),(0,l.Z)(r,"text",i.TXT),r)},61599:function(e,n,t){t.d(n,{D5:function(){return h},MU:function(){return i},RL:function(){return c},Xv:function(){return a},Zj:function(){return v},_B:function(){return r},eL:function(){return s},fe:function(){return p},ks:function(){return f},th:function(){return m},u7:function(){return d},zS:function(){return u}});var o,r,i,u,l=t(82394);!function(e){e.FULL_TABLE="FULL_TABLE",e.INCREMENTAL="INCREMENTAL",e.LOG_BASED="LOG_BASED"}(r||(r={})),function(e){e.IGNORE="IGNORE",e.UPDATE="UPDATE"}(i||(i={})),function(e){e.DATE_TIME="date-time",e.UUID="uuid"}(u||(u={}));var c,a="datetime",s=(o={},(0,l.Z)(o,u.DATE_TIME,a),(0,l.Z)(o,u.UUID,u.UUID),o);!function(e){e.ARRAY="array",e.BOOLEAN="boolean",e.INTEGER="integer",e.NULL="null",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(c||(c={}));var d,f,p,m,v,h=[c.ARRAY,c.BOOLEAN,a,c.INTEGER,c.NULL,c.NUMBER,c.OBJECT,c.STRING,u.UUID];!function(e){e.PROPERTIES="properties"}(d||(d={})),function(e){e.AUTOMATIC="automatic",e.AVAILABLE="available",e.UNSUPPORTED="unsupported"}(f||(f={})),function(e){e.FORCED_REPLICATION_METHOD="forced-replication-method",e.KEY_PROPERTIES="table-key-properties",e.REPLICATION_KEYS="valid-replication-keys",e.SCHEMA_NAME="schema-name"}(p||(p={})),function(e){e.AMPLITUDE="amplitude",e.BIGQUERY="bigquery",e.CHARGEBEE="chargebee",e.GOOGLE_ADS="google_ads",e.GOOGLE_SEARCH_CONSOLE="google_search_console",e.GOOGLE_SHEETS="google_sheets",e.INTERCOM="intercom",e.MYSQL="mysql",e.PIPEDRIVE="pipedrive",e.POSTGRESQL="postgresql",e.REDSHIFT="redshift",e.SALESFORCE="salesforce",e.STRIPE="stripe"}(m||(m={})),function(e){e.BIGQUERY="bigquery",e.DELTA_LAKE_S3="delta_lake_s3",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.SNOWFLAKE="snowflake"}(v||(v={}))},7267:function(e,n,t){var o;t.d(n,{z:function(){return o}}),function(e){e.GENERATE_BLOCK_WITH_DESCRIPTION="generate_block_with_description",e.GENERATE_COMMENT_FOR_CODE="generate_comment_for_code",e.GENERATE_DOC_FOR_BLOCK="generate_doc_for_block",e.GENERATE_DOC_FOR_PIPELINE="generate_doc_for_pipeline",e.GENERATE_PIPELINE_WITH_DESCRIPTION="generate_pipeline_with_description"}(o||(o={}))},57653:function(e,n,t){t.d(n,{$1:function(){return s},G7:function(){return f},LM:function(){return p},Mj:function(){return m},QK:function(){return a},a_:function(){return h},kA:function(){return v},qL:function(){return u},r0:function(){return d}});var o,r,i,u,l=t(82394),c=t(72473);!function(e){e.INTEGRATION="integration",e.PYTHON="python",e.PYSPARK="pyspark",e.STREAMING="streaming"}(u||(u={}));var a,s,d,f=(o={},(0,l.Z)(o,u.INTEGRATION,"Integration"),(0,l.Z)(o,u.PYTHON,"Standard"),(0,l.Z)(o,u.PYSPARK,"PySpark"),(0,l.Z)(o,u.STREAMING,"Streaming"),o),p="all",m=(u.PYTHON,u.INTEGRATION,u.STREAMING,r={},(0,l.Z)(r,p,c.ie),(0,l.Z)(r,u.INTEGRATION,c.YC),(0,l.Z)(r,u.PYTHON,c.El),(0,l.Z)(r,u.STREAMING,c.dB),r);!function(e){e.ACTIVE="active",e.INACTIVE="inactive",e.NO_SCHEDULES="no_schedules",e.RETRY="retry",e.RETRY_INCOMPLETE_BLOCK_RUNS="retry_incomplete_block_runs"}(a||(a={})),function(e){e.GROUP="group_by",e.HISTORY_DAYS="from_history_days",e.STATUS="status[]",e.TAG="tag[]",e.TYPE="type[]"}(s||(s={})),function(e){e.STATUS="status",e.TAG="tag",e.TYPE="type"}(d||(d={}));var v=[a.ACTIVE,a.INACTIVE,a.NO_SCHEDULES],h=(i={},(0,l.Z)(i,u.PYTHON,"python3"),(0,l.Z)(i,u.PYSPARK,"pysparkkernel"),i)},5677:function(e,n,t){t.d(n,{NX:function(){return v},Wt:function(){return m},_G:function(){return c},c1:function(){return p},d9:function(){return f}});var o,r,i,u,l,c,a=t(82394),s=t(8454),d=(s.Q0.AVERAGE,s.Q0.CLEAN_COLUMN_NAME,s.Q0.COUNT,s.Q0.COUNT_DISTINCT,s.Q0.CUSTOM,s.Q0.DIFF,s.Q0.FIRST,s.Q0.FIX_SYNTAX_ERRORS,s.Q0.IMPUTE,s.Q0.LAST,s.Q0.MAX,s.Q0.MEDIAN,s.Q0.MIN,s.Q0.NORMALIZE,s.Q0.REFORMAT,s.Q0.REMOVE,s.Q0.REMOVE_OUTLIERS,s.Q0.SELECT,s.Q0.SHIFT_DOWN,s.Q0.SHIFT_UP,s.Q0.STANDARDIZE,s.Q0.SUM,[s.Q0.DROP_DUPLICATE,s.Q0.FILTER,s.Q0.SORT,s.Q0.REMOVE]);!function(e){e.AGGREGATE="Aggregate",e.FORMATTING="Formatting",e.COLUMN_REMOVAL="Column removal",e.SHIFT_ROWS="Shift rows in a column",e.MISC="Miscellaneous",e.FEATURE_SCALING="Feature Scaling"}(c||(c={}));var f=(r={},(0,a.Z)(r,s.qs.COLUMN,(o={},(0,a.Z)(o,c.AGGREGATE,[s.Q0.AVERAGE,s.Q0.COUNT,s.Q0.COUNT_DISTINCT,s.Q0.FIRST,s.Q0.LAST,s.Q0.MAX,s.Q0.MEDIAN,s.Q0.MIN,s.Q0.SUM]),(0,a.Z)(o,c.FORMATTING,[s.Q0.CLEAN_COLUMN_NAME,s.Q0.FIX_SYNTAX_ERRORS,s.Q0.REFORMAT]),(0,a.Z)(o,c.COLUMN_REMOVAL,[s.Q0.REMOVE,s.Q0.SELECT]),(0,a.Z)(o,c.SHIFT_ROWS,[s.Q0.SHIFT_DOWN,s.Q0.SHIFT_UP]),(0,a.Z)(o,c.MISC,[s.Q0.DIFF,s.Q0.IMPUTE,s.Q0.REMOVE_OUTLIERS]),(0,a.Z)(o,c.FEATURE_SCALING,[s.Q0.NORMALIZE,s.Q0.STANDARDIZE]),o)),(0,a.Z)(r,s.qs.ROW,(0,a.Z)({},c.MISC,[].concat(d))),r),p=Object.keys(f[s.qs.COLUMN]),m=[c.MISC],v=(l={},(0,a.Z)(l,s.qs.COLUMN,(i={},(0,a.Z)(i,s.Q0.ADD,"Add column"),(0,a.Z)(i,s.Q0.AVERAGE,"Aggregate by average value"),(0,a.Z)(i,s.Q0.CLEAN_COLUMN_NAME,"Clean column name"),(0,a.Z)(i,s.Q0.COUNT_DISTINCT,"Aggregate by distinct count"),(0,a.Z)(i,s.Q0.COUNT,"Aggregate by total count"),(0,a.Z)(i,s.Q0.DIFF,"Difference"),(0,a.Z)(i,s.Q0.FIRST,"Aggregate by first value"),(0,a.Z)(i,s.Q0.FIX_SYNTAX_ERRORS,"Fix syntax errors"),(0,a.Z)(i,s.Q0.IMPUTE,"Fill in missing values"),(0,a.Z)(i,s.Q0.NORMALIZE,"Normalize Data"),(0,a.Z)(i,s.Q0.STANDARDIZE,"Standardize Data"),(0,a.Z)(i,s.Q0.LAST,"Aggregate by last value"),(0,a.Z)(i,s.Q0.MAX,"Aggregate by maximum value"),(0,a.Z)(i,s.Q0.MEDIAN,"Aggregate by median value"),(0,a.Z)(i,s.Q0.MIN,"Aggregate by mininum value"),(0,a.Z)(i,s.Q0.REFORMAT,"Reformat"),(0,a.Z)(i,s.Q0.REMOVE_OUTLIERS,"Remove outliers"),(0,a.Z)(i,s.Q0.REMOVE,"Remove column(s)"),(0,a.Z)(i,s.Q0.SELECT,"Keep columns"),(0,a.Z)(i,s.Q0.SHIFT_DOWN,"Shift rows down in a column"),(0,a.Z)(i,s.Q0.SHIFT_UP,"Shift rows up in a column"),(0,a.Z)(i,s.Q0.SUM,"Aggregate by sum of values"),i)),(0,a.Z)(l,s.qs.ROW,(u={},(0,a.Z)(u,s.Q0.DROP_DUPLICATE,"Drop duplicates"),(0,a.Z)(u,s.Q0.FILTER,"Filter"),(0,a.Z)(u,s.Q0.SORT,"Sort"),(0,a.Z)(u,s.Q0.REMOVE,"Remove rows"),u)),l)},46732:function(e,n,t){var o=t(82394),r=t(26304),i=(t(82684),t(50724)),u=t(70374),l=t(28598),c=["children","items","open","onClickCallback","onClickOutside","parentRef","uuid","zIndex"];function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.items,o=e.open,a=e.onClickCallback,d=e.onClickOutside,f=e.parentRef,p=e.uuid,m=e.zIndex,v=(0,r.Z)(e,c),h=(0,l.jsxs)("div",{style:{position:"relative",zIndex:(d?3:2)+(m||0)},children:[(0,l.jsx)("div",{ref:f,children:n}),(0,l.jsx)(u.Z,s(s({},v),{},{items:t,onClickCallback:a,open:o,parentRef:f,uuid:p}))]});return d?(0,l.jsx)(i.Z,{onClickOutside:d,open:!0,children:h}):h}},56747:function(e,n,t){t.d(n,{Z:function(){return j}});var o=t(21124),r=t(40583),i=t(85223),u=t(45993),l=t(85854),c=t(48670),a=t(30160),s=t(44897),d=t(38626),f=t(95363),p=t(70515),m=t(42631),v=t(61896),h=t(47041),b="0.75em",g=d.default.div.withConfig({displayName:"indexstyle__MarkdownContainer",componentId:"sc-j72mol-0"})(["font-family:",";margin:0 ","px;overflow:auto;"," "," p{margin:0.5em 0;}blockquote{margin:"," 0;padding:","px 0;","}blockquote:before{content:'';font-size:","px;line-height:0.1em;margin-right:0.25em;vertical-align:-0.4em;}blockquote p{display:inline;}pre{border-radius:","px;white-space:pre;margin:"," 0;padding:","px;overflow-x:auto;"," "," span{padding:0;}}ul,ol{margin-bottom:",";padding-left:","px;}li{","}li > input[type='checkbox']{pointer-events:none;}table{"," margin:",";thead{font-family:",";","}th,td{padding:","px ","px;","}}"],f.ry,p.iI,h.w5,(function(e){return"\n color: ".concat((e.theme||s.Z).content.active,";\n ")}),b,p.iI,(function(e){return"\n border-left: ".concat(.5*p.iI,"px solid ").concat((e.theme||s.Z).content.active,";\n ")}),3*p.l4,m.BG,b,p.iI,h.w5,(function(e){return"\n background-color: ".concat((e.theme||s.Z).interactive.defaultBorder,";\n ")}),b,3*p.iI,v.iD,v.iD,b,f.nF,(function(e){return"\n border-bottom: ".concat(m.YF,"px solid ").concat((e.theme||s.Z).content.active,";\n ")}),.5*p.iI,.75*p.iI,(function(e){return"\n border: ".concat(m.YF,"px solid ").concat((e.theme||s.Z).content.muted,";\n ")})),x=t(28598);var j=function(e){var n=e.children;return(0,x.jsx)(g,{children:(0,x.jsx)(o.D,{components:{a:function(e){var n=e.children,t=e.href;return(0,x.jsx)(c.Z,{href:t,inline:!0,openNewWindow:!0,primary:!0,children:n})},code:function(e){var n=e.children;return(0,x.jsx)(a.ZP,{backgroundColor:s.Z.interactive.defaultBorder,inline:!0,monospace:!0,pre:!0,style:{fontSize:"13px"},children:n})},em:function(e){var n=e.children;return(0,x.jsx)(a.ZP,{inline:!0,italic:!0,children:n})},h1:function(e){var n=e.children;return(0,x.jsx)(l.Z,{level:1,children:n})},h2:function(e){var n=e.children;return(0,x.jsx)(l.Z,{level:2,children:n})},h3:function(e){var n=e.children;return(0,x.jsx)(l.Z,{level:3,children:n})},h4:function(e){var n=e.children;return(0,x.jsx)(l.Z,{level:4,children:n})},h5:function(e){var n=e.children;return(0,x.jsx)(l.Z,{level:5,children:n})},p:function(e){var n=e.children;return(0,x.jsx)(a.ZP,{children:n})},strong:function(e){var n=e.children;return(0,x.jsx)(a.ZP,{bold:!0,inline:!0,children:n})}},rehypePlugins:[r.Z,i.Z],remarkPlugins:[u.Z],children:n})})}},65956:function(e,n,t){var o=t(38626),r=t(55485),i=t(38276),u=t(30160),l=t(44897),c=t(42631),a=t(47041),s=t(70515),d=t(28598),f=(0,o.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*s.iI,1.5*s.iI,1.5*s.iI),p=o.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],c.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return!e.borderless&&"\n border: 1px solid ".concat((e.theme.interactive||l.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||l.Z.background).successLight,";\n ")}),(function(e){return e.success&&!e.borderless&&"\n border: 1px solid ".concat((e.theme.background||l.Z.background).success,";\n ")}),(function(e){return!e.dark&&!e.success&&"\n background-color: ".concat((e.theme.background||l.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||l.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 "})),m=o.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],c.n_,c.n_,(function(e){return"\n background-color: ".concat((e.theme.background||l.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||l.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),f,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),v=o.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*s.iI,a.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 "})),h=o.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],c.M8,c.YF,1.75*s.iI);n.Z=function(e){var n=e.borderless,t=e.children,o=e.containerRef,l=e.contentContainerRef,c=e.dark,a=e.footer,s=e.fullHeight,f=void 0===s||s,b=e.fullWidth,g=void 0===b||b,x=e.header,j=e.headerHeight,O=e.headerIcon,C=e.headerPaddingVertical,_=e.headerTitle,Z=e.maxHeight,E=e.maxWidth,y=e.minWidth,k=e.noPadding,T=e.overflowVisible,I=e.subtitle,S=e.success;return(0,d.jsxs)(p,{borderless:n,dark:c,fullHeight:f,fullWidth:g,maxHeight:Z,maxWidth:E,minWidth:y,overflowVisible:T,ref:o,success:S,children:[(x||_)&&(0,d.jsxs)(m,{headerPaddingVertical:C,height:j,children:[x&&x,_&&(0,d.jsx)(r.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,d.jsxs)(r.ZP,{alignItems:"center",children:[O&&O,(0,d.jsx)(i.Z,{ml:O?1:0,children:(0,d.jsx)(u.ZP,{bold:!0,default:!0,children:_})})]})})]}),(0,d.jsxs)(v,{maxHeight:Z,noPadding:k,overflowVisible:T,ref:l,children:[I&&(0,d.jsx)(i.Z,{mb:2,children:(0,d.jsx)(u.ZP,{default:!0,children:I})}),t]}),a&&(0,d.jsx)(h,{children:a})]})}},35185:function(e,n,t){var o=t(82394),r=t(91835),i=(t(82684),t(38626)),u=t(44897),l=t(42631),c=t(70515),a=t(28598);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}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,o.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 f=i.default.div.withConfig({displayName:"ProgressBar__ProgressBarContainerStyle",componentId:"sc-10x9ojc-0"})(["border-radius:","px;height:","px;overflow:hidden;position:relative;width:100%;",""],l.BG,.75*c.iI,(function(e){return"\n background-color: ".concat((e.theme.monotone||u.Z.monotone).grey200,";\n ")})),p=i.default.div.withConfig({displayName:"ProgressBar__ProgressBarStyle",componentId:"sc-10x9ojc-1"})(["height:inherit;position:absolute;"," "," "," ",""],(function(e){return!e.danger&&"\n background-color: ".concat((e.theme.progress||u.Z.progress).positive,";\n ")}),(function(e){return e.progress&&"\n width: ".concat(e.progress,"%;\n ")}),(function(e){return e.danger&&"\n background-color: ".concat((e.theme.progress||u.Z.progress).negative,";\n ")}),(function(e){return e.animateProgress&&"\n animation: animate-progress ".concat(e.animateProgress.duration,"ms linear forwards;\n\n @keyframes animate-progress {\n 0% {\n width: ").concat(e.animateProgress.start,"%;\n }\n\n 100% {\n width: ").concat(e.animateProgress.end,"%;\n }\n }\n ")}));n.Z=function(e){var n=(0,r.Z)({},e);return(0,a.jsx)(f,d(d({},n),{},{children:(0,a.jsx)(p,d({},n))}))}},13507:function(e,n,t){var o=t(28598);n.Z=function(e){var n=e.fill,t=void 0===n?"white":n,r=e.size;return(0,o.jsxs)("svg",{fill:"none",height:r,viewBox:"0 0 20 20",width:r,xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsxs)("g",{clipPath:"url(#clip0_11802_82850)",children:[(0,o.jsx)("path",{d:"M15.6276 1.73378C15.97 1.96689 16.022 2.44136 15.7638 2.76532C15.5057 3.08929 15.0355 3.13958 14.69 2.91102C13.3636 2.0334 11.8126 1.54269 10.2126 1.50266C8.36175 1.45636 6.54643 2.01561 5.04253 3.09541C3.53863 4.1752 2.4284 5.71649 1.8806 7.48498C1.40702 9.01387 1.37618 10.6403 1.7837 12.1777C1.88982 12.5781 1.69185 13.0076 1.30237 13.1486C0.912892 13.2896 0.479935 13.0887 0.368517 12.6897C-0.147093 10.8435 -0.122519 8.88224 0.447763 7.04116C1.09223 4.96057 2.39838 3.14729 4.16768 1.87695C5.93697 0.606601 8.07265 -0.0513415 10.2501 0.00312922C12.1769 0.0513296 14.0431 0.655033 15.6276 1.73378Z",fill:t}),(0,o.jsx)("path",{d:"M13.2714 5.89383C13.5295 5.56986 13.4781 5.09341 13.1245 4.87771C12.2306 4.33247 11.2055 4.02828 10.15 4.00188C8.84359 3.9692 7.56218 4.36396 6.50061 5.12617C5.43903 5.88838 4.65534 6.97634 4.26866 8.22469C3.95628 9.23316 3.91679 10.3017 4.14767 11.323C4.23901 11.727 4.67403 11.928 5.06351 11.787C5.45299 11.6461 5.64766 11.216 5.57323 10.8086C5.44361 10.0989 5.48588 9.36461 5.70149 8.66852C5.9915 7.73226 6.57927 6.91628 7.37545 6.34463C8.17164 5.77297 9.13269 5.4769 10.1125 5.50141C10.841 5.51963 11.5503 5.71432 12.1813 6.06401C12.5436 6.26478 13.0133 6.2178 13.2714 5.89383Z",fill:t}),(0,o.jsx)("path",{clipRule:"evenodd",d:"M10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5ZM9 10C9 10.5523 9.44772 11 10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10Z",fill:t,fillRule:"evenodd"}),(0,o.jsx)("path",{d:"M6.87554 15.1223C6.52192 14.9066 6.47052 14.4301 6.72863 14.1062C6.98673 13.7822 7.45642 13.7352 7.81872 13.936C8.44971 14.2857 9.15897 14.4804 9.88746 14.4986C10.8673 14.5231 11.8284 14.227 12.6245 13.6554C13.4207 13.0837 14.0085 12.2677 14.2985 11.3315C14.5141 10.6354 14.5564 9.90111 14.4268 9.19144C14.3523 8.78397 14.547 8.35395 14.9365 8.21295C15.326 8.07196 15.761 8.27297 15.8523 8.67699C16.0832 9.69826 16.0437 10.7668 15.7313 11.7753C15.3447 13.0237 14.561 14.1116 13.4994 14.8738C12.4378 15.636 11.1564 16.0308 9.84995 15.9981C8.79455 15.9717 7.76942 15.6675 6.87554 15.1223Z",fill:t}),(0,o.jsx)("path",{d:"M4.23615 17.2347C3.97805 17.5586 4.03001 18.0331 4.37241 18.2662C5.95691 19.345 7.82314 19.9487 9.74992 19.9969C11.9274 20.0513 14.063 19.3934 15.8323 18.1231C17.6016 16.8527 18.9078 15.0394 19.5522 12.9588C20.1225 11.1178 20.1471 9.15647 19.6315 7.31026C19.5201 6.91131 19.0871 6.7104 18.6976 6.85139C18.3082 6.99238 18.1102 7.42188 18.2163 7.82227C18.6238 9.35971 18.593 10.9861 18.1194 12.515C17.5716 14.2835 16.4614 15.8248 14.9575 16.9046C13.4536 17.9844 11.6382 18.5436 9.78743 18.4973C8.18738 18.4573 6.63645 17.9666 5.30996 17.089C4.96451 16.8604 4.49426 16.9107 4.23615 17.2347Z",fill:t})]}),(0,o.jsx)("defs",{children:(0,o.jsx)("clipPath",{id:"clip0_11802_82850",children:(0,o.jsx)("rect",{fill:t,height:"20",width:"20"})})})]})}},94777:function(e,n,t){var o=t(75582),r=t(82684),i=t(34376),u=t(71180),l=t(55485),c=t(65956),a=t(38276),s=t(30160),d=t(89538),f=t(28598);n.Z=function(e){var n=e.shouldWarn,t=e.warningMessage,p=(0,i.useRouter)(),m=(0,r.useState)(!1),v=m[0],h=m[1],b=(0,r.useState)({isModalOpen:!1,nextRoute:null}),g=b[0],x=b[1];(0,r.useEffect)((function(){var e=function(e){if(n)return e.preventDefault(),(e||window.event).returnValue="Are you sure you want to leave?"};return window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}}),[n]),(0,r.useEffect)((function(){var e=function(e){if(n&&!v)throw x({isModalOpen:!0,nextRoute:e}),p.events.emit("routeChangeError"),"navigation aborted"};p.events.on("routeChangeStart",e);var t=function(){return p.events.off("routeChangeStart",e)};if(v){if(!g.nextRoute)return;return p.push(g.nextRoute),t}return t}),[g,v,p,n]);var j=(0,d.dd)((function(){return(0,f.jsxs)(c.Z,{children:[(0,f.jsx)(s.ZP,{children:t}),(0,f.jsx)(a.Z,{mt:2,children:(0,f.jsxs)(l.ZP,{alignItems:"center",children:[(0,f.jsx)(u.Z,{onClick:function(){return h(!0)},primary:!0,children:"Leave"}),(0,f.jsx)(a.Z,{mr:1}),(0,f.jsx)(u.Z,{onClick:function(){x({isModalOpen:!1,nextRoute:null})},secondary:!0,children:"Cancel"})]})})]})}),{},[t],{background:!0,hideCallback:function(){x({isModalOpen:!1,nextRoute:null})},uuid:"stale_pipeline_message"}),O=(0,o.Z)(j,2),C=O[0],_=O[1];(0,r.useEffect)((function(){g.isModalOpen?C():_()}),[_,g.isModalOpen,C]);return{ConfirmLeaveModal:function(){return(0,f.jsx)("div",{})}}}},53405:function(e,n,t){t.d(n,{$C:function(){return _},AP:function(){return L},I1:function(){return o},JN:function(){return W},KN:function(){return M},Kq:function(){return Q},M$:function(){return g},MB:function(){return C},Nf:function(){return w},Qu:function(){return x},RP:function(){return R},UA:function(){return k},Uc:function(){return y},VZ:function(){return U},WD:function(){return j},WE:function(){return K},Wi:function(){return Y},XE:function(){return Z},Z5:function(){return E},bX:function(){return z},cU:function(){return h},eH:function(){return T},iN:function(){return H},ig:function(){return S},jC:function(){return N},jO:function(){return b},p$:function(){return P},qf:function(){return A},qx:function(){return B},th:function(){return G},wx:function(){return F},zB:function(){return I}});var o,r=t(75582),i=t(82394),u=t(21831),l=t(82684),c=t(44425),a=t(57653),s=t(61599),d=t(86735),f=t(42122);function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function v(e,n){return function(e,n,t){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{includeAllNodes:!1},r=(0,d.HK)(t,(function(e){return e.uuid})),i=(o||{}).includeAllNodes,u=[];function l(t){if(t){var o=(t[n]||[]).reduce((function(n,t){return e.uuid===t?n:n.concat(r[t])}),[]);(0===o.length||i&&e.uuid!==t.uuid)&&u.push(t),o.forEach((function(e){l(e)}))}}return l(e),u}(e,"upstream_blocks",n,{includeAllNodes:!0})}function h(e,n){return(0,l.useMemo)((function(){return e.map((function(t){var o=function(e,n){var t=v(e,n),o=t.filter((function(n){var t=n.configuration,o=n.uuid;return(null===t||void 0===t?void 0:t.dynamic)&&o!==(null===e||void 0===e?void 0:e.uuid)})),r=t.filter((function(n){var t=n.configuration,o=n.uuid;return(null===t||void 0===t?void 0:t.reduce_output)&&o!==(null===e||void 0===e?void 0:e.uuid)}));return{dynamicUpstreamBlock:o[0],dynamicUpstreamBlocks:o,reduceOutputUpstreamBlock:r[0],reduceOutputUpstreamBlocks:r}}(t,n),r=o.dynamicUpstreamBlock,i=o.dynamicUpstreamBlocks,u=o.reduceOutputUpstreamBlock,l=o.reduceOutputUpstreamBlocks,c=(t||{}).configuration||{},a=c.dynamic,s=c.reduce_output;return{block:t,blocksToUse:e,dynamic:!!a,dynamicUpstreamBlock:r,dynamicUpstreamBlocks:i,reduceOutput:!!s,reduceOutputUpstreamBlock:u,reduceOutputUpstreamBlocks:l}}))}),[n,null===n||void 0===n?void 0:n.map((function(e){var n=e.configuration;return null===n||void 0===n?void 0:n.dynamic})),null===n||void 0===n?void 0:n.map((function(e){var n=e.configuration;return null===n||void 0===n?void 0:n.reduce_output})),null===n||void 0===n?void 0:n.map((function(e){return e.upstream_blocks}))])}function b(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=e||{},o=t.configuration,r=t.language,i=t.type,u=o||{},l=u.data_integration,s=[c.tf.DATA_LOADER,c.tf.DATA_EXPORTER].includes(i);if(a.qL.PYTHON===(null===n||void 0===n?void 0:n.type)&&s){if(c.t6.YAML===r)return!0;if(c.t6.PYTHON===r&&l)return!0}return!1}function g(e){return(null===e||void 0===e?void 0:e.stream)||(null===e||void 0===e?void 0:e.tap_stream_id)}function x(e){return null===e||void 0===e?void 0:e.parent_stream}function j(e){return[x(e),g(e)].filter((function(e){return e})).join("/")}function O(e){var n;return 0===(null===e||void 0===e||null===(n=e.breadcrumb)||void 0===n?void 0:n.length)}function C(e){var n;return(null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.find(O))||{breadcrumb:[],metadata:{}}}function _(e,n){var t=(null===n||void 0===n?void 0:n.catalog)||{streams:[]},o=(0,u.Z)((null===t||void 0===t?void 0:t.streams)||[]),r=null===o||void 0===o?void 0:o.findIndex((function(n){return j(n)===j(e)}));return r>=0?o[r]=e:o.push(e),m(m({},n),{},{catalog:m(m({},t),{},{streams:o})})}function Z(e,n){var t,o,r=m({},e);null!==r&&void 0!==r&&r.metadata||(r.metadata=[]);var i=null===r||void 0===r||null===(t=r.metadata)||void 0===t?void 0:t.findIndex(O),u={breadcrumb:[],metadata:{}};i>=0&&(u=C(r)||{breadcrumb:[],metadata:{}});var l=m(m({},u),{},{metadata:m(m({},null===(o=u)||void 0===o?void 0:o.metadata),n)});return i>=0?r.metadata[i]=l:r.metadata.push(l),r}function E(e){var n,t,o=(e||{}).metadata;return null===o||void 0===o||null===(n=o.find(O))||void 0===n||null===(t=n.metadata)||void 0===t?void 0:t.selected}function y(e,n){var t=(n||{}).getAll,o=null===e||void 0===e?void 0:e.catalog,r=(null===o||void 0===o?void 0:o.streams)||[];return t?r:null===r||void 0===r?void 0:r.filter(E)}function k(e,n){var t=n||{},o=t.noParents,r=t.parents,i={noParents:{},parents:{}};return null===e||void 0===e||e.forEach((function(e){var n,t=null===e||void 0===e?void 0:e.parent_stream,u=g(e);t?null!==r&&void 0!==r&&null!==(n=r[t])&&void 0!==n&&n[u]||(i.parents[t]||(i.parents[t]={}),i.parents[t][u]=e):null!==o&&void 0!==o&&o[u]||(i.noParents[u]=e)})),i}function T(e){var n=e||{},t=n.noParents,o=void 0===t?{}:t,r=n.parents,i=void 0===r?{}:r;return Object.values(o||[]).concat(Object.values(i||[]).reduce((function(e,n){return e.concat(Object.values(n))}),[]))}function I(e,n){var t,o,r,i=null===e||void 0===e?void 0:e.parent_stream,u=g(e);return i?null===n||void 0===n||null===(o=n.parents)||void 0===o||null===(r=o[i])||void 0===r?void 0:r[u]:null===n||void 0===n||null===(t=n.noParents)||void 0===t?void 0:t[u]}function S(e,n,t){return!!I(e,n)&&!!I(e,t)}function P(e,n,t){var o=function(e,n){var t,o,i={},u=[],l={};function c(e,n){null!==i&&void 0!==i&&i[e]||(i[e]={}),i[e]=m(m({},null===i||void 0===i?void 0:i[e]),n)}var a=(null===e||void 0===e||null===(t=e.schema)||void 0===t?void 0:t.properties)||{},s=(null===n||void 0===n||null===(o=n.schema)||void 0===o?void 0:o.properties)||{};return Object.entries(a).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],o=n[1],a=null===s||void 0===s?void 0:s[t];if(a){var p=(null===o||void 0===o?void 0:o.type)||[],m=(null===a||void 0===a?void 0:a.type)||[];(0,d.fS)(p,m)||c(t,{type:p});var v=null===o||void 0===o?void 0:o.format;v!==(null===a||void 0===a?void 0:a.format)&&c(t,{format:v});var h=(null===o||void 0===o?void 0:o.anyOf)||{},b=(null===a||void 0===a?void 0:a.anyOf)||{};(0,f.Xy)(h,b)||c(t,{anyOf:h}),null!==i&&void 0!==i&&i[t]&&(l[t]=o)}else u.push(t),l[t]=o})),{newColumnSettings:i,newColumns:u,stream:m(m({},n),{},{schema:m(m({},null===n||void 0===n?void 0:n.schema),{},{properties:m(m(m({},s),l),i)})})}}(I(e,n),I(e,t)),i=o||{},u=i.newColumnSettings,l=i.newColumns;if(!(0,f.Qr)(u||{})||(null===l||void 0===l?void 0:l.length)>=1)return o}function A(e,n){return[].concat((0,u.Z)(Object.values(e||{})),(0,u.Z)(Object.values(n||{}))).every((function(e){return(0,f.Qr)(e)}))}function R(e){var n,t,o=m({},(null===e||void 0===e||null===(n=e.schema)||void 0===n?void 0:n.properties)||{});return null===e||void 0===e||null===(t=e.metadata)||void 0===t||t.forEach((function(e){if(!O(e)){var n,t=null===e||void 0===e||null===(n=e.breadcrumb)||void 0===n?void 0:n.find((function(e){return e!==s.u7.PROPERTIES}));t&&null!==o&&void 0!==o&&o[t]&&(o[t]=m(m({},o[t]),{},{metadata:e}))}})),o}function w(e){var n;return null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.reduce((function(e,n){if(O(n))return e;var t=D(n);return t&&(e[t]=n),e}),{})}function D(e){var n;return null===e||void 0===e||null===(n=e.breadcrumb)||void 0===n?void 0:n.find((function(e){return e!==s.u7.PROPERTIES}))}function N(e){return{breadcrumb:[s.u7.PROPERTIES,e],metadata:{inclusion:s.ks.AVAILABLE,selected:!0}}}function M(e,n){var t;return m(m({},e),{},{schema:m(m({},null===e||void 0===e?void 0:e.schema),{},{properties:m(m({},null===e||void 0===e||null===(t=e.schema)||void 0===t?void 0:t.properties),n)})})}function L(e,n){var t=C(e),o=m(m({},w(e)),n);return m(m({},e),{},{metadata:[t].concat((0,u.Z)(Object.values(o||{})))})}function B(e,n){var t=n||{},o=t.type,r=t.typesDerived,i=m({},n),l=(0,u.Z)(o),c=(0,u.Z)(r);return null===e||void 0===e||e.forEach((function(e){s.Xv===e?i.format=s.zS.DATE_TIME:s.zS.UUID===e?i.format=s.zS.UUID:(null!==l&&void 0!==l&&l.includes(e)||l.push(e),null!==c&&void 0!==c&&c.includes(e)||c.push(e))})),m(m({},i),{},{type:l,typesDerived:c})}function U(e,n){var t=n||{},o=t.format,r=t.type,i=t.typesDerived,l=m({},n),c=(0,u.Z)(r),a=(0,u.Z)(i);return null===e||void 0===e||e.forEach((function(e){if(o&&s.eL[o]===e)delete l.format;else{var n,t,r,i;if(null!==(n=c)&&void 0!==n&&n.includes(e))c=(0,u.Z)(null===(r=c)||void 0===r?void 0:r.filter((function(n){return n!==e})));if(null!==(t=a)&&void 0!==t&&t.includes(e))a=(0,u.Z)(null===(i=a)||void 0===i?void 0:i.filter((function(n){return n!==e})))}})),m(m({},l),{},{type:c,typesDerived:a})}function F(e,n){var t=n||{},o=t.format,r=t.type,i=void 0===r?[]:r,u=null===i||void 0===i?void 0:i.filter((function(e){var n;return!(null!==(n=[s.Xv,s.zS.UUID])&&void 0!==n&&n.includes(e))}));return s.eL[o]&&(null!==u&&void 0!==u&&u.includes(s.eL[o])||u.push(s.eL[o])),m(m({},n),{},{typesDerived:u,uuid:e})}function G(e){var n=e||{},t=n.noParents,o=n.parents;return[{groupHeader:null,streams:(0,d.YC)(Object.values(t),(function(e){return g(e)}))}].concat((0,u.Z)((0,d.YC)(Object.entries(o),(function(e){return(0,r.Z)(e,1)[0]})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],o=n[1];return{groupHeader:t,streams:(0,d.YC)(Object.values(o),(function(e){return g(e)}))}}))))}function H(e,n,t){var o,r,u=(t||{}).remove,l=g(e||{}),c=x(e||{}),a=m({},n);if(c)u?null===a||void 0===a||(null===(o=a.parents)||void 0===o||(null===(r=o[c])||void 0===r||delete r[l])):a.parents=m(m({},null===a||void 0===a?void 0:a.parents),{},(0,i.Z)({},c,(0,i.Z)({},l,e)));else if(l){var s;if(u)null===a||void 0===a||(null===(s=a.noParents)||void 0===s||delete s[l]);else a.noParents=m(m({},null===a||void 0===a?void 0:a.noParents),{},(0,i.Z)({},l,e))}return a}function z(e,n){var t=[o.AUTO_ADD_NEW_FIELDS,o.DISABLE_COLUMN_TYPE_CHECK,o.REPLICATION_METHOD,o.RUN_IN_PARALLEL,o.UNIQUE_CONFLICT_METHOD],u=Object.entries(n||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),o=t[0],u=t[1],l=u.selected,c=u.value;return m(m({},e),l?(0,i.Z)({},o,c):{})}),{}),l=m({},e),c=e&&T(e)||[];return null===c||void 0===c||c.forEach((function(e){l=H(function(e){var n,o=m({},e);return null===o||void 0===o||null===(n=o.schema)||void 0===n||n.properties,Object.entries(u||{}).forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],u=n[1];t.includes(i)&&(o[i]=u)})),o}(e),l)})),l}function Q(e,n,t){var u=[o.BOOKMARK_PROPERTIES,o.KEY_PROPERTIES,o.PARTITION_KEYS,o.UNIQUE_CONSTRAINTS],l=Object.entries(n||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),o=t[0];return t[1]?e.concat(o):e}),[]),c=Object.entries(t||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),o=t[0],u=t[1],l=u.selected,c=u.value;return m(m({},e),l?(0,i.Z)({},o,c):{})}),{}),a=m({},e),p=e&&T(e)||[];return null===p||void 0===p||p.forEach((function(e){a=H(function(e){var n,t=m({},e),i=(null===t||void 0===t||null===(n=t.schema)||void 0===n?void 0:n.properties)||{},a=w(e);return null===l||void 0===l||l.forEach((function(e){null!==i&&void 0!==i&&i[e]&&Object.entries(c||{}).forEach((function(n){var l=(0,r.Z)(n,2),c=l[0],p=l[1];if(o.PROPERTY_SELECTED===c){var v=(null===a||void 0===a?void 0:a[e])||N(e)||{breadcrumb:[],metadata:{}},h=m(m({},v),{},{metadata:m(m({},null===v||void 0===v?void 0:v.metadata),{},{selected:p})});a[e]=h}else if(u.includes(c)){var b;null!==t&&void 0!==t&&t[c]||(t[c]=[]);var g=null===(b=t[c])||void 0===b?void 0:b.includes(e);p&&!g?t[c].push(e):!p&&g&&(t[c]=(0,d.Od)(t[c],(function(n){return n===e})))}else if(s.D5.includes(c)){var x,j=m({},(null===i||void 0===i?void 0:i[e])||{}),O=(p?B:U)([c],F(e,j)),C=O.anyOf,_=O.format,Z=O.type;null!==t&&void 0!==t&&t.schema||(t.schema={properties:{}}),null!==t&&void 0!==t&&null!==(x=t.schema)&&void 0!==x&&x.properties||(t.schema=m(m({},null===t||void 0===t?void 0:t.schema),{},{properties:{}}));var E=(0,f.hB)({anyOf:C,format:_,type:Z});t.schema.properties[e]=E}}))})),L(t,a)}(e),a)})),a}function K(e){var n,t,o=(null===e||void 0===e||null===(n=e.schema)||void 0===n?void 0:n.properties)||{};return null===e||void 0===e||null===(t=e.metadata)||void 0===t?void 0:t.reduce((function(e,n){var t;if(O(n))return e;if(!(null===n||void 0===n||null===(t=n.metadata)||void 0===t?void 0:t.selected))return e;var r=D(n),u=null===o||void 0===o?void 0:o[r];return m(m({},e),{},(0,i.Z)({},r,m(m({},u),{},{metadata:n,uuid:r})))}),{})}function Y(e,n){var t=(null===n||void 0===n?void 0:n.inputs)||{};return null===e||void 0===e?void 0:e.reduce((function(e,n){var o=null===n||void 0===n?void 0:n.uuid,r=o&&(null===t||void 0===t?void 0:t[o]);return r?e.concat({block:n,input:r}):e}),[])}function W(e){var n,t,o={},i={},u={};return null===e||void 0===e||null===(n=e.metadata)||void 0===n||n.forEach((function(e){if(!O(e)){var n,t=D(e);if(t&&null!==e&&void 0!==e&&e.metadata)u[t]=null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.selected}})),Object.entries((null===e||void 0===e||null===(t=e.schema)||void 0===t?void 0:t.properties)||{}).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],l=m(m({},n[1]),{},{uuid:t});t in u?null!==u&&void 0!==u&&u[t]&&(i[t]=l):i[t]=l,o[t]=l})),{allColumns:o,selectedColumns:i}}!function(e){e.AUTO_ADD_NEW_FIELDS="auto_add_new_fields",e.BOOKMARK_PROPERTIES="bookmark_properties",e.DISABLE_COLUMN_TYPE_CHECK="disable_column_type_check",e.KEY_PROPERTIES="key_properties",e.PARTITION_KEYS="partition_keys",e.PROPERTY_SELECTED="property_selected",e.REPLICATION_METHOD="replication_method",e.RUN_IN_PARALLEL="run_in_parallel",e.UNIQUE_CONFLICT_METHOD="unique_conflict_method",e.UNIQUE_CONSTRAINTS="unique_constraints"}(o||(o={}))},22286:function(e,n,t){t.d(n,{M:function(){return s}});var o=t(82394),r=t(75582),i=t(54193),u=t(81728),l=t(42122);function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e,n){var t,c;if(!n||null===n||void 0===n||!n.length)return e;if(null!==n&&void 0!==n&&n.includes(i.zj.LIST))return((0,l.Kn)(e)?Object.keys(e||{}):[e]).map((function(e){return s(e,null===n||void 0===n?void 0:n.filter((function(e){return i.zj.LIST!==e})))}));if(null!==n&&void 0!==n&&n.includes(i.zj.DICTIONARY)){var d=(0,l.Kn)(e)?e:(0,u.Pb)(e)?JSON.parse(e):e;if((0,l.Kn)(d))return Object.entries(d).reduce((function(e,t){var u=(0,r.Z)(t,2),l=u[0],c=u[1];return a(a({},e),{},(0,o.Z)({},l,s(c,null===n||void 0===n?void 0:n.filter((function(e){return i.zj.DICTIONARY!==e})))))}),{})}if(null!==n&&void 0!==n&&n.includes(i.zj.BOOLEAN)){var f,p;if("boolean"===typeof e)return e;if("true"===(null===(f=String(e))||void 0===f?void 0:f.toLowerCase()))return!0;if("false"===(null===(p=String(e))||void 0===p?void 0:p.toLowerCase()))return!1}return null!==n&&void 0!==n&&null!==(t=n.includes)&&void 0!==t&&t.call(n,i.zj.FLOAT)&&(0,u.HW)(e)?parseFloat(e):null!==n&&void 0!==n&&null!==(c=n.includes)&&void 0!==c&&c.call(n,i.zj.INTEGER)&&(0,u.HW)(e)?parseInt(e):e}},65044:function(e,n,t){t.d(n,{Gr:function(){return r},Lz:function(){return o},Vc:function(){return u},gr:function(){return i}});var o=/\[__internal_output__\]/,r=/\[__internal_test__\]/,i="[__internal_output__]",u="[__internal_test__]"},58325:function(e,n,t){var o;t.d(n,{V5:function(){return i}}),function(e){e.ANDROID="Android",e.CHROME_OS="ChromeOS",e.IOS="iOS",e.LINUX="Linux",e.MAC="macOS",e.WINDOWS="Windows"}(o||(o={}));var r=o;function i(){return function(){var e,n,t,o,i,u,l,c=r.MAC,a=null===(e=window)||void 0===e||null===(n=e.navigator)||void 0===n?void 0:n.userAgent,s=(null===(t=window)||void 0===t||null===(o=t.navigator)||void 0===o||null===(i=o.userAgentData)||void 0===i?void 0:i.platform)||(null===(u=window)||void 0===u||null===(l=u.navigator)||void 0===l?void 0:l.platform);return s?["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(s)?c=r.MAC:["Win32","Win64","Windows","WinCE"].includes(s)?c=r.WINDOWS:["iPhone","iPad","iPod"].includes(s)&&(c=r.IOS):a&&(a.includes("Macintosh")?c=r.MAC:a.includes("Windows")?c=r.WINDOWS:a.includes("Linux")&&a.includes("X11")?c=r.LINUX:/(iPhone|iPad)/.test(a)?c=r.IOS:a.includes("Android")&&a.includes("Mobi")?c=r.ANDROID:a.includes("CrOS")&&(c=r.CHROME_OS)),c}()===r.MAC}}}]);
|